@react-md/core 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (821) 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/_base.scss +6 -2
  8. package/dist/_border-radius.scss +92 -0
  9. package/dist/_core.scss +2 -0
  10. package/dist/_spacing.scss +86 -0
  11. package/dist/app-bar/_app-bar.scss +9 -7
  12. package/dist/app-bar/styles.js +1 -1
  13. package/dist/app-bar/styles.js.map +1 -1
  14. package/dist/autocomplete/Autocomplete.d.ts +2 -2
  15. package/dist/autocomplete/Autocomplete.js +1 -1
  16. package/dist/autocomplete/Autocomplete.js.map +1 -1
  17. package/dist/autocomplete/AutocompleteChip.d.ts +1 -1
  18. package/dist/autocomplete/AutocompleteChip.js +1 -1
  19. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  20. package/dist/autocomplete/AutocompleteCircularProgress.d.ts +1 -1
  21. package/dist/autocomplete/AutocompleteCircularProgress.js +1 -1
  22. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  23. package/dist/autocomplete/AutocompleteClearButton.d.ts +1 -1
  24. package/dist/autocomplete/AutocompleteClearButton.js +1 -1
  25. package/dist/autocomplete/AutocompleteClearButton.js.map +1 -1
  26. package/dist/autocomplete/AutocompleteDropdownButton.d.ts +1 -1
  27. package/dist/autocomplete/AutocompleteDropdownButton.js +1 -1
  28. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  29. package/dist/autocomplete/_autocomplete.scss +8 -5
  30. package/dist/autocomplete/useAutocomplete.d.ts +3 -3
  31. package/dist/autocomplete/useAutocomplete.js +2 -1
  32. package/dist/autocomplete/useAutocomplete.js.map +1 -1
  33. package/dist/avatar/Avatar.d.ts +1 -1
  34. package/dist/avatar/Avatar.js +1 -1
  35. package/dist/avatar/Avatar.js.map +1 -1
  36. package/dist/avatar/_avatar.scss +3 -3
  37. package/dist/badge/Badge.d.ts +1 -1
  38. package/dist/badge/Badge.js +1 -1
  39. package/dist/badge/Badge.js.map +1 -1
  40. package/dist/badge/_badge.scss +10 -2
  41. package/dist/box/Box.d.ts +1 -1
  42. package/dist/box/Box.js +1 -1
  43. package/dist/box/Box.js.map +1 -1
  44. package/dist/box/_box.scss +78 -11
  45. package/dist/button/AsyncButton.d.ts +1 -1
  46. package/dist/button/AsyncButton.js +1 -1
  47. package/dist/button/AsyncButton.js.map +1 -1
  48. package/dist/button/Button.d.ts +1 -1
  49. package/dist/button/Button.js +1 -1
  50. package/dist/button/Button.js.map +1 -1
  51. package/dist/button/ButtonUnstyled.d.ts +1 -1
  52. package/dist/button/ButtonUnstyled.js +1 -1
  53. package/dist/button/ButtonUnstyled.js.map +1 -1
  54. package/dist/button/TooltippedButton.d.ts +1 -1
  55. package/dist/button/TooltippedButton.js +1 -1
  56. package/dist/button/TooltippedButton.js.map +1 -1
  57. package/dist/button/_button.scss +21 -11
  58. package/dist/card/Card.d.ts +1 -1
  59. package/dist/card/Card.js +1 -1
  60. package/dist/card/Card.js.map +1 -1
  61. package/dist/card/CardContent.d.ts +1 -1
  62. package/dist/card/CardContent.js +1 -1
  63. package/dist/card/CardContent.js.map +1 -1
  64. package/dist/card/CardFooter.d.ts +1 -1
  65. package/dist/card/CardFooter.js +1 -1
  66. package/dist/card/CardFooter.js.map +1 -1
  67. package/dist/card/CardHeader.d.ts +1 -1
  68. package/dist/card/CardHeader.js +1 -1
  69. package/dist/card/CardHeader.js.map +1 -1
  70. package/dist/card/CardSubtitle.d.ts +1 -1
  71. package/dist/card/CardSubtitle.js +1 -1
  72. package/dist/card/CardSubtitle.js.map +1 -1
  73. package/dist/card/CardTitle.d.ts +1 -1
  74. package/dist/card/CardTitle.js +1 -1
  75. package/dist/card/CardTitle.js.map +1 -1
  76. package/dist/card/ClickableCard.d.ts +1 -1
  77. package/dist/card/ClickableCard.js +1 -1
  78. package/dist/card/ClickableCard.js.map +1 -1
  79. package/dist/card/_card.scss +9 -7
  80. package/dist/chip/Chip.d.ts +1 -1
  81. package/dist/chip/Chip.js +1 -1
  82. package/dist/chip/Chip.js.map +1 -1
  83. package/dist/chip/_chip.scss +9 -7
  84. package/dist/dialog/Dialog.d.ts +1 -1
  85. package/dist/dialog/Dialog.js +1 -1
  86. package/dist/dialog/Dialog.js.map +1 -1
  87. package/dist/dialog/DialogContent.d.ts +1 -1
  88. package/dist/dialog/DialogContent.js +1 -1
  89. package/dist/dialog/DialogContent.js.map +1 -1
  90. package/dist/dialog/DialogFooter.d.ts +1 -1
  91. package/dist/dialog/DialogFooter.js +1 -1
  92. package/dist/dialog/DialogFooter.js.map +1 -1
  93. package/dist/dialog/DialogHeader.d.ts +1 -1
  94. package/dist/dialog/DialogHeader.js +1 -1
  95. package/dist/dialog/DialogHeader.js.map +1 -1
  96. package/dist/dialog/DialogTitle.d.ts +1 -1
  97. package/dist/dialog/DialogTitle.js +1 -1
  98. package/dist/dialog/DialogTitle.js.map +1 -1
  99. package/dist/dialog/FixedDialog.d.ts +1 -1
  100. package/dist/dialog/FixedDialog.js +1 -1
  101. package/dist/dialog/FixedDialog.js.map +1 -1
  102. package/dist/dialog/_dialog.scss +7 -6
  103. package/dist/divider/Divider.d.ts +1 -1
  104. package/dist/divider/Divider.js +1 -1
  105. package/dist/divider/Divider.js.map +1 -1
  106. package/dist/divider/_divider.scss +3 -2
  107. package/dist/draggable/useDraggable.d.ts +1 -1
  108. package/dist/draggable/useDraggable.js +1 -1
  109. package/dist/draggable/useDraggable.js.map +1 -1
  110. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  111. package/dist/expansion-panel/ExpansionList.js +1 -1
  112. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  113. package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
  114. package/dist/expansion-panel/ExpansionPanel.js +1 -1
  115. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  116. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +1 -1
  117. package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
  118. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  119. package/dist/expansion-panel/_expansion-panel.scss +4 -3
  120. package/dist/expansion-panel/useExpansionList.d.ts +1 -1
  121. package/dist/expansion-panel/useExpansionList.js +1 -1
  122. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  123. package/dist/expansion-panel/useExpansionPanels.d.ts +1 -1
  124. package/dist/expansion-panel/useExpansionPanels.js +1 -1
  125. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  126. package/dist/files/FileInput.d.ts +1 -1
  127. package/dist/files/FileInput.js +1 -1
  128. package/dist/files/FileInput.js.map +1 -1
  129. package/dist/files/useFileUpload.d.ts +2 -2
  130. package/dist/files/useFileUpload.js +2 -2
  131. package/dist/files/useFileUpload.js.map +1 -1
  132. package/dist/form/Checkbox.d.ts +1 -1
  133. package/dist/form/Checkbox.js +1 -1
  134. package/dist/form/Checkbox.js.map +1 -1
  135. package/dist/form/Fieldset.d.ts +1 -1
  136. package/dist/form/Fieldset.js +1 -1
  137. package/dist/form/Fieldset.js.map +1 -1
  138. package/dist/form/Form.d.ts +1 -1
  139. package/dist/form/Form.js +1 -1
  140. package/dist/form/Form.js.map +1 -1
  141. package/dist/form/FormMessage.d.ts +1 -1
  142. package/dist/form/FormMessage.js +1 -1
  143. package/dist/form/FormMessage.js.map +1 -1
  144. package/dist/form/FormMessageContainer.d.ts +1 -1
  145. package/dist/form/FormMessageContainer.js +1 -1
  146. package/dist/form/FormMessageContainer.js.map +1 -1
  147. package/dist/form/FormMessageCounter.d.ts +2 -2
  148. package/dist/form/FormMessageCounter.js +2 -2
  149. package/dist/form/FormMessageCounter.js.map +1 -1
  150. package/dist/form/InputToggle.d.ts +2 -2
  151. package/dist/form/InputToggle.js +2 -2
  152. package/dist/form/InputToggle.js.map +1 -1
  153. package/dist/form/Label.d.ts +3 -3
  154. package/dist/form/Label.js +3 -3
  155. package/dist/form/Label.js.map +1 -1
  156. package/dist/form/Legend.d.ts +1 -1
  157. package/dist/form/Legend.js +1 -1
  158. package/dist/form/Legend.js.map +1 -1
  159. package/dist/form/NativeSelect.d.ts +1 -1
  160. package/dist/form/NativeSelect.js +1 -1
  161. package/dist/form/NativeSelect.js.map +1 -1
  162. package/dist/form/OptGroup.d.ts +1 -1
  163. package/dist/form/OptGroup.js +1 -1
  164. package/dist/form/OptGroup.js.map +1 -1
  165. package/dist/form/Option.d.ts +1 -1
  166. package/dist/form/Option.js +1 -1
  167. package/dist/form/Option.js.map +1 -1
  168. package/dist/form/Password.d.ts +1 -1
  169. package/dist/form/Password.js +1 -1
  170. package/dist/form/Password.js.map +1 -1
  171. package/dist/form/Radio.d.ts +1 -1
  172. package/dist/form/Radio.js +1 -1
  173. package/dist/form/Radio.js.map +1 -1
  174. package/dist/form/Select.d.ts +1 -1
  175. package/dist/form/Select.js +1 -1
  176. package/dist/form/Select.js.map +1 -1
  177. package/dist/form/Slider.d.ts +1 -1
  178. package/dist/form/Slider.js.map +1 -1
  179. package/dist/form/Switch.d.ts +1 -1
  180. package/dist/form/Switch.js +1 -1
  181. package/dist/form/Switch.js.map +1 -1
  182. package/dist/form/TextArea.d.ts +1 -1
  183. package/dist/form/TextArea.js +2 -2
  184. package/dist/form/TextArea.js.map +1 -1
  185. package/dist/form/TextField.d.ts +1 -1
  186. package/dist/form/TextField.js +1 -1
  187. package/dist/form/TextField.js.map +1 -1
  188. package/dist/form/_form-message.scss +4 -3
  189. package/dist/form/_input-toggle.scss +2 -1
  190. package/dist/form/_label.scss +3 -2
  191. package/dist/form/_password.scss +2 -1
  192. package/dist/form/_select.scss +4 -4
  193. package/dist/form/_slider.scss +4 -3
  194. package/dist/form/_switch.scss +2 -1
  195. package/dist/form/_text-area.scss +3 -2
  196. package/dist/form/_text-field.scss +20 -16
  197. package/dist/form/useCheckboxGroup.d.ts +8 -8
  198. package/dist/form/useCheckboxGroup.js +2 -2
  199. package/dist/form/useCheckboxGroup.js.map +1 -1
  200. package/dist/form/useCombobox.js +1 -0
  201. package/dist/form/useCombobox.js.map +1 -1
  202. package/dist/form/useNumberField.d.ts +2 -2
  203. package/dist/form/useNumberField.js +2 -2
  204. package/dist/form/useNumberField.js.map +1 -1
  205. package/dist/form/useRadioGroup.d.ts +4 -4
  206. package/dist/form/useRadioGroup.js +2 -2
  207. package/dist/form/useRadioGroup.js.map +1 -1
  208. package/dist/form/useRangeSlider.d.ts +1 -1
  209. package/dist/form/useRangeSlider.js +1 -1
  210. package/dist/form/useRangeSlider.js.map +1 -1
  211. package/dist/form/useSlider.d.ts +1 -1
  212. package/dist/form/useSlider.js +1 -1
  213. package/dist/form/useSlider.js.map +1 -1
  214. package/dist/form/useTextField.d.ts +4 -4
  215. package/dist/form/useTextField.js +2 -2
  216. package/dist/form/useTextField.js.map +1 -1
  217. package/dist/form/utils.js +1 -0
  218. package/dist/form/utils.js.map +1 -1
  219. package/dist/icon/FontIcon.d.ts +1 -1
  220. package/dist/icon/FontIcon.js +1 -1
  221. package/dist/icon/FontIcon.js.map +1 -1
  222. package/dist/icon/IconRotator.d.ts +1 -1
  223. package/dist/icon/IconRotator.js +1 -1
  224. package/dist/icon/IconRotator.js.map +1 -1
  225. package/dist/icon/MaterialIcon.d.ts +2 -2
  226. package/dist/icon/MaterialIcon.js +2 -2
  227. package/dist/icon/MaterialIcon.js.map +1 -1
  228. package/dist/icon/MaterialSymbol.d.ts +2 -2
  229. package/dist/icon/MaterialSymbol.js +2 -2
  230. package/dist/icon/MaterialSymbol.js.map +1 -1
  231. package/dist/icon/SVGIcon.d.ts +1 -1
  232. package/dist/icon/SVGIcon.js +1 -1
  233. package/dist/icon/SVGIcon.js.map +1 -1
  234. package/dist/icon/TextIconSpacing.d.ts +1 -1
  235. package/dist/icon/TextIconSpacing.js +1 -1
  236. package/dist/icon/TextIconSpacing.js.map +1 -1
  237. package/dist/icon/_icon.scss +2 -1
  238. package/dist/interaction/useElementInteraction.js +1 -1
  239. package/dist/interaction/useElementInteraction.js.map +1 -1
  240. package/dist/layout/LayoutAppBar.d.ts +1 -1
  241. package/dist/layout/LayoutAppBar.js +1 -1
  242. package/dist/layout/LayoutAppBar.js.map +1 -1
  243. package/dist/layout/LayoutNav.d.ts +1 -1
  244. package/dist/layout/LayoutNav.js +2 -2
  245. package/dist/layout/LayoutNav.js.map +1 -1
  246. package/dist/layout/LayoutWindowSplitter.d.ts +1 -1
  247. package/dist/layout/LayoutWindowSplitter.js +1 -1
  248. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  249. package/dist/layout/Main.d.ts +1 -1
  250. package/dist/layout/Main.js +1 -1
  251. package/dist/layout/Main.js.map +1 -1
  252. package/dist/layout/useExpandableLayout.d.ts +1 -1
  253. package/dist/layout/useExpandableLayout.js +1 -1
  254. package/dist/layout/useExpandableLayout.js.map +1 -1
  255. package/dist/layout/useHorizontalLayoutTransition.d.ts +1 -1
  256. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  257. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  258. package/dist/layout/useLayoutAppBarHeight.d.ts +1 -1
  259. package/dist/layout/useLayoutAppBarHeight.js +1 -1
  260. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  261. package/dist/layout/useLayoutTree.d.ts +3 -3
  262. package/dist/layout/useLayoutTree.js +3 -3
  263. package/dist/layout/useLayoutTree.js.map +1 -1
  264. package/dist/layout/useLayoutWindowSplitter.d.ts +1 -1
  265. package/dist/layout/useLayoutWindowSplitter.js +1 -1
  266. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  267. package/dist/layout/useMainTabIndex.js +1 -0
  268. package/dist/layout/useMainTabIndex.js.map +1 -1
  269. package/dist/layout/useResizableLayout.d.ts +1 -1
  270. package/dist/layout/useResizableLayout.js +1 -1
  271. package/dist/layout/useResizableLayout.js.map +1 -1
  272. package/dist/layout/useTemporaryLayout.d.ts +1 -1
  273. package/dist/layout/useTemporaryLayout.js +1 -1
  274. package/dist/layout/useTemporaryLayout.js.map +1 -1
  275. package/dist/link/Link.d.ts +1 -1
  276. package/dist/link/Link.js +1 -1
  277. package/dist/link/Link.js.map +1 -1
  278. package/dist/link/SkipToMainContent.d.ts +1 -1
  279. package/dist/link/SkipToMainContent.js +1 -1
  280. package/dist/link/SkipToMainContent.js.map +1 -1
  281. package/dist/link/_link.scss +3 -2
  282. package/dist/list/List.d.ts +1 -1
  283. package/dist/list/List.js +1 -1
  284. package/dist/list/List.js.map +1 -1
  285. package/dist/list/ListItem.d.ts +1 -1
  286. package/dist/list/ListItem.js +1 -1
  287. package/dist/list/ListItem.js.map +1 -1
  288. package/dist/list/ListItemChildren.d.ts +1 -1
  289. package/dist/list/ListItemChildren.js +1 -1
  290. package/dist/list/ListItemChildren.js.map +1 -1
  291. package/dist/list/ListItemLink.d.ts +1 -1
  292. package/dist/list/ListItemLink.js +1 -1
  293. package/dist/list/ListItemLink.js.map +1 -1
  294. package/dist/list/ListSubheader.d.ts +1 -1
  295. package/dist/list/ListSubheader.js +1 -1
  296. package/dist/list/ListSubheader.js.map +1 -1
  297. package/dist/list/_list.scss +7 -6
  298. package/dist/media-queries/AppSizeProvider.d.ts +2 -2
  299. package/dist/media-queries/AppSizeProvider.js +2 -2
  300. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  301. package/dist/media-queries/useMediaQuery.d.ts +2 -2
  302. package/dist/media-queries/useMediaQuery.js +2 -2
  303. package/dist/media-queries/useMediaQuery.js.map +1 -1
  304. package/dist/menu/DropdownMenu.d.ts +1 -1
  305. package/dist/menu/DropdownMenu.js +2 -1
  306. package/dist/menu/DropdownMenu.js.map +1 -1
  307. package/dist/menu/Menu.d.ts +1 -1
  308. package/dist/menu/Menu.js +1 -1
  309. package/dist/menu/Menu.js.map +1 -1
  310. package/dist/menu/MenuBar.d.ts +1 -1
  311. package/dist/menu/MenuBar.js +1 -1
  312. package/dist/menu/MenuBar.js.map +1 -1
  313. package/dist/menu/MenuButton.d.ts +1 -1
  314. package/dist/menu/MenuButton.js +1 -1
  315. package/dist/menu/MenuButton.js.map +1 -1
  316. package/dist/menu/MenuItem.d.ts +1 -1
  317. package/dist/menu/MenuItem.js +1 -1
  318. package/dist/menu/MenuItem.js.map +1 -1
  319. package/dist/menu/MenuItemCheckbox.d.ts +1 -1
  320. package/dist/menu/MenuItemCheckbox.js +1 -1
  321. package/dist/menu/MenuItemCheckbox.js.map +1 -1
  322. package/dist/menu/MenuItemFileInput.d.ts +1 -1
  323. package/dist/menu/MenuItemFileInput.js +1 -1
  324. package/dist/menu/MenuItemFileInput.js.map +1 -1
  325. package/dist/menu/MenuItemGroup.d.ts +1 -1
  326. package/dist/menu/MenuItemGroup.js +1 -1
  327. package/dist/menu/MenuItemGroup.js.map +1 -1
  328. package/dist/menu/MenuItemInputToggle.d.ts +1 -1
  329. package/dist/menu/MenuItemInputToggle.js +1 -1
  330. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  331. package/dist/menu/MenuItemRadio.d.ts +1 -1
  332. package/dist/menu/MenuItemRadio.js +1 -1
  333. package/dist/menu/MenuItemRadio.js.map +1 -1
  334. package/dist/menu/MenuItemSeparator.d.ts +1 -1
  335. package/dist/menu/MenuItemSeparator.js +1 -1
  336. package/dist/menu/MenuItemSeparator.js.map +1 -1
  337. package/dist/menu/MenuItemSwitch.d.ts +1 -1
  338. package/dist/menu/MenuItemSwitch.js +1 -1
  339. package/dist/menu/MenuItemSwitch.js.map +1 -1
  340. package/dist/menu/MenuItemTextField.d.ts +1 -1
  341. package/dist/menu/MenuItemTextField.js +1 -1
  342. package/dist/menu/MenuItemTextField.js.map +1 -1
  343. package/dist/menu/_menu.scss +2 -1
  344. package/dist/menu/useContextMenu.d.ts +1 -1
  345. package/dist/menu/useContextMenu.js +1 -1
  346. package/dist/menu/useContextMenu.js.map +1 -1
  347. package/dist/navigation/CollapsibleNavGroup.d.ts +1 -1
  348. package/dist/navigation/CollapsibleNavGroup.js +1 -1
  349. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  350. package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -1
  351. package/dist/navigation/DefaultNavigationRenderer.js +1 -1
  352. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  353. package/dist/navigation/NavGroup.d.ts +1 -1
  354. package/dist/navigation/NavGroup.js +1 -1
  355. package/dist/navigation/NavGroup.js.map +1 -1
  356. package/dist/navigation/NavItem.d.ts +1 -1
  357. package/dist/navigation/NavItem.js +1 -1
  358. package/dist/navigation/NavItem.js.map +1 -1
  359. package/dist/navigation/NavItemButton.d.ts +1 -1
  360. package/dist/navigation/NavItemButton.js +1 -1
  361. package/dist/navigation/NavItemButton.js.map +1 -1
  362. package/dist/navigation/NavItemLink.d.ts +1 -1
  363. package/dist/navigation/NavItemLink.js +1 -1
  364. package/dist/navigation/NavItemLink.js.map +1 -1
  365. package/dist/navigation/NavSubheader.d.ts +1 -1
  366. package/dist/navigation/NavSubheader.js +1 -1
  367. package/dist/navigation/NavSubheader.js.map +1 -1
  368. package/dist/navigation/Navigation.d.ts +1 -1
  369. package/dist/navigation/Navigation.js +1 -1
  370. package/dist/navigation/Navigation.js.map +1 -1
  371. package/dist/navigation/_navigation.scss +5 -3
  372. package/dist/navigation/useActiveHeadingId.d.ts +1 -1
  373. package/dist/navigation/useActiveHeadingId.js +1 -1
  374. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  375. package/dist/navigation/useNavigationExpansion.d.ts +2 -2
  376. package/dist/navigation/useNavigationExpansion.js +2 -2
  377. package/dist/navigation/useNavigationExpansion.js.map +1 -1
  378. package/dist/navigation/useTableOfContentsHeadings.d.ts +1 -1
  379. package/dist/navigation/useTableOfContentsHeadings.js +1 -1
  380. package/dist/navigation/useTableOfContentsHeadings.js.map +1 -1
  381. package/dist/overlay/Overlay.d.ts +1 -1
  382. package/dist/overlay/Overlay.js +1 -1
  383. package/dist/overlay/Overlay.js.map +1 -1
  384. package/dist/portal/Portal.d.ts +1 -1
  385. package/dist/portal/Portal.js +1 -1
  386. package/dist/portal/Portal.js.map +1 -1
  387. package/dist/portal/PortalContainerProvider.d.ts +1 -1
  388. package/dist/portal/PortalContainerProvider.js +1 -1
  389. package/dist/portal/PortalContainerProvider.js.map +1 -1
  390. package/dist/positioning/useFixedPositioning.d.ts +1 -1
  391. package/dist/positioning/useFixedPositioning.js +1 -1
  392. package/dist/positioning/useFixedPositioning.js.map +1 -1
  393. package/dist/progress/CircularProgress.d.ts +1 -1
  394. package/dist/progress/CircularProgress.js +1 -1
  395. package/dist/progress/CircularProgress.js.map +1 -1
  396. package/dist/progress/LinearProgress.d.ts +1 -1
  397. package/dist/progress/LinearProgress.js +1 -1
  398. package/dist/progress/LinearProgress.js.map +1 -1
  399. package/dist/responsive-item/ResponsiveItem.d.ts +1 -1
  400. package/dist/responsive-item/ResponsiveItem.js +1 -1
  401. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  402. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -1
  403. package/dist/responsive-item/ResponsiveItemOverlay.js +1 -1
  404. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  405. package/dist/responsive-item/_responsive-item.scss +2 -1
  406. package/dist/scroll/useScrollLock.d.ts +1 -1
  407. package/dist/scroll/useScrollLock.js +1 -1
  408. package/dist/scroll/useScrollLock.js.map +1 -1
  409. package/dist/segmented-button/SegmentedButton.d.ts +1 -1
  410. package/dist/segmented-button/SegmentedButton.js +1 -1
  411. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  412. package/dist/segmented-button/SegmentedButtonContainer.d.ts +1 -1
  413. package/dist/segmented-button/SegmentedButtonContainer.js +1 -1
  414. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  415. package/dist/segmented-button/_segmented-button.scss +20 -13
  416. package/dist/sheet/Sheet.d.ts +1 -1
  417. package/dist/sheet/Sheet.js +1 -1
  418. package/dist/sheet/Sheet.js.map +1 -1
  419. package/dist/sheet/_sheet.scss +2 -1
  420. package/dist/snackbar/DefaultToastRenderer.d.ts +1 -1
  421. package/dist/snackbar/DefaultToastRenderer.js +1 -1
  422. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  423. package/dist/snackbar/Snackbar.d.ts +1 -1
  424. package/dist/snackbar/Snackbar.js +1 -1
  425. package/dist/snackbar/Snackbar.js.map +1 -1
  426. package/dist/snackbar/Toast.d.ts +1 -1
  427. package/dist/snackbar/Toast.js +1 -1
  428. package/dist/snackbar/Toast.js.map +1 -1
  429. package/dist/snackbar/ToastActionButton.d.ts +1 -1
  430. package/dist/snackbar/ToastActionButton.js +1 -1
  431. package/dist/snackbar/ToastActionButton.js.map +1 -1
  432. package/dist/snackbar/ToastCloseButton.d.ts +1 -1
  433. package/dist/snackbar/ToastCloseButton.js +1 -1
  434. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  435. package/dist/snackbar/ToastContent.d.ts +1 -1
  436. package/dist/snackbar/ToastContent.js +1 -1
  437. package/dist/snackbar/ToastContent.js.map +1 -1
  438. package/dist/snackbar/ToastManager.d.ts +1 -1
  439. package/dist/snackbar/ToastManager.js +1 -1
  440. package/dist/snackbar/ToastManager.js.map +1 -1
  441. package/dist/snackbar/ToastManagerProvider.d.ts +1 -1
  442. package/dist/snackbar/ToastManagerProvider.js +1 -1
  443. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  444. package/dist/snackbar/_snackbar.scss +12 -10
  445. package/dist/snackbar/useCurrentToastActions.d.ts +1 -1
  446. package/dist/snackbar/useCurrentToastActions.js +1 -1
  447. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  448. package/dist/storage/useStorage.d.ts +1 -1
  449. package/dist/storage/useStorage.js +1 -1
  450. package/dist/storage/useStorage.js.map +1 -1
  451. package/dist/suspense/CircularProgressSuspense.d.ts +1 -1
  452. package/dist/suspense/CircularProgressSuspense.js +1 -1
  453. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  454. package/dist/suspense/NullSuspense.d.ts +1 -1
  455. package/dist/suspense/NullSuspense.js +1 -1
  456. package/dist/suspense/NullSuspense.js.map +1 -1
  457. package/dist/table/StickyTableSection.d.ts +2 -2
  458. package/dist/table/StickyTableSection.js +2 -2
  459. package/dist/table/StickyTableSection.js.map +1 -1
  460. package/dist/table/Table.d.ts +1 -1
  461. package/dist/table/Table.js +1 -1
  462. package/dist/table/Table.js.map +1 -1
  463. package/dist/table/TableBody.d.ts +1 -1
  464. package/dist/table/TableBody.js +1 -1
  465. package/dist/table/TableBody.js.map +1 -1
  466. package/dist/table/TableCell.d.ts +1 -1
  467. package/dist/table/TableCell.js +1 -1
  468. package/dist/table/TableCell.js.map +1 -1
  469. package/dist/table/TableCheckbox.d.ts +1 -1
  470. package/dist/table/TableCheckbox.js +1 -1
  471. package/dist/table/TableCheckbox.js.map +1 -1
  472. package/dist/table/TableContainer.d.ts +1 -1
  473. package/dist/table/TableContainer.js +1 -1
  474. package/dist/table/TableContainer.js.map +1 -1
  475. package/dist/table/TableFooter.d.ts +1 -1
  476. package/dist/table/TableFooter.js +1 -1
  477. package/dist/table/TableFooter.js.map +1 -1
  478. package/dist/table/TableHeader.d.ts +1 -1
  479. package/dist/table/TableHeader.js +1 -1
  480. package/dist/table/TableHeader.js.map +1 -1
  481. package/dist/table/TableRadio.d.ts +1 -1
  482. package/dist/table/TableRadio.js +1 -1
  483. package/dist/table/TableRadio.js.map +1 -1
  484. package/dist/table/TableRow.d.ts +1 -1
  485. package/dist/table/TableRow.js +1 -1
  486. package/dist/table/TableRow.js.map +1 -1
  487. package/dist/table/_table.scss +5 -4
  488. package/dist/tabs/SimpleTabPanel.d.ts +2 -2
  489. package/dist/tabs/SimpleTabPanel.js +2 -2
  490. package/dist/tabs/SimpleTabPanel.js.map +1 -1
  491. package/dist/tabs/SimpleTabPanels.d.ts +2 -2
  492. package/dist/tabs/SimpleTabPanels.js +2 -2
  493. package/dist/tabs/SimpleTabPanels.js.map +1 -1
  494. package/dist/tabs/Tab.d.ts +1 -1
  495. package/dist/tabs/Tab.js +1 -1
  496. package/dist/tabs/Tab.js.map +1 -1
  497. package/dist/tabs/TabList.d.ts +1 -1
  498. package/dist/tabs/TabList.js +1 -1
  499. package/dist/tabs/TabList.js.map +1 -1
  500. package/dist/tabs/_tabs.scss +7 -4
  501. package/dist/tabs/useTabs.d.ts +4 -4
  502. package/dist/tabs/useTabs.js +2 -1
  503. package/dist/tabs/useTabs.js.map +1 -1
  504. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
  505. package/dist/theme/LocalStorageColorSchemeProvider.js +2 -2
  506. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  507. package/dist/theme/ThemeProvider.d.ts +1 -1
  508. package/dist/theme/ThemeProvider.js +1 -1
  509. package/dist/theme/ThemeProvider.js.map +1 -1
  510. package/dist/theme/useColorSchemeProvider.js +1 -0
  511. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  512. package/dist/theme/utils.js +2 -2
  513. package/dist/theme/utils.js.map +1 -1
  514. package/dist/tooltip/Tooltip.d.ts +1 -1
  515. package/dist/tooltip/Tooltip.js +1 -1
  516. package/dist/tooltip/Tooltip.js.map +1 -1
  517. package/dist/tooltip/TooltipHoverModeProvider.d.ts +1 -1
  518. package/dist/tooltip/TooltipHoverModeProvider.js +1 -1
  519. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  520. package/dist/tooltip/_tooltip.scss +52 -25
  521. package/dist/tooltip/useTooltip.d.ts +1 -1
  522. package/dist/tooltip/useTooltip.js +1 -1
  523. package/dist/tooltip/useTooltip.js.map +1 -1
  524. package/dist/transition/CSSTransition.d.ts +1 -1
  525. package/dist/transition/CSSTransition.js +1 -1
  526. package/dist/transition/CSSTransition.js.map +1 -1
  527. package/dist/transition/Collapse.d.ts +1 -1
  528. package/dist/transition/Collapse.js +1 -1
  529. package/dist/transition/Collapse.js.map +1 -1
  530. package/dist/transition/CrossFade.d.ts +1 -1
  531. package/dist/transition/CrossFade.js +1 -1
  532. package/dist/transition/CrossFade.js.map +1 -1
  533. package/dist/transition/ScaleTransition.d.ts +1 -1
  534. package/dist/transition/ScaleTransition.js +1 -1
  535. package/dist/transition/ScaleTransition.js.map +1 -1
  536. package/dist/transition/SkeletonPlaceholder.d.ts +1 -1
  537. package/dist/transition/SkeletonPlaceholder.js +1 -1
  538. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  539. package/dist/transition/Slide.d.ts +1 -1
  540. package/dist/transition/Slide.js +1 -1
  541. package/dist/transition/Slide.js.map +1 -1
  542. package/dist/transition/SlideContainer.d.ts +1 -1
  543. package/dist/transition/SlideContainer.js +1 -1
  544. package/dist/transition/SlideContainer.js.map +1 -1
  545. package/dist/transition/_transition.scss +2 -1
  546. package/dist/transition/useCSSTransition.d.ts +2 -2
  547. package/dist/transition/useCSSTransition.js +2 -2
  548. package/dist/transition/useCSSTransition.js.map +1 -1
  549. package/dist/transition/useCarousel.d.ts +1 -1
  550. package/dist/transition/useCarousel.js +1 -1
  551. package/dist/transition/useCarousel.js.map +1 -1
  552. package/dist/transition/useCollapseTransition.d.ts +2 -2
  553. package/dist/transition/useCollapseTransition.js +2 -2
  554. package/dist/transition/useCollapseTransition.js.map +1 -1
  555. package/dist/transition/useCrossFadeTransition.d.ts +2 -2
  556. package/dist/transition/useCrossFadeTransition.js +2 -2
  557. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  558. package/dist/transition/useScaleTransition.d.ts +2 -2
  559. package/dist/transition/useScaleTransition.js +2 -2
  560. package/dist/transition/useScaleTransition.js.map +1 -1
  561. package/dist/transition/useSkeletonPlaceholder.d.ts +2 -2
  562. package/dist/transition/useSkeletonPlaceholder.js +2 -2
  563. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  564. package/dist/transition/useSlideTransition.d.ts +1 -1
  565. package/dist/transition/useSlideTransition.js +1 -1
  566. package/dist/transition/useSlideTransition.js.map +1 -1
  567. package/dist/transition/useTransition.d.ts +1 -1
  568. package/dist/transition/useTransition.js +1 -1
  569. package/dist/transition/useTransition.js.map +1 -1
  570. package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
  571. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  572. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  573. package/dist/tree/Tree.d.ts +1 -1
  574. package/dist/tree/Tree.js +1 -1
  575. package/dist/tree/Tree.js.map +1 -1
  576. package/dist/tree/TreeItem.d.ts +1 -1
  577. package/dist/tree/TreeItem.js +1 -1
  578. package/dist/tree/TreeItem.js.map +1 -1
  579. package/dist/tree/_tree.scss +1 -1
  580. package/dist/tree/useTree.d.ts +1 -1
  581. package/dist/tree/useTree.js +1 -1
  582. package/dist/tree/useTree.js.map +1 -1
  583. package/dist/tree/useTreeExpansion.d.ts +1 -1
  584. package/dist/tree/useTreeExpansion.js +1 -1
  585. package/dist/tree/useTreeExpansion.js.map +1 -1
  586. package/dist/tree/useTreeItems.d.ts +1 -1
  587. package/dist/tree/useTreeItems.js +1 -1
  588. package/dist/tree/useTreeItems.js.map +1 -1
  589. package/dist/tree/useTreeSelection.d.ts +1 -1
  590. package/dist/tree/useTreeSelection.js +1 -1
  591. package/dist/tree/useTreeSelection.js.map +1 -1
  592. package/dist/typography/HighlightText.d.ts +1 -1
  593. package/dist/typography/HighlightText.js +1 -1
  594. package/dist/typography/HighlightText.js.map +1 -1
  595. package/dist/typography/Mark.d.ts +1 -1
  596. package/dist/typography/Mark.js +1 -1
  597. package/dist/typography/Mark.js.map +1 -1
  598. package/dist/typography/SrOnly.d.ts +1 -1
  599. package/dist/typography/SrOnly.js +1 -1
  600. package/dist/typography/SrOnly.js.map +1 -1
  601. package/dist/typography/TextContainer.d.ts +1 -1
  602. package/dist/typography/TextContainer.js +1 -1
  603. package/dist/typography/TextContainer.js.map +1 -1
  604. package/dist/typography/Typography.d.ts +1 -1
  605. package/dist/typography/Typography.js +1 -1
  606. package/dist/typography/Typography.js.map +1 -1
  607. package/dist/typography/WritingDirectionProvider.d.ts +1 -1
  608. package/dist/typography/WritingDirectionProvider.js +1 -1
  609. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  610. package/dist/useEnsuredState.d.ts +1 -0
  611. package/dist/useEnsuredState.js +5 -3
  612. package/dist/useEnsuredState.js.map +1 -1
  613. package/dist/utils/RenderRecursively.d.ts +1 -1
  614. package/dist/utils/RenderRecursively.js +1 -1
  615. package/dist/utils/RenderRecursively.js.map +1 -1
  616. package/dist/utils/bem.js +1 -1
  617. package/dist/utils/bem.js.map +1 -1
  618. package/dist/utils/parseCssLengthUnit.js +3 -0
  619. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  620. package/dist/window-splitter/WindowSplitter.d.ts +1 -1
  621. package/dist/window-splitter/WindowSplitter.js +1 -1
  622. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  623. package/package.json +10 -10
  624. package/src/CoreProviders.tsx +1 -1
  625. package/src/SsrProvider.tsx +1 -1
  626. package/src/app-bar/styles.ts +1 -1
  627. package/src/autocomplete/Autocomplete.tsx +3 -3
  628. package/src/autocomplete/AutocompleteChip.tsx +1 -1
  629. package/src/autocomplete/AutocompleteCircularProgress.tsx +1 -1
  630. package/src/autocomplete/AutocompleteClearButton.tsx +1 -1
  631. package/src/autocomplete/AutocompleteDropdownButton.tsx +1 -1
  632. package/src/autocomplete/useAutocomplete.ts +5 -4
  633. package/src/avatar/Avatar.tsx +1 -1
  634. package/src/badge/Badge.tsx +1 -1
  635. package/src/box/Box.tsx +1 -1
  636. package/src/button/AsyncButton.tsx +1 -1
  637. package/src/button/Button.tsx +1 -1
  638. package/src/button/ButtonUnstyled.tsx +1 -1
  639. package/src/button/TooltippedButton.tsx +1 -1
  640. package/src/card/Card.tsx +1 -1
  641. package/src/card/CardContent.tsx +1 -1
  642. package/src/card/CardFooter.tsx +1 -1
  643. package/src/card/CardHeader.tsx +1 -1
  644. package/src/card/CardSubtitle.tsx +1 -1
  645. package/src/card/CardTitle.tsx +1 -1
  646. package/src/card/ClickableCard.tsx +1 -1
  647. package/src/chip/Chip.tsx +1 -1
  648. package/src/dialog/Dialog.tsx +1 -1
  649. package/src/dialog/DialogContent.tsx +1 -1
  650. package/src/dialog/DialogFooter.tsx +1 -1
  651. package/src/dialog/DialogHeader.tsx +1 -1
  652. package/src/dialog/DialogTitle.tsx +1 -1
  653. package/src/dialog/FixedDialog.tsx +1 -1
  654. package/src/divider/Divider.tsx +1 -1
  655. package/src/draggable/useDraggable.ts +1 -1
  656. package/src/expansion-panel/ExpansionList.tsx +1 -1
  657. package/src/expansion-panel/ExpansionPanel.tsx +1 -1
  658. package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -1
  659. package/src/expansion-panel/useExpansionList.ts +1 -1
  660. package/src/expansion-panel/useExpansionPanels.ts +1 -1
  661. package/src/files/FileInput.tsx +1 -1
  662. package/src/files/useFileUpload.ts +2 -2
  663. package/src/form/Checkbox.tsx +1 -1
  664. package/src/form/Fieldset.tsx +1 -1
  665. package/src/form/Form.tsx +1 -1
  666. package/src/form/FormMessage.tsx +1 -1
  667. package/src/form/FormMessageContainer.tsx +1 -1
  668. package/src/form/FormMessageCounter.tsx +2 -2
  669. package/src/form/InputToggle.tsx +2 -2
  670. package/src/form/Label.tsx +3 -3
  671. package/src/form/Legend.tsx +1 -1
  672. package/src/form/NativeSelect.tsx +1 -1
  673. package/src/form/OptGroup.tsx +1 -1
  674. package/src/form/Option.tsx +1 -1
  675. package/src/form/Password.tsx +1 -1
  676. package/src/form/Radio.tsx +1 -1
  677. package/src/form/Select.tsx +1 -1
  678. package/src/form/Slider.tsx +1 -1
  679. package/src/form/Switch.tsx +1 -1
  680. package/src/form/TextArea.tsx +2 -2
  681. package/src/form/TextField.tsx +1 -1
  682. package/src/form/useCheckboxGroup.ts +10 -10
  683. package/src/form/useCombobox.ts +1 -0
  684. package/src/form/useNumberField.ts +4 -4
  685. package/src/form/useRadioGroup.ts +6 -6
  686. package/src/form/useRangeSlider.ts +1 -1
  687. package/src/form/useSlider.ts +1 -1
  688. package/src/form/useTextField.ts +6 -6
  689. package/src/form/utils.ts +1 -0
  690. package/src/icon/FontIcon.tsx +1 -1
  691. package/src/icon/IconRotator.tsx +1 -1
  692. package/src/icon/MaterialIcon.tsx +2 -2
  693. package/src/icon/MaterialSymbol.tsx +2 -2
  694. package/src/icon/SVGIcon.tsx +1 -1
  695. package/src/icon/TextIconSpacing.tsx +1 -1
  696. package/src/interaction/useElementInteraction.tsx +1 -1
  697. package/src/layout/LayoutAppBar.tsx +1 -1
  698. package/src/layout/LayoutNav.tsx +2 -2
  699. package/src/layout/LayoutWindowSplitter.tsx +1 -1
  700. package/src/layout/Main.tsx +1 -1
  701. package/src/layout/useExpandableLayout.ts +1 -1
  702. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  703. package/src/layout/useLayoutAppBarHeight.ts +1 -1
  704. package/src/layout/useLayoutTree.ts +3 -3
  705. package/src/layout/useLayoutWindowSplitter.ts +1 -1
  706. package/src/layout/useMainTabIndex.ts +1 -0
  707. package/src/layout/useResizableLayout.ts +1 -1
  708. package/src/layout/useTemporaryLayout.ts +1 -1
  709. package/src/link/Link.tsx +1 -1
  710. package/src/link/SkipToMainContent.tsx +1 -1
  711. package/src/list/List.tsx +1 -1
  712. package/src/list/ListItem.tsx +1 -1
  713. package/src/list/ListItemChildren.tsx +1 -1
  714. package/src/list/ListItemLink.tsx +1 -1
  715. package/src/list/ListSubheader.tsx +1 -1
  716. package/src/media-queries/AppSizeProvider.tsx +2 -2
  717. package/src/media-queries/useMediaQuery.ts +2 -2
  718. package/src/menu/DropdownMenu.tsx +2 -1
  719. package/src/menu/Menu.tsx +1 -1
  720. package/src/menu/MenuBar.tsx +1 -1
  721. package/src/menu/MenuButton.tsx +1 -1
  722. package/src/menu/MenuItem.tsx +1 -1
  723. package/src/menu/MenuItemCheckbox.tsx +1 -1
  724. package/src/menu/MenuItemFileInput.tsx +1 -1
  725. package/src/menu/MenuItemGroup.tsx +1 -1
  726. package/src/menu/MenuItemInputToggle.tsx +1 -1
  727. package/src/menu/MenuItemRadio.tsx +1 -1
  728. package/src/menu/MenuItemSeparator.tsx +1 -1
  729. package/src/menu/MenuItemSwitch.tsx +1 -1
  730. package/src/menu/MenuItemTextField.tsx +1 -1
  731. package/src/menu/useContextMenu.ts +1 -1
  732. package/src/navigation/CollapsibleNavGroup.tsx +1 -1
  733. package/src/navigation/DefaultNavigationRenderer.tsx +1 -1
  734. package/src/navigation/NavGroup.tsx +1 -1
  735. package/src/navigation/NavItem.tsx +1 -1
  736. package/src/navigation/NavItemButton.tsx +1 -1
  737. package/src/navigation/NavItemLink.tsx +1 -1
  738. package/src/navigation/NavSubheader.tsx +1 -1
  739. package/src/navigation/Navigation.tsx +1 -1
  740. package/src/navigation/useActiveHeadingId.ts +1 -1
  741. package/src/navigation/useNavigationExpansion.ts +2 -2
  742. package/src/navigation/useTableOfContentsHeadings.ts +1 -1
  743. package/src/overlay/Overlay.tsx +1 -1
  744. package/src/portal/Portal.tsx +1 -1
  745. package/src/portal/PortalContainerProvider.tsx +1 -1
  746. package/src/positioning/useFixedPositioning.ts +1 -1
  747. package/src/progress/CircularProgress.tsx +1 -1
  748. package/src/progress/LinearProgress.tsx +1 -1
  749. package/src/responsive-item/ResponsiveItem.tsx +1 -1
  750. package/src/responsive-item/ResponsiveItemOverlay.tsx +1 -1
  751. package/src/scroll/useScrollLock.ts +1 -1
  752. package/src/segmented-button/SegmentedButton.tsx +1 -1
  753. package/src/segmented-button/SegmentedButtonContainer.tsx +1 -1
  754. package/src/sheet/Sheet.tsx +1 -1
  755. package/src/snackbar/DefaultToastRenderer.tsx +1 -1
  756. package/src/snackbar/Snackbar.tsx +1 -1
  757. package/src/snackbar/Toast.tsx +1 -1
  758. package/src/snackbar/ToastActionButton.tsx +1 -1
  759. package/src/snackbar/ToastCloseButton.tsx +1 -1
  760. package/src/snackbar/ToastContent.tsx +1 -1
  761. package/src/snackbar/ToastManager.ts +1 -1
  762. package/src/snackbar/ToastManagerProvider.tsx +1 -1
  763. package/src/snackbar/useCurrentToastActions.ts +1 -1
  764. package/src/storage/useStorage.ts +1 -1
  765. package/src/suspense/CircularProgressSuspense.tsx +1 -1
  766. package/src/suspense/NullSuspense.tsx +1 -1
  767. package/src/table/StickyTableSection.tsx +2 -2
  768. package/src/table/Table.tsx +1 -1
  769. package/src/table/TableBody.tsx +1 -1
  770. package/src/table/TableCell.tsx +1 -1
  771. package/src/table/TableCheckbox.tsx +1 -1
  772. package/src/table/TableContainer.tsx +1 -1
  773. package/src/table/TableFooter.tsx +1 -1
  774. package/src/table/TableHeader.tsx +1 -1
  775. package/src/table/TableRadio.tsx +1 -1
  776. package/src/table/TableRow.tsx +1 -1
  777. package/src/tabs/SimpleTabPanel.tsx +2 -2
  778. package/src/tabs/SimpleTabPanels.tsx +2 -2
  779. package/src/tabs/Tab.tsx +1 -1
  780. package/src/tabs/TabList.tsx +1 -1
  781. package/src/tabs/useTabs.ts +6 -5
  782. package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
  783. package/src/theme/ThemeProvider.tsx +1 -1
  784. package/src/theme/useColorSchemeProvider.ts +1 -0
  785. package/src/theme/utils.ts +2 -1
  786. package/src/tooltip/Tooltip.tsx +1 -1
  787. package/src/tooltip/TooltipHoverModeProvider.tsx +1 -1
  788. package/src/tooltip/useTooltip.ts +1 -1
  789. package/src/transition/CSSTransition.tsx +1 -1
  790. package/src/transition/Collapse.tsx +1 -1
  791. package/src/transition/CrossFade.tsx +1 -1
  792. package/src/transition/ScaleTransition.tsx +1 -1
  793. package/src/transition/SkeletonPlaceholder.tsx +1 -1
  794. package/src/transition/Slide.tsx +1 -1
  795. package/src/transition/SlideContainer.tsx +1 -1
  796. package/src/transition/useCSSTransition.ts +2 -2
  797. package/src/transition/useCarousel.ts +1 -1
  798. package/src/transition/useCollapseTransition.ts +2 -2
  799. package/src/transition/useCrossFadeTransition.ts +2 -2
  800. package/src/transition/useScaleTransition.ts +2 -2
  801. package/src/transition/useSkeletonPlaceholder.ts +2 -2
  802. package/src/transition/useSlideTransition.ts +1 -1
  803. package/src/transition/useTransition.ts +1 -1
  804. package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
  805. package/src/tree/Tree.tsx +1 -1
  806. package/src/tree/TreeItem.tsx +1 -1
  807. package/src/tree/useTree.ts +1 -1
  808. package/src/tree/useTreeExpansion.ts +1 -1
  809. package/src/tree/useTreeItems.ts +1 -1
  810. package/src/tree/useTreeSelection.ts +1 -1
  811. package/src/typography/HighlightText.tsx +1 -1
  812. package/src/typography/Mark.tsx +1 -1
  813. package/src/typography/SrOnly.tsx +1 -1
  814. package/src/typography/TextContainer.tsx +1 -1
  815. package/src/typography/Typography.tsx +1 -1
  816. package/src/typography/WritingDirectionProvider.tsx +1 -1
  817. package/src/useEnsuredState.ts +6 -3
  818. package/src/utils/RenderRecursively.tsx +1 -1
  819. package/src/utils/bem.ts +1 -1
  820. package/src/utils/parseCssLengthUnit.ts +4 -0
  821. package/src/window-splitter/WindowSplitter.tsx +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { type ElementType, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * The `SrOnly` component is used to render content that is only visible to\n * screen readers.\n *\n * @example Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core/typography/SrOnly\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/sr-only | SrOnly Demos}\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly: focusable ? \"focusable\" : phoneOnly ? \"phone\" : true,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","undefined","srOnly"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAE1E,SAASC,QAAQ,QAAQ,iBAAiB;AA2B1C;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,MAAMC,uBAASF,WACpB,SAASE,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,qBACE,KAACO;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIK,SAAQ;QAC/CP,WAAWN,SAAS;YAClBc,QAAQN,YAAY,cAAcD,YAAY,UAAU;YACxDD;QACF;kBAECG;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { type ElementType, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * The `SrOnly` component is used to render content that is only visible to\n * screen readers.\n *\n * @example Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core/typography/SrOnly\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/sr-only | SrOnly Demos}\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly: focusable ? \"focusable\" : phoneOnly ? \"phone\" : true,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","undefined","srOnly"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAE1E,SAASC,QAAQ,QAAQ,iBAAiB;AA2B1C;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,MAAMC,uBAASF,WACpB,SAASE,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,qBACE,KAACO;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIK,SAAQ;QAC/CP,WAAWN,SAAS;YAClBc,QAAQN,YAAY,cAAcD,YAAY,UAAU;YACxDD;QACF;kBAECG;;AAGP,GACA"}
@@ -39,7 +39,7 @@ export interface TextContainerProps extends HTMLAttributes<HTMLDivElement>, Text
39
39
  * }
40
40
  * ```
41
41
  *
42
- * @see {@link https://next.react-md.dev/components/text-container | TextContainer Demos}
42
+ * @see {@link https://react-md.dev/components/text-container | TextContainer Demos}
43
43
  * @see {@link textContainer} If you only want to apply this class to an
44
44
  * element.
45
45
  * @since 6.0.0 Removed the `size` option since there is no longer a
@@ -26,7 +26,7 @@ import { textContainer } from "./textContainerStyles.js";
26
26
  * }
27
27
  * ```
28
28
  *
29
- * @see {@link https://next.react-md.dev/components/text-container | TextContainer Demos}
29
+ * @see {@link https://react-md.dev/components/text-container | TextContainer Demos}
30
30
  * @see {@link textContainer} If you only want to apply this class to an
31
31
  * element.
32
32
  * @since 6.0.0 Removed the `size` option since there is no longer a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type TextContainerClassNameOptions,\n textContainer,\n} from \"./textContainerStyles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-line-length\"?: string | number;\n \"--rmd-text-container-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextContainerClassNameOptions {}\n\n/**\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example Simple Example\n * ```tsx\n * import { TextContainer } from \"@react-md/core/typography/TextContainer\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/text-container | TextContainer Demos}\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport const TextContainer = forwardRef<HTMLDivElement, TextContainerProps>(\n function TextContainer(props, ref) {\n const { className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","textContainer","TextContainer","props","ref","className","children","remaining","div"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAEEC,aAAa,QACR,2BAA2B;AAmBlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,MAAMC,8BAAgBF,WAC3B,SAASE,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAE9C,qBACE,KAACK;QAAK,GAAGD,SAAS;QAAEH,KAAKA;QAAKC,WAAWJ,cAAc;YAAEI;QAAU;kBAChEC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type TextContainerClassNameOptions,\n textContainer,\n} from \"./textContainerStyles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-line-length\"?: string | number;\n \"--rmd-text-container-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextContainerClassNameOptions {}\n\n/**\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example Simple Example\n * ```tsx\n * import { TextContainer } from \"@react-md/core/typography/TextContainer\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-container | TextContainer Demos}\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport const TextContainer = forwardRef<HTMLDivElement, TextContainerProps>(\n function TextContainer(props, ref) {\n const { className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","textContainer","TextContainer","props","ref","className","children","remaining","div"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAEEC,aAAa,QACR,2BAA2B;AAmBlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,MAAMC,8BAAgBF,WAC3B,SAASE,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAE9C,qBACE,KAACK;QAAK,GAAGD,SAAS;QAAEH,KAAKA;QAAKC,WAAWJ,cAAc;YAAEI;QAAU;kBAChEC;;AAGP,GACA"}
@@ -79,7 +79,7 @@ export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>,
79
79
  * }
80
80
  * ```
81
81
  *
82
- * @see {@link https://next.react-md.dev/components/typography | Typography Demos}
82
+ * @see {@link https://react-md.dev/components/typography | Typography Demos}
83
83
  * @since 6.0.0 Removed the children render function behavior . Use the
84
84
  * `typography` class name utility instead.
85
85
  */
@@ -68,7 +68,7 @@ import { typography } from "./typographyStyles.js";
68
68
  * }
69
69
  * ```
70
70
  *
71
- * @see {@link https://next.react-md.dev/components/typography | Typography Demos}
71
+ * @see {@link https://react-md.dev/components/typography | Typography Demos}
72
72
  * @since 6.0.0 Removed the children render function behavior . Use the
73
73
  * `typography` class name utility instead.
74
74
  */ export const Typography = /*#__PURE__*/ forwardRef(function Typography(props, ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport {\n type TypographyClassNameOptions,\n type TypographyType,\n typography,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\n/**\n * @since 6.0.0 Renamed `component` to `as`.\n * @since 6.0.0 Removed the children render function behavior. Use the\n * `typography` class name utility instead.\n */\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>,\n TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n *\n * @since 6.0.0 Renamed from `component`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example All Example\n * ```tsx\n * import { Typography } from \"@react-md/core/typography/Typography\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/typography | Typography Demos}\n * @since 6.0.0 Removed the children render function behavior . Use the\n * `typography` class name utility instead.\n */\nexport const Typography = forwardRef<TypographyHTMLElement, TypographyProps>(\n function Typography(props, ref): ReactElement {\n const {\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","typography","getComponent","as","type","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAGEC,UAAU,QACL,wBAAwB;AAuB/B,cAAc,GACd,SAASC,aACPC,EAAyC,EACzCC,IAAoB;IAEpB,IAAID,IAAI;QACN,OAAOA;IACT;IAEA,OAAQC;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,MAAMC,2BAAaL,WACxB,SAASK,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJJ,EAAE,EACFC,OAAO,QAAQ,EACfI,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYjB,aAAaC,IAAIC;IACnC,qBACE,KAACe;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWP,WAAW;YACpBG;YACAK;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport {\n type TypographyClassNameOptions,\n type TypographyType,\n typography,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\n/**\n * @since 6.0.0 Renamed `component` to `as`.\n * @since 6.0.0 Removed the children render function behavior. Use the\n * `typography` class name utility instead.\n */\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>,\n TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n *\n * @since 6.0.0 Renamed from `component`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example All Example\n * ```tsx\n * import { Typography } from \"@react-md/core/typography/Typography\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/typography | Typography Demos}\n * @since 6.0.0 Removed the children render function behavior . Use the\n * `typography` class name utility instead.\n */\nexport const Typography = forwardRef<TypographyHTMLElement, TypographyProps>(\n function Typography(props, ref): ReactElement {\n const {\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","typography","getComponent","as","type","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAGEC,UAAU,QACL,wBAAwB;AAuB/B,cAAc,GACd,SAASC,aACPC,EAAyC,EACzCC,IAAoB;IAEpB,IAAID,IAAI;QACN,OAAOA;IACT;IAEA,OAAQC;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,MAAMC,2BAAaL,WACxB,SAASK,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJJ,EAAE,EACFC,OAAO,QAAQ,EACfI,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYjB,aAAaC,IAAIC;IACnC,qBACE,KAACe;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWP,WAAW;YACpBG;YACAK;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP,GACA"}
@@ -143,7 +143,7 @@ export declare const DEFAULT_WRITING_DIRECTION: () => Dir;
143
143
  * );
144
144
  * ```
145
145
  *
146
- * @see {@link https://next.react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}
146
+ * @see {@link https://react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}
147
147
  * @since 6.0.0 Renamed from `Dir`
148
148
  */
149
149
  export declare function WritingDirectionProvider(props: WritingDirectionProviderProps): ReactElement;
@@ -124,7 +124,7 @@ const { Provider } = context;
124
124
  * );
125
125
  * ```
126
126
  *
127
- * @see {@link https://next.react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}
127
+ * @see {@link https://react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}
128
128
  * @since 6.0.0 Renamed from `Dir`
129
129
  */ export function WritingDirectionProvider(props) {
130
130
  const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/WritingDirectionProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n type ReactElement,\n type ReactNode,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nimport { type UseStateInitializer } from \"../types.js\";\n\n/**\n * Note: unlike the `dir` DOM attribute, the `\"auto\"` value is not supported.\n *\n * @since 6.0.0\n */\nexport type Dir = \"ltr\" | \"rtl\";\n\n/** @since 6.0.0 */\nexport type DefaultDir = UseStateInitializer<Dir>;\n\n/** @since 2.3.0 */\nexport interface WritingDirectionContext {\n /**\n * The current writing direction that is being inherited.\n */\n dir: Dir;\n\n /**\n * Toggles the current writing direction for the first parent `Dir` component.\n */\n toggleDir: () => void;\n}\n\n/** @internal */\ninterface InheritableContext extends WritingDirectionContext {\n root: boolean;\n}\n\nconst context = createContext<InheritableContext>({\n root: true,\n dir: \"ltr\",\n toggleDir: () => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Tried to toggle the current writing direction without initializing the `Dir` component.\"\n );\n }\n },\n});\ncontext.displayName = \"WritingDirection\";\nconst { Provider } = context;\n\n/**\n * Gets the writing direction context which provides access to the current `dir`\n * and a `toggleDir` function.\n *\n * @example Manually Changing the Writing Direction\n * ```tsx\n * import { useDir } from \"@react-md/core/typography/WritingDirectionProvider\";\n *\n * function Example() {\n * const { dir, toggleDir } = useDir();\n *\n * return (\n * <>\n * <p>{`The current dir is: \"${dir}\"`}</p>\n * <button type=\"button\" onClick={toggleDir}>Toggle</button>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useDir(): Readonly<WritingDirectionContext> {\n const { root: _root, ...current } = useContext(context);\n return current;\n}\n\n/** @since 6.0.0 */\nexport interface WritingDirectionProviderProps {\n /**\n * A single ReactElement child. If the `WritingDirection` has a parent\n * `WritingDirection`, the child will have the `dir` prop cloned into this\n * element.\n */\n children: ReactElement<{ dir?: Dir }> | ReactNode;\n\n /**\n * The default writing direction for your app or a subtree. To change the\n * current writing direction, use the `useDir` hook to get access to the\n * current `dir` and the `toggleDir` function.\n *\n * @defaultValue `\"ltr\"`\n * @see {@link DEFAULT_WRITING_DIRECTION}\n */\n defaultDir?: DefaultDir;\n}\n\n/**\n * In the browser, this will default to the `<html>`'s `dir` value if one\n * exists. If the `dir` attribute does not exist, it will default to `\"ltr\"`.\n *\n * In node environments, this will default to `\"ltr\"`.\n *\n * @since 6.0.0 Renamed from `DEFAULT_DIR`\n */\nexport const DEFAULT_WRITING_DIRECTION = (): Dir => {\n let dir: Dir = \"ltr\";\n if (typeof document !== \"undefined\") {\n const rootDir = document.documentElement.getAttribute(\"dir\");\n dir = rootDir === \"rtl\" ? \"rtl\" : \"ltr\";\n }\n\n return dir;\n};\n\n/**\n * **Client Component**\n *\n * The `WritingDirection` component is used to handle the current writing\n * direction within your app as well as conditionally updating the writing\n * direction for small sections in your app. When this component is used for the\n * first time near the root of your React component tree, the current direction\n * will be applied to the root `<html>` element. Otherwise the current dir will\n * be cloned into the child element so it can be passed as a prop.\n *\n * Note: Since the `dir` is cloned into the child element, you need to make sure\n * that the child is either a DOM element or the `dir` prop is passed from your\n * custom component.\n *\n * @example Root Setup\n * ```tsx\n * import { WritingDirectionProvider } from \"@react-md/core/typography/WritingDirectionProvider\";\n * import { createRoot } from \"react-dom/client\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <WritingDirectionProvider>\n * <App />\n * </WritingDirectionProvider>\n * );\n * ```\n *\n * @example Supporting RTL Languages\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { type Dir, WritingDirectionProvider } from \"@react-md/core/typography/WritingDirectionProvider\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * // see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code\n * const SUPPORTED_RTL_LANGUAGES = [\n * \"ar\",\n * \"arc\",\n * \"ckb\",\n * \"dv\",\n * \"fa\",\n * \"ha\",\n * \"he\",\n * \"khw\",\n * \"ks\",\n * \"ps\",\n * \"sd\",\n * \"ur\",\n * \"uz_AF\",\n * \"ti\",\n * ];\n *\n * const defaultDir = (): Dir => {\n * if (SUPPORTED_RTL_LANGUAGES.includes(navigator.language)) {\n * return \"rtl\"\n * }\n *\n * return \"ltr\";\n * }\n *\n * root.render(\n * <WritingDirectionProvider defaultDir={defaultDir}>\n * <App />\n * </WritingDirectionProvider>\n * );\n * ```\n *\n * @see {@link https://next.react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}\n * @since 6.0.0 Renamed from `Dir`\n */\nexport function WritingDirectionProvider(\n props: WritingDirectionProviderProps\n): ReactElement {\n const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;\n const { root } = useContext(context);\n const [dir, setDir] = useState(defaultDir);\n useEffect(() => {\n if (!root || typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.setAttribute(\"dir\", dir);\n\n return () => {\n document.documentElement.removeAttribute(\"dir\");\n };\n }, [dir, root]);\n\n const toggleDir = useCallback(() => {\n setDir((prevDir) => (prevDir === \"ltr\" ? \"rtl\" : \"ltr\"));\n }, []);\n\n const value = useMemo<InheritableContext>(\n () => ({ root: false, dir, toggleDir }),\n [dir, toggleDir]\n );\n let child = Children.only(children);\n if (!root && isValidElement<{ dir: Dir }>(child)) {\n child = cloneElement(child, { dir });\n }\n\n return <Provider value={value}>{child}</Provider>;\n}\n"],"names":["Children","cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useState","context","root","dir","toggleDir","process","env","NODE_ENV","Error","displayName","Provider","useDir","_root","current","DEFAULT_WRITING_DIRECTION","document","rootDir","documentElement","getAttribute","WritingDirectionProvider","props","children","defaultDir","setDir","setAttribute","removeAttribute","prevDir","value","child","only"],"mappings":"AAAA;;AAEA,SACEA,QAAQ,EAGRC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAgCf,MAAMC,wBAAUP,cAAkC;IAChDQ,MAAM;IACNC,KAAK;IACLC,WAAW;QACT,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,IAAIC,MACR;QAEJ;IACF;AACF;AACAP,QAAQQ,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGT;AAErB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASU;IACd,MAAM,EAAET,MAAMU,KAAK,EAAE,GAAGC,SAAS,GAAGhB,WAAWI;IAC/C,OAAOY;AACT;AAsBA;;;;;;;CAOC,GACD,OAAO,MAAMC,4BAA4B;IACvC,IAAIX,MAAW;IACf,IAAI,OAAOY,aAAa,aAAa;QACnC,MAAMC,UAAUD,SAASE,eAAe,CAACC,YAAY,CAAC;QACtDf,MAAMa,YAAY,QAAQ,QAAQ;IACpC;IAEA,OAAOb;AACT,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EC,GACD,OAAO,SAASgB,yBACdC,KAAoC;IAEpC,MAAM,EAAEC,QAAQ,EAAEC,aAAaR,yBAAyB,EAAE,GAAGM;IAC7D,MAAM,EAAElB,IAAI,EAAE,GAAGL,WAAWI;IAC5B,MAAM,CAACE,KAAKoB,OAAO,GAAGvB,SAASsB;IAC/BxB,UAAU;QACR,IAAI,CAACI,QAAQ,OAAOa,aAAa,aAAa;YAC5C;QACF;QAEAA,SAASE,eAAe,CAACO,YAAY,CAAC,OAAOrB;QAE7C,OAAO;YACLY,SAASE,eAAe,CAACQ,eAAe,CAAC;QAC3C;IACF,GAAG;QAACtB;QAAKD;KAAK;IAEd,MAAME,YAAYR,YAAY;QAC5B2B,OAAO,CAACG,UAAaA,YAAY,QAAQ,QAAQ;IACnD,GAAG,EAAE;IAEL,MAAMC,QAAQ5B,QACZ,IAAO,CAAA;YAAEG,MAAM;YAAOC;YAAKC;QAAU,CAAA,GACrC;QAACD;QAAKC;KAAU;IAElB,IAAIwB,QAAQpC,SAASqC,IAAI,CAACR;IAC1B,IAAI,CAACnB,sBAAQP,eAA6BiC,QAAQ;QAChDA,sBAAQnC,aAAamC,OAAO;YAAEzB;QAAI;IACpC;IAEA,qBAAO,KAACO;QAASiB,OAAOA;kBAAQC;;AAClC"}
1
+ {"version":3,"sources":["../../src/typography/WritingDirectionProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n type ReactElement,\n type ReactNode,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nimport { type UseStateInitializer } from \"../types.js\";\n\n/**\n * Note: unlike the `dir` DOM attribute, the `\"auto\"` value is not supported.\n *\n * @since 6.0.0\n */\nexport type Dir = \"ltr\" | \"rtl\";\n\n/** @since 6.0.0 */\nexport type DefaultDir = UseStateInitializer<Dir>;\n\n/** @since 2.3.0 */\nexport interface WritingDirectionContext {\n /**\n * The current writing direction that is being inherited.\n */\n dir: Dir;\n\n /**\n * Toggles the current writing direction for the first parent `Dir` component.\n */\n toggleDir: () => void;\n}\n\n/** @internal */\ninterface InheritableContext extends WritingDirectionContext {\n root: boolean;\n}\n\nconst context = createContext<InheritableContext>({\n root: true,\n dir: \"ltr\",\n toggleDir: () => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Tried to toggle the current writing direction without initializing the `Dir` component.\"\n );\n }\n },\n});\ncontext.displayName = \"WritingDirection\";\nconst { Provider } = context;\n\n/**\n * Gets the writing direction context which provides access to the current `dir`\n * and a `toggleDir` function.\n *\n * @example Manually Changing the Writing Direction\n * ```tsx\n * import { useDir } from \"@react-md/core/typography/WritingDirectionProvider\";\n *\n * function Example() {\n * const { dir, toggleDir } = useDir();\n *\n * return (\n * <>\n * <p>{`The current dir is: \"${dir}\"`}</p>\n * <button type=\"button\" onClick={toggleDir}>Toggle</button>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useDir(): Readonly<WritingDirectionContext> {\n const { root: _root, ...current } = useContext(context);\n return current;\n}\n\n/** @since 6.0.0 */\nexport interface WritingDirectionProviderProps {\n /**\n * A single ReactElement child. If the `WritingDirection` has a parent\n * `WritingDirection`, the child will have the `dir` prop cloned into this\n * element.\n */\n children: ReactElement<{ dir?: Dir }> | ReactNode;\n\n /**\n * The default writing direction for your app or a subtree. To change the\n * current writing direction, use the `useDir` hook to get access to the\n * current `dir` and the `toggleDir` function.\n *\n * @defaultValue `\"ltr\"`\n * @see {@link DEFAULT_WRITING_DIRECTION}\n */\n defaultDir?: DefaultDir;\n}\n\n/**\n * In the browser, this will default to the `<html>`'s `dir` value if one\n * exists. If the `dir` attribute does not exist, it will default to `\"ltr\"`.\n *\n * In node environments, this will default to `\"ltr\"`.\n *\n * @since 6.0.0 Renamed from `DEFAULT_DIR`\n */\nexport const DEFAULT_WRITING_DIRECTION = (): Dir => {\n let dir: Dir = \"ltr\";\n if (typeof document !== \"undefined\") {\n const rootDir = document.documentElement.getAttribute(\"dir\");\n dir = rootDir === \"rtl\" ? \"rtl\" : \"ltr\";\n }\n\n return dir;\n};\n\n/**\n * **Client Component**\n *\n * The `WritingDirection` component is used to handle the current writing\n * direction within your app as well as conditionally updating the writing\n * direction for small sections in your app. When this component is used for the\n * first time near the root of your React component tree, the current direction\n * will be applied to the root `<html>` element. Otherwise the current dir will\n * be cloned into the child element so it can be passed as a prop.\n *\n * Note: Since the `dir` is cloned into the child element, you need to make sure\n * that the child is either a DOM element or the `dir` prop is passed from your\n * custom component.\n *\n * @example Root Setup\n * ```tsx\n * import { WritingDirectionProvider } from \"@react-md/core/typography/WritingDirectionProvider\";\n * import { createRoot } from \"react-dom/client\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <WritingDirectionProvider>\n * <App />\n * </WritingDirectionProvider>\n * );\n * ```\n *\n * @example Supporting RTL Languages\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { type Dir, WritingDirectionProvider } from \"@react-md/core/typography/WritingDirectionProvider\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * // see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code\n * const SUPPORTED_RTL_LANGUAGES = [\n * \"ar\",\n * \"arc\",\n * \"ckb\",\n * \"dv\",\n * \"fa\",\n * \"ha\",\n * \"he\",\n * \"khw\",\n * \"ks\",\n * \"ps\",\n * \"sd\",\n * \"ur\",\n * \"uz_AF\",\n * \"ti\",\n * ];\n *\n * const defaultDir = (): Dir => {\n * if (SUPPORTED_RTL_LANGUAGES.includes(navigator.language)) {\n * return \"rtl\"\n * }\n *\n * return \"ltr\";\n * }\n *\n * root.render(\n * <WritingDirectionProvider defaultDir={defaultDir}>\n * <App />\n * </WritingDirectionProvider>\n * );\n * ```\n *\n * @see {@link https://react-md.dev/components/writing-direction-provider | WritingDirectionProvider Demos}\n * @since 6.0.0 Renamed from `Dir`\n */\nexport function WritingDirectionProvider(\n props: WritingDirectionProviderProps\n): ReactElement {\n const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;\n const { root } = useContext(context);\n const [dir, setDir] = useState(defaultDir);\n useEffect(() => {\n if (!root || typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.setAttribute(\"dir\", dir);\n\n return () => {\n document.documentElement.removeAttribute(\"dir\");\n };\n }, [dir, root]);\n\n const toggleDir = useCallback(() => {\n setDir((prevDir) => (prevDir === \"ltr\" ? \"rtl\" : \"ltr\"));\n }, []);\n\n const value = useMemo<InheritableContext>(\n () => ({ root: false, dir, toggleDir }),\n [dir, toggleDir]\n );\n let child = Children.only(children);\n if (!root && isValidElement<{ dir: Dir }>(child)) {\n child = cloneElement(child, { dir });\n }\n\n return <Provider value={value}>{child}</Provider>;\n}\n"],"names":["Children","cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useState","context","root","dir","toggleDir","process","env","NODE_ENV","Error","displayName","Provider","useDir","_root","current","DEFAULT_WRITING_DIRECTION","document","rootDir","documentElement","getAttribute","WritingDirectionProvider","props","children","defaultDir","setDir","setAttribute","removeAttribute","prevDir","value","child","only"],"mappings":"AAAA;;AAEA,SACEA,QAAQ,EAGRC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAgCf,MAAMC,wBAAUP,cAAkC;IAChDQ,MAAM;IACNC,KAAK;IACLC,WAAW;QACT,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,IAAIC,MACR;QAEJ;IACF;AACF;AACAP,QAAQQ,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGT;AAErB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASU;IACd,MAAM,EAAET,MAAMU,KAAK,EAAE,GAAGC,SAAS,GAAGhB,WAAWI;IAC/C,OAAOY;AACT;AAsBA;;;;;;;CAOC,GACD,OAAO,MAAMC,4BAA4B;IACvC,IAAIX,MAAW;IACf,IAAI,OAAOY,aAAa,aAAa;QACnC,MAAMC,UAAUD,SAASE,eAAe,CAACC,YAAY,CAAC;QACtDf,MAAMa,YAAY,QAAQ,QAAQ;IACpC;IAEA,OAAOb;AACT,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EC,GACD,OAAO,SAASgB,yBACdC,KAAoC;IAEpC,MAAM,EAAEC,QAAQ,EAAEC,aAAaR,yBAAyB,EAAE,GAAGM;IAC7D,MAAM,EAAElB,IAAI,EAAE,GAAGL,WAAWI;IAC5B,MAAM,CAACE,KAAKoB,OAAO,GAAGvB,SAASsB;IAC/BxB,UAAU;QACR,IAAI,CAACI,QAAQ,OAAOa,aAAa,aAAa;YAC5C;QACF;QAEAA,SAASE,eAAe,CAACO,YAAY,CAAC,OAAOrB;QAE7C,OAAO;YACLY,SAASE,eAAe,CAACQ,eAAe,CAAC;QAC3C;IACF,GAAG;QAACtB;QAAKD;KAAK;IAEd,MAAME,YAAYR,YAAY;QAC5B2B,OAAO,CAACG,UAAaA,YAAY,QAAQ,QAAQ;IACnD,GAAG,EAAE;IAEL,MAAMC,QAAQ5B,QACZ,IAAO,CAAA;YAAEG,MAAM;YAAOC;YAAKC;QAAU,CAAA,GACrC;QAACD;QAAKC;KAAU;IAElB,IAAIwB,QAAQpC,SAASqC,IAAI,CAACR;IAC1B,IAAI,CAACnB,sBAAQP,eAA6BiC,QAAQ;QAChDA,sBAAQnC,aAAamC,OAAO;YAAEzB;QAAI;IACpC;IAEA,qBAAO,KAACO;QAASiB,OAAOA;kBAAQC;;AAClC"}
@@ -5,6 +5,7 @@ import type { UseStateInitializer, UseStateSetter } from "./types.js";
5
5
  * @since 6.0.0
6
6
  */
7
7
  export interface EnsuredStateOptions<V, Setter extends Dispatch<V> | UseStateSetter<V> = UseStateSetter<V>> {
8
+ name?: string;
8
9
  value?: V;
9
10
  setValue?: Setter;
10
11
  defaultValue?: UseStateInitializer<V>;
@@ -6,7 +6,7 @@
6
6
  * @internal
7
7
  * @since 6.0.0
8
8
  */ export function useEnsuredState(options) {
9
- const { value, setValue, defaultValue } = options;
9
+ const { name = "value", value, setValue, defaultValue } = options;
10
10
  if (typeof value !== "undefined" && typeof setValue !== "undefined") {
11
11
  return [
12
12
  value,
@@ -14,10 +14,12 @@
14
14
  ];
15
15
  }
16
16
  if (typeof value !== "undefined" || typeof setValue !== "undefined") {
17
- throw new Error("Both a `value` and `setValue` must be defined for controlled components.");
17
+ const pascalName = name.charAt(0).toUpperCase() + name.substring(1);
18
+ throw new Error(`Both a \`${name}\` and \`set${pascalName}\` must be defined for controlled components.`);
18
19
  }
19
20
  if (typeof defaultValue === "undefined") {
20
- throw new Error("A `defaultValue` must be defined for uncontrolled components.");
21
+ const pascalName = name.charAt(0).toUpperCase() + name.substring(1);
22
+ throw new Error(`A \`default${pascalName}\` must be defined for uncontrolled components.`);
21
23
  }
22
24
  return useState(defaultValue);
23
25
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useEnsuredState.ts"],"sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport type { Dispatch } from \"react\";\nimport { useState } from \"react\";\n\nimport type { UseStateInitializer, UseStateSetter } from \"./types.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface EnsuredStateOptions<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V> = UseStateSetter<V>,\n> {\n value?: V;\n setValue?: Setter;\n defaultValue?: UseStateInitializer<V>;\n}\n\n/**\n * This is used to dynamically allow controlling hooks by providing a `value` +\n * `setValue` or defaulting to uncontrolled behavior with local state.\n *\n * @internal\n * @since 6.0.0\n */\nexport function useEnsuredState<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V>,\n>(\n options: EnsuredStateOptions<V, Setter>\n): readonly [value: V, setValue: Setter] {\n const { value, setValue, defaultValue } = options;\n if (typeof value !== \"undefined\" && typeof setValue !== \"undefined\") {\n return [value, setValue];\n }\n\n if (typeof value !== \"undefined\" || typeof setValue !== \"undefined\") {\n throw new Error(\n \"Both a `value` and `setValue` must be defined for controlled components.\"\n );\n }\n\n if (typeof defaultValue === \"undefined\") {\n throw new Error(\n \"A `defaultValue` must be defined for uncontrolled components.\"\n );\n }\n\n return useState(defaultValue) as [value: V, setValue: Setter];\n}\n"],"names":["useState","useEnsuredState","options","value","setValue","defaultValue","Error"],"mappings":"AAAA,6CAA6C,GAE7C,SAASA,QAAQ,QAAQ,QAAQ;AAiBjC;;;;;;CAMC,GACD,OAAO,SAASC,gBAIdC,OAAuC;IAEvC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGH;IAC1C,IAAI,OAAOC,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,OAAO;YAACD;YAAOC;SAAS;IAC1B;IAEA,IAAI,OAAOD,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,MAAM,IAAIE,MACR;IAEJ;IAEA,IAAI,OAAOD,iBAAiB,aAAa;QACvC,MAAM,IAAIC,MACR;IAEJ;IAEA,OAAON,SAASK;AAClB"}
1
+ {"version":3,"sources":["../src/useEnsuredState.ts"],"sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport type { Dispatch } from \"react\";\nimport { useState } from \"react\";\n\nimport type { UseStateInitializer, UseStateSetter } from \"./types.js\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface EnsuredStateOptions<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V> = UseStateSetter<V>,\n> {\n name?: string;\n value?: V;\n setValue?: Setter;\n defaultValue?: UseStateInitializer<V>;\n}\n\n/**\n * This is used to dynamically allow controlling hooks by providing a `value` +\n * `setValue` or defaulting to uncontrolled behavior with local state.\n *\n * @internal\n * @since 6.0.0\n */\nexport function useEnsuredState<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V>,\n>(\n options: EnsuredStateOptions<V, Setter>\n): readonly [value: V, setValue: Setter] {\n const { name = \"value\", value, setValue, defaultValue } = options;\n if (typeof value !== \"undefined\" && typeof setValue !== \"undefined\") {\n return [value, setValue];\n }\n\n if (typeof value !== \"undefined\" || typeof setValue !== \"undefined\") {\n const pascalName = name.charAt(0).toUpperCase() + name.substring(1);\n throw new Error(\n `Both a \\`${name}\\` and \\`set${pascalName}\\` must be defined for controlled components.`\n );\n }\n\n if (typeof defaultValue === \"undefined\") {\n const pascalName = name.charAt(0).toUpperCase() + name.substring(1);\n throw new Error(\n `A \\`default${pascalName}\\` must be defined for uncontrolled components.`\n );\n }\n\n return useState(defaultValue) as [value: V, setValue: Setter];\n}\n"],"names":["useState","useEnsuredState","options","name","value","setValue","defaultValue","pascalName","charAt","toUpperCase","substring","Error"],"mappings":"AAAA,6CAA6C,GAE7C,SAASA,QAAQ,QAAQ,QAAQ;AAkBjC;;;;;;CAMC,GACD,OAAO,SAASC,gBAIdC,OAAuC;IAEvC,MAAM,EAAEC,OAAO,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGJ;IAC1D,IAAI,OAAOE,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,OAAO;YAACD;YAAOC;SAAS;IAC1B;IAEA,IAAI,OAAOD,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,MAAME,aAAaJ,KAAKK,MAAM,CAAC,GAAGC,WAAW,KAAKN,KAAKO,SAAS,CAAC;QACjE,MAAM,IAAIC,MACR,CAAC,SAAS,EAAER,KAAK,YAAY,EAAEI,WAAW,6CAA6C,CAAC;IAE5F;IAEA,IAAI,OAAOD,iBAAiB,aAAa;QACvC,MAAMC,aAAaJ,KAAKK,MAAM,CAAC,GAAGC,WAAW,KAAKN,KAAKO,SAAS,CAAC;QACjE,MAAM,IAAIC,MACR,CAAC,WAAW,EAAEJ,WAAW,+CAA+C,CAAC;IAE7E;IAEA,OAAOP,SAASM;AAClB"}
@@ -219,7 +219,7 @@ export interface RenderRecursivelyProps<Item = Record<string, unknown>, Data = u
219
219
  * }
220
220
  * ```
221
221
  *
222
- * @see {@link https://next.react-md.dev/components/render-recursively | RenderRecursively Demos}
222
+ * @see {@link https://react-md.dev/components/render-recursively | RenderRecursively Demos}
223
223
  * @since 6.0.0
224
224
  */
225
225
  export declare function RenderRecursively<Item, Data>(props: RenderRecursivelyProps<Item, Data>): ReactElement;
@@ -156,7 +156,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
156
156
  * }
157
157
  * ```
158
158
  *
159
- * @see {@link https://next.react-md.dev/components/render-recursively | RenderRecursively Demos}
159
+ * @see {@link https://react-md.dev/components/render-recursively | RenderRecursively Demos}
160
160
  * @since 6.0.0
161
161
  */ export function RenderRecursively(props) {
162
162
  const { data, items, render: Render, getItemKey = getRecursiveItemKey, parents = [] } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/RenderRecursively.tsx"],"sourcesContent":["// TODO: Figure out how to strictly enforce the data\nimport { type ComponentType, type ReactElement, type ReactNode } from \"react\";\n\n/**\n * @since 6.0.0\n */\nexport type RecursiveItem<T = Record<string, unknown>> = T & {\n items?: readonly RecursiveItem<T>[];\n};\n\n/**\n * @since 6.0.0\n */\nexport interface RecursiveItemKeyOptions<Item = Record<string, unknown>> {\n item: RecursiveItem<Item>;\n depth: number;\n index: number;\n}\n\n/**\n * This is the default implementation for {@link RenderRecursivelyProps.getItemKey}.\n *\n * ```ts\n * return `${options.depth}-${options.index}`\n * ```\n *\n * @since 6.0.0\n */\nexport function getRecursiveItemKey<Item = Record<string, unknown>>(\n options: RecursiveItemKeyOptions<Item>\n): string {\n const { depth, index } = options;\n\n return `${depth}-${index}`;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface RenderRecursiveItemsProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n\n /**\n * The current item to render.\n */\n item: RecursiveItem<Item>;\n\n /**\n * The list of parent items which can be used to determine the depth or \"share\n * props\" if the items contained props.\n */\n parents: readonly RecursiveItem<Item>[];\n\n /**\n * This will be provided if the {@link item} had child items and will be the\n * rendered content.\n */\n children?: ReactNode;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface RenderRecursivelyProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n items: readonly RecursiveItem<Item>[];\n\n /**\n * The renderer for each item.\n */\n render: ComponentType<RenderRecursiveItemsProps<Item, Data>>;\n\n /**\n * This should not be used for external users. This is used to build the\n * {@link RenderRecursiveItemsProps.parents} list.\n *\n * @internal\n * @defaultValue `[]`\n */\n parents?: readonly RecursiveItem<Item>[];\n\n /**\n * Gets a React `key` for a specific item. This should be provided if the\n * items can be moved around to improve performance.\n *\n * @example\n * ```ts\n * getItemKey={({ item }) => item.id}\n * ```\n *\n * @see {@link getRecursiveItemKey}\n * @defaultValue `` ({ index, depth }) => `${depth}-${index}` ``\n */\n getItemKey?: (options: RecursiveItemKeyOptions<Item>) => string;\n}\n\n/**\n * Helper component for recursively rendering specific data structures (mostly\n * trees). The main use-case is for rendering site navigation and the `Tree`\n * component.\n *\n * @example\n * ```tsx\n * \"use client\";\n *\n * import { Box } from \"@react-md/core/box/Box\";\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Divider } from \"@react-md/core/divider/Divider\";\n * import { List } from \"@react-md/core/list/List\";\n * import { useCollapseTransition } from \"@react-md/core/transition/useCollapseTransition\";\n * import {\n * type DefaultTreeItemNode,\n * type TreeData,\n * } from \"@react-md/core/tree/types\";\n * import { type UseStateSetter } from \"@react-md/core/types\";\n * import { useToggle } from \"@react-md/core/useToggle\";\n * import {\n * type RenderRecursiveItemsProps,\n * RenderRecursively,\n * } from \"@react-md/core/utils/RenderRecursively\";\n * import { type ReactElement, useState } from \"react\";\n *\n * interface Data {\n * activeId: string;\n * setActiveId: UseStateSetter<string>;\n * }\n *\n * export default function SimpleExample(): ReactElement {\n * const [activeId, setActiveId] = useState(\"/\");\n * return (\n * <Box fullWidth disableWrap>\n * <Box stacked align=\"stretch\">\n * <RenderRecursively\n * // this is optional and can be any sort of info\n * data={{ activeId, setActiveId }}\n * items={Object.values(navItems)}\n * render={Render}\n * />\n * </Box>\n * <div>Active route: {activeId}</div>\n * </Box>\n * );\n * }\n *\n * const navItems = {\n * \"/\": {\n * href: \"/\",\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Collapsible\",\n * },\n * \"/nested-route-1\": {\n * itemId: \"/nested-route-1\",\n * parentId: \"/route-1\",\n * children: \"Child 1\",\n * },\n * \"/nested-route-2\": {\n * itemId: \"/nested-route-2\",\n * parentId: \"/route-2\",\n * children: \"Child 2\",\n * },\n * \"/divider-1\": {\n * itemId: \"/divider-1\",\n * parentId: null,\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * },\n * } satisfies TreeData;\n *\n * function Render(\n * props: RenderRecursiveItemsProps<DefaultTreeItemNode, Data>\n * ): ReactElement {\n * const {\n * item,\n * parents,\n * // this is passed down from the root `RenderRecursively`\n * data,\n * // this _might_ be defined based on the implementation. it's set to any\n * // renderable element\n * children: _children,\n * } = props;\n * if (item.itemId.includes(\"divider\")) {\n * return <Divider />;\n * }\n *\n * if (item.items) {\n * return <NestedNavigation {...props} />;\n * }\n *\n * const prefix = parents.map((parent) => parent.itemId).join(\"/\");\n * const currentId = `${prefix}${item.itemId}`;\n * // I haven't figured out how to manage the type safety of this yet\n * const active = data?.activeId === currentId;\n * // this would normally be a link, but to keep the demo simple, it's a button\n * return (\n * <Button\n * theme={active ? \"primary\" : \"clear\"}\n * themeType={active ? \"contained\" : \"flat\"}\n * onClick={() => {\n * data?.setActiveId(currentId);\n * }}\n * style={{ justifyContent: \"flex-start\" }}\n * >\n * {item.children}\n * </Button>\n * );\n * }\n *\n * function NestedNavigation(\n * props: RenderRecursiveItemsProps<DefaultTreeItemNode, Data>\n * ): ReactElement {\n * const {\n * item,\n * parents: _parents,\n * // this is passed down from the root `RenderRecursively`\n * data: _data,\n * children,\n * } = props;\n * const { toggle, toggled: collapsed } = useToggle(false);\n * const { elementProps } = useCollapseTransition({\n * transitionIn: !collapsed,\n * });\n *\n * return (\n * <li>\n * <Button onClick={toggle}>{item.children}</Button>\n * <List {...elementProps}>{children}</List>\n * </li>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/render-recursively | RenderRecursively Demos}\n * @since 6.0.0\n */\nexport function RenderRecursively<Item, Data>(\n props: RenderRecursivelyProps<Item, Data>\n): ReactElement {\n const {\n data,\n items,\n render: Render,\n getItemKey = getRecursiveItemKey,\n parents = [],\n } = props;\n\n return (\n <>\n {items.map((item, index) => {\n let children: ReactNode;\n const depth = parents.length;\n if (item.items?.length) {\n children = (\n <RenderRecursively\n data={data}\n items={item.items}\n render={Render}\n getItemKey={getItemKey}\n parents={[...parents, item]}\n />\n );\n }\n\n return (\n <Render\n key={getItemKey({ item, depth, index })}\n // typecast since it should be undefined in renderer as well?\n data={data}\n item={item}\n parents={parents}\n >\n {children}\n </Render>\n );\n })}\n </>\n );\n}\n"],"names":["getRecursiveItemKey","options","depth","index","RenderRecursively","props","data","items","render","Render","getItemKey","parents","map","item","children","length"],"mappings":"AAAA,oDAAoD;;AAmBpD;;;;;;;;CAQC,GACD,OAAO,SAASA,oBACdC,OAAsC;IAEtC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;IAEzB,OAAO,GAAGC,MAAM,CAAC,EAAEC,OAAO;AAC5B;AAoEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJC,GACD,OAAO,SAASC,kBACdC,KAAyC;IAEzC,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,QAAQC,MAAM,EACdC,aAAaV,mBAAmB,EAChCW,UAAU,EAAE,EACb,GAAGN;IAEJ,qBACE;kBACGE,MAAMK,GAAG,CAAC,CAACC,MAAMV;YAChB,IAAIW;YACJ,MAAMZ,QAAQS,QAAQI,MAAM;YAC5B,IAAIF,KAAKN,KAAK,EAAEQ,QAAQ;gBACtBD,yBACE,KAACV;oBACCE,MAAMA;oBACNC,OAAOM,KAAKN,KAAK;oBACjBC,QAAQC;oBACRC,YAAYA;oBACZC,SAAS;2BAAIA;wBAASE;qBAAK;;YAGjC;YAEA,qBACE,KAACJ;gBAEC,6DAA6D;gBAC7DH,MAAMA;gBACNO,MAAMA;gBACNF,SAASA;0BAERG;eANIJ,WAAW;gBAAEG;gBAAMX;gBAAOC;YAAM;QAS3C;;AAGN"}
1
+ {"version":3,"sources":["../../src/utils/RenderRecursively.tsx"],"sourcesContent":["// TODO: Figure out how to strictly enforce the data\nimport { type ComponentType, type ReactElement, type ReactNode } from \"react\";\n\n/**\n * @since 6.0.0\n */\nexport type RecursiveItem<T = Record<string, unknown>> = T & {\n items?: readonly RecursiveItem<T>[];\n};\n\n/**\n * @since 6.0.0\n */\nexport interface RecursiveItemKeyOptions<Item = Record<string, unknown>> {\n item: RecursiveItem<Item>;\n depth: number;\n index: number;\n}\n\n/**\n * This is the default implementation for {@link RenderRecursivelyProps.getItemKey}.\n *\n * ```ts\n * return `${options.depth}-${options.index}`\n * ```\n *\n * @since 6.0.0\n */\nexport function getRecursiveItemKey<Item = Record<string, unknown>>(\n options: RecursiveItemKeyOptions<Item>\n): string {\n const { depth, index } = options;\n\n return `${depth}-${index}`;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface RenderRecursiveItemsProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n\n /**\n * The current item to render.\n */\n item: RecursiveItem<Item>;\n\n /**\n * The list of parent items which can be used to determine the depth or \"share\n * props\" if the items contained props.\n */\n parents: readonly RecursiveItem<Item>[];\n\n /**\n * This will be provided if the {@link item} had child items and will be the\n * rendered content.\n */\n children?: ReactNode;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface RenderRecursivelyProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n items: readonly RecursiveItem<Item>[];\n\n /**\n * The renderer for each item.\n */\n render: ComponentType<RenderRecursiveItemsProps<Item, Data>>;\n\n /**\n * This should not be used for external users. This is used to build the\n * {@link RenderRecursiveItemsProps.parents} list.\n *\n * @internal\n * @defaultValue `[]`\n */\n parents?: readonly RecursiveItem<Item>[];\n\n /**\n * Gets a React `key` for a specific item. This should be provided if the\n * items can be moved around to improve performance.\n *\n * @example\n * ```ts\n * getItemKey={({ item }) => item.id}\n * ```\n *\n * @see {@link getRecursiveItemKey}\n * @defaultValue `` ({ index, depth }) => `${depth}-${index}` ``\n */\n getItemKey?: (options: RecursiveItemKeyOptions<Item>) => string;\n}\n\n/**\n * Helper component for recursively rendering specific data structures (mostly\n * trees). The main use-case is for rendering site navigation and the `Tree`\n * component.\n *\n * @example\n * ```tsx\n * \"use client\";\n *\n * import { Box } from \"@react-md/core/box/Box\";\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Divider } from \"@react-md/core/divider/Divider\";\n * import { List } from \"@react-md/core/list/List\";\n * import { useCollapseTransition } from \"@react-md/core/transition/useCollapseTransition\";\n * import {\n * type DefaultTreeItemNode,\n * type TreeData,\n * } from \"@react-md/core/tree/types\";\n * import { type UseStateSetter } from \"@react-md/core/types\";\n * import { useToggle } from \"@react-md/core/useToggle\";\n * import {\n * type RenderRecursiveItemsProps,\n * RenderRecursively,\n * } from \"@react-md/core/utils/RenderRecursively\";\n * import { type ReactElement, useState } from \"react\";\n *\n * interface Data {\n * activeId: string;\n * setActiveId: UseStateSetter<string>;\n * }\n *\n * export default function SimpleExample(): ReactElement {\n * const [activeId, setActiveId] = useState(\"/\");\n * return (\n * <Box fullWidth disableWrap>\n * <Box stacked align=\"stretch\">\n * <RenderRecursively\n * // this is optional and can be any sort of info\n * data={{ activeId, setActiveId }}\n * items={Object.values(navItems)}\n * render={Render}\n * />\n * </Box>\n * <div>Active route: {activeId}</div>\n * </Box>\n * );\n * }\n *\n * const navItems = {\n * \"/\": {\n * href: \"/\",\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Collapsible\",\n * },\n * \"/nested-route-1\": {\n * itemId: \"/nested-route-1\",\n * parentId: \"/route-1\",\n * children: \"Child 1\",\n * },\n * \"/nested-route-2\": {\n * itemId: \"/nested-route-2\",\n * parentId: \"/route-2\",\n * children: \"Child 2\",\n * },\n * \"/divider-1\": {\n * itemId: \"/divider-1\",\n * parentId: null,\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * },\n * } satisfies TreeData;\n *\n * function Render(\n * props: RenderRecursiveItemsProps<DefaultTreeItemNode, Data>\n * ): ReactElement {\n * const {\n * item,\n * parents,\n * // this is passed down from the root `RenderRecursively`\n * data,\n * // this _might_ be defined based on the implementation. it's set to any\n * // renderable element\n * children: _children,\n * } = props;\n * if (item.itemId.includes(\"divider\")) {\n * return <Divider />;\n * }\n *\n * if (item.items) {\n * return <NestedNavigation {...props} />;\n * }\n *\n * const prefix = parents.map((parent) => parent.itemId).join(\"/\");\n * const currentId = `${prefix}${item.itemId}`;\n * // I haven't figured out how to manage the type safety of this yet\n * const active = data?.activeId === currentId;\n * // this would normally be a link, but to keep the demo simple, it's a button\n * return (\n * <Button\n * theme={active ? \"primary\" : \"clear\"}\n * themeType={active ? \"contained\" : \"flat\"}\n * onClick={() => {\n * data?.setActiveId(currentId);\n * }}\n * style={{ justifyContent: \"flex-start\" }}\n * >\n * {item.children}\n * </Button>\n * );\n * }\n *\n * function NestedNavigation(\n * props: RenderRecursiveItemsProps<DefaultTreeItemNode, Data>\n * ): ReactElement {\n * const {\n * item,\n * parents: _parents,\n * // this is passed down from the root `RenderRecursively`\n * data: _data,\n * children,\n * } = props;\n * const { toggle, toggled: collapsed } = useToggle(false);\n * const { elementProps } = useCollapseTransition({\n * transitionIn: !collapsed,\n * });\n *\n * return (\n * <li>\n * <Button onClick={toggle}>{item.children}</Button>\n * <List {...elementProps}>{children}</List>\n * </li>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/render-recursively | RenderRecursively Demos}\n * @since 6.0.0\n */\nexport function RenderRecursively<Item, Data>(\n props: RenderRecursivelyProps<Item, Data>\n): ReactElement {\n const {\n data,\n items,\n render: Render,\n getItemKey = getRecursiveItemKey,\n parents = [],\n } = props;\n\n return (\n <>\n {items.map((item, index) => {\n let children: ReactNode;\n const depth = parents.length;\n if (item.items?.length) {\n children = (\n <RenderRecursively\n data={data}\n items={item.items}\n render={Render}\n getItemKey={getItemKey}\n parents={[...parents, item]}\n />\n );\n }\n\n return (\n <Render\n key={getItemKey({ item, depth, index })}\n // typecast since it should be undefined in renderer as well?\n data={data}\n item={item}\n parents={parents}\n >\n {children}\n </Render>\n );\n })}\n </>\n );\n}\n"],"names":["getRecursiveItemKey","options","depth","index","RenderRecursively","props","data","items","render","Render","getItemKey","parents","map","item","children","length"],"mappings":"AAAA,oDAAoD;;AAmBpD;;;;;;;;CAQC,GACD,OAAO,SAASA,oBACdC,OAAsC;IAEtC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;IAEzB,OAAO,GAAGC,MAAM,CAAC,EAAEC,OAAO;AAC5B;AAoEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJC,GACD,OAAO,SAASC,kBACdC,KAAyC;IAEzC,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,QAAQC,MAAM,EACdC,aAAaV,mBAAmB,EAChCW,UAAU,EAAE,EACb,GAAGN;IAEJ,qBACE;kBACGE,MAAMK,GAAG,CAAC,CAACC,MAAMV;YAChB,IAAIW;YACJ,MAAMZ,QAAQS,QAAQI,MAAM;YAC5B,IAAIF,KAAKN,KAAK,EAAEQ,QAAQ;gBACtBD,yBACE,KAACV;oBACCE,MAAMA;oBACNC,OAAOM,KAAKN,KAAK;oBACjBC,QAAQC;oBACRC,YAAYA;oBACZC,SAAS;2BAAIA;wBAASE;qBAAK;;YAGjC;YAEA,qBACE,KAACJ;gBAEC,6DAA6D;gBAC7DH,MAAMA;gBACNO,MAAMA;gBACNF,SAASA;0BAERG;eANIJ,WAAW;gBAAEG;gBAAMX;gBAAOC;YAAM;QAS3C;;AAGN"}
package/dist/utils/bem.js CHANGED
@@ -5,7 +5,7 @@ function modify(base, modifier) {
5
5
  const hasOwn = Object.prototype.hasOwnProperty;
6
6
  return Object.keys(modifier).reduce((s, mod)=>{
7
7
  if (hasOwn.call(modifier, mod) && modifier[mod]) {
8
- s = `${s} ${base}--${mod}`;
8
+ return `${s} ${base}--${mod}`;
9
9
  }
10
10
  return s;
11
11
  }, base);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/bem.ts"],"sourcesContent":["export type BEMModifier = Record<string, unknown>;\n\nfunction modify(base: string, modifier?: BEMModifier): string {\n if (!modifier) {\n return base;\n }\n\n const hasOwn = Object.prototype.hasOwnProperty;\n return Object.keys(modifier).reduce((s, mod) => {\n if (hasOwn.call(modifier, mod) && modifier[mod]) {\n s = `${s} ${base}--${mod}`;\n }\n\n return s;\n }, base);\n}\n\n/**\n * Creates the full class name from the base block name. This can be called\n * without any arguments which will just return the base block name (kind of\n * worthless), or you can provide a child element name and modifiers.\n *\n * @since 6.0.0 Converted to an interface that supports the `base` attribute.\n */\nexport interface BEMResult {\n /**\n * @example Simple Example\n * ```ts\n * const styles = bem(\"root\");\n *\n * styles(\"child\"); // \"root__child\"\n * styles(\"child\", {\n * modifier1: true,\n * modifier2: false,\n * }); // \"root__child root__child--modifier-1\"\n * ```\n * @param element - The child element to be prefixed before any modifiers.\n * @param modifier - Any optional modifiers to apply to the block and optional\n * element.\n * @returns the full class name\n */\n (element: string, modifier?: BEMModifier): string;\n\n /**\n * @example Simple Example\n * ```ts\n * const styles = bem(\"root\");\n *\n * styles() // \"root\"\n * styles({\n * modifier1: true,\n * modifier2: false,\n * }); // \"root--modifier-1\"\n * ```\n * @param modifier - Any optional modifiers to apply to the block and optional\n * element.\n * @returns the full class name\n */\n (modifier?: BEMModifier): string;\n\n /**\n * The base class name\n */\n base: string;\n}\n\n/**\n * Applies the BEM styled class name to an element.\n *\n * @example Simple Example\n * ```tsx\n * import { bem } from \"@react-md/core/utils/bem\":\n *\n * const styles = bem(\"my-component\"):\n *\n * export function MyComponent(props) {\n * const className = styles({\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * }):\n * const childClassName = styles('child', {\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * });\n *\n * // With a false-like `props.something`\n * // className === \"my-component__child my-component__child--always\"\n * // childClassName === \"my-component my-component--always\"\n * // With a truthy `props.something`\n * // className === \"my-component my-component--always my-component--some-condition\"\n * // childClassName === \"my-component__child my-component__child--always my-component__child--some-condition\"\n *\n * return (\n * <div className={className}>\n * <div className={childClassName} />\n * </div>\n * ):\n * }\n * ```\n *\n * @see https://en.bem.info/methodology/css/\n * @param base - The base class to use\n * @returns a function to call that generates the full class name\n */\nexport function bem(base: string): BEMResult {\n if (process.env.NODE_ENV !== \"production\") {\n if (!base) {\n throw new Error(\n \"bem requires a base block class but none were provided.\"\n );\n }\n }\n\n function block(\n elementOrModifier?: BEMModifier | string,\n modifier?: BEMModifier\n ): string {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof elementOrModifier !== \"string\" && modifier) {\n throw new TypeError(\n \"bem does not support having two modifier arguments.\"\n );\n }\n }\n\n if (!elementOrModifier) {\n return base;\n }\n\n if (typeof elementOrModifier !== \"string\") {\n return modify(base, elementOrModifier);\n }\n\n return modify(`${base}__${elementOrModifier}`, modifier);\n }\n block.base = base;\n return block;\n}\n"],"names":["modify","base","modifier","hasOwn","Object","prototype","hasOwnProperty","keys","reduce","s","mod","call","bem","process","env","NODE_ENV","Error","block","elementOrModifier","TypeError"],"mappings":"AAEA,SAASA,OAAOC,IAAY,EAAEC,QAAsB;IAClD,IAAI,CAACA,UAAU;QACb,OAAOD;IACT;IAEA,MAAME,SAASC,OAAOC,SAAS,CAACC,cAAc;IAC9C,OAAOF,OAAOG,IAAI,CAACL,UAAUM,MAAM,CAAC,CAACC,GAAGC;QACtC,IAAIP,OAAOQ,IAAI,CAACT,UAAUQ,QAAQR,QAAQ,CAACQ,IAAI,EAAE;YAC/CD,IAAI,GAAGA,EAAE,CAAC,EAAER,KAAK,EAAE,EAAES,KAAK;QAC5B;QAEA,OAAOD;IACT,GAAGR;AACL;AAmDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASW,IAAIX,IAAY;IAC9B,IAAIY,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACd,MAAM;YACT,MAAM,IAAIe,MACR;QAEJ;IACF;IAEA,SAASC,MACPC,iBAAwC,EACxChB,QAAsB;QAEtB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,IAAI,OAAOG,sBAAsB,YAAYhB,UAAU;gBACrD,MAAM,IAAIiB,UACR;YAEJ;QACF;QAEA,IAAI,CAACD,mBAAmB;YACtB,OAAOjB;QACT;QAEA,IAAI,OAAOiB,sBAAsB,UAAU;YACzC,OAAOlB,OAAOC,MAAMiB;QACtB;QAEA,OAAOlB,OAAO,GAAGC,KAAK,EAAE,EAAEiB,mBAAmB,EAAEhB;IACjD;IACAe,MAAMhB,IAAI,GAAGA;IACb,OAAOgB;AACT"}
1
+ {"version":3,"sources":["../../src/utils/bem.ts"],"sourcesContent":["export type BEMModifier = Record<string, unknown>;\n\nfunction modify(base: string, modifier?: BEMModifier): string {\n if (!modifier) {\n return base;\n }\n\n const hasOwn = Object.prototype.hasOwnProperty;\n return Object.keys(modifier).reduce((s, mod) => {\n if (hasOwn.call(modifier, mod) && modifier[mod]) {\n return `${s} ${base}--${mod}`;\n }\n\n return s;\n }, base);\n}\n\n/**\n * Creates the full class name from the base block name. This can be called\n * without any arguments which will just return the base block name (kind of\n * worthless), or you can provide a child element name and modifiers.\n *\n * @since 6.0.0 Converted to an interface that supports the `base` attribute.\n */\nexport interface BEMResult {\n /**\n * @example Simple Example\n * ```ts\n * const styles = bem(\"root\");\n *\n * styles(\"child\"); // \"root__child\"\n * styles(\"child\", {\n * modifier1: true,\n * modifier2: false,\n * }); // \"root__child root__child--modifier-1\"\n * ```\n * @param element - The child element to be prefixed before any modifiers.\n * @param modifier - Any optional modifiers to apply to the block and optional\n * element.\n * @returns the full class name\n */\n (element: string, modifier?: BEMModifier): string;\n\n /**\n * @example Simple Example\n * ```ts\n * const styles = bem(\"root\");\n *\n * styles() // \"root\"\n * styles({\n * modifier1: true,\n * modifier2: false,\n * }); // \"root--modifier-1\"\n * ```\n * @param modifier - Any optional modifiers to apply to the block and optional\n * element.\n * @returns the full class name\n */\n (modifier?: BEMModifier): string;\n\n /**\n * The base class name\n */\n base: string;\n}\n\n/**\n * Applies the BEM styled class name to an element.\n *\n * @example Simple Example\n * ```tsx\n * import { bem } from \"@react-md/core/utils/bem\":\n *\n * const styles = bem(\"my-component\"):\n *\n * export function MyComponent(props) {\n * const className = styles({\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * }):\n * const childClassName = styles('child', {\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * });\n *\n * // With a false-like `props.something`\n * // className === \"my-component__child my-component__child--always\"\n * // childClassName === \"my-component my-component--always\"\n * // With a truthy `props.something`\n * // className === \"my-component my-component--always my-component--some-condition\"\n * // childClassName === \"my-component__child my-component__child--always my-component__child--some-condition\"\n *\n * return (\n * <div className={className}>\n * <div className={childClassName} />\n * </div>\n * ):\n * }\n * ```\n *\n * @see https://en.bem.info/methodology/css/\n * @param base - The base class to use\n * @returns a function to call that generates the full class name\n */\nexport function bem(base: string): BEMResult {\n if (process.env.NODE_ENV !== \"production\") {\n if (!base) {\n throw new Error(\n \"bem requires a base block class but none were provided.\"\n );\n }\n }\n\n function block(\n elementOrModifier?: BEMModifier | string,\n modifier?: BEMModifier\n ): string {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof elementOrModifier !== \"string\" && modifier) {\n throw new TypeError(\n \"bem does not support having two modifier arguments.\"\n );\n }\n }\n\n if (!elementOrModifier) {\n return base;\n }\n\n if (typeof elementOrModifier !== \"string\") {\n return modify(base, elementOrModifier);\n }\n\n return modify(`${base}__${elementOrModifier}`, modifier);\n }\n block.base = base;\n return block;\n}\n"],"names":["modify","base","modifier","hasOwn","Object","prototype","hasOwnProperty","keys","reduce","s","mod","call","bem","process","env","NODE_ENV","Error","block","elementOrModifier","TypeError"],"mappings":"AAEA,SAASA,OAAOC,IAAY,EAAEC,QAAsB;IAClD,IAAI,CAACA,UAAU;QACb,OAAOD;IACT;IAEA,MAAME,SAASC,OAAOC,SAAS,CAACC,cAAc;IAC9C,OAAOF,OAAOG,IAAI,CAACL,UAAUM,MAAM,CAAC,CAACC,GAAGC;QACtC,IAAIP,OAAOQ,IAAI,CAACT,UAAUQ,QAAQR,QAAQ,CAACQ,IAAI,EAAE;YAC/C,OAAO,GAAGD,EAAE,CAAC,EAAER,KAAK,EAAE,EAAES,KAAK;QAC/B;QAEA,OAAOD;IACT,GAAGR;AACL;AAmDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASW,IAAIX,IAAY;IAC9B,IAAIY,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACd,MAAM;YACT,MAAM,IAAIe,MACR;QAEJ;IACF;IAEA,SAASC,MACPC,iBAAwC,EACxChB,QAAsB;QAEtB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,IAAI,OAAOG,sBAAsB,YAAYhB,UAAU;gBACrD,MAAM,IAAIiB,UACR;YAEJ;QACF;QAEA,IAAI,CAACD,mBAAmB;YACtB,OAAOjB;QACT;QAEA,IAAI,OAAOiB,sBAAsB,UAAU;YACzC,OAAOlB,OAAOC,MAAMiB;QACtB;QAEA,OAAOlB,OAAO,GAAGC,KAAK,EAAE,EAAEiB,mBAAmB,EAAEhB;IACjD;IACAe,MAAMhB,IAAI,GAAGA;IACb,OAAOgB;AACT"}
@@ -22,6 +22,9 @@
22
22
  if (typeof value === "number") {
23
23
  return value;
24
24
  }
25
+ if (value.includes("calc")) {
26
+ throw new Error(`Unable to parse a unit with \`calc\`: "${value}"`);
27
+ }
25
28
  const parsed = parseFloat(value);
26
29
  if (/px$/i.test(value)) {
27
30
  return parsed;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/parseCssLengthUnit.ts"],"sourcesContent":["/** @internal */\nexport interface ParseCssLengthUnitOptions {\n /**\n * The css unit to convert to a numeric value.\n */\n value: number | string;\n\n /**\n * @defaultValue `16`\n */\n fallbackFontSize?: number;\n\n /**\n * @defaultValue `document.documentElement`\n */\n container?: Element | null;\n}\n\n/**\n * This is used to convert CSS length units into a number. At this time, it really only supports\n * - `px`\n * - `rem`\n * - `em` (if {@link ParseCssLengthUnitOptions.container} is provided)\n *\n * @example Simple Example\n * ```ts\n * parseCssLengthUnit({ value: \"24px\" }) // 24\n * parseCssLengthUnit({ value: \"3.5rem\" }) // 56\n * parseCssLengthUnit({\n * value: \"3em\",\n * container: document.querySelector(SOME_QUERY),\n * }); // container's computed fontSize * 3\n * ```\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths}\n * @internal\n * @since 6.0.0 This was renamed from `unitToNumber`\n */\nexport function parseCssLengthUnit(options: ParseCssLengthUnitOptions): number {\n const { value, container, fallbackFontSize = 16 } = options;\n\n if (typeof value === \"number\") {\n return value;\n }\n\n const parsed = parseFloat(value);\n if (/px$/i.test(value)) {\n return parsed;\n }\n\n if (typeof window === \"undefined\") {\n return parsed * fallbackFontSize;\n }\n\n const styleContainer =\n !container || /rem$/i.test(value) ? document.documentElement : container;\n\n const fontSize = parseFloat(\n window.getComputedStyle(styleContainer).fontSize || `${fallbackFontSize}px`\n );\n\n return parsed * fontSize;\n}\n"],"names":["parseCssLengthUnit","options","value","container","fallbackFontSize","parsed","parseFloat","test","window","styleContainer","document","documentElement","fontSize","getComputedStyle"],"mappings":"AAAA,cAAc,GAkBd;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASA,mBAAmBC,OAAkC;IACnE,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,mBAAmB,EAAE,EAAE,GAAGH;IAEpD,IAAI,OAAOC,UAAU,UAAU;QAC7B,OAAOA;IACT;IAEA,MAAMG,SAASC,WAAWJ;IAC1B,IAAI,OAAOK,IAAI,CAACL,QAAQ;QACtB,OAAOG;IACT;IAEA,IAAI,OAAOG,WAAW,aAAa;QACjC,OAAOH,SAASD;IAClB;IAEA,MAAMK,iBACJ,CAACN,aAAa,QAAQI,IAAI,CAACL,SAASQ,SAASC,eAAe,GAAGR;IAEjE,MAAMS,WAAWN,WACfE,OAAOK,gBAAgB,CAACJ,gBAAgBG,QAAQ,IAAI,GAAGR,iBAAiB,EAAE,CAAC;IAG7E,OAAOC,SAASO;AAClB"}
1
+ {"version":3,"sources":["../../src/utils/parseCssLengthUnit.ts"],"sourcesContent":["/** @internal */\nexport interface ParseCssLengthUnitOptions {\n /**\n * The css unit to convert to a numeric value.\n */\n value: number | string;\n\n /**\n * @defaultValue `16`\n */\n fallbackFontSize?: number;\n\n /**\n * @defaultValue `document.documentElement`\n */\n container?: Element | null;\n}\n\n/**\n * This is used to convert CSS length units into a number. At this time, it really only supports\n * - `px`\n * - `rem`\n * - `em` (if {@link ParseCssLengthUnitOptions.container} is provided)\n *\n * @example Simple Example\n * ```ts\n * parseCssLengthUnit({ value: \"24px\" }) // 24\n * parseCssLengthUnit({ value: \"3.5rem\" }) // 56\n * parseCssLengthUnit({\n * value: \"3em\",\n * container: document.querySelector(SOME_QUERY),\n * }); // container's computed fontSize * 3\n * ```\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths}\n * @internal\n * @since 6.0.0 This was renamed from `unitToNumber`\n */\nexport function parseCssLengthUnit(options: ParseCssLengthUnitOptions): number {\n const { value, container, fallbackFontSize = 16 } = options;\n\n if (typeof value === \"number\") {\n return value;\n }\n\n if (value.includes(\"calc\")) {\n throw new Error(`Unable to parse a unit with \\`calc\\`: \"${value}\"`);\n }\n\n const parsed = parseFloat(value);\n if (/px$/i.test(value)) {\n return parsed;\n }\n\n if (typeof window === \"undefined\") {\n return parsed * fallbackFontSize;\n }\n\n const styleContainer =\n !container || /rem$/i.test(value) ? document.documentElement : container;\n\n const fontSize = parseFloat(\n window.getComputedStyle(styleContainer).fontSize || `${fallbackFontSize}px`\n );\n\n return parsed * fontSize;\n}\n"],"names":["parseCssLengthUnit","options","value","container","fallbackFontSize","includes","Error","parsed","parseFloat","test","window","styleContainer","document","documentElement","fontSize","getComputedStyle"],"mappings":"AAAA,cAAc,GAkBd;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASA,mBAAmBC,OAAkC;IACnE,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,mBAAmB,EAAE,EAAE,GAAGH;IAEpD,IAAI,OAAOC,UAAU,UAAU;QAC7B,OAAOA;IACT;IAEA,IAAIA,MAAMG,QAAQ,CAAC,SAAS;QAC1B,MAAM,IAAIC,MAAM,CAAC,uCAAuC,EAAEJ,MAAM,CAAC,CAAC;IACpE;IAEA,MAAMK,SAASC,WAAWN;IAC1B,IAAI,OAAOO,IAAI,CAACP,QAAQ;QACtB,OAAOK;IACT;IAEA,IAAI,OAAOG,WAAW,aAAa;QACjC,OAAOH,SAASH;IAClB;IAEA,MAAMO,iBACJ,CAACR,aAAa,QAAQM,IAAI,CAACP,SAASU,SAASC,eAAe,GAAGV;IAEjE,MAAMW,WAAWN,WACfE,OAAOK,gBAAgB,CAACJ,gBAAgBG,QAAQ,IAAI,GAAGV,iBAAiB,EAAE,CAAC;IAG7E,OAAOG,SAASO;AAClB"}
@@ -80,7 +80,7 @@ export type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;
80
80
  * }
81
81
  * ```
82
82
  *
83
- * @see {@link https://next.react-md.dev/components/window-splitter | WindowSplitter Demos}
83
+ * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}
84
84
  * @since 6.0.0
85
85
  */
86
86
  export declare const WindowSplitter: import("react").ForwardRefExoticComponent<WindowSplitterProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -42,7 +42,7 @@ import { windowSplitter } from "./styles.js";
42
42
  * }
43
43
  * ```
44
44
  *
45
- * @see {@link https://next.react-md.dev/components/window-splitter | WindowSplitter Demos}
45
+ * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}
46
46
  * @since 6.0.0
47
47
  */ export const WindowSplitter = /*#__PURE__*/ forwardRef(function WindowSplitter(props, ref) {
48
48
  const { role = "separator", className, dragging, reversed, disableFixed = false, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/window-splitter/WindowSplitter.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, forwardRef } from \"react\";\n\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { windowSplitter } from \"./styles.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type useWindowSplitter } from \"./useWindowSplitter.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-window-splitter-top\"?: number | string;\n \"--rmd-window-splitter-right\"?: number | string;\n \"--rmd-window-splitter-bottom\"?: number | string;\n \"--rmd-window-splitter-left\"?: number | string;\n \"--rmd-window-splitter-opacity\"?: number | string;\n \"--rmd-window-splitter-position\"?: number | string;\n }\n}\n\n/**\n * @since 6.0.0\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/}\n */\nexport interface BaseWindowSplitterProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"children\"> {\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n \"aria-controls\": string;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n dragging: boolean;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n reversed: boolean;\n\n /**\n * Set this to `true` if the window splitter should use `position: absolute`\n * instead of `position: fixed`.\n *\n * @defaultValue `false`\n */\n disableFixed?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;\n\n/**\n * The `WindowSplitter` should be used with the `useWindowSplitter` hook to\n * resize parts of a layout.\n *\n * See the `useResizableLayout` hook if the entire page layout should be\n * resizable.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import { WindowSplitter } from \"@react-md/core/window-splitter/WindowSplitter\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useId, type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * const panelId = useId();\n * const { value, splitterProps } = useWindowSplitter({\n * min: 120,\n * max: 380,\n * });\n *\n * return (\n * <div\n * style={{\n * \"--rmd-window-splitter-position\": `${value}px`,\n * display: \"grid\",\n * gridTemplateColumns: \"var(--rmd-window-splitter-position, 120px) 1fr\",\n * }}\n * >\n * <div>Panel 1</div>\n * <WindowSplitter\n * {...splitterProps}\n * aria-controls={panelId}\n * aria-labelledby={panelId}\n * />\n * <div>Panel 2</div>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/window-splitter | WindowSplitter Demos}\n * @since 6.0.0\n */\nexport const WindowSplitter = forwardRef<\n HTMLButtonElement,\n WindowSplitterProps\n>(function WindowSplitter(props, ref) {\n const {\n role = \"separator\",\n className,\n dragging,\n reversed,\n disableFixed = false,\n ...remaining\n } = props;\n const vertical = props[\"aria-orientation\"] === \"vertical\";\n\n return (\n <button\n {...remaining}\n ref={ref}\n type=\"button\"\n role={role}\n className={windowSplitter({\n className,\n reversed,\n dragging,\n vertical,\n disableFixed,\n })}\n />\n );\n});\n"],"names":["forwardRef","windowSplitter","WindowSplitter","props","ref","role","className","dragging","reversed","disableFixed","remaining","vertical","button","type"],"mappings":";AAAA,SAAoCA,UAAU,QAAQ,QAAQ;AAG9D,SAASC,cAAc,QAAQ,cAAc;AAkD7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GACD,OAAO,MAAMC,+BAAiBF,WAG5B,SAASE,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,OAAO,WAAW,EAClBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,eAAe,KAAK,EACpB,GAAGC,WACJ,GAAGP;IACJ,MAAMQ,WAAWR,KAAK,CAAC,mBAAmB,KAAK;IAE/C,qBACE,KAACS;QACE,GAAGF,SAAS;QACbN,KAAKA;QACLS,MAAK;QACLR,MAAMA;QACNC,WAAWL,eAAe;YACxBK;YACAE;YACAD;YACAI;YACAF;QACF;;AAGN,GAAG"}
1
+ {"version":3,"sources":["../../src/window-splitter/WindowSplitter.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, forwardRef } from \"react\";\n\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { windowSplitter } from \"./styles.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type useWindowSplitter } from \"./useWindowSplitter.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-window-splitter-top\"?: number | string;\n \"--rmd-window-splitter-right\"?: number | string;\n \"--rmd-window-splitter-bottom\"?: number | string;\n \"--rmd-window-splitter-left\"?: number | string;\n \"--rmd-window-splitter-opacity\"?: number | string;\n \"--rmd-window-splitter-position\"?: number | string;\n }\n}\n\n/**\n * @since 6.0.0\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/}\n */\nexport interface BaseWindowSplitterProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"children\"> {\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n \"aria-controls\": string;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n dragging: boolean;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n reversed: boolean;\n\n /**\n * Set this to `true` if the window splitter should use `position: absolute`\n * instead of `position: fixed`.\n *\n * @defaultValue `false`\n */\n disableFixed?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;\n\n/**\n * The `WindowSplitter` should be used with the `useWindowSplitter` hook to\n * resize parts of a layout.\n *\n * See the `useResizableLayout` hook if the entire page layout should be\n * resizable.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import { WindowSplitter } from \"@react-md/core/window-splitter/WindowSplitter\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useId, type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * const panelId = useId();\n * const { value, splitterProps } = useWindowSplitter({\n * min: 120,\n * max: 380,\n * });\n *\n * return (\n * <div\n * style={{\n * \"--rmd-window-splitter-position\": `${value}px`,\n * display: \"grid\",\n * gridTemplateColumns: \"var(--rmd-window-splitter-position, 120px) 1fr\",\n * }}\n * >\n * <div>Panel 1</div>\n * <WindowSplitter\n * {...splitterProps}\n * aria-controls={panelId}\n * aria-labelledby={panelId}\n * />\n * <div>Panel 2</div>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}\n * @since 6.0.0\n */\nexport const WindowSplitter = forwardRef<\n HTMLButtonElement,\n WindowSplitterProps\n>(function WindowSplitter(props, ref) {\n const {\n role = \"separator\",\n className,\n dragging,\n reversed,\n disableFixed = false,\n ...remaining\n } = props;\n const vertical = props[\"aria-orientation\"] === \"vertical\";\n\n return (\n <button\n {...remaining}\n ref={ref}\n type=\"button\"\n role={role}\n className={windowSplitter({\n className,\n reversed,\n dragging,\n vertical,\n disableFixed,\n })}\n />\n );\n});\n"],"names":["forwardRef","windowSplitter","WindowSplitter","props","ref","role","className","dragging","reversed","disableFixed","remaining","vertical","button","type"],"mappings":";AAAA,SAAoCA,UAAU,QAAQ,QAAQ;AAG9D,SAASC,cAAc,QAAQ,cAAc;AAkD7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GACD,OAAO,MAAMC,+BAAiBF,WAG5B,SAASE,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,OAAO,WAAW,EAClBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,eAAe,KAAK,EACpB,GAAGC,WACJ,GAAGP;IACJ,MAAMQ,WAAWR,KAAK,CAAC,mBAAmB,KAAK;IAE/C,qBACE,KAACS;QACE,GAAGF,SAAS;QACbN,KAAKA;QACLS,MAAK;QACLR,MAAMA;QACNC,WAAWL,eAAe;YACxBK;YACAE;YACAD;YACAI;YACAF;QACF;;AAGN,GAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-md/core",
3
- "version": "6.0.1",
3
+ "version": "6.1.0",
4
4
  "description": "The core components and functionality for react-md.",
5
5
  "type": "module",
6
6
  "sass": "./dist/_core.scss",
@@ -82,21 +82,21 @@
82
82
  "@jest/globals": "^29.7.0",
83
83
  "@jest/types": "^29.6.3",
84
84
  "@microsoft/api-extractor": "^7.52.8",
85
- "@mlaursen/eslint-config": "^8.0.0",
85
+ "@mlaursen/eslint-config": "^8.0.1",
86
86
  "@swc/cli": "^0.6.0",
87
- "@swc/core": "^1.11.22",
87
+ "@swc/core": "^1.11.29",
88
88
  "@swc/jest": "^0.2.38",
89
89
  "@testing-library/dom": "^10.4.0",
90
90
  "@testing-library/jest-dom": "^6.6.3",
91
91
  "@testing-library/react": "^16.3.0",
92
92
  "@testing-library/user-event": "^14.6.1",
93
93
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
94
- "@types/lodash": "^4.17.16",
95
- "@types/node": "^22.15.18",
94
+ "@types/lodash": "^4.17.17",
95
+ "@types/node": "^22.15.29",
96
96
  "@types/react": "^18.3.12",
97
97
  "@types/react-dom": "^18.3.1",
98
98
  "chokidar": "^4.0.3",
99
- "eslint": "^9.26.0",
99
+ "eslint": "^9.28.0",
100
100
  "filesize": "^10.1.6",
101
101
  "glob": "11.0.2",
102
102
  "jest": "^29.7.0",
@@ -106,16 +106,16 @@
106
106
  "lz-string": "^1.5.0",
107
107
  "npm-run-all": "^4.1.5",
108
108
  "prettier": "^3.5.3",
109
- "stylelint": "^16.19.1",
109
+ "stylelint": "^16.20.0",
110
110
  "stylelint-config-prettier-scss": "^1.0.0",
111
- "stylelint-config-recommended-scss": "^15.0.0",
111
+ "stylelint-config-recommended-scss": "^15.0.1",
112
112
  "stylelint-order": "^7.0.0",
113
113
  "stylelint-scss": "^6.12.0",
114
- "ts-morph": "^25.0.1",
114
+ "ts-morph": "^26.0.0",
115
115
  "ts-node": "^10.9.2",
116
116
  "tsx": "^4.19.4",
117
117
  "typescript": "^5.8.3",
118
- "vitest": "^3.1.3"
118
+ "vitest": "^3.1.4"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@jest/globals": "^29.7.0",
@@ -87,7 +87,7 @@ export interface CoreProvidersProps extends ReactMDCoreConfiguration {
87
87
  * - {@link Snackbar} - This isn't a provider but this is how you can display
88
88
  * alerts in your app
89
89
  *
90
- * @see {@link https://next.react-md.dev/components/core-providers | CoreProviders Demos}
90
+ * @see {@link https://react-md.dev/components/core-providers | CoreProviders Demos}
91
91
  * @since 6.0.0
92
92
  */
93
93
  export function CoreProviders(props: CoreProvidersProps): ReactElement {
@@ -31,7 +31,7 @@ export interface SsrProviderProps {
31
31
  /**
32
32
  * **Client Component**
33
33
  *
34
- * @see {@link https://next.react-md.dev/components/ssr-provider | SsrProvider Demos}
34
+ * @see {@link https://react-md.dev/components/ssr-provider | SsrProvider Demos}
35
35
  * @since 6.0.0
36
36
  */
37
37
  export function SsrProvider(props: SsrProviderProps): ReactElement {
@@ -199,7 +199,7 @@ export function appBarTitle(options: AppBarTitleClassNameOptions = {}): string {
199
199
  const { className, keyline = "small" } = options;
200
200
  return cnb(
201
201
  titleStyles({
202
- keyline: keyline == "list",
202
+ keyline: keyline === "list",
203
203
  "nav-keyline": keyline === "nav",
204
204
  }),
205
205
  className
@@ -75,7 +75,7 @@ const noop = (): undefined => undefined;
75
75
  * }
76
76
  * ```
77
77
  *
78
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
78
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
79
79
  * @since 6.0.0
80
80
  */
81
81
  export function Autocomplete<Option extends AutocompleteOption>(
@@ -117,14 +117,14 @@ export function Autocomplete<Option extends AutocompleteOption>(
117
117
  * }
118
118
  * ```
119
119
  *
120
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
120
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
121
121
  * @since 6.0.0
122
122
  */
123
123
  export function Autocomplete<Option extends AutocompleteOption>(
124
124
  props: AutocompleteMultiSelectProps<Option>
125
125
  ): ReactElement;
126
126
  /**
127
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
127
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
128
128
  * @since 6.0.0
129
129
  * @internal
130
130
  */
@@ -9,7 +9,7 @@ import { type AutocompleteChipProps } from "./types.js";
9
9
  * A small wrapper around the `Chip` that defaults the `rightAddon` to the
10
10
  * remove icon and adds a default `aria-description`.
11
11
  *
12
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
12
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
13
13
  * @since 6.0.0
14
14
  */
15
15
  export const AutocompleteChip = forwardRef<
@@ -7,7 +7,7 @@ import { type AutocompleteCircularProgressProps } from "./types.js";
7
7
  * An internal component used to handle the styling and minimal accessibility
8
8
  * for the `CircularProgress` within the `Autocomplete`
9
9
  *
10
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
10
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
11
11
  * @internal
12
12
  * @since 6.0.0
13
13
  */
@@ -11,7 +11,7 @@ import { type AutocompleteClearButtonProps } from "./types.js";
11
11
  /**
12
12
  * An internal component used for to clear the value from the `Autocomplete`.
13
13
  *
14
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
14
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
15
15
  * @internal
16
16
  * @since 6.0.0
17
17
  */
@@ -14,7 +14,7 @@ import { type AutocompleteDropdownButtonProps } from "./types.js";
14
14
  * This is a simple `Button` wrapper to be used as a dropdown button within the
15
15
  * `Autocomplete`.
16
16
  *
17
- * @see {@link https://next.react-md.dev/components/autocomplete | Autocomplete Demos}
17
+ * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
18
18
  * @since 6.0.0
19
19
  */
20
20
  export function AutocompleteDropdownButton(