@react-md/core 6.0.0 → 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 (764) 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/box/_box.scss +1 -1
  36. package/dist/button/AsyncButton.d.ts +1 -1
  37. package/dist/button/AsyncButton.js +1 -1
  38. package/dist/button/AsyncButton.js.map +1 -1
  39. package/dist/button/Button.d.ts +1 -1
  40. package/dist/button/Button.js +1 -1
  41. package/dist/button/Button.js.map +1 -1
  42. package/dist/button/ButtonUnstyled.d.ts +1 -1
  43. package/dist/button/ButtonUnstyled.js +1 -1
  44. package/dist/button/ButtonUnstyled.js.map +1 -1
  45. package/dist/button/TooltippedButton.d.ts +1 -1
  46. package/dist/button/TooltippedButton.js +1 -1
  47. package/dist/button/TooltippedButton.js.map +1 -1
  48. package/dist/card/Card.d.ts +1 -1
  49. package/dist/card/Card.js +1 -1
  50. package/dist/card/Card.js.map +1 -1
  51. package/dist/card/CardContent.d.ts +1 -1
  52. package/dist/card/CardContent.js +1 -1
  53. package/dist/card/CardContent.js.map +1 -1
  54. package/dist/card/CardFooter.d.ts +1 -1
  55. package/dist/card/CardFooter.js +1 -1
  56. package/dist/card/CardFooter.js.map +1 -1
  57. package/dist/card/CardHeader.d.ts +1 -1
  58. package/dist/card/CardHeader.js +1 -1
  59. package/dist/card/CardHeader.js.map +1 -1
  60. package/dist/card/CardSubtitle.d.ts +1 -1
  61. package/dist/card/CardSubtitle.js +1 -1
  62. package/dist/card/CardSubtitle.js.map +1 -1
  63. package/dist/card/CardTitle.d.ts +1 -1
  64. package/dist/card/CardTitle.js +1 -1
  65. package/dist/card/CardTitle.js.map +1 -1
  66. package/dist/card/ClickableCard.d.ts +1 -1
  67. package/dist/card/ClickableCard.js +1 -1
  68. package/dist/card/ClickableCard.js.map +1 -1
  69. package/dist/chip/Chip.d.ts +1 -1
  70. package/dist/chip/Chip.js +1 -1
  71. package/dist/chip/Chip.js.map +1 -1
  72. package/dist/dialog/Dialog.d.ts +1 -1
  73. package/dist/dialog/Dialog.js +1 -1
  74. package/dist/dialog/Dialog.js.map +1 -1
  75. package/dist/dialog/DialogContent.d.ts +1 -1
  76. package/dist/dialog/DialogContent.js +1 -1
  77. package/dist/dialog/DialogContent.js.map +1 -1
  78. package/dist/dialog/DialogFooter.d.ts +1 -1
  79. package/dist/dialog/DialogFooter.js +1 -1
  80. package/dist/dialog/DialogFooter.js.map +1 -1
  81. package/dist/dialog/DialogHeader.d.ts +1 -1
  82. package/dist/dialog/DialogHeader.js +1 -1
  83. package/dist/dialog/DialogHeader.js.map +1 -1
  84. package/dist/dialog/DialogTitle.d.ts +1 -1
  85. package/dist/dialog/DialogTitle.js +1 -1
  86. package/dist/dialog/DialogTitle.js.map +1 -1
  87. package/dist/dialog/FixedDialog.d.ts +1 -1
  88. package/dist/dialog/FixedDialog.js +1 -1
  89. package/dist/dialog/FixedDialog.js.map +1 -1
  90. package/dist/divider/Divider.d.ts +1 -1
  91. package/dist/divider/Divider.js +1 -1
  92. package/dist/divider/Divider.js.map +1 -1
  93. package/dist/draggable/useDraggable.d.ts +1 -1
  94. package/dist/draggable/useDraggable.js +1 -1
  95. package/dist/draggable/useDraggable.js.map +1 -1
  96. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  97. package/dist/expansion-panel/ExpansionList.js +1 -1
  98. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
  100. package/dist/expansion-panel/ExpansionPanel.js +1 -1
  101. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +1 -1
  103. package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
  104. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  105. package/dist/expansion-panel/useExpansionList.d.ts +1 -1
  106. package/dist/expansion-panel/useExpansionList.js +1 -1
  107. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  108. package/dist/expansion-panel/useExpansionPanels.d.ts +1 -1
  109. package/dist/expansion-panel/useExpansionPanels.js +1 -1
  110. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  111. package/dist/files/FileInput.d.ts +1 -1
  112. package/dist/files/FileInput.js +1 -1
  113. package/dist/files/FileInput.js.map +1 -1
  114. package/dist/files/useFileUpload.d.ts +2 -2
  115. package/dist/files/useFileUpload.js +2 -2
  116. package/dist/files/useFileUpload.js.map +1 -1
  117. package/dist/form/Checkbox.d.ts +1 -1
  118. package/dist/form/Checkbox.js +1 -1
  119. package/dist/form/Checkbox.js.map +1 -1
  120. package/dist/form/Fieldset.d.ts +1 -1
  121. package/dist/form/Fieldset.js +1 -1
  122. package/dist/form/Fieldset.js.map +1 -1
  123. package/dist/form/Form.d.ts +1 -1
  124. package/dist/form/Form.js +1 -1
  125. package/dist/form/Form.js.map +1 -1
  126. package/dist/form/FormMessage.d.ts +1 -1
  127. package/dist/form/FormMessage.js +1 -1
  128. package/dist/form/FormMessage.js.map +1 -1
  129. package/dist/form/FormMessageContainer.d.ts +1 -1
  130. package/dist/form/FormMessageContainer.js +1 -1
  131. package/dist/form/FormMessageContainer.js.map +1 -1
  132. package/dist/form/FormMessageCounter.d.ts +2 -2
  133. package/dist/form/FormMessageCounter.js +2 -2
  134. package/dist/form/FormMessageCounter.js.map +1 -1
  135. package/dist/form/InputToggle.d.ts +2 -2
  136. package/dist/form/InputToggle.js +2 -2
  137. package/dist/form/InputToggle.js.map +1 -1
  138. package/dist/form/Label.d.ts +3 -3
  139. package/dist/form/Label.js +3 -3
  140. package/dist/form/Label.js.map +1 -1
  141. package/dist/form/Legend.d.ts +1 -1
  142. package/dist/form/Legend.js +1 -1
  143. package/dist/form/Legend.js.map +1 -1
  144. package/dist/form/NativeSelect.d.ts +1 -1
  145. package/dist/form/NativeSelect.js +1 -1
  146. package/dist/form/NativeSelect.js.map +1 -1
  147. package/dist/form/OptGroup.d.ts +1 -1
  148. package/dist/form/OptGroup.js +1 -1
  149. package/dist/form/OptGroup.js.map +1 -1
  150. package/dist/form/Option.d.ts +1 -1
  151. package/dist/form/Option.js +1 -1
  152. package/dist/form/Option.js.map +1 -1
  153. package/dist/form/Password.d.ts +1 -1
  154. package/dist/form/Password.js +1 -1
  155. package/dist/form/Password.js.map +1 -1
  156. package/dist/form/Radio.d.ts +1 -1
  157. package/dist/form/Radio.js +1 -1
  158. package/dist/form/Radio.js.map +1 -1
  159. package/dist/form/Select.d.ts +1 -1
  160. package/dist/form/Select.js +1 -1
  161. package/dist/form/Select.js.map +1 -1
  162. package/dist/form/Slider.d.ts +1 -1
  163. package/dist/form/Slider.js.map +1 -1
  164. package/dist/form/Switch.d.ts +1 -1
  165. package/dist/form/Switch.js +1 -1
  166. package/dist/form/Switch.js.map +1 -1
  167. package/dist/form/TextArea.d.ts +1 -1
  168. package/dist/form/TextArea.js +1 -1
  169. package/dist/form/TextArea.js.map +1 -1
  170. package/dist/form/TextField.d.ts +1 -1
  171. package/dist/form/TextField.js +1 -1
  172. package/dist/form/TextField.js.map +1 -1
  173. package/dist/form/useCheckboxGroup.d.ts +8 -8
  174. package/dist/form/useCheckboxGroup.js +2 -2
  175. package/dist/form/useCheckboxGroup.js.map +1 -1
  176. package/dist/form/useCombobox.js +1 -0
  177. package/dist/form/useCombobox.js.map +1 -1
  178. package/dist/form/useNumberField.d.ts +2 -2
  179. package/dist/form/useNumberField.js +2 -2
  180. package/dist/form/useNumberField.js.map +1 -1
  181. package/dist/form/useRadioGroup.d.ts +4 -4
  182. package/dist/form/useRadioGroup.js +2 -2
  183. package/dist/form/useRadioGroup.js.map +1 -1
  184. package/dist/form/useRangeSlider.d.ts +1 -1
  185. package/dist/form/useRangeSlider.js +1 -1
  186. package/dist/form/useRangeSlider.js.map +1 -1
  187. package/dist/form/useSlider.d.ts +1 -1
  188. package/dist/form/useSlider.js +1 -1
  189. package/dist/form/useSlider.js.map +1 -1
  190. package/dist/form/useTextField.d.ts +4 -4
  191. package/dist/form/useTextField.js +2 -2
  192. package/dist/form/useTextField.js.map +1 -1
  193. package/dist/icon/FontIcon.d.ts +1 -1
  194. package/dist/icon/FontIcon.js +1 -1
  195. package/dist/icon/FontIcon.js.map +1 -1
  196. package/dist/icon/IconRotator.d.ts +1 -1
  197. package/dist/icon/IconRotator.js +1 -1
  198. package/dist/icon/IconRotator.js.map +1 -1
  199. package/dist/icon/MaterialIcon.d.ts +2 -2
  200. package/dist/icon/MaterialIcon.js +2 -2
  201. package/dist/icon/MaterialIcon.js.map +1 -1
  202. package/dist/icon/MaterialSymbol.d.ts +2 -2
  203. package/dist/icon/MaterialSymbol.js +2 -2
  204. package/dist/icon/MaterialSymbol.js.map +1 -1
  205. package/dist/icon/SVGIcon.d.ts +1 -1
  206. package/dist/icon/SVGIcon.js +1 -1
  207. package/dist/icon/SVGIcon.js.map +1 -1
  208. package/dist/icon/TextIconSpacing.d.ts +1 -1
  209. package/dist/icon/TextIconSpacing.js +1 -1
  210. package/dist/icon/TextIconSpacing.js.map +1 -1
  211. package/dist/layout/LayoutAppBar.d.ts +1 -1
  212. package/dist/layout/LayoutAppBar.js +1 -1
  213. package/dist/layout/LayoutAppBar.js.map +1 -1
  214. package/dist/layout/LayoutNav.d.ts +1 -1
  215. package/dist/layout/LayoutNav.js +1 -1
  216. package/dist/layout/LayoutNav.js.map +1 -1
  217. package/dist/layout/LayoutWindowSplitter.d.ts +1 -1
  218. package/dist/layout/LayoutWindowSplitter.js +1 -1
  219. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  220. package/dist/layout/Main.d.ts +1 -1
  221. package/dist/layout/Main.js +1 -1
  222. package/dist/layout/Main.js.map +1 -1
  223. package/dist/layout/useExpandableLayout.d.ts +1 -1
  224. package/dist/layout/useExpandableLayout.js +1 -1
  225. package/dist/layout/useExpandableLayout.js.map +1 -1
  226. package/dist/layout/useHorizontalLayoutTransition.d.ts +1 -1
  227. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  228. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  229. package/dist/layout/useLayoutAppBarHeight.d.ts +1 -1
  230. package/dist/layout/useLayoutAppBarHeight.js +1 -1
  231. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  232. package/dist/layout/useLayoutTree.d.ts +3 -3
  233. package/dist/layout/useLayoutTree.js +3 -3
  234. package/dist/layout/useLayoutTree.js.map +1 -1
  235. package/dist/layout/useLayoutWindowSplitter.d.ts +1 -1
  236. package/dist/layout/useLayoutWindowSplitter.js +1 -1
  237. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  238. package/dist/layout/useResizableLayout.d.ts +1 -1
  239. package/dist/layout/useResizableLayout.js +1 -1
  240. package/dist/layout/useResizableLayout.js.map +1 -1
  241. package/dist/layout/useTemporaryLayout.d.ts +1 -1
  242. package/dist/layout/useTemporaryLayout.js +1 -1
  243. package/dist/layout/useTemporaryLayout.js.map +1 -1
  244. package/dist/link/Link.d.ts +1 -1
  245. package/dist/link/Link.js +1 -1
  246. package/dist/link/Link.js.map +1 -1
  247. package/dist/link/SkipToMainContent.d.ts +1 -1
  248. package/dist/link/SkipToMainContent.js +1 -1
  249. package/dist/link/SkipToMainContent.js.map +1 -1
  250. package/dist/list/List.d.ts +1 -1
  251. package/dist/list/List.js +1 -1
  252. package/dist/list/List.js.map +1 -1
  253. package/dist/list/ListItem.d.ts +1 -1
  254. package/dist/list/ListItem.js +1 -1
  255. package/dist/list/ListItem.js.map +1 -1
  256. package/dist/list/ListItemChildren.d.ts +1 -1
  257. package/dist/list/ListItemChildren.js +1 -1
  258. package/dist/list/ListItemChildren.js.map +1 -1
  259. package/dist/list/ListItemLink.d.ts +1 -1
  260. package/dist/list/ListItemLink.js +1 -1
  261. package/dist/list/ListItemLink.js.map +1 -1
  262. package/dist/list/ListSubheader.d.ts +1 -1
  263. package/dist/list/ListSubheader.js +1 -1
  264. package/dist/list/ListSubheader.js.map +1 -1
  265. package/dist/media-queries/AppSizeProvider.d.ts +2 -2
  266. package/dist/media-queries/AppSizeProvider.js +2 -2
  267. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  268. package/dist/media-queries/useMediaQuery.d.ts +2 -2
  269. package/dist/media-queries/useMediaQuery.js +2 -2
  270. package/dist/media-queries/useMediaQuery.js.map +1 -1
  271. package/dist/menu/DropdownMenu.d.ts +1 -1
  272. package/dist/menu/DropdownMenu.js +2 -1
  273. package/dist/menu/DropdownMenu.js.map +1 -1
  274. package/dist/menu/Menu.d.ts +1 -1
  275. package/dist/menu/Menu.js +1 -1
  276. package/dist/menu/Menu.js.map +1 -1
  277. package/dist/menu/MenuBar.d.ts +1 -1
  278. package/dist/menu/MenuBar.js +1 -1
  279. package/dist/menu/MenuBar.js.map +1 -1
  280. package/dist/menu/MenuButton.d.ts +1 -1
  281. package/dist/menu/MenuButton.js +1 -1
  282. package/dist/menu/MenuButton.js.map +1 -1
  283. package/dist/menu/MenuItem.d.ts +1 -1
  284. package/dist/menu/MenuItem.js +1 -1
  285. package/dist/menu/MenuItem.js.map +1 -1
  286. package/dist/menu/MenuItemCheckbox.d.ts +1 -1
  287. package/dist/menu/MenuItemCheckbox.js +1 -1
  288. package/dist/menu/MenuItemCheckbox.js.map +1 -1
  289. package/dist/menu/MenuItemFileInput.d.ts +1 -1
  290. package/dist/menu/MenuItemFileInput.js +1 -1
  291. package/dist/menu/MenuItemFileInput.js.map +1 -1
  292. package/dist/menu/MenuItemGroup.d.ts +1 -1
  293. package/dist/menu/MenuItemGroup.js +1 -1
  294. package/dist/menu/MenuItemGroup.js.map +1 -1
  295. package/dist/menu/MenuItemInputToggle.d.ts +1 -1
  296. package/dist/menu/MenuItemInputToggle.js +1 -1
  297. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  298. package/dist/menu/MenuItemRadio.d.ts +1 -1
  299. package/dist/menu/MenuItemRadio.js +1 -1
  300. package/dist/menu/MenuItemRadio.js.map +1 -1
  301. package/dist/menu/MenuItemSeparator.d.ts +1 -1
  302. package/dist/menu/MenuItemSeparator.js +1 -1
  303. package/dist/menu/MenuItemSeparator.js.map +1 -1
  304. package/dist/menu/MenuItemSwitch.d.ts +1 -1
  305. package/dist/menu/MenuItemSwitch.js +1 -1
  306. package/dist/menu/MenuItemSwitch.js.map +1 -1
  307. package/dist/menu/MenuItemTextField.d.ts +1 -1
  308. package/dist/menu/MenuItemTextField.js +1 -1
  309. package/dist/menu/MenuItemTextField.js.map +1 -1
  310. package/dist/menu/useContextMenu.d.ts +1 -1
  311. package/dist/menu/useContextMenu.js +1 -1
  312. package/dist/menu/useContextMenu.js.map +1 -1
  313. package/dist/navigation/CollapsibleNavGroup.d.ts +1 -1
  314. package/dist/navigation/CollapsibleNavGroup.js +1 -1
  315. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  316. package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -1
  317. package/dist/navigation/DefaultNavigationRenderer.js +1 -1
  318. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  319. package/dist/navigation/NavGroup.d.ts +1 -1
  320. package/dist/navigation/NavGroup.js +1 -1
  321. package/dist/navigation/NavGroup.js.map +1 -1
  322. package/dist/navigation/NavItem.d.ts +1 -1
  323. package/dist/navigation/NavItem.js +1 -1
  324. package/dist/navigation/NavItem.js.map +1 -1
  325. package/dist/navigation/NavItemButton.d.ts +1 -1
  326. package/dist/navigation/NavItemButton.js +1 -1
  327. package/dist/navigation/NavItemButton.js.map +1 -1
  328. package/dist/navigation/NavItemLink.d.ts +1 -1
  329. package/dist/navigation/NavItemLink.js +1 -1
  330. package/dist/navigation/NavItemLink.js.map +1 -1
  331. package/dist/navigation/NavSubheader.d.ts +1 -1
  332. package/dist/navigation/NavSubheader.js +1 -1
  333. package/dist/navigation/NavSubheader.js.map +1 -1
  334. package/dist/navigation/Navigation.d.ts +1 -1
  335. package/dist/navigation/Navigation.js +1 -1
  336. package/dist/navigation/Navigation.js.map +1 -1
  337. package/dist/navigation/useActiveHeadingId.d.ts +1 -1
  338. package/dist/navigation/useActiveHeadingId.js +1 -1
  339. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  340. package/dist/navigation/useNavigationExpansion.d.ts +2 -2
  341. package/dist/navigation/useNavigationExpansion.js +2 -2
  342. package/dist/navigation/useNavigationExpansion.js.map +1 -1
  343. package/dist/navigation/useTableOfContentsHeadings.d.ts +1 -1
  344. package/dist/navigation/useTableOfContentsHeadings.js +1 -1
  345. package/dist/navigation/useTableOfContentsHeadings.js.map +1 -1
  346. package/dist/overlay/Overlay.d.ts +1 -1
  347. package/dist/overlay/Overlay.js +1 -1
  348. package/dist/overlay/Overlay.js.map +1 -1
  349. package/dist/portal/Portal.d.ts +1 -1
  350. package/dist/portal/Portal.js +1 -1
  351. package/dist/portal/Portal.js.map +1 -1
  352. package/dist/portal/PortalContainerProvider.d.ts +1 -1
  353. package/dist/portal/PortalContainerProvider.js +1 -1
  354. package/dist/portal/PortalContainerProvider.js.map +1 -1
  355. package/dist/positioning/useFixedPositioning.d.ts +1 -1
  356. package/dist/positioning/useFixedPositioning.js +1 -1
  357. package/dist/positioning/useFixedPositioning.js.map +1 -1
  358. package/dist/progress/CircularProgress.d.ts +1 -1
  359. package/dist/progress/CircularProgress.js +1 -1
  360. package/dist/progress/CircularProgress.js.map +1 -1
  361. package/dist/progress/LinearProgress.d.ts +1 -1
  362. package/dist/progress/LinearProgress.js +1 -1
  363. package/dist/progress/LinearProgress.js.map +1 -1
  364. package/dist/responsive-item/ResponsiveItem.d.ts +1 -1
  365. package/dist/responsive-item/ResponsiveItem.js +1 -1
  366. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  367. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -1
  368. package/dist/responsive-item/ResponsiveItemOverlay.js +1 -1
  369. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  370. package/dist/scroll/useScrollLock.d.ts +1 -1
  371. package/dist/scroll/useScrollLock.js +1 -1
  372. package/dist/scroll/useScrollLock.js.map +1 -1
  373. package/dist/segmented-button/SegmentedButton.d.ts +1 -1
  374. package/dist/segmented-button/SegmentedButton.js +1 -1
  375. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  376. package/dist/segmented-button/SegmentedButtonContainer.d.ts +1 -1
  377. package/dist/segmented-button/SegmentedButtonContainer.js +1 -1
  378. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  379. package/dist/sheet/Sheet.d.ts +1 -1
  380. package/dist/sheet/Sheet.js +1 -1
  381. package/dist/sheet/Sheet.js.map +1 -1
  382. package/dist/snackbar/DefaultToastRenderer.d.ts +1 -1
  383. package/dist/snackbar/DefaultToastRenderer.js +1 -1
  384. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  385. package/dist/snackbar/Snackbar.d.ts +1 -1
  386. package/dist/snackbar/Snackbar.js +1 -1
  387. package/dist/snackbar/Snackbar.js.map +1 -1
  388. package/dist/snackbar/Toast.d.ts +1 -1
  389. package/dist/snackbar/Toast.js +1 -1
  390. package/dist/snackbar/Toast.js.map +1 -1
  391. package/dist/snackbar/ToastActionButton.d.ts +1 -1
  392. package/dist/snackbar/ToastActionButton.js +1 -1
  393. package/dist/snackbar/ToastActionButton.js.map +1 -1
  394. package/dist/snackbar/ToastCloseButton.d.ts +1 -1
  395. package/dist/snackbar/ToastCloseButton.js +1 -1
  396. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  397. package/dist/snackbar/ToastContent.d.ts +1 -1
  398. package/dist/snackbar/ToastContent.js +1 -1
  399. package/dist/snackbar/ToastContent.js.map +1 -1
  400. package/dist/snackbar/ToastManager.d.ts +1 -1
  401. package/dist/snackbar/ToastManager.js +1 -1
  402. package/dist/snackbar/ToastManager.js.map +1 -1
  403. package/dist/snackbar/ToastManagerProvider.d.ts +1 -1
  404. package/dist/snackbar/ToastManagerProvider.js +1 -1
  405. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  406. package/dist/snackbar/useCurrentToastActions.d.ts +1 -1
  407. package/dist/snackbar/useCurrentToastActions.js +1 -1
  408. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  409. package/dist/storage/useStorage.d.ts +1 -1
  410. package/dist/storage/useStorage.js +1 -1
  411. package/dist/storage/useStorage.js.map +1 -1
  412. package/dist/suspense/CircularProgressSuspense.d.ts +1 -1
  413. package/dist/suspense/CircularProgressSuspense.js +1 -1
  414. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  415. package/dist/suspense/NullSuspense.d.ts +1 -1
  416. package/dist/suspense/NullSuspense.js +1 -1
  417. package/dist/suspense/NullSuspense.js.map +1 -1
  418. package/dist/table/StickyTableSection.d.ts +2 -2
  419. package/dist/table/StickyTableSection.js +2 -2
  420. package/dist/table/StickyTableSection.js.map +1 -1
  421. package/dist/table/Table.d.ts +1 -1
  422. package/dist/table/Table.js +1 -1
  423. package/dist/table/Table.js.map +1 -1
  424. package/dist/table/TableBody.d.ts +1 -1
  425. package/dist/table/TableBody.js +1 -1
  426. package/dist/table/TableBody.js.map +1 -1
  427. package/dist/table/TableCell.d.ts +1 -1
  428. package/dist/table/TableCell.js +1 -1
  429. package/dist/table/TableCell.js.map +1 -1
  430. package/dist/table/TableCheckbox.d.ts +1 -1
  431. package/dist/table/TableCheckbox.js +1 -1
  432. package/dist/table/TableCheckbox.js.map +1 -1
  433. package/dist/table/TableContainer.d.ts +1 -1
  434. package/dist/table/TableContainer.js +1 -1
  435. package/dist/table/TableContainer.js.map +1 -1
  436. package/dist/table/TableFooter.d.ts +1 -1
  437. package/dist/table/TableFooter.js +1 -1
  438. package/dist/table/TableFooter.js.map +1 -1
  439. package/dist/table/TableHeader.d.ts +1 -1
  440. package/dist/table/TableHeader.js +1 -1
  441. package/dist/table/TableHeader.js.map +1 -1
  442. package/dist/table/TableRadio.d.ts +1 -1
  443. package/dist/table/TableRadio.js +1 -1
  444. package/dist/table/TableRadio.js.map +1 -1
  445. package/dist/table/TableRow.d.ts +1 -1
  446. package/dist/table/TableRow.js +1 -1
  447. package/dist/table/TableRow.js.map +1 -1
  448. package/dist/tabs/SimpleTabPanel.d.ts +2 -2
  449. package/dist/tabs/SimpleTabPanel.js +2 -2
  450. package/dist/tabs/SimpleTabPanel.js.map +1 -1
  451. package/dist/tabs/SimpleTabPanels.d.ts +2 -2
  452. package/dist/tabs/SimpleTabPanels.js +2 -2
  453. package/dist/tabs/SimpleTabPanels.js.map +1 -1
  454. package/dist/tabs/Tab.d.ts +1 -1
  455. package/dist/tabs/Tab.js +1 -1
  456. package/dist/tabs/Tab.js.map +1 -1
  457. package/dist/tabs/TabList.d.ts +1 -1
  458. package/dist/tabs/TabList.js +1 -1
  459. package/dist/tabs/TabList.js.map +1 -1
  460. package/dist/tabs/useTabs.d.ts +4 -4
  461. package/dist/tabs/useTabs.js +2 -1
  462. package/dist/tabs/useTabs.js.map +1 -1
  463. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
  464. package/dist/theme/LocalStorageColorSchemeProvider.js +2 -2
  465. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  466. package/dist/theme/ThemeProvider.d.ts +1 -1
  467. package/dist/theme/ThemeProvider.js +1 -1
  468. package/dist/theme/ThemeProvider.js.map +1 -1
  469. package/dist/theme/useColorSchemeProvider.js +1 -0
  470. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  471. package/dist/tooltip/Tooltip.d.ts +1 -1
  472. package/dist/tooltip/Tooltip.js +1 -1
  473. package/dist/tooltip/Tooltip.js.map +1 -1
  474. package/dist/tooltip/TooltipHoverModeProvider.d.ts +1 -1
  475. package/dist/tooltip/TooltipHoverModeProvider.js +1 -1
  476. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  477. package/dist/tooltip/useTooltip.d.ts +1 -1
  478. package/dist/tooltip/useTooltip.js +1 -1
  479. package/dist/tooltip/useTooltip.js.map +1 -1
  480. package/dist/transition/CSSTransition.d.ts +1 -1
  481. package/dist/transition/CSSTransition.js +1 -1
  482. package/dist/transition/CSSTransition.js.map +1 -1
  483. package/dist/transition/Collapse.d.ts +1 -1
  484. package/dist/transition/Collapse.js +1 -1
  485. package/dist/transition/Collapse.js.map +1 -1
  486. package/dist/transition/CrossFade.d.ts +1 -1
  487. package/dist/transition/CrossFade.js +1 -1
  488. package/dist/transition/CrossFade.js.map +1 -1
  489. package/dist/transition/ScaleTransition.d.ts +1 -1
  490. package/dist/transition/ScaleTransition.js +1 -1
  491. package/dist/transition/ScaleTransition.js.map +1 -1
  492. package/dist/transition/SkeletonPlaceholder.d.ts +1 -1
  493. package/dist/transition/SkeletonPlaceholder.js +1 -1
  494. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  495. package/dist/transition/Slide.d.ts +1 -1
  496. package/dist/transition/Slide.js +1 -1
  497. package/dist/transition/Slide.js.map +1 -1
  498. package/dist/transition/SlideContainer.d.ts +1 -1
  499. package/dist/transition/SlideContainer.js +1 -1
  500. package/dist/transition/SlideContainer.js.map +1 -1
  501. package/dist/transition/useCSSTransition.d.ts +2 -2
  502. package/dist/transition/useCSSTransition.js +2 -2
  503. package/dist/transition/useCSSTransition.js.map +1 -1
  504. package/dist/transition/useCarousel.d.ts +1 -1
  505. package/dist/transition/useCarousel.js +1 -1
  506. package/dist/transition/useCarousel.js.map +1 -1
  507. package/dist/transition/useCollapseTransition.d.ts +2 -2
  508. package/dist/transition/useCollapseTransition.js +2 -2
  509. package/dist/transition/useCollapseTransition.js.map +1 -1
  510. package/dist/transition/useCrossFadeTransition.d.ts +2 -2
  511. package/dist/transition/useCrossFadeTransition.js +2 -2
  512. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  513. package/dist/transition/useScaleTransition.d.ts +2 -2
  514. package/dist/transition/useScaleTransition.js +2 -2
  515. package/dist/transition/useScaleTransition.js.map +1 -1
  516. package/dist/transition/useSkeletonPlaceholder.d.ts +2 -2
  517. package/dist/transition/useSkeletonPlaceholder.js +2 -2
  518. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  519. package/dist/transition/useSlideTransition.d.ts +1 -1
  520. package/dist/transition/useSlideTransition.js +1 -1
  521. package/dist/transition/useSlideTransition.js.map +1 -1
  522. package/dist/transition/useTransition.d.ts +1 -1
  523. package/dist/transition/useTransition.js +1 -1
  524. package/dist/transition/useTransition.js.map +1 -1
  525. package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
  526. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  527. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  528. package/dist/tree/Tree.d.ts +1 -1
  529. package/dist/tree/Tree.js +1 -1
  530. package/dist/tree/Tree.js.map +1 -1
  531. package/dist/tree/TreeItem.d.ts +1 -1
  532. package/dist/tree/TreeItem.js +1 -1
  533. package/dist/tree/TreeItem.js.map +1 -1
  534. package/dist/tree/useTree.d.ts +1 -1
  535. package/dist/tree/useTree.js +1 -1
  536. package/dist/tree/useTree.js.map +1 -1
  537. package/dist/tree/useTreeExpansion.d.ts +1 -1
  538. package/dist/tree/useTreeExpansion.js +1 -1
  539. package/dist/tree/useTreeExpansion.js.map +1 -1
  540. package/dist/tree/useTreeItems.d.ts +1 -1
  541. package/dist/tree/useTreeItems.js +1 -1
  542. package/dist/tree/useTreeItems.js.map +1 -1
  543. package/dist/tree/useTreeSelection.d.ts +1 -1
  544. package/dist/tree/useTreeSelection.js +1 -1
  545. package/dist/tree/useTreeSelection.js.map +1 -1
  546. package/dist/typography/HighlightText.d.ts +1 -1
  547. package/dist/typography/HighlightText.js +1 -1
  548. package/dist/typography/HighlightText.js.map +1 -1
  549. package/dist/typography/Mark.d.ts +1 -1
  550. package/dist/typography/Mark.js +1 -1
  551. package/dist/typography/Mark.js.map +1 -1
  552. package/dist/typography/SrOnly.d.ts +1 -1
  553. package/dist/typography/SrOnly.js +1 -1
  554. package/dist/typography/SrOnly.js.map +1 -1
  555. package/dist/typography/TextContainer.d.ts +1 -1
  556. package/dist/typography/TextContainer.js +1 -1
  557. package/dist/typography/TextContainer.js.map +1 -1
  558. package/dist/typography/Typography.d.ts +1 -1
  559. package/dist/typography/Typography.js +1 -1
  560. package/dist/typography/Typography.js.map +1 -1
  561. package/dist/typography/WritingDirectionProvider.d.ts +1 -1
  562. package/dist/typography/WritingDirectionProvider.js +1 -1
  563. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  564. package/dist/useEnsuredState.d.ts +1 -0
  565. package/dist/useEnsuredState.js +5 -3
  566. package/dist/useEnsuredState.js.map +1 -1
  567. package/dist/utils/RenderRecursively.d.ts +1 -1
  568. package/dist/utils/RenderRecursively.js +1 -1
  569. package/dist/utils/RenderRecursively.js.map +1 -1
  570. package/dist/window-splitter/WindowSplitter.d.ts +1 -1
  571. package/dist/window-splitter/WindowSplitter.js +1 -1
  572. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  573. package/package.json +1 -1
  574. package/src/CoreProviders.tsx +1 -1
  575. package/src/SsrProvider.tsx +1 -1
  576. package/src/autocomplete/Autocomplete.tsx +3 -3
  577. package/src/autocomplete/AutocompleteChip.tsx +1 -1
  578. package/src/autocomplete/AutocompleteCircularProgress.tsx +1 -1
  579. package/src/autocomplete/AutocompleteClearButton.tsx +1 -1
  580. package/src/autocomplete/AutocompleteDropdownButton.tsx +1 -1
  581. package/src/autocomplete/useAutocomplete.ts +5 -4
  582. package/src/avatar/Avatar.tsx +1 -1
  583. package/src/badge/Badge.tsx +1 -1
  584. package/src/box/Box.tsx +1 -1
  585. package/src/button/AsyncButton.tsx +1 -1
  586. package/src/button/Button.tsx +1 -1
  587. package/src/button/ButtonUnstyled.tsx +1 -1
  588. package/src/button/TooltippedButton.tsx +1 -1
  589. package/src/card/Card.tsx +1 -1
  590. package/src/card/CardContent.tsx +1 -1
  591. package/src/card/CardFooter.tsx +1 -1
  592. package/src/card/CardHeader.tsx +1 -1
  593. package/src/card/CardSubtitle.tsx +1 -1
  594. package/src/card/CardTitle.tsx +1 -1
  595. package/src/card/ClickableCard.tsx +1 -1
  596. package/src/chip/Chip.tsx +1 -1
  597. package/src/dialog/Dialog.tsx +1 -1
  598. package/src/dialog/DialogContent.tsx +1 -1
  599. package/src/dialog/DialogFooter.tsx +1 -1
  600. package/src/dialog/DialogHeader.tsx +1 -1
  601. package/src/dialog/DialogTitle.tsx +1 -1
  602. package/src/dialog/FixedDialog.tsx +1 -1
  603. package/src/divider/Divider.tsx +1 -1
  604. package/src/draggable/useDraggable.ts +1 -1
  605. package/src/expansion-panel/ExpansionList.tsx +1 -1
  606. package/src/expansion-panel/ExpansionPanel.tsx +1 -1
  607. package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -1
  608. package/src/expansion-panel/useExpansionList.ts +1 -1
  609. package/src/expansion-panel/useExpansionPanels.ts +1 -1
  610. package/src/files/FileInput.tsx +1 -1
  611. package/src/files/useFileUpload.ts +2 -2
  612. package/src/form/Checkbox.tsx +1 -1
  613. package/src/form/Fieldset.tsx +1 -1
  614. package/src/form/Form.tsx +1 -1
  615. package/src/form/FormMessage.tsx +1 -1
  616. package/src/form/FormMessageContainer.tsx +1 -1
  617. package/src/form/FormMessageCounter.tsx +2 -2
  618. package/src/form/InputToggle.tsx +2 -2
  619. package/src/form/Label.tsx +3 -3
  620. package/src/form/Legend.tsx +1 -1
  621. package/src/form/NativeSelect.tsx +1 -1
  622. package/src/form/OptGroup.tsx +1 -1
  623. package/src/form/Option.tsx +1 -1
  624. package/src/form/Password.tsx +1 -1
  625. package/src/form/Radio.tsx +1 -1
  626. package/src/form/Select.tsx +1 -1
  627. package/src/form/Slider.tsx +1 -1
  628. package/src/form/Switch.tsx +1 -1
  629. package/src/form/TextArea.tsx +1 -1
  630. package/src/form/TextField.tsx +1 -1
  631. package/src/form/useCheckboxGroup.ts +10 -10
  632. package/src/form/useCombobox.ts +1 -0
  633. package/src/form/useNumberField.ts +4 -4
  634. package/src/form/useRadioGroup.ts +6 -6
  635. package/src/form/useRangeSlider.ts +1 -1
  636. package/src/form/useSlider.ts +1 -1
  637. package/src/form/useTextField.ts +6 -6
  638. package/src/icon/FontIcon.tsx +1 -1
  639. package/src/icon/IconRotator.tsx +1 -1
  640. package/src/icon/MaterialIcon.tsx +2 -2
  641. package/src/icon/MaterialSymbol.tsx +2 -2
  642. package/src/icon/SVGIcon.tsx +1 -1
  643. package/src/icon/TextIconSpacing.tsx +1 -1
  644. package/src/layout/LayoutAppBar.tsx +1 -1
  645. package/src/layout/LayoutNav.tsx +1 -1
  646. package/src/layout/LayoutWindowSplitter.tsx +1 -1
  647. package/src/layout/Main.tsx +1 -1
  648. package/src/layout/useExpandableLayout.ts +1 -1
  649. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  650. package/src/layout/useLayoutAppBarHeight.ts +1 -1
  651. package/src/layout/useLayoutTree.ts +3 -3
  652. package/src/layout/useLayoutWindowSplitter.ts +1 -1
  653. package/src/layout/useResizableLayout.ts +1 -1
  654. package/src/layout/useTemporaryLayout.ts +1 -1
  655. package/src/link/Link.tsx +1 -1
  656. package/src/link/SkipToMainContent.tsx +1 -1
  657. package/src/list/List.tsx +1 -1
  658. package/src/list/ListItem.tsx +1 -1
  659. package/src/list/ListItemChildren.tsx +1 -1
  660. package/src/list/ListItemLink.tsx +1 -1
  661. package/src/list/ListSubheader.tsx +1 -1
  662. package/src/media-queries/AppSizeProvider.tsx +2 -2
  663. package/src/media-queries/useMediaQuery.ts +2 -2
  664. package/src/menu/DropdownMenu.tsx +2 -1
  665. package/src/menu/Menu.tsx +1 -1
  666. package/src/menu/MenuBar.tsx +1 -1
  667. package/src/menu/MenuButton.tsx +1 -1
  668. package/src/menu/MenuItem.tsx +1 -1
  669. package/src/menu/MenuItemCheckbox.tsx +1 -1
  670. package/src/menu/MenuItemFileInput.tsx +1 -1
  671. package/src/menu/MenuItemGroup.tsx +1 -1
  672. package/src/menu/MenuItemInputToggle.tsx +1 -1
  673. package/src/menu/MenuItemRadio.tsx +1 -1
  674. package/src/menu/MenuItemSeparator.tsx +1 -1
  675. package/src/menu/MenuItemSwitch.tsx +1 -1
  676. package/src/menu/MenuItemTextField.tsx +1 -1
  677. package/src/menu/useContextMenu.ts +1 -1
  678. package/src/navigation/CollapsibleNavGroup.tsx +1 -1
  679. package/src/navigation/DefaultNavigationRenderer.tsx +1 -1
  680. package/src/navigation/NavGroup.tsx +1 -1
  681. package/src/navigation/NavItem.tsx +1 -1
  682. package/src/navigation/NavItemButton.tsx +1 -1
  683. package/src/navigation/NavItemLink.tsx +1 -1
  684. package/src/navigation/NavSubheader.tsx +1 -1
  685. package/src/navigation/Navigation.tsx +1 -1
  686. package/src/navigation/useActiveHeadingId.ts +1 -1
  687. package/src/navigation/useNavigationExpansion.ts +2 -2
  688. package/src/navigation/useTableOfContentsHeadings.ts +1 -1
  689. package/src/overlay/Overlay.tsx +1 -1
  690. package/src/portal/Portal.tsx +1 -1
  691. package/src/portal/PortalContainerProvider.tsx +1 -1
  692. package/src/positioning/useFixedPositioning.ts +1 -1
  693. package/src/progress/CircularProgress.tsx +1 -1
  694. package/src/progress/LinearProgress.tsx +1 -1
  695. package/src/responsive-item/ResponsiveItem.tsx +1 -1
  696. package/src/responsive-item/ResponsiveItemOverlay.tsx +1 -1
  697. package/src/scroll/useScrollLock.ts +1 -1
  698. package/src/segmented-button/SegmentedButton.tsx +1 -1
  699. package/src/segmented-button/SegmentedButtonContainer.tsx +1 -1
  700. package/src/sheet/Sheet.tsx +1 -1
  701. package/src/snackbar/DefaultToastRenderer.tsx +1 -1
  702. package/src/snackbar/Snackbar.tsx +1 -1
  703. package/src/snackbar/Toast.tsx +1 -1
  704. package/src/snackbar/ToastActionButton.tsx +1 -1
  705. package/src/snackbar/ToastCloseButton.tsx +1 -1
  706. package/src/snackbar/ToastContent.tsx +1 -1
  707. package/src/snackbar/ToastManager.ts +1 -1
  708. package/src/snackbar/ToastManagerProvider.tsx +1 -1
  709. package/src/snackbar/useCurrentToastActions.ts +1 -1
  710. package/src/storage/useStorage.ts +1 -1
  711. package/src/suspense/CircularProgressSuspense.tsx +1 -1
  712. package/src/suspense/NullSuspense.tsx +1 -1
  713. package/src/table/StickyTableSection.tsx +2 -2
  714. package/src/table/Table.tsx +1 -1
  715. package/src/table/TableBody.tsx +1 -1
  716. package/src/table/TableCell.tsx +1 -1
  717. package/src/table/TableCheckbox.tsx +1 -1
  718. package/src/table/TableContainer.tsx +1 -1
  719. package/src/table/TableFooter.tsx +1 -1
  720. package/src/table/TableHeader.tsx +1 -1
  721. package/src/table/TableRadio.tsx +1 -1
  722. package/src/table/TableRow.tsx +1 -1
  723. package/src/tabs/SimpleTabPanel.tsx +2 -2
  724. package/src/tabs/SimpleTabPanels.tsx +2 -2
  725. package/src/tabs/Tab.tsx +1 -1
  726. package/src/tabs/TabList.tsx +1 -1
  727. package/src/tabs/useTabs.ts +6 -5
  728. package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
  729. package/src/theme/ThemeProvider.tsx +1 -1
  730. package/src/theme/useColorSchemeProvider.ts +1 -0
  731. package/src/tooltip/Tooltip.tsx +1 -1
  732. package/src/tooltip/TooltipHoverModeProvider.tsx +1 -1
  733. package/src/tooltip/useTooltip.ts +1 -1
  734. package/src/transition/CSSTransition.tsx +1 -1
  735. package/src/transition/Collapse.tsx +1 -1
  736. package/src/transition/CrossFade.tsx +1 -1
  737. package/src/transition/ScaleTransition.tsx +1 -1
  738. package/src/transition/SkeletonPlaceholder.tsx +1 -1
  739. package/src/transition/Slide.tsx +1 -1
  740. package/src/transition/SlideContainer.tsx +1 -1
  741. package/src/transition/useCSSTransition.ts +2 -2
  742. package/src/transition/useCarousel.ts +1 -1
  743. package/src/transition/useCollapseTransition.ts +2 -2
  744. package/src/transition/useCrossFadeTransition.ts +2 -2
  745. package/src/transition/useScaleTransition.ts +2 -2
  746. package/src/transition/useSkeletonPlaceholder.ts +2 -2
  747. package/src/transition/useSlideTransition.ts +1 -1
  748. package/src/transition/useTransition.ts +1 -1
  749. package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
  750. package/src/tree/Tree.tsx +1 -1
  751. package/src/tree/TreeItem.tsx +1 -1
  752. package/src/tree/useTree.ts +1 -1
  753. package/src/tree/useTreeExpansion.ts +1 -1
  754. package/src/tree/useTreeItems.ts +1 -1
  755. package/src/tree/useTreeSelection.ts +1 -1
  756. package/src/typography/HighlightText.tsx +1 -1
  757. package/src/typography/Mark.tsx +1 -1
  758. package/src/typography/SrOnly.tsx +1 -1
  759. package/src/typography/TextContainer.tsx +1 -1
  760. package/src/typography/Typography.tsx +1 -1
  761. package/src/typography/WritingDirectionProvider.tsx +1 -1
  762. package/src/useEnsuredState.ts +6 -3
  763. package/src/utils/RenderRecursively.tsx +1 -1
  764. package/src/window-splitter/WindowSplitter.tsx +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expansion-panel/ExpansionList.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { KeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { useExpansionList } from \"./useExpansionList.js\";\n\n/**\n * @since 6.0.0 No longer requires the `onKeyDown` prop.\n */\nexport interface ExpansionListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is only used to implement the keyboard movement behavior for\n * the `ExpansionPanel` components.\n *\n * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @see {@link useExpansionList} for a custom implementation example if you do\n * not want to use a `<div>` for this wrapper component.\n * @since 6.0.0 Uses the new keyboard movement API and does not\n * require the `onKeyDown` prop to be provided.\n */\nexport const ExpansionList = forwardRef<HTMLDivElement, ExpansionListProps>(\n function ExpansionList(props, ref) {\n const { onClick, onFocus, onKeyDown, children, ...remaining } = props;\n\n const { movementContext, movementProps } = useExpansionList({\n onClick,\n onFocus,\n onKeyDown,\n });\n\n return (\n <KeyboardMovementProvider value={movementContext}>\n <div {...remaining} {...movementProps} ref={ref}>\n {children}\n </div>\n </KeyboardMovementProvider>\n );\n }\n);\n"],"names":["forwardRef","KeyboardMovementProvider","useExpansionList","ExpansionList","props","ref","onClick","onFocus","onKeyDown","children","remaining","movementContext","movementProps","value","div"],"mappings":"AAAA;;AAEA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAASC,wBAAwB,QAAQ,6CAA6C;AACtF,SAASC,gBAAgB,QAAQ,wBAAwB;AASzD;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,8BAAgBH,WAC3B,SAASG,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGN;IAEhE,MAAM,EAAEO,eAAe,EAAEC,aAAa,EAAE,GAAGV,iBAAiB;QAC1DI;QACAC;QACAC;IACF;IAEA,qBACE,KAACP;QAAyBY,OAAOF;kBAC/B,cAAA,KAACG;YAAK,GAAGJ,SAAS;YAAG,GAAGE,aAAa;YAAEP,KAAKA;sBACzCI;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/expansion-panel/ExpansionList.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { KeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { useExpansionList } from \"./useExpansionList.js\";\n\n/**\n * @since 6.0.0 No longer requires the `onKeyDown` prop.\n */\nexport interface ExpansionListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is only used to implement the keyboard movement behavior for\n * the `ExpansionPanel` components.\n *\n * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @see {@link useExpansionList} for a custom implementation example if you do\n * not want to use a `<div>` for this wrapper component.\n * @since 6.0.0 Uses the new keyboard movement API and does not\n * require the `onKeyDown` prop to be provided.\n */\nexport const ExpansionList = forwardRef<HTMLDivElement, ExpansionListProps>(\n function ExpansionList(props, ref) {\n const { onClick, onFocus, onKeyDown, children, ...remaining } = props;\n\n const { movementContext, movementProps } = useExpansionList({\n onClick,\n onFocus,\n onKeyDown,\n });\n\n return (\n <KeyboardMovementProvider value={movementContext}>\n <div {...remaining} {...movementProps} ref={ref}>\n {children}\n </div>\n </KeyboardMovementProvider>\n );\n }\n);\n"],"names":["forwardRef","KeyboardMovementProvider","useExpansionList","ExpansionList","props","ref","onClick","onFocus","onKeyDown","children","remaining","movementContext","movementProps","value","div"],"mappings":"AAAA;;AAEA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAASC,wBAAwB,QAAQ,6CAA6C;AACtF,SAASC,gBAAgB,QAAQ,wBAAwB;AASzD;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,8BAAgBH,WAC3B,SAASG,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGN;IAEhE,MAAM,EAAEO,eAAe,EAAEC,aAAa,EAAE,GAAGV,iBAAiB;QAC1DI;QACAC;QACAC;IACF;IAEA,qBACE,KAACP;QAAyBY,OAAOF;kBAC/B,cAAA,KAACG;YAAK,GAAGJ,SAAS;YAAG,GAAGE,aAAa;YAAEP,KAAKA;sBACzCI;;;AAIT,GACA"}
@@ -171,7 +171,7 @@ export interface ExpansionPanelProps extends CardProps {
171
171
  * }
172
172
  * ```
173
173
  *
174
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
174
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
175
175
  * @see `useExpansionPanels` for examples.
176
176
  * @since 6.0.0 The content will be persistent and invisible using `display: none`
177
177
  * instead of unmounting and also animate the `margin-top` style.
@@ -41,7 +41,7 @@ import { expansionPanel } from "./styles.js";
41
41
  * }
42
42
  * ```
43
43
  *
44
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
44
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
45
45
  * @see `useExpansionPanels` for examples.
46
46
  * @since 6.0.0 The content will be persistent and invisible using `display: none`
47
47
  * instead of unmounting and also animate the `margin-top` style.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expansion-panel/ExpansionPanel.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, type ReactNode, forwardRef } from \"react\";\n\nimport { Card, type CardProps } from \"../card/Card.js\";\nimport { CardContent, type CardContentProps } from \"../card/CardContent.js\";\nimport { useCollapseTransition } from \"../transition/useCollapseTransition.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n ExpansionPanelHeader,\n type ExpansionPanelHeaderProps,\n} from \"./ExpansionPanelHeader.js\";\nimport { expansionPanel } from \"./styles.js\";\n\n/**\n * @since 6.0.0 The `disableSecondaryColor` convenience prop was removed in\n * favor of the new `contentProps` object.\n * @since 6.0.0 The `disableParagraphMargin` prop was removed since it no longer\n * exists on the `CardContent` component.\n * @since 6.0.0 Removed the `marginTop` prop since it is no longer needed.\n */\nexport interface ExpansionPanelProps extends CardProps {\n /**\n * Set this to `true` if the {@link children} should be visible. This should\n * generally be provided by the `useExpansionPanels` hook.\n */\n expanded: boolean;\n\n /**\n * A function that should toggle the {@link expanded} state. This should\n * generally be provided by the `useExpansionPanels` hook.\n */\n onExpandClick: () => void;\n\n /**\n * Set this to `true` to prevent the panel from toggling the {@link expanded}\n * state. This should generally be provided by the `useExpansionPanels` hook.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * @defaultValue `true`\n * @see {@link CardProps.fullWidth}\n */\n fullWidth?: boolean;\n\n /**\n * This can be used to implement a custom header implementation, but it\n * probably shouldn't be needed.\n *\n * @since 6.0.0 This was renamed from `customHeader`\n * @see {@link headerProps}\n */\n header?: ReactNode;\n\n /**\n * This can be used to apply additional props to the header element.\n *\n * Note: You can override the `style` and `className` using\n * {@link headerStyle} and {@link headerClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <ExpansionPanel\n * {...props}\n * headerProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * icon: <MyCustomIcon />,\n * iconRotatorProps: {\n * className: \"another-custom-class-name\",\n * },\n * }}\n * />\n * ```\n */\n headerProps?: Omit<\n ExpansionPanelHeaderProps,\n \"id\" | \"aria-disabled\" | \"onClick\" | \"expanded\"\n >;\n\n /**\n * Convenience prop to apply custom style to the `ExpansionPanelHeader`\n * component.\n */\n headerStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `ExpansionPanelHeader`\n * component.\n */\n headerClassName?: string;\n\n /**\n * Content to display within the header of the expansion panel that toggles\n * the expanded state. This should generally contain some accessible text\n * describing the expansion panel's content.\n *\n * @since 6.0.0 This was renamed from `header`\n */\n headerChildren?: ReactNode;\n\n /**\n * This can be used to apply additional props to the `CardContent` component\n * if needed.\n *\n * Note: `disableSecondaryColor` and `disableLastChildPadding` default to\n * `true` in this implementation.\n *\n * @example\n * ```tsx\n * contentProps={{\n * style: {},\n * className: \"some-class-name\",\n * disablePadding: true,\n * disableSecondaryColor: false,\n * disableLastChildPadding: false,\n * // whatever else\n * }}\n * ```\n *\n * @see {@link contentStyle}\n * @see {@link contentClassName}\n * @see {@link disableContentPadding}\n */\n contentProps?: PropsWithRef<Omit<CardContentProps, \"role\">, HTMLDivElement>;\n\n /**\n * Convenience prop to apply custom style to the `CardContent` component.\n */\n contentStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `CardContent` component.\n */\n contentClassName?: string;\n\n /**\n * Set to `true` to disable the collapse transition for the card content\n * whenever the {@link expanded} state changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `false`\n * @see {@link CardContentProps.disablePadding}\n */\n disableContentPadding?: boolean;\n\n /**\n * Set this to `true` to unmount the {@link children} when the\n * {@link expanded} state is `false`.\n *\n * @defaultValue `false`\n * @since 6.0.0 Renamed from `persistent` to match the\n * `useCollapseTransition` naming convention.\n */\n temporary?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * An expansion panel enables content to be either collapsed (hidden) or\n * expanded (visible) following the disclosure pattern.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n *\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * export default function ExpansionPanelGroupExample(): ReactElement {\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <ExpansionList style={{ width: \"100%\" }}>\n * <ExpansionPanel {...getPanelProps(0)} headerChildren=\"Panel 1\">\n * Panel 1 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(1)} headerChildren=\"Panel 2\">\n * Panel 2 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(2)} headerChildren=\"Panel 3\">\n * Panel 3 Contents\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @see `useExpansionPanels` for examples.\n * @since 6.0.0 The content will be persistent and invisible using `display: none`\n * instead of unmounting and also animate the `margin-top` style.\n */\nexport const ExpansionPanel = forwardRef<\n HTMLHeadingElement,\n ExpansionPanelProps\n>(function ExpansionPanel(props, ref) {\n const {\n id: propId,\n className,\n contentProps,\n contentStyle,\n contentClassName,\n header: propHeader,\n headerProps,\n headerStyle,\n headerClassName,\n headerChildren,\n children,\n expanded,\n onExpandClick,\n disabled = false,\n fullWidth = true,\n temporary = false,\n disableTransition = false,\n disableContentPadding = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"expansion-panel\");\n const { elementProps, rendered } = useCollapseTransition({\n nodeRef: contentProps?.ref,\n style: contentStyle,\n className: contentClassName,\n timeout: disableTransition ? 0 : undefined,\n temporary,\n transitionIn: expanded,\n });\n\n let header = propHeader;\n if (typeof header === \"undefined\") {\n header = (\n <ExpansionPanelHeader\n style={headerStyle}\n className={headerClassName}\n disableTransition={disableTransition}\n {...headerProps}\n aria-disabled={disabled || undefined}\n id={id}\n onClick={onExpandClick}\n expanded={expanded}\n >\n {headerChildren}\n </ExpansionPanelHeader>\n );\n }\n\n return (\n <Card\n {...remaining}\n id={`${id}-container`}\n ref={ref}\n fullWidth={fullWidth}\n className={expansionPanel({\n expanded,\n disableTransition,\n className,\n })}\n >\n {header}\n {rendered && (\n <CardContent\n id={`${id}-content`}\n aria-labelledby={id}\n disablePadding={disableContentPadding}\n disableSecondaryColor\n disableLastChildPadding\n {...contentProps}\n {...elementProps}\n role=\"region\"\n >\n {children}\n </CardContent>\n )}\n </Card>\n );\n});\n"],"names":["forwardRef","Card","CardContent","useCollapseTransition","useEnsuredId","ExpansionPanelHeader","expansionPanel","ExpansionPanel","props","ref","id","propId","className","contentProps","contentStyle","contentClassName","header","propHeader","headerProps","headerStyle","headerClassName","headerChildren","children","expanded","onExpandClick","disabled","fullWidth","temporary","disableTransition","disableContentPadding","remaining","elementProps","rendered","nodeRef","style","timeout","undefined","transitionIn","aria-disabled","onClick","aria-labelledby","disablePadding","disableSecondaryColor","disableLastChildPadding","role"],"mappings":"AAAA;;AAEA,SAA6CA,UAAU,QAAQ,QAAQ;AAEvE,SAASC,IAAI,QAAwB,kBAAkB;AACvD,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,qBAAqB,QAAQ,yCAAyC;AAE/E,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,oBAAoB,QAEf,4BAA4B;AACnC,SAASC,cAAc,QAAQ,cAAc;AA0J7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,MAAMC,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,YAAY,EACZC,YAAY,EACZC,gBAAgB,EAChBC,QAAQC,UAAU,EAClBC,WAAW,EACXC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,WAAW,KAAK,EAChBC,YAAY,IAAI,EAChBC,YAAY,KAAK,EACjBC,oBAAoB,KAAK,EACzBC,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGtB;IAEJ,MAAME,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEoB,YAAY,EAAEC,QAAQ,EAAE,GAAG7B,sBAAsB;QACvD8B,SAASpB,cAAcJ;QACvByB,OAAOpB;QACPF,WAAWG;QACXoB,SAASP,oBAAoB,IAAIQ;QACjCT;QACAU,cAAcd;IAChB;IAEA,IAAIP,SAASC;IACb,IAAI,OAAOD,WAAW,aAAa;QACjCA,uBACE,KAACX;YACC6B,OAAOf;YACPP,WAAWQ;YACXQ,mBAAmBA;YAClB,GAAGV,WAAW;YACfoB,iBAAeb,YAAYW;YAC3B1B,IAAIA;YACJ6B,SAASf;YACTD,UAAUA;sBAETF;;IAGP;IAEA,qBACE,MAACpB;QACE,GAAG6B,SAAS;QACbpB,IAAI,GAAGA,GAAG,UAAU,CAAC;QACrBD,KAAKA;QACLiB,WAAWA;QACXd,WAAWN,eAAe;YACxBiB;YACAK;YACAhB;QACF;;YAECI;YACAgB,0BACC,KAAC9B;gBACCQ,IAAI,GAAGA,GAAG,QAAQ,CAAC;gBACnB8B,mBAAiB9B;gBACjB+B,gBAAgBZ;gBAChBa,qBAAqB;gBACrBC,uBAAuB;gBACtB,GAAG9B,YAAY;gBACf,GAAGkB,YAAY;gBAChBa,MAAK;0BAEJtB;;;;AAKX,GAAG"}
1
+ {"version":3,"sources":["../../src/expansion-panel/ExpansionPanel.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, type ReactNode, forwardRef } from \"react\";\n\nimport { Card, type CardProps } from \"../card/Card.js\";\nimport { CardContent, type CardContentProps } from \"../card/CardContent.js\";\nimport { useCollapseTransition } from \"../transition/useCollapseTransition.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n ExpansionPanelHeader,\n type ExpansionPanelHeaderProps,\n} from \"./ExpansionPanelHeader.js\";\nimport { expansionPanel } from \"./styles.js\";\n\n/**\n * @since 6.0.0 The `disableSecondaryColor` convenience prop was removed in\n * favor of the new `contentProps` object.\n * @since 6.0.0 The `disableParagraphMargin` prop was removed since it no longer\n * exists on the `CardContent` component.\n * @since 6.0.0 Removed the `marginTop` prop since it is no longer needed.\n */\nexport interface ExpansionPanelProps extends CardProps {\n /**\n * Set this to `true` if the {@link children} should be visible. This should\n * generally be provided by the `useExpansionPanels` hook.\n */\n expanded: boolean;\n\n /**\n * A function that should toggle the {@link expanded} state. This should\n * generally be provided by the `useExpansionPanels` hook.\n */\n onExpandClick: () => void;\n\n /**\n * Set this to `true` to prevent the panel from toggling the {@link expanded}\n * state. This should generally be provided by the `useExpansionPanels` hook.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * @defaultValue `true`\n * @see {@link CardProps.fullWidth}\n */\n fullWidth?: boolean;\n\n /**\n * This can be used to implement a custom header implementation, but it\n * probably shouldn't be needed.\n *\n * @since 6.0.0 This was renamed from `customHeader`\n * @see {@link headerProps}\n */\n header?: ReactNode;\n\n /**\n * This can be used to apply additional props to the header element.\n *\n * Note: You can override the `style` and `className` using\n * {@link headerStyle} and {@link headerClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <ExpansionPanel\n * {...props}\n * headerProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * icon: <MyCustomIcon />,\n * iconRotatorProps: {\n * className: \"another-custom-class-name\",\n * },\n * }}\n * />\n * ```\n */\n headerProps?: Omit<\n ExpansionPanelHeaderProps,\n \"id\" | \"aria-disabled\" | \"onClick\" | \"expanded\"\n >;\n\n /**\n * Convenience prop to apply custom style to the `ExpansionPanelHeader`\n * component.\n */\n headerStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `ExpansionPanelHeader`\n * component.\n */\n headerClassName?: string;\n\n /**\n * Content to display within the header of the expansion panel that toggles\n * the expanded state. This should generally contain some accessible text\n * describing the expansion panel's content.\n *\n * @since 6.0.0 This was renamed from `header`\n */\n headerChildren?: ReactNode;\n\n /**\n * This can be used to apply additional props to the `CardContent` component\n * if needed.\n *\n * Note: `disableSecondaryColor` and `disableLastChildPadding` default to\n * `true` in this implementation.\n *\n * @example\n * ```tsx\n * contentProps={{\n * style: {},\n * className: \"some-class-name\",\n * disablePadding: true,\n * disableSecondaryColor: false,\n * disableLastChildPadding: false,\n * // whatever else\n * }}\n * ```\n *\n * @see {@link contentStyle}\n * @see {@link contentClassName}\n * @see {@link disableContentPadding}\n */\n contentProps?: PropsWithRef<Omit<CardContentProps, \"role\">, HTMLDivElement>;\n\n /**\n * Convenience prop to apply custom style to the `CardContent` component.\n */\n contentStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `CardContent` component.\n */\n contentClassName?: string;\n\n /**\n * Set to `true` to disable the collapse transition for the card content\n * whenever the {@link expanded} state changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `false`\n * @see {@link CardContentProps.disablePadding}\n */\n disableContentPadding?: boolean;\n\n /**\n * Set this to `true` to unmount the {@link children} when the\n * {@link expanded} state is `false`.\n *\n * @defaultValue `false`\n * @since 6.0.0 Renamed from `persistent` to match the\n * `useCollapseTransition` naming convention.\n */\n temporary?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * An expansion panel enables content to be either collapsed (hidden) or\n * expanded (visible) following the disclosure pattern.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n *\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * export default function ExpansionPanelGroupExample(): ReactElement {\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <ExpansionList style={{ width: \"100%\" }}>\n * <ExpansionPanel {...getPanelProps(0)} headerChildren=\"Panel 1\">\n * Panel 1 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(1)} headerChildren=\"Panel 2\">\n * Panel 2 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(2)} headerChildren=\"Panel 3\">\n * Panel 3 Contents\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @see `useExpansionPanels` for examples.\n * @since 6.0.0 The content will be persistent and invisible using `display: none`\n * instead of unmounting and also animate the `margin-top` style.\n */\nexport const ExpansionPanel = forwardRef<\n HTMLHeadingElement,\n ExpansionPanelProps\n>(function ExpansionPanel(props, ref) {\n const {\n id: propId,\n className,\n contentProps,\n contentStyle,\n contentClassName,\n header: propHeader,\n headerProps,\n headerStyle,\n headerClassName,\n headerChildren,\n children,\n expanded,\n onExpandClick,\n disabled = false,\n fullWidth = true,\n temporary = false,\n disableTransition = false,\n disableContentPadding = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"expansion-panel\");\n const { elementProps, rendered } = useCollapseTransition({\n nodeRef: contentProps?.ref,\n style: contentStyle,\n className: contentClassName,\n timeout: disableTransition ? 0 : undefined,\n temporary,\n transitionIn: expanded,\n });\n\n let header = propHeader;\n if (typeof header === \"undefined\") {\n header = (\n <ExpansionPanelHeader\n style={headerStyle}\n className={headerClassName}\n disableTransition={disableTransition}\n {...headerProps}\n aria-disabled={disabled || undefined}\n id={id}\n onClick={onExpandClick}\n expanded={expanded}\n >\n {headerChildren}\n </ExpansionPanelHeader>\n );\n }\n\n return (\n <Card\n {...remaining}\n id={`${id}-container`}\n ref={ref}\n fullWidth={fullWidth}\n className={expansionPanel({\n expanded,\n disableTransition,\n className,\n })}\n >\n {header}\n {rendered && (\n <CardContent\n id={`${id}-content`}\n aria-labelledby={id}\n disablePadding={disableContentPadding}\n disableSecondaryColor\n disableLastChildPadding\n {...contentProps}\n {...elementProps}\n role=\"region\"\n >\n {children}\n </CardContent>\n )}\n </Card>\n );\n});\n"],"names":["forwardRef","Card","CardContent","useCollapseTransition","useEnsuredId","ExpansionPanelHeader","expansionPanel","ExpansionPanel","props","ref","id","propId","className","contentProps","contentStyle","contentClassName","header","propHeader","headerProps","headerStyle","headerClassName","headerChildren","children","expanded","onExpandClick","disabled","fullWidth","temporary","disableTransition","disableContentPadding","remaining","elementProps","rendered","nodeRef","style","timeout","undefined","transitionIn","aria-disabled","onClick","aria-labelledby","disablePadding","disableSecondaryColor","disableLastChildPadding","role"],"mappings":"AAAA;;AAEA,SAA6CA,UAAU,QAAQ,QAAQ;AAEvE,SAASC,IAAI,QAAwB,kBAAkB;AACvD,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,qBAAqB,QAAQ,yCAAyC;AAE/E,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,oBAAoB,QAEf,4BAA4B;AACnC,SAASC,cAAc,QAAQ,cAAc;AA0J7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,MAAMC,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,YAAY,EACZC,YAAY,EACZC,gBAAgB,EAChBC,QAAQC,UAAU,EAClBC,WAAW,EACXC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,WAAW,KAAK,EAChBC,YAAY,IAAI,EAChBC,YAAY,KAAK,EACjBC,oBAAoB,KAAK,EACzBC,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGtB;IAEJ,MAAME,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEoB,YAAY,EAAEC,QAAQ,EAAE,GAAG7B,sBAAsB;QACvD8B,SAASpB,cAAcJ;QACvByB,OAAOpB;QACPF,WAAWG;QACXoB,SAASP,oBAAoB,IAAIQ;QACjCT;QACAU,cAAcd;IAChB;IAEA,IAAIP,SAASC;IACb,IAAI,OAAOD,WAAW,aAAa;QACjCA,uBACE,KAACX;YACC6B,OAAOf;YACPP,WAAWQ;YACXQ,mBAAmBA;YAClB,GAAGV,WAAW;YACfoB,iBAAeb,YAAYW;YAC3B1B,IAAIA;YACJ6B,SAASf;YACTD,UAAUA;sBAETF;;IAGP;IAEA,qBACE,MAACpB;QACE,GAAG6B,SAAS;QACbpB,IAAI,GAAGA,GAAG,UAAU,CAAC;QACrBD,KAAKA;QACLiB,WAAWA;QACXd,WAAWN,eAAe;YACxBiB;YACAK;YACAhB;QACF;;YAECI;YACAgB,0BACC,KAAC9B;gBACCQ,IAAI,GAAGA,GAAG,QAAQ,CAAC;gBACnB8B,mBAAiB9B;gBACjB+B,gBAAgBZ;gBAChBa,qBAAqB;gBACrBC,uBAAuB;gBACtB,GAAG9B,YAAY;gBACf,GAAGkB,YAAY;gBAChBa,MAAK;0BAEJtB;;;;AAKX,GAAG"}
@@ -104,7 +104,7 @@ export interface ExpansionPanelHeaderProps extends ButtonHTMLAttributes<HTMLButt
104
104
  * }
105
105
  * ```
106
106
  *
107
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
107
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
108
108
  * @since 6.0.0 Updated to be wrapped by the {@link Typography}
109
109
  * component and rendered as an `<h6>`.
110
110
  */
@@ -48,7 +48,7 @@ import { expansionPanelButton, expansionPanelHeading } from "./styles.js";
48
48
  * }
49
49
  * ```
50
50
  *
51
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
51
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
52
52
  * @since 6.0.0 Updated to be wrapped by the {@link Typography}
53
53
  * component and rendered as an `<h6>`.
54
54
  */ export const ExpansionPanelHeader = /*#__PURE__*/ forwardRef(function ExpansionPanelHeader(props, ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expansion-panel/ExpansionPanelHeader.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEventHandler,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { ButtonUnstyled } from \"../button/ButtonUnstyled.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { Typography, type TypographyProps } from \"../typography/Typography.js\";\nimport { type TypographyType } from \"../typography/typographyStyles.js\";\nimport { expansionPanelButton, expansionPanelHeading } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Updated to include additional heading/Typography\n * props.\n */\nexport interface ExpansionPanelHeaderProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n id: string;\n\n /**\n * This should be a function that toggles the expansion state for the parent\n * `ExpansionPanel`.\n */\n onClick: MouseEventHandler<HTMLButtonElement>;\n expanded: boolean;\n\n /**\n * @defaultValue `\"h3\"`\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\n /**\n * @defaultValue `getIcon(\"expander\")`\n */\n icon?: ReactNode;\n\n /**\n * @defaultValue `\"subtitle-1\"`\n */\n headingType?: TypographyType;\n\n /**\n * Any additional props to provide to the heading element that wraps the\n * expansion panel button.\n */\n headingProps?: PropsWithRef<TypographyProps, HTMLHeadingElement>;\n iconRotatorProps?: Omit<IconRotatorProps, \"rotated\" | \"disableTransition\">;\n\n /**\n * Any children to display **before** the button in the heading element. This\n * should really only be used if you need to add additional clickable elements\n * within the header.\n */\n beforeChildren?: ReactNode;\n\n /**\n * Any children to display **after** the button in the heading element.This\n * should really only be used if you need to add additional clickable elements\n * within the header.\n *\n * @example\n * ```tsx\n * afterChildren={\n * <DropdownMenu buttonType=\"icon\" ButtonChildren={<MoreVertSVGIcon />}>\n * <MenuItem>Item 1</MenuItem>\n * <MenuItem>Item 2</MenuItem>\n * <MenuItem>Item 3</MenuItem>\n * </DropdownMenu>\n * }\n * ```\n */\n afterChildren?: ReactNode;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n * This is mostly an internal component, but can also be used to implement a\n * custom header implementation if needed. This might really be a client\n * component in practice since the `onClick` prop must be provided.\n *\n * @example Custom Header\n * ```tsx\n * import { ExpansionPanel, type ExpansionPanelProps } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { ExpansionPanelHeader } from \"@react-md/core/expansion-panel/ExpansionPanelHeader\";\n * import { type ReactElement, useId } from \"react\";\n *\n * export type CustomExpansionPanelProps = ExpansionPanelProps & { id: string; };\n *\n * export function CustomExpansionPanel(props: CustomExpansionPanelProps): ReactElement {\n * const {\n * id,\n * disabled,\n * onExpandClick,\n * expanded,\n * disableTransition,\n * headerChildren,\n * } = props;\n *\n * return (\n * <ExpansionPanel\n * {...props}\n * header={(\n * <ExpansionPanelHeader\n * aria-disabled={disabled || undefined}\n * id={id}\n * onClick={onExpandClick}\n * expanded={expanded}\n * disableTransition={disableTransition}\n * // whatever props and any custom implementation\n * >\n * {headerChildren}\n * </ExpansionPanelHeader>\n * )}\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0 Updated to be wrapped by the {@link Typography}\n * component and rendered as an `<h6>`.\n */\nexport const ExpansionPanelHeader = forwardRef<\n HTMLHeadingElement,\n ExpansionPanelHeaderProps\n>(function ExpansionPanelHeader(props, ref) {\n const {\n id,\n headingType = \"subtitle-1\",\n headingProps,\n iconRotatorProps,\n icon: propIcon,\n expanded,\n className,\n children,\n beforeChildren,\n afterChildren,\n disableTransition = false,\n ...remaining\n } = props;\n\n const icon = getIcon(\"expander\", propIcon);\n\n return (\n <Typography\n ref={ref}\n type={headingType}\n margin=\"none\"\n {...headingProps}\n className={expansionPanelHeading(headingProps)}\n >\n {beforeChildren}\n <ButtonUnstyled\n {...remaining}\n aria-expanded={expanded}\n id={id}\n className={expansionPanelButton({ className })}\n >\n {children}\n {icon && (\n <IconRotator\n {...iconRotatorProps}\n rotated={expanded}\n disableTransition={disableTransition}\n >\n {icon}\n </IconRotator>\n )}\n </ButtonUnstyled>\n {afterChildren}\n </Typography>\n );\n});\n"],"names":["forwardRef","ButtonUnstyled","IconRotator","getIcon","Typography","expansionPanelButton","expansionPanelHeading","ExpansionPanelHeader","props","ref","id","headingType","headingProps","iconRotatorProps","icon","propIcon","expanded","className","children","beforeChildren","afterChildren","disableTransition","remaining","type","margin","aria-expanded","rotated"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,UAAU,QAA8B,8BAA8B;AAE/E,SAASC,oBAAoB,EAAEC,qBAAqB,QAAQ,cAAc;AAsE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CC,GACD,OAAO,MAAMC,qCAAuBP,WAGlC,SAASO,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EACJC,EAAE,EACFC,cAAc,YAAY,EAC1BC,YAAY,EACZC,gBAAgB,EAChBC,MAAMC,QAAQ,EACdC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGd;IAEJ,MAAMM,OAAOX,QAAQ,YAAYY;IAEjC,qBACE,MAACX;QACCK,KAAKA;QACLc,MAAMZ;QACNa,QAAO;QACN,GAAGZ,YAAY;QAChBK,WAAWX,sBAAsBM;;YAEhCO;0BACD,MAAClB;gBACE,GAAGqB,SAAS;gBACbG,iBAAeT;gBACfN,IAAIA;gBACJO,WAAWZ,qBAAqB;oBAAEY;gBAAU;;oBAE3CC;oBACAJ,sBACC,KAACZ;wBACE,GAAGW,gBAAgB;wBACpBa,SAASV;wBACTK,mBAAmBA;kCAElBP;;;;YAINM;;;AAGP,GAAG"}
1
+ {"version":3,"sources":["../../src/expansion-panel/ExpansionPanelHeader.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEventHandler,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { ButtonUnstyled } from \"../button/ButtonUnstyled.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { Typography, type TypographyProps } from \"../typography/Typography.js\";\nimport { type TypographyType } from \"../typography/typographyStyles.js\";\nimport { expansionPanelButton, expansionPanelHeading } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Updated to include additional heading/Typography\n * props.\n */\nexport interface ExpansionPanelHeaderProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n id: string;\n\n /**\n * This should be a function that toggles the expansion state for the parent\n * `ExpansionPanel`.\n */\n onClick: MouseEventHandler<HTMLButtonElement>;\n expanded: boolean;\n\n /**\n * @defaultValue `\"h3\"`\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\n /**\n * @defaultValue `getIcon(\"expander\")`\n */\n icon?: ReactNode;\n\n /**\n * @defaultValue `\"subtitle-1\"`\n */\n headingType?: TypographyType;\n\n /**\n * Any additional props to provide to the heading element that wraps the\n * expansion panel button.\n */\n headingProps?: PropsWithRef<TypographyProps, HTMLHeadingElement>;\n iconRotatorProps?: Omit<IconRotatorProps, \"rotated\" | \"disableTransition\">;\n\n /**\n * Any children to display **before** the button in the heading element. This\n * should really only be used if you need to add additional clickable elements\n * within the header.\n */\n beforeChildren?: ReactNode;\n\n /**\n * Any children to display **after** the button in the heading element.This\n * should really only be used if you need to add additional clickable elements\n * within the header.\n *\n * @example\n * ```tsx\n * afterChildren={\n * <DropdownMenu buttonType=\"icon\" ButtonChildren={<MoreVertSVGIcon />}>\n * <MenuItem>Item 1</MenuItem>\n * <MenuItem>Item 2</MenuItem>\n * <MenuItem>Item 3</MenuItem>\n * </DropdownMenu>\n * }\n * ```\n */\n afterChildren?: ReactNode;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n * This is mostly an internal component, but can also be used to implement a\n * custom header implementation if needed. This might really be a client\n * component in practice since the `onClick` prop must be provided.\n *\n * @example Custom Header\n * ```tsx\n * import { ExpansionPanel, type ExpansionPanelProps } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { ExpansionPanelHeader } from \"@react-md/core/expansion-panel/ExpansionPanelHeader\";\n * import { type ReactElement, useId } from \"react\";\n *\n * export type CustomExpansionPanelProps = ExpansionPanelProps & { id: string; };\n *\n * export function CustomExpansionPanel(props: CustomExpansionPanelProps): ReactElement {\n * const {\n * id,\n * disabled,\n * onExpandClick,\n * expanded,\n * disableTransition,\n * headerChildren,\n * } = props;\n *\n * return (\n * <ExpansionPanel\n * {...props}\n * header={(\n * <ExpansionPanelHeader\n * aria-disabled={disabled || undefined}\n * id={id}\n * onClick={onExpandClick}\n * expanded={expanded}\n * disableTransition={disableTransition}\n * // whatever props and any custom implementation\n * >\n * {headerChildren}\n * </ExpansionPanelHeader>\n * )}\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0 Updated to be wrapped by the {@link Typography}\n * component and rendered as an `<h6>`.\n */\nexport const ExpansionPanelHeader = forwardRef<\n HTMLHeadingElement,\n ExpansionPanelHeaderProps\n>(function ExpansionPanelHeader(props, ref) {\n const {\n id,\n headingType = \"subtitle-1\",\n headingProps,\n iconRotatorProps,\n icon: propIcon,\n expanded,\n className,\n children,\n beforeChildren,\n afterChildren,\n disableTransition = false,\n ...remaining\n } = props;\n\n const icon = getIcon(\"expander\", propIcon);\n\n return (\n <Typography\n ref={ref}\n type={headingType}\n margin=\"none\"\n {...headingProps}\n className={expansionPanelHeading(headingProps)}\n >\n {beforeChildren}\n <ButtonUnstyled\n {...remaining}\n aria-expanded={expanded}\n id={id}\n className={expansionPanelButton({ className })}\n >\n {children}\n {icon && (\n <IconRotator\n {...iconRotatorProps}\n rotated={expanded}\n disableTransition={disableTransition}\n >\n {icon}\n </IconRotator>\n )}\n </ButtonUnstyled>\n {afterChildren}\n </Typography>\n );\n});\n"],"names":["forwardRef","ButtonUnstyled","IconRotator","getIcon","Typography","expansionPanelButton","expansionPanelHeading","ExpansionPanelHeader","props","ref","id","headingType","headingProps","iconRotatorProps","icon","propIcon","expanded","className","children","beforeChildren","afterChildren","disableTransition","remaining","type","margin","aria-expanded","rotated"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,UAAU,QAA8B,8BAA8B;AAE/E,SAASC,oBAAoB,EAAEC,qBAAqB,QAAQ,cAAc;AAsE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CC,GACD,OAAO,MAAMC,qCAAuBP,WAGlC,SAASO,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EACJC,EAAE,EACFC,cAAc,YAAY,EAC1BC,YAAY,EACZC,gBAAgB,EAChBC,MAAMC,QAAQ,EACdC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGd;IAEJ,MAAMM,OAAOX,QAAQ,YAAYY;IAEjC,qBACE,MAACX;QACCK,KAAKA;QACLc,MAAMZ;QACNa,QAAO;QACN,GAAGZ,YAAY;QAChBK,WAAWX,sBAAsBM;;YAEhCO;0BACD,MAAClB;gBACE,GAAGqB,SAAS;gBACbG,iBAAeT;gBACfN,IAAIA;gBACJO,WAAWZ,qBAAqB;oBAAEY;gBAAU;;oBAE3CC;oBACAJ,sBACC,KAACZ;wBACE,GAAGW,gBAAgB;wBACpBa,SAASV;wBACTK,mBAAmBA;kCAElBP;;;;YAINM;;;AAGP,GAAG"}
@@ -44,7 +44,7 @@ export type ExpansionListImplementation<E extends HTMLElement> = KeyboardMovemen
44
44
  * }
45
45
  * ```
46
46
  *
47
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
47
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
48
48
  * @since 6.0.0
49
49
  */
50
50
  export declare function useExpansionList<E extends HTMLElement>(options?: ExpansionListHookOptions<E>): ExpansionListImplementation<E>;
@@ -42,7 +42,7 @@ import { useKeyboardMovementProvider } from "../movement/useKeyboardMovementProv
42
42
  * }
43
43
  * ```
44
44
  *
45
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
45
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
46
46
  * @since 6.0.0
47
47
  */ export function useExpansionList(options = {}) {
48
48
  return useKeyboardMovementProvider({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expansion-panel/useExpansionList.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n} from \"react\";\n\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nconst getPanelsOnly = (container: HTMLElement): readonly HTMLElement[] => [\n ...container.querySelectorAll<HTMLElement>(\".rmd-expansion-panel__button\"),\n];\n\n/** @since 6.0.0 */\nexport interface ExpansionListHookOptions<E extends HTMLElement> {\n onClick?: MouseEventHandler<E>;\n onFocus?: FocusEventHandler<E>;\n onKeyDown?: KeyboardEventHandler<E>;\n}\n\n/** @since 6.0.0 */\nexport type ExpansionListImplementation<E extends HTMLElement> =\n KeyboardMovementProviderImplementation<E>;\n\n/**\n * @example Custom Implementation\n * ```tsx\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionList } from \"@react-md/core/expansion-panel/useExpansionList\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { KeyboardMovementProvider } from \"@react-md/core/movement/useKeyboardMovementProvider\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import { type ReactElement } from \"react\";\n *\n * import { BillingAddress } from \"./BillingAddress\";\n * import { BillingInformation } from \"./BillingInformation\";\n * import { PersonalInformation } from \"./PersonalInformation\";\n *\n * function Example(): ReactElement {\n * const { movementContext, movementProps } = useExpansionList();\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <KeyboardMovementProvider value={movementContext}>\n * <Form {...movementProps}>\n * <ExpansionPanel {...getPanelProps(\"personal-information-panel\")}>\n * <PersonalInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(\"billing-information-panel\")}>\n * <BillingInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(\"billing-address-panel\")}>\n * <BillingAddress />\n * </ExpansionPanel>\n * </Form>\n * </KeyboardMovementProvider>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0\n */\nexport function useExpansionList<E extends HTMLElement>(\n options: ExpansionListHookOptions<E> = {}\n): ExpansionListImplementation<E> {\n return useKeyboardMovementProvider({\n ...options,\n loopable: true,\n includeDisabled: true,\n getFocusableElements: getPanelsOnly,\n });\n}\n"],"names":["useKeyboardMovementProvider","getPanelsOnly","container","querySelectorAll","useExpansionList","options","loopable","includeDisabled","getFocusableElements"],"mappings":"AAAA;AASA,SAASA,2BAA2B,QAAQ,6CAA6C;AAEzF;;;CAGC,GACD,MAAMC,gBAAgB,CAACC,YAAmD;WACrEA,UAAUC,gBAAgB,CAAc;KAC5C;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,SAASC,iBACdC,UAAuC,CAAC,CAAC;IAEzC,OAAOL,4BAA4B;QACjC,GAAGK,OAAO;QACVC,UAAU;QACVC,iBAAiB;QACjBC,sBAAsBP;IACxB;AACF"}
1
+ {"version":3,"sources":["../../src/expansion-panel/useExpansionList.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n} from \"react\";\n\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nconst getPanelsOnly = (container: HTMLElement): readonly HTMLElement[] => [\n ...container.querySelectorAll<HTMLElement>(\".rmd-expansion-panel__button\"),\n];\n\n/** @since 6.0.0 */\nexport interface ExpansionListHookOptions<E extends HTMLElement> {\n onClick?: MouseEventHandler<E>;\n onFocus?: FocusEventHandler<E>;\n onKeyDown?: KeyboardEventHandler<E>;\n}\n\n/** @since 6.0.0 */\nexport type ExpansionListImplementation<E extends HTMLElement> =\n KeyboardMovementProviderImplementation<E>;\n\n/**\n * @example Custom Implementation\n * ```tsx\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionList } from \"@react-md/core/expansion-panel/useExpansionList\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { KeyboardMovementProvider } from \"@react-md/core/movement/useKeyboardMovementProvider\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import { type ReactElement } from \"react\";\n *\n * import { BillingAddress } from \"./BillingAddress\";\n * import { BillingInformation } from \"./BillingInformation\";\n * import { PersonalInformation } from \"./PersonalInformation\";\n *\n * function Example(): ReactElement {\n * const { movementContext, movementProps } = useExpansionList();\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <KeyboardMovementProvider value={movementContext}>\n * <Form {...movementProps}>\n * <ExpansionPanel {...getPanelProps(\"personal-information-panel\")}>\n * <PersonalInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(\"billing-information-panel\")}>\n * <BillingInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(\"billing-address-panel\")}>\n * <BillingAddress />\n * </ExpansionPanel>\n * </Form>\n * </KeyboardMovementProvider>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0\n */\nexport function useExpansionList<E extends HTMLElement>(\n options: ExpansionListHookOptions<E> = {}\n): ExpansionListImplementation<E> {\n return useKeyboardMovementProvider({\n ...options,\n loopable: true,\n includeDisabled: true,\n getFocusableElements: getPanelsOnly,\n });\n}\n"],"names":["useKeyboardMovementProvider","getPanelsOnly","container","querySelectorAll","useExpansionList","options","loopable","includeDisabled","getFocusableElements"],"mappings":"AAAA;AASA,SAASA,2BAA2B,QAAQ,6CAA6C;AAEzF;;;CAGC,GACD,MAAMC,gBAAgB,CAACC,YAAmD;WACrEA,UAAUC,gBAAgB,CAAc;KAC5C;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,SAASC,iBACdC,UAAuC,CAAC,CAAC;IAEzC,OAAOL,4BAA4B;QACjC,GAAGK,OAAO;QACVC,UAAU;QACVC,iBAAiB;QACjBC,sBAAsBP;IACxB;AACF"}
@@ -163,7 +163,7 @@ export interface ExpansionPanelImplementation {
163
163
  * ```
164
164
  *
165
165
  *
166
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
166
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
167
167
  * @since 6.0.0 The hook was renamed from `usePanels` to `useExpansionPanels`,
168
168
  * the API changed to return `getPanelProps` instead of a generated list of
169
169
  * panel props based on the provided `count`, and the hook no longer supports
@@ -68,7 +68,7 @@ import { useReadonlySet } from "../useReadonlySet.js";
68
68
  * ```
69
69
  *
70
70
  *
71
- * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}
71
+ * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}
72
72
  * @since 6.0.0 The hook was renamed from `usePanels` to `useExpansionPanels`,
73
73
  * the API changed to return `getPanelProps` instead of a generated list of
74
74
  * panel props based on the provided `count`, and the hook no longer supports
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expansion-panel/useExpansionPanels.ts"],"sourcesContent":["\"use client\";\n\nimport type { UseStateInitializer, UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useReadonlySet } from \"../useReadonlySet.js\";\nimport type { ExpansionPanelProps } from \"./ExpansionPanel.js\";\n\n/** @since 6.0.0 */\nexport interface ExpansionPanelHookOptions {\n /**\n * An optional id to prefix each panel with.\n *\n * @defaultValue `\"expansion-panel-\" + useId()`\n */\n baseId?: string;\n\n /**\n * Set this to `true` if multiple panels can be open at the same time.\n *\n * @defaultValue `false`\n */\n multiple?: boolean;\n\n /**\n * Set this to `true` to enforce that at least one panel must always be\n * expanded.\n *\n * @defaultValue `false`\n */\n preventAllCollapsed?: boolean;\n\n /**\n * This is a convenience option to disable the expansion transition for all\n * panels.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `preventAllCollapsed ? [\"expansion-panel-\" + useId() + \"-1\"] : []`\n */\n defaultExpandedIds?: UseStateInitializer<string[]>;\n\n /**\n * This can only be used if the {@link defaultExpandedIds} was not provided\n * and using index based panels.\n *\n * @example\n * ```tsx\n * const { getPanelProps } = useExpansionPanels({\n * defaultExpandedIndex: 2,\n * });\n *\n * return (\n * <ExpansionPanel {...getPanelProps(0)} />\n * <ExpansionPanel {...getPanelProps(1)} />\n * // expanded on first render\n * <ExpansionPanel {...getPanelProps(2)} />\n * <ExpansionPanel {...getPanelProps(3)} />\n * );\n * ```\n */\n defaultExpandedIndex?: number;\n\n /**\n * @defaultValue `false`\n */\n disableContentPadding?: boolean;\n}\n\n/** @since 6.0.0 */\nexport type ProvidedExpansionPanelProps = Pick<\n Required<ExpansionPanelProps>,\n | \"disabled\"\n | \"expanded\"\n | \"onExpandClick\"\n | \"disableTransition\"\n | \"disableContentPadding\"\n> & { id?: string };\n\n/**\n * @param indexOrPanelId - This should either be a DOM id to use for the panel\n * or the panel's index.\n * @returns Props to pass to an `ExpansionPanel` for it to work correctly.\n * @since 6.0.0\n */\nexport type GetExpansionPanelProps = (\n indexOrPanelId: string | number\n) => ProvidedExpansionPanelProps;\n\n/** @since 6.0.0 */\nexport interface ExpansionPanelImplementation {\n /**\n * The current set of expanded panel ids if you need this for some reason.\n */\n expandedIds: ReadonlySet<string>;\n\n /**\n * This can be used to manually control which panels are expanded if the\n * default behavior does not work for your use case.\n */\n setExpandedIds: UseStateSetter<ReadonlySet<string>>;\n\n /**\n * @example Index Based Panels\n * ```tsx\n * <ExpansionPanel {...getPanelProps(0)} />\n * <ExpansionPanel {...getPanelProps(1)} />\n * <ExpansionPanel {...getPanelProps(2)} />\n * ```\n *\n * @example Custom Panel Ids\n * ```tsx\n * <ExpansionPanel {...getPanelProps(\"address-panel\")} />\n * <ExpansionPanel {...getPanelProps(\"billing-panel\")} />\n * <ExpansionPanel {...getPanelProps(\"confirmation-panel\")} />\n * ```\n */\n getPanelProps: GetExpansionPanelProps;\n}\n\n/**\n * Use this hook to control the expanded state for a group of `ExpansionPanel`.\n *\n * @example Index Based Panels\n * ```tsx\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <ExpansionList>\n * <ExpansionPanel {...getPanelProps(0)} headerChildren=\"Panel 1\">\n * Panel 1 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(1)} headerChildren=\"Panel 2\">\n * Panel 2 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(2)} headerChildren=\"Panel 3\">\n * Panel 3 Contents\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n * @example Custom Panel Ids and Expand All Panels by Default\n * ```tsx\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * import { BillingAddress } from \"./BillingAddress\";\n * import { BillingInformation } from \"./BillingInformation\";\n * import { PersonalInformation } from \"./PersonalInformation\";\n *\n * const panel1Id = \"personal-information-panel\";\n * const panel2Id = \"billing-information-panel\";\n * const panel3Id = \"billing-address-panel\";\n *\n * function Example(): ReactElement {\n * const { getPanelProps } = useExpansionPanels({\n * multiple: true,\n * defaultExpandedIds: () => [panel1Id, panel2Id, panel3Id],\n * });\n *\n * return (\n * <ExpansionList>\n * <ExpansionPanel {...getPanelProps(panel1Id)} headerChildren=\"Personal Information\">\n * <PersonalInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(panel2Id)} headerChildren=\"Billing Information\">\n * <BillingInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(panel3Id)} headerChildren=\"Billing Address\">\n * <BillingAddress />\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n *\n * @see {@link https://next.react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0 The hook was renamed from `usePanels` to `useExpansionPanels`,\n * the API changed to return `getPanelProps` instead of a generated list of\n * panel props based on the provided `count`, and the hook no longer supports\n * having all panels expanded by default.\n */\nexport function useExpansionPanels(\n options: ExpansionPanelHookOptions = {}\n): ExpansionPanelImplementation {\n const {\n baseId: propBaseId,\n multiple = false,\n preventAllCollapsed = false,\n disableTransition = false,\n defaultExpandedIds,\n defaultExpandedIndex,\n disableContentPadding = false,\n } = options;\n\n const baseId = useEnsuredId(propBaseId, \"expansion-panel\");\n const createId = (index: number): string => `${baseId}-${index + 1}`;\n const {\n value: expandedIds,\n setValue: setExpandedIds,\n toggleValue,\n } = useReadonlySet({\n toggleType: multiple ? \"multiple\" : \"single\",\n defaultValue: () => {\n if (typeof defaultExpandedIds === \"undefined\") {\n const initialList: string[] = [];\n if (typeof defaultExpandedIndex === \"number\" || preventAllCollapsed) {\n initialList.push(createId(defaultExpandedIndex ?? 0));\n }\n\n return new Set(initialList);\n }\n\n return typeof defaultExpandedIds === \"function\"\n ? defaultExpandedIds()\n : defaultExpandedIds;\n },\n });\n\n return {\n expandedIds,\n setExpandedIds,\n getPanelProps(indexOrPanelId) {\n let id: string | undefined;\n let panelId: string;\n if (typeof indexOrPanelId === \"number\") {\n id = createId(indexOrPanelId);\n panelId = id;\n } else {\n panelId = indexOrPanelId;\n }\n\n const expanded = expandedIds.has(panelId);\n const disabled =\n expanded && preventAllCollapsed && expandedIds.size === 1;\n return {\n id,\n disabled,\n expanded,\n onExpandClick() {\n if (disabled) {\n return;\n }\n\n toggleValue(panelId);\n },\n disableTransition,\n disableContentPadding,\n };\n },\n };\n}\n"],"names":["useEnsuredId","useReadonlySet","useExpansionPanels","options","baseId","propBaseId","multiple","preventAllCollapsed","disableTransition","defaultExpandedIds","defaultExpandedIndex","disableContentPadding","createId","index","value","expandedIds","setValue","setExpandedIds","toggleValue","toggleType","defaultValue","initialList","push","Set","getPanelProps","indexOrPanelId","id","panelId","expanded","has","disabled","size","onExpandClick"],"mappings":"AAAA;AAGA,SAASA,YAAY,QAAQ,qBAAqB;AAClD,SAASC,cAAc,QAAQ,uBAAuB;AAsHtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEC,GACD,OAAO,SAASC,mBACdC,UAAqC,CAAC,CAAC;IAEvC,MAAM,EACJC,QAAQC,UAAU,EAClBC,WAAW,KAAK,EAChBC,sBAAsB,KAAK,EAC3BC,oBAAoB,KAAK,EACzBC,kBAAkB,EAClBC,oBAAoB,EACpBC,wBAAwB,KAAK,EAC9B,GAAGR;IAEJ,MAAMC,SAASJ,aAAaK,YAAY;IACxC,MAAMO,WAAW,CAACC,QAA0B,GAAGT,OAAO,CAAC,EAAES,QAAQ,GAAG;IACpE,MAAM,EACJC,OAAOC,WAAW,EAClBC,UAAUC,cAAc,EACxBC,WAAW,EACZ,GAAGjB,eAAe;QACjBkB,YAAYb,WAAW,aAAa;QACpCc,cAAc;YACZ,IAAI,OAAOX,uBAAuB,aAAa;gBAC7C,MAAMY,cAAwB,EAAE;gBAChC,IAAI,OAAOX,yBAAyB,YAAYH,qBAAqB;oBACnEc,YAAYC,IAAI,CAACV,SAASF,wBAAwB;gBACpD;gBAEA,OAAO,IAAIa,IAAIF;YACjB;YAEA,OAAO,OAAOZ,uBAAuB,aACjCA,uBACAA;QACN;IACF;IAEA,OAAO;QACLM;QACAE;QACAO,eAAcC,cAAc;YAC1B,IAAIC;YACJ,IAAIC;YACJ,IAAI,OAAOF,mBAAmB,UAAU;gBACtCC,KAAKd,SAASa;gBACdE,UAAUD;YACZ,OAAO;gBACLC,UAAUF;YACZ;YAEA,MAAMG,WAAWb,YAAYc,GAAG,CAACF;YACjC,MAAMG,WACJF,YAAYrB,uBAAuBQ,YAAYgB,IAAI,KAAK;YAC1D,OAAO;gBACLL;gBACAI;gBACAF;gBACAI;oBACE,IAAIF,UAAU;wBACZ;oBACF;oBAEAZ,YAAYS;gBACd;gBACAnB;gBACAG;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/expansion-panel/useExpansionPanels.ts"],"sourcesContent":["\"use client\";\n\nimport type { UseStateInitializer, UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useReadonlySet } from \"../useReadonlySet.js\";\nimport type { ExpansionPanelProps } from \"./ExpansionPanel.js\";\n\n/** @since 6.0.0 */\nexport interface ExpansionPanelHookOptions {\n /**\n * An optional id to prefix each panel with.\n *\n * @defaultValue `\"expansion-panel-\" + useId()`\n */\n baseId?: string;\n\n /**\n * Set this to `true` if multiple panels can be open at the same time.\n *\n * @defaultValue `false`\n */\n multiple?: boolean;\n\n /**\n * Set this to `true` to enforce that at least one panel must always be\n * expanded.\n *\n * @defaultValue `false`\n */\n preventAllCollapsed?: boolean;\n\n /**\n * This is a convenience option to disable the expansion transition for all\n * panels.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `preventAllCollapsed ? [\"expansion-panel-\" + useId() + \"-1\"] : []`\n */\n defaultExpandedIds?: UseStateInitializer<string[]>;\n\n /**\n * This can only be used if the {@link defaultExpandedIds} was not provided\n * and using index based panels.\n *\n * @example\n * ```tsx\n * const { getPanelProps } = useExpansionPanels({\n * defaultExpandedIndex: 2,\n * });\n *\n * return (\n * <ExpansionPanel {...getPanelProps(0)} />\n * <ExpansionPanel {...getPanelProps(1)} />\n * // expanded on first render\n * <ExpansionPanel {...getPanelProps(2)} />\n * <ExpansionPanel {...getPanelProps(3)} />\n * );\n * ```\n */\n defaultExpandedIndex?: number;\n\n /**\n * @defaultValue `false`\n */\n disableContentPadding?: boolean;\n}\n\n/** @since 6.0.0 */\nexport type ProvidedExpansionPanelProps = Pick<\n Required<ExpansionPanelProps>,\n | \"disabled\"\n | \"expanded\"\n | \"onExpandClick\"\n | \"disableTransition\"\n | \"disableContentPadding\"\n> & { id?: string };\n\n/**\n * @param indexOrPanelId - This should either be a DOM id to use for the panel\n * or the panel's index.\n * @returns Props to pass to an `ExpansionPanel` for it to work correctly.\n * @since 6.0.0\n */\nexport type GetExpansionPanelProps = (\n indexOrPanelId: string | number\n) => ProvidedExpansionPanelProps;\n\n/** @since 6.0.0 */\nexport interface ExpansionPanelImplementation {\n /**\n * The current set of expanded panel ids if you need this for some reason.\n */\n expandedIds: ReadonlySet<string>;\n\n /**\n * This can be used to manually control which panels are expanded if the\n * default behavior does not work for your use case.\n */\n setExpandedIds: UseStateSetter<ReadonlySet<string>>;\n\n /**\n * @example Index Based Panels\n * ```tsx\n * <ExpansionPanel {...getPanelProps(0)} />\n * <ExpansionPanel {...getPanelProps(1)} />\n * <ExpansionPanel {...getPanelProps(2)} />\n * ```\n *\n * @example Custom Panel Ids\n * ```tsx\n * <ExpansionPanel {...getPanelProps(\"address-panel\")} />\n * <ExpansionPanel {...getPanelProps(\"billing-panel\")} />\n * <ExpansionPanel {...getPanelProps(\"confirmation-panel\")} />\n * ```\n */\n getPanelProps: GetExpansionPanelProps;\n}\n\n/**\n * Use this hook to control the expanded state for a group of `ExpansionPanel`.\n *\n * @example Index Based Panels\n * ```tsx\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { getPanelProps } = useExpansionPanels();\n *\n * return (\n * <ExpansionList>\n * <ExpansionPanel {...getPanelProps(0)} headerChildren=\"Panel 1\">\n * Panel 1 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(1)} headerChildren=\"Panel 2\">\n * Panel 2 Contents\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(2)} headerChildren=\"Panel 3\">\n * Panel 3 Contents\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n * @example Custom Panel Ids and Expand All Panels by Default\n * ```tsx\n * import { ExpansionList } from \"@react-md/core/expansion-panel/ExpansionList\";\n * import { ExpansionPanel } from \"@react-md/core/expansion-panel/ExpansionPanel\";\n * import { useExpansionPanels } from \"@react-md/core/expansion-panel/useExpansionPanels\";\n * import { type ReactElement } from \"react\";\n *\n * import { BillingAddress } from \"./BillingAddress\";\n * import { BillingInformation } from \"./BillingInformation\";\n * import { PersonalInformation } from \"./PersonalInformation\";\n *\n * const panel1Id = \"personal-information-panel\";\n * const panel2Id = \"billing-information-panel\";\n * const panel3Id = \"billing-address-panel\";\n *\n * function Example(): ReactElement {\n * const { getPanelProps } = useExpansionPanels({\n * multiple: true,\n * defaultExpandedIds: () => [panel1Id, panel2Id, panel3Id],\n * });\n *\n * return (\n * <ExpansionList>\n * <ExpansionPanel {...getPanelProps(panel1Id)} headerChildren=\"Personal Information\">\n * <PersonalInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(panel2Id)} headerChildren=\"Billing Information\">\n * <BillingInformation />\n * </ExpansionPanel>\n * <ExpansionPanel {...getPanelProps(panel3Id)} headerChildren=\"Billing Address\">\n * <BillingAddress />\n * </ExpansionPanel>\n * </ExpansionList>\n * );\n * }\n * ```\n *\n *\n * @see {@link https://react-md.dev/components/expansion-panel | ExpansionPanel Demos}\n * @since 6.0.0 The hook was renamed from `usePanels` to `useExpansionPanels`,\n * the API changed to return `getPanelProps` instead of a generated list of\n * panel props based on the provided `count`, and the hook no longer supports\n * having all panels expanded by default.\n */\nexport function useExpansionPanels(\n options: ExpansionPanelHookOptions = {}\n): ExpansionPanelImplementation {\n const {\n baseId: propBaseId,\n multiple = false,\n preventAllCollapsed = false,\n disableTransition = false,\n defaultExpandedIds,\n defaultExpandedIndex,\n disableContentPadding = false,\n } = options;\n\n const baseId = useEnsuredId(propBaseId, \"expansion-panel\");\n const createId = (index: number): string => `${baseId}-${index + 1}`;\n const {\n value: expandedIds,\n setValue: setExpandedIds,\n toggleValue,\n } = useReadonlySet({\n toggleType: multiple ? \"multiple\" : \"single\",\n defaultValue: () => {\n if (typeof defaultExpandedIds === \"undefined\") {\n const initialList: string[] = [];\n if (typeof defaultExpandedIndex === \"number\" || preventAllCollapsed) {\n initialList.push(createId(defaultExpandedIndex ?? 0));\n }\n\n return new Set(initialList);\n }\n\n return typeof defaultExpandedIds === \"function\"\n ? defaultExpandedIds()\n : defaultExpandedIds;\n },\n });\n\n return {\n expandedIds,\n setExpandedIds,\n getPanelProps(indexOrPanelId) {\n let id: string | undefined;\n let panelId: string;\n if (typeof indexOrPanelId === \"number\") {\n id = createId(indexOrPanelId);\n panelId = id;\n } else {\n panelId = indexOrPanelId;\n }\n\n const expanded = expandedIds.has(panelId);\n const disabled =\n expanded && preventAllCollapsed && expandedIds.size === 1;\n return {\n id,\n disabled,\n expanded,\n onExpandClick() {\n if (disabled) {\n return;\n }\n\n toggleValue(panelId);\n },\n disableTransition,\n disableContentPadding,\n };\n },\n };\n}\n"],"names":["useEnsuredId","useReadonlySet","useExpansionPanels","options","baseId","propBaseId","multiple","preventAllCollapsed","disableTransition","defaultExpandedIds","defaultExpandedIndex","disableContentPadding","createId","index","value","expandedIds","setValue","setExpandedIds","toggleValue","toggleType","defaultValue","initialList","push","Set","getPanelProps","indexOrPanelId","id","panelId","expanded","has","disabled","size","onExpandClick"],"mappings":"AAAA;AAGA,SAASA,YAAY,QAAQ,qBAAqB;AAClD,SAASC,cAAc,QAAQ,uBAAuB;AAsHtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEC,GACD,OAAO,SAASC,mBACdC,UAAqC,CAAC,CAAC;IAEvC,MAAM,EACJC,QAAQC,UAAU,EAClBC,WAAW,KAAK,EAChBC,sBAAsB,KAAK,EAC3BC,oBAAoB,KAAK,EACzBC,kBAAkB,EAClBC,oBAAoB,EACpBC,wBAAwB,KAAK,EAC9B,GAAGR;IAEJ,MAAMC,SAASJ,aAAaK,YAAY;IACxC,MAAMO,WAAW,CAACC,QAA0B,GAAGT,OAAO,CAAC,EAAES,QAAQ,GAAG;IACpE,MAAM,EACJC,OAAOC,WAAW,EAClBC,UAAUC,cAAc,EACxBC,WAAW,EACZ,GAAGjB,eAAe;QACjBkB,YAAYb,WAAW,aAAa;QACpCc,cAAc;YACZ,IAAI,OAAOX,uBAAuB,aAAa;gBAC7C,MAAMY,cAAwB,EAAE;gBAChC,IAAI,OAAOX,yBAAyB,YAAYH,qBAAqB;oBACnEc,YAAYC,IAAI,CAACV,SAASF,wBAAwB;gBACpD;gBAEA,OAAO,IAAIa,IAAIF;YACjB;YAEA,OAAO,OAAOZ,uBAAuB,aACjCA,uBACAA;QACN;IACF;IAEA,OAAO;QACLM;QACAE;QACAO,eAAcC,cAAc;YAC1B,IAAIC;YACJ,IAAIC;YACJ,IAAI,OAAOF,mBAAmB,UAAU;gBACtCC,KAAKd,SAASa;gBACdE,UAAUD;YACZ,OAAO;gBACLC,UAAUF;YACZ;YAEA,MAAMG,WAAWb,YAAYc,GAAG,CAACF;YACjC,MAAMG,WACJF,YAAYrB,uBAAuBQ,YAAYgB,IAAI,KAAK;YAC1D,OAAO;gBACLL;gBACAI;gBACAF;gBACAI;oBACE,IAAIF,UAAU;wBACZ;oBACF;oBAEAZ,YAAYS;gBACd;gBACAnB;gBACAG;YACF;QACF;IACF;AACF"}
@@ -95,7 +95,7 @@ export interface FileInputProps extends ButtonClassNameThemeOptions, FileInputHT
95
95
  * }
96
96
  * ```
97
97
  *
98
- * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}
98
+ * @see {@link https://react-md.dev/components/file-input | FileInput Demos}
99
99
  * @since 6.0.0 Added additional support for `iconSize` and
100
100
  * `responsive`. Also removed the `disableIconSpacing` prop since it is no
101
101
  * longer required.
@@ -52,7 +52,7 @@ import { fileInput } from "./styles.js";
52
52
  * }
53
53
  * ```
54
54
  *
55
- * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}
55
+ * @see {@link https://react-md.dev/components/file-input | FileInput Demos}
56
56
  * @since 6.0.0 Added additional support for `iconSize` and
57
57
  * `responsive`. Also removed the `disableIconSpacing` prop since it is no
58
58
  * longer required.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/files/FileInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type ButtonClassNameThemeOptions } from \"../button/styles.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { SrOnly } from \"../typography/SrOnly.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { fileInput } from \"./styles.js\";\n\n/** @since 6.0.0 */\nexport type FileInputHTMLAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `disableIconSpacing` prop since it is no\n * longer required.\n */\nexport interface FileInputProps\n extends ButtonClassNameThemeOptions,\n FileInputHTMLAttributes,\n ComponentWithRippleProps {\n /**\n * This is the label text for icon-only file inputs.\n *\n * @defaultValue `\"Upload\"`\n */\n srOnlyLabel?: ReactNode;\n\n /**\n * Any additional props to provide to the container `<label>` element since\n * most props get passed to the `<input type=\"file\">`. So this would be useful\n * for inline style or click handlers.\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * An optional icon to display for the file input.\n *\n * @defaultValue `getIcon(\"upload\")`\n */\n icon?: ReactNode;\n\n /**\n * Boolean if the icon should appear after the children in the label.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Boolean if the file input should no longer allow the same file to be\n * selected multiple times and trigger the `onChange` each time it is\n * selected.\n *\n * @defaultValue `false`\n */\n disableRepeatableFiles?: boolean;\n\n /**\n * Children should generally be provided when the {@link buttonType} is\n * set to `\"text\"`. This defaults to a screen-reader only accessible text.\n *\n * @defaultValue `<SrOnly phoneOnly={responsive}>Upload</SrOnly>`\n */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n * This might be able to become a server component if I remove the getIcon hook\n *\n * @example Simple Example\n * ```tsx\n * import { FileInput } from \"@react-md/core/files/FileInput\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import type { ReactElement } from \"react\";\n *\n * const extensions = [\n * \"svg\",\n * \"jpeg\",\n * \"jpg\",\n * \"png\",\n * \"apng\",\n * \"mkv\",\n * \"mp4\",\n * \"mpeg\",\n * \"mpg\",\n * \"webm\",\n * \"mov\",\n * ] as const;\n *\n * const FOUR_HUNDRED_MB = 400 * 1024 * 1024;\n * const maxFiles = 10;\n *\n * function Example(): ReactElement {\n * const { stats, errors, onChange, clearErrors, reset, remove, accept } =\n * useFileUpload({\n * maxFiles,\n * maxFileSize: FOUR_HUNDRED_MB,\n * extensions,\n * });\n *\n * return (\n * <Form>\n * <FileInput accept={accept} multiple={maxFiles > 1} onChange={onChange} />\n * <Button onClick={reset} disabled={!stats.length}>\n * Remove all files\n * </Button>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}\n * @since 6.0.0 Added additional support for `iconSize` and\n * `responsive`. Also removed the `disableIconSpacing` prop since it is no\n * longer required.\n */\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(\n function FileInput(props, ref) {\n const {\n id: propId,\n className,\n children: propChildren,\n icon: propIcon,\n iconAfter = false,\n srOnlyLabel = \"Upload\",\n disableRepeatableFiles = false,\n labelProps,\n theme = \"primary\",\n themeType = \"contained\",\n buttonType = propChildren ? \"text\" : \"icon\",\n disabled = false,\n iconSize,\n responsive,\n multiple = false,\n disableRipple,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"file-input\");\n const { pressed, pressedClassName, ripples, handlers } =\n useElementInteraction({\n ...labelProps,\n mode: disableRipple ? \"none\" : undefined,\n onClick(event) {\n labelProps?.onClick?.(event);\n\n // stop propagation so 2 ripples are not created\n event.stopPropagation();\n },\n disabled,\n });\n\n const icon = getIcon(\"upload\", propIcon);\n let children = propChildren;\n if (\n typeof propChildren === \"undefined\" &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"]\n ) {\n children = <SrOnly phoneOnly={responsive}>{srOnlyLabel}</SrOnly>;\n }\n\n return (\n <label\n {...labelProps}\n {...handlers}\n className={fileInput({\n theme,\n themeType,\n buttonType,\n disabled,\n iconSize,\n pressed,\n responsive,\n pressedClassName,\n className: className || labelProps?.className,\n })}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n <input\n {...remaining}\n id={id}\n ref={ref}\n value={\n disableRepeatableFiles || !props.onChange ? remaining.value : \"\"\n }\n type=\"file\"\n className=\"rmd-hidden-input\"\n disabled={disabled}\n multiple={multiple}\n />\n {ripples}\n </label>\n );\n }\n);\n"],"names":["forwardRef","getIcon","useElementInteraction","SrOnly","useEnsuredId","fileInput","FileInput","props","ref","id","propId","className","children","propChildren","icon","propIcon","iconAfter","srOnlyLabel","disableRepeatableFiles","labelProps","theme","themeType","buttonType","disabled","iconSize","responsive","multiple","disableRipple","remaining","pressed","pressedClassName","ripples","handlers","mode","undefined","onClick","event","stopPropagation","phoneOnly","label","input","value","onChange","type"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAiExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,UAAUC,YAAY,EACtBC,MAAMC,QAAQ,EACdC,YAAY,KAAK,EACjBC,cAAc,QAAQ,EACtBC,yBAAyB,KAAK,EAC9BC,UAAU,EACVC,QAAQ,SAAS,EACjBC,YAAY,WAAW,EACvBC,aAAaT,eAAe,SAAS,MAAM,EAC3CU,WAAW,KAAK,EAChBC,QAAQ,EACRC,UAAU,EACVC,WAAW,KAAK,EAChBC,aAAa,EACb,GAAGC,WACJ,GAAGrB;IACJ,MAAME,KAAKL,aAAaM,QAAQ;IAChC,MAAM,EAAEmB,OAAO,EAAEC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GACpD9B,sBAAsB;QACpB,GAAGiB,UAAU;QACbc,MAAMN,gBAAgB,SAASO;QAC/BC,SAAQC,KAAK;YACXjB,YAAYgB,UAAUC;YAEtB,gDAAgD;YAChDA,MAAMC,eAAe;QACvB;QACAd;IACF;IAEF,MAAMT,OAAOb,QAAQ,UAAUc;IAC/B,IAAIH,WAAWC;IACf,IACE,OAAOA,iBAAiB,eACxB,CAACN,KAAK,CAAC,aAAa,IACpB,CAACA,KAAK,CAAC,kBAAkB,EACzB;QACAK,yBAAW,KAACT;YAAOmC,WAAWb;sBAAaR;;IAC7C;IAEA,qBACE,MAACsB;QACE,GAAGpB,UAAU;QACb,GAAGa,QAAQ;QACZrB,WAAWN,UAAU;YACnBe;YACAC;YACAC;YACAC;YACAC;YACAK;YACAJ;YACAK;YACAnB,WAAWA,aAAaQ,YAAYR;QACtC;;YAEC,CAACK,aAAaF;YACdF;YACAI,aAAaF;0BACd,KAAC0B;gBACE,GAAGZ,SAAS;gBACbnB,IAAIA;gBACJD,KAAKA;gBACLiC,OACEvB,0BAA0B,CAACX,MAAMmC,QAAQ,GAAGd,UAAUa,KAAK,GAAG;gBAEhEE,MAAK;gBACLhC,WAAU;gBACVY,UAAUA;gBACVG,UAAUA;;YAEXK;;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/files/FileInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type ButtonClassNameThemeOptions } from \"../button/styles.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { SrOnly } from \"../typography/SrOnly.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { fileInput } from \"./styles.js\";\n\n/** @since 6.0.0 */\nexport type FileInputHTMLAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `disableIconSpacing` prop since it is no\n * longer required.\n */\nexport interface FileInputProps\n extends ButtonClassNameThemeOptions,\n FileInputHTMLAttributes,\n ComponentWithRippleProps {\n /**\n * This is the label text for icon-only file inputs.\n *\n * @defaultValue `\"Upload\"`\n */\n srOnlyLabel?: ReactNode;\n\n /**\n * Any additional props to provide to the container `<label>` element since\n * most props get passed to the `<input type=\"file\">`. So this would be useful\n * for inline style or click handlers.\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * An optional icon to display for the file input.\n *\n * @defaultValue `getIcon(\"upload\")`\n */\n icon?: ReactNode;\n\n /**\n * Boolean if the icon should appear after the children in the label.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Boolean if the file input should no longer allow the same file to be\n * selected multiple times and trigger the `onChange` each time it is\n * selected.\n *\n * @defaultValue `false`\n */\n disableRepeatableFiles?: boolean;\n\n /**\n * Children should generally be provided when the {@link buttonType} is\n * set to `\"text\"`. This defaults to a screen-reader only accessible text.\n *\n * @defaultValue `<SrOnly phoneOnly={responsive}>Upload</SrOnly>`\n */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n * This might be able to become a server component if I remove the getIcon hook\n *\n * @example Simple Example\n * ```tsx\n * import { FileInput } from \"@react-md/core/files/FileInput\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import type { ReactElement } from \"react\";\n *\n * const extensions = [\n * \"svg\",\n * \"jpeg\",\n * \"jpg\",\n * \"png\",\n * \"apng\",\n * \"mkv\",\n * \"mp4\",\n * \"mpeg\",\n * \"mpg\",\n * \"webm\",\n * \"mov\",\n * ] as const;\n *\n * const FOUR_HUNDRED_MB = 400 * 1024 * 1024;\n * const maxFiles = 10;\n *\n * function Example(): ReactElement {\n * const { stats, errors, onChange, clearErrors, reset, remove, accept } =\n * useFileUpload({\n * maxFiles,\n * maxFileSize: FOUR_HUNDRED_MB,\n * extensions,\n * });\n *\n * return (\n * <Form>\n * <FileInput accept={accept} multiple={maxFiles > 1} onChange={onChange} />\n * <Button onClick={reset} disabled={!stats.length}>\n * Remove all files\n * </Button>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/file-input | FileInput Demos}\n * @since 6.0.0 Added additional support for `iconSize` and\n * `responsive`. Also removed the `disableIconSpacing` prop since it is no\n * longer required.\n */\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(\n function FileInput(props, ref) {\n const {\n id: propId,\n className,\n children: propChildren,\n icon: propIcon,\n iconAfter = false,\n srOnlyLabel = \"Upload\",\n disableRepeatableFiles = false,\n labelProps,\n theme = \"primary\",\n themeType = \"contained\",\n buttonType = propChildren ? \"text\" : \"icon\",\n disabled = false,\n iconSize,\n responsive,\n multiple = false,\n disableRipple,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"file-input\");\n const { pressed, pressedClassName, ripples, handlers } =\n useElementInteraction({\n ...labelProps,\n mode: disableRipple ? \"none\" : undefined,\n onClick(event) {\n labelProps?.onClick?.(event);\n\n // stop propagation so 2 ripples are not created\n event.stopPropagation();\n },\n disabled,\n });\n\n const icon = getIcon(\"upload\", propIcon);\n let children = propChildren;\n if (\n typeof propChildren === \"undefined\" &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"]\n ) {\n children = <SrOnly phoneOnly={responsive}>{srOnlyLabel}</SrOnly>;\n }\n\n return (\n <label\n {...labelProps}\n {...handlers}\n className={fileInput({\n theme,\n themeType,\n buttonType,\n disabled,\n iconSize,\n pressed,\n responsive,\n pressedClassName,\n className: className || labelProps?.className,\n })}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n <input\n {...remaining}\n id={id}\n ref={ref}\n value={\n disableRepeatableFiles || !props.onChange ? remaining.value : \"\"\n }\n type=\"file\"\n className=\"rmd-hidden-input\"\n disabled={disabled}\n multiple={multiple}\n />\n {ripples}\n </label>\n );\n }\n);\n"],"names":["forwardRef","getIcon","useElementInteraction","SrOnly","useEnsuredId","fileInput","FileInput","props","ref","id","propId","className","children","propChildren","icon","propIcon","iconAfter","srOnlyLabel","disableRepeatableFiles","labelProps","theme","themeType","buttonType","disabled","iconSize","responsive","multiple","disableRipple","remaining","pressed","pressedClassName","ripples","handlers","mode","undefined","onClick","event","stopPropagation","phoneOnly","label","input","value","onChange","type"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAiExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,UAAUC,YAAY,EACtBC,MAAMC,QAAQ,EACdC,YAAY,KAAK,EACjBC,cAAc,QAAQ,EACtBC,yBAAyB,KAAK,EAC9BC,UAAU,EACVC,QAAQ,SAAS,EACjBC,YAAY,WAAW,EACvBC,aAAaT,eAAe,SAAS,MAAM,EAC3CU,WAAW,KAAK,EAChBC,QAAQ,EACRC,UAAU,EACVC,WAAW,KAAK,EAChBC,aAAa,EACb,GAAGC,WACJ,GAAGrB;IACJ,MAAME,KAAKL,aAAaM,QAAQ;IAChC,MAAM,EAAEmB,OAAO,EAAEC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GACpD9B,sBAAsB;QACpB,GAAGiB,UAAU;QACbc,MAAMN,gBAAgB,SAASO;QAC/BC,SAAQC,KAAK;YACXjB,YAAYgB,UAAUC;YAEtB,gDAAgD;YAChDA,MAAMC,eAAe;QACvB;QACAd;IACF;IAEF,MAAMT,OAAOb,QAAQ,UAAUc;IAC/B,IAAIH,WAAWC;IACf,IACE,OAAOA,iBAAiB,eACxB,CAACN,KAAK,CAAC,aAAa,IACpB,CAACA,KAAK,CAAC,kBAAkB,EACzB;QACAK,yBAAW,KAACT;YAAOmC,WAAWb;sBAAaR;;IAC7C;IAEA,qBACE,MAACsB;QACE,GAAGpB,UAAU;QACb,GAAGa,QAAQ;QACZrB,WAAWN,UAAU;YACnBe;YACAC;YACAC;YACAC;YACAC;YACAK;YACAJ;YACAK;YACAnB,WAAWA,aAAaQ,YAAYR;QACtC;;YAEC,CAACK,aAAaF;YACdF;YACAI,aAAaF;0BACd,KAAC0B;gBACE,GAAGZ,SAAS;gBACbnB,IAAIA;gBACJD,KAAKA;gBACLiC,OACEvB,0BAA0B,CAACX,MAAMmC,QAAQ,GAAGd,UAAUa,KAAK,GAAG;gBAEhEE,MAAK;gBACLhC,WAAU;gBACVY,UAAUA;gBACVG,UAAUA;;YAEXK;;;AAGP,GACA"}
@@ -135,8 +135,8 @@ export interface FileUploadHookReturnValue<E extends HTMLElement = HTMLElement,
135
135
  * can also be used to upload the files as an `ArrayBuffer` and then uploaded to
136
136
  * a server.
137
137
  *
138
- * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}
139
- * @see {@link https://next.react-md.dev/hooks/use-file-input | useFileInput Demos}
138
+ * @see {@link https://react-md.dev/components/file-input | FileInput Demos}
139
+ * @see {@link https://react-md.dev/hooks/use-file-input | useFileInput Demos}
140
140
  * @typeParam E - An optional HTMLElement type that is used for the
141
141
  * {@link FileUploadHandlers}.
142
142
  * @typeParam CustomError - An optional error type that gets returned from the
@@ -14,8 +14,8 @@ const noop = ()=>{
14
14
  * can also be used to upload the files as an `ArrayBuffer` and then uploaded to
15
15
  * a server.
16
16
  *
17
- * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}
18
- * @see {@link https://next.react-md.dev/hooks/use-file-input | useFileInput Demos}
17
+ * @see {@link https://react-md.dev/components/file-input | FileInput Demos}
18
+ * @see {@link https://react-md.dev/hooks/use-file-input | useFileInput Demos}
19
19
  * @typeParam E - An optional HTMLElement type that is used for the
20
20
  * {@link FileUploadHandlers}.
21
21
  * @typeParam CustomError - An optional error type that gets returned from the
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/files/useFileUpload.ts"],"sourcesContent":["\"use client\";\n\nimport { nanoid } from \"nanoid\";\nimport {\n type ChangeEvent,\n type DragEvent,\n useCallback,\n useEffect,\n useReducer,\n} from \"react\";\n\nimport {\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type GetFileParser,\n type ProcessingFileUploadStats,\n getFileParser as defaultGetFileParser,\n} from \"./utils.js\";\nimport {\n FileAccessError,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset: () => void;\n\n /**\n * Removes all the errors that exist in state without canceling any of the\n * uploads already in progress.\n */\n clearErrors: () => void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove: (keyOrKeys: string | readonly string[]) => void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}\n * @see {@link https://next.react-md.dev/hooks/use-file-input | useFileInput Demos}\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>(\n options: FileUploadOptions<E, CustomError> = {}\n): Readonly<FileUploadHookReturnValue<E, CustomError>> {\n const {\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n } = options;\n\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\"readAsText\", \"readAsDataURL\", \"readAsArrayBuffer\"].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","getFileParser","defaultGetFileParser","FileAccessError","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","options","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"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"}
1
+ {"version":3,"sources":["../../src/files/useFileUpload.ts"],"sourcesContent":["\"use client\";\n\nimport { nanoid } from \"nanoid\";\nimport {\n type ChangeEvent,\n type DragEvent,\n useCallback,\n useEffect,\n useReducer,\n} from \"react\";\n\nimport {\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type GetFileParser,\n type ProcessingFileUploadStats,\n getFileParser as defaultGetFileParser,\n} from \"./utils.js\";\nimport {\n FileAccessError,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset: () => void;\n\n /**\n * Removes all the errors that exist in state without canceling any of the\n * uploads already in progress.\n */\n clearErrors: () => void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove: (keyOrKeys: string | readonly string[]) => void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * @see {@link https://react-md.dev/components/file-input | FileInput Demos}\n * @see {@link https://react-md.dev/hooks/use-file-input | useFileInput Demos}\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>(\n options: FileUploadOptions<E, CustomError> = {}\n): Readonly<FileUploadHookReturnValue<E, CustomError>> {\n const {\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n } = options;\n\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\"readAsText\", \"readAsDataURL\", \"readAsArrayBuffer\"].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","getFileParser","defaultGetFileParser","FileAccessError","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","options","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"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"}
@@ -15,6 +15,6 @@ import { type CheckboxProps } from "./InputToggle.js";
15
15
  * }
16
16
  * ```
17
17
  *
18
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
18
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
19
19
  */
20
20
  export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -17,7 +17,7 @@ import { InputToggle } from "./InputToggle.js";
17
17
  * }
18
18
  * ```
19
19
  *
20
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
20
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
21
21
  */ export const Checkbox = /*#__PURE__*/ forwardRef(function Checkbox(props, ref) {
22
22
  return /*#__PURE__*/ _jsx(InputToggle, {
23
23
  ...props,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Checkbox.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { type CheckboxProps, InputToggle } from \"./InputToggle.js\";\n\n/**\n * **Client Component**\n *\n * You'll generally want to use the `useCheckboxGroup` hook for managing the\n * checked state for groups of checkboxes and indeterminate checkbox behavior.\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { Checkbox } from \"@react-md/core/form/Checkbox\";\n *\n * function Example(): ReactElement {\n * return <Checkbox label=\"Checkbox\" value=\"a\" />;\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(props, ref) {\n return <InputToggle {...props} ref={ref} type=\"checkbox\" />;\n }\n);\n"],"names":["forwardRef","InputToggle","Checkbox","props","ref","type"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAA6BC,WAAW,QAAQ,mBAAmB;AAEnE;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,qBAAO,KAACH;QAAa,GAAGE,KAAK;QAAEC,KAAKA;QAAKC,MAAK;;AAChD,GACA"}
1
+ {"version":3,"sources":["../../src/form/Checkbox.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { type CheckboxProps, InputToggle } from \"./InputToggle.js\";\n\n/**\n * **Client Component**\n *\n * You'll generally want to use the `useCheckboxGroup` hook for managing the\n * checked state for groups of checkboxes and indeterminate checkbox behavior.\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { Checkbox } from \"@react-md/core/form/Checkbox\";\n *\n * function Example(): ReactElement {\n * return <Checkbox label=\"Checkbox\" value=\"a\" />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(props, ref) {\n return <InputToggle {...props} ref={ref} type=\"checkbox\" />;\n }\n);\n"],"names":["forwardRef","InputToggle","Checkbox","props","ref","type"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAA6BC,WAAW,QAAQ,mBAAmB;AAEnE;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,qBAAO,KAACH;QAAa,GAAGE,KAAK;QAAEC,KAAKA;QAAKC,MAAK;;AAChD,GACA"}
@@ -26,6 +26,6 @@ export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElemen
26
26
  * }
27
27
  * ```
28
28
  *
29
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
29
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
30
30
  */
31
31
  export declare const Fieldset: import("react").ForwardRefExoticComponent<FieldsetProps & import("react").RefAttributes<HTMLFieldSetElement>>;
@@ -20,7 +20,7 @@ import { fieldset } from "./fieldsetStyles.js";
20
20
  * }
21
21
  * ```
22
22
  *
23
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
23
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
24
24
  */ export const Fieldset = /*#__PURE__*/ forwardRef(function Fieldset(props, ref) {
25
25
  const { className, fullWidth = false, browserStyles = false, children, ...remaining } = props;
26
26
  return /*#__PURE__*/ _jsx("fieldset", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { type FieldsetHTMLAttributes, forwardRef } from \"react\";\n\nimport { type FieldsetClassNameOptions, fieldset } from \"./fieldsetStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Fieldset } from \"@react-md/core/form/Fieldset\";\n * import { Legend } from \"@react-md/core/form/Legend\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["forwardRef","fieldset","Fieldset","props","ref","className","fullWidth","browserStyles","children","remaining"],"mappings":";AAAA,SAAsCA,UAAU,QAAQ,QAAQ;AAEhE,SAAwCC,QAAQ,QAAQ,sBAAsB;AAW9E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBC,QAAQ,EACR,GAAGC,WACJ,GAAGN;IAEJ,qBACE,KAACF;QACE,GAAGQ,SAAS;QACbL,KAAKA;QACLC,WAAWJ,SAAS;YAClBI;YACAC;YACAC;QACF;kBAECC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { type FieldsetHTMLAttributes, forwardRef } from \"react\";\n\nimport { type FieldsetClassNameOptions, fieldset } from \"./fieldsetStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Fieldset } from \"@react-md/core/form/Fieldset\";\n * import { Legend } from \"@react-md/core/form/Legend\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["forwardRef","fieldset","Fieldset","props","ref","className","fullWidth","browserStyles","children","remaining"],"mappings":";AAAA,SAAsCA,UAAU,QAAQ,QAAQ;AAEhE,SAAwCC,QAAQ,QAAQ,sBAAsB;AAW9E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBC,QAAQ,EACR,GAAGC,WACJ,GAAGN;IAEJ,qBACE,KAACF;QACE,GAAGQ,SAAS;QACbL,KAAKA;QACLC,WAAWJ,SAAS;YAClBI;YACAC;YACAC;QACF;kBAECC;;AAGP,GACA"}
@@ -16,6 +16,6 @@ export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
16
16
  * do much styling or logic. All this form component will do is add basic flex
17
17
  * behavior and prevent the default form submit behavior.
18
18
  *
19
- * @see {@link https://next.react-md.dev/components/form | Form Demos}
19
+ * @see {@link https://react-md.dev/components/form | Form Demos}
20
20
  */
21
21
  export declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
package/dist/form/Form.js CHANGED
@@ -11,7 +11,7 @@ const noop = ()=>{
11
11
  * do much styling or logic. All this form component will do is add basic flex
12
12
  * behavior and prevent the default form submit behavior.
13
13
  *
14
- * @see {@link https://next.react-md.dev/components/form | Form Demos}
14
+ * @see {@link https://react-md.dev/components/form | Form Demos}
15
15
  */ export const Form = /*#__PURE__*/ forwardRef(function Form(props, ref) {
16
16
  const { children, onSubmit = noop, disablePreventDefault = false, ...remaining } = props;
17
17
  return /*#__PURE__*/ _jsx("form", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FormHTMLAttributes, forwardRef } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * Boolean if the form should no longer prevent default submit behavior. If\n * you enable this prop you should honestly just use a `<form>` element\n * instead\n *\n * @defaultValue `false`\n */\n disablePreventDefault?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is probably one of the least useful components available as it doesn't\n * do much styling or logic. All this form component will do is add basic flex\n * behavior and prevent the default form submit behavior.\n *\n * @see {@link https://next.react-md.dev/components/form | Form Demos}\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(\n function Form(props, ref) {\n const {\n children,\n onSubmit = noop,\n disablePreventDefault = false,\n ...remaining\n } = props;\n\n return (\n <form\n {...remaining}\n onSubmit={(event) => {\n if (!disablePreventDefault) {\n event.preventDefault();\n }\n\n onSubmit(event);\n }}\n ref={ref}\n >\n {children}\n </form>\n );\n }\n);\n"],"names":["forwardRef","noop","Form","props","ref","children","onSubmit","disablePreventDefault","remaining","form","event","preventDefault"],"mappings":"AAAA;;AAEA,SAAkCA,UAAU,QAAQ,QAAQ;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AAaA;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,QAAQ,EACRC,WAAWL,IAAI,EACfM,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbF,UAAU,CAACI;YACT,IAAI,CAACH,uBAAuB;gBAC1BG,MAAMC,cAAc;YACtB;YAEAL,SAASI;QACX;QACAN,KAAKA;kBAEJC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FormHTMLAttributes, forwardRef } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * Boolean if the form should no longer prevent default submit behavior. If\n * you enable this prop you should honestly just use a `<form>` element\n * instead\n *\n * @defaultValue `false`\n */\n disablePreventDefault?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is probably one of the least useful components available as it doesn't\n * do much styling or logic. All this form component will do is add basic flex\n * behavior and prevent the default form submit behavior.\n *\n * @see {@link https://react-md.dev/components/form | Form Demos}\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(\n function Form(props, ref) {\n const {\n children,\n onSubmit = noop,\n disablePreventDefault = false,\n ...remaining\n } = props;\n\n return (\n <form\n {...remaining}\n onSubmit={(event) => {\n if (!disablePreventDefault) {\n event.preventDefault();\n }\n\n onSubmit(event);\n }}\n ref={ref}\n >\n {children}\n </form>\n );\n }\n);\n"],"names":["forwardRef","noop","Form","props","ref","children","onSubmit","disablePreventDefault","remaining","form","event","preventDefault"],"mappings":"AAAA;;AAEA,SAAkCA,UAAU,QAAQ,QAAQ;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AAaA;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,QAAQ,EACRC,WAAWL,IAAI,EACfM,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbF,UAAU,CAACI;YACT,IAAI,CAACH,uBAAuB;gBAC1BG,MAAMC,cAAc;YACtB;YAEAL,SAASI;QACX;QACAN,KAAKA;kBAEJC;;AAGP,GACA"}
@@ -8,6 +8,6 @@ import { type FormMessageInputLengthCounterProps, type FormMessageProps } from "
8
8
  * This component can also be used to create form-level validation messages by
9
9
  * setting the `role` prop to `"alert"`.
10
10
  *
11
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
11
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
12
12
  */
13
13
  export declare const FormMessage: import("react").ForwardRefExoticComponent<FormMessageProps & Partial<FormMessageInputLengthCounterProps> & import("react").RefAttributes<HTMLDivElement>>;
@@ -13,7 +13,7 @@ import { formMessage, formMessageText } from "./formMessageStyles.js";
13
13
  * This component can also be used to create form-level validation messages by
14
14
  * setting the `role` prop to `"alert"`.
15
15
  *
16
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
16
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
17
17
  */ export const FormMessage = /*#__PURE__*/ forwardRef(function FormMessage(props, ref) {
18
18
  const { id: propId, role, className, counterStyle, counterClassName, messageStyle, messageClassName, error = false, disableWrap = false, theme: propTheme, children, length, maxLength, ...remaining } = props;
19
19
  const id = useEnsuredId(propId, "form-message");