@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/files/useFileUpload.ts"],"sourcesContent":["\"use client\";\n\nimport { nanoid } from \"nanoid\";\nimport {\n type ChangeEvent,\n type DragEvent,\n useCallback,\n useEffect,\n useReducer,\n} from \"react\";\n\nimport {\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type GetFileParser,\n type ProcessingFileUploadStats,\n getFileParser as defaultGetFileParser,\n} from \"./utils.js\";\nimport {\n FileAccessError,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset: () => void;\n\n /**\n * Removes all the errors that exist in state without canceling any of the\n * uploads already in progress.\n */\n clearErrors: () => void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove: (keyOrKeys: string | readonly string[]) => void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * @see {@link https://next.react-md.dev/components/file-input | FileInput Demos}\n * @see {@link https://next.react-md.dev/hooks/use-file-input | useFileInput Demos}\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>(\n options: FileUploadOptions<E, CustomError> = {}\n): Readonly<FileUploadHookReturnValue<E, CustomError>> {\n const {\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n } = options;\n\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\"readAsText\", \"readAsDataURL\", \"readAsArrayBuffer\"].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","getFileParser","defaultGetFileParser","FileAccessError","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","options","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAGEC,WAAW,EACXC,SAAS,EACTC,UAAU,QACL,QAAQ;AAEf,SAOEC,iBAAiBC,oBAAoB,QAChC,aAAa;AACpB,SACEC,eAAe,EAIfC,mBAAmBC,sBAAsB,EACzCC,iBAAiBC,oBAAoB,QAChC,kBAAkB;AAEzB,MAAMC,OAAO;AACX,aAAa;AACf;AAqKA,cAAc,GACd,MAAMC,aAAa,EAAE;AACrB,cAAc,GACd,MAAMC,eAAe,CAAC;AAEtB;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,cACdC,UAA6C,CAAC,CAAC;IAE/C,MAAM,EACJC,WAAW,CAAC,CAAC,EACbC,aAAaL,UAAU,EACvBM,cAAc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,GACd4B,KAAKO,GAAG,CAAC,GAAG/D,cAAc4D,UAAUhC,MAAM;QAChD,MAAMoC,QAAQhC,QAAQiC,KAAK,CAAC,GAAGH;QAC/B,IAAI,CAACE,MAAMpC,MAAM,EAAE;YACjB;QACF;QAEAoC,MAAMlB,OAAO,CAAC,CAACpC;YACb,MAAM,EAAEG,GAAG,EAAEI,IAAI,EAAE,GAAGP;YACtB,MAAMU,SAAS,IAAI8C;YAEnB,0DAA0D;YAC1D,yDAAyD;YACzD9C,OAAO+C,gBAAgB,CAAC,YAAYd,2BAA2BxC;YAC/DO,OAAO+C,gBAAgB,CAAC,QAAQ;gBAC9Bf,SAASvC,KAAKO,OAAOE,MAAM;YAC7B;YAEA6B,MAAMtC,KAAKO;YACX,MAAMgD,SAASrF,cAAckC;YAC7B,wBAAwB,GACxB,IACEoD,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzB,CAAC;gBAAC;gBAAc;gBAAiB;aAAoB,CAACxD,QAAQ,CAACqD,SAC/D;gBACA,MAAM,IAAI5B,MAAM;YAClB;YAEApB,MAAM,CAACgD,OAAO,CAACnD;QACjB;IACF,GAAG;QACDjB;QACAU;QACA3B;QACAsE;QACAF;QACAC;KACD;IAED,IAAIoB,SAAS;IACb,IAAI5E,WAAWgC,MAAM,EAAE;QACrB4C,SAAS5E,WAAWoB,MAAM,CAAC,CAACyD,GAAGC,MAAQ,GAAGD,IAAI,GAAGA,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,EAAEC,KAAK,EAAE;IACvE;IAEA,OAAO;QACLhE,OAAOc;QACPb;QACA6D;QACA3C;QACAF;QACA1B;QACAE;QACA8C;QACAL;QACAM;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/files/useFileUpload.ts"],"sourcesContent":["\"use client\";\n\nimport { nanoid } from \"nanoid\";\nimport {\n type ChangeEvent,\n type DragEvent,\n useCallback,\n useEffect,\n useReducer,\n} from \"react\";\n\nimport {\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type GetFileParser,\n type ProcessingFileUploadStats,\n getFileParser as defaultGetFileParser,\n} from \"./utils.js\";\nimport {\n FileAccessError,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset: () => void;\n\n /**\n * Removes all the errors that exist in state without canceling any of the\n * uploads already in progress.\n */\n clearErrors: () => void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove: (keyOrKeys: string | readonly string[]) => void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * @see {@link https://react-md.dev/components/file-input | FileInput Demos}\n * @see {@link https://react-md.dev/hooks/use-file-input | useFileInput Demos}\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>(\n options: FileUploadOptions<E, CustomError> = {}\n): Readonly<FileUploadHookReturnValue<E, CustomError>> {\n const {\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n } = options;\n\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\"readAsText\", \"readAsDataURL\", \"readAsArrayBuffer\"].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","getFileParser","defaultGetFileParser","FileAccessError","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","options","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAGEC,WAAW,EACXC,SAAS,EACTC,UAAU,QACL,QAAQ;AAEf,SAOEC,iBAAiBC,oBAAoB,QAChC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AAC,CAAC,GAAG,GAAG,CAAC,EAAEC,KAAK,EAAE;IACvE;IAEA,OAAO;QACLhE,OAAOc;QACPb;QACA6D;QACA3C;QACAF;QACA1B;QACAE;QACA8C;QACAL;QACAM;IACF;AACF"}
@@ -15,6 +15,6 @@ import { type CheckboxProps } from "./InputToggle.js";
15
15
  * }
16
16
  * ```
17
17
  *
18
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
18
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
19
19
  */
20
20
  export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -17,7 +17,7 @@ import { InputToggle } from "./InputToggle.js";
17
17
  * }
18
18
  * ```
19
19
  *
20
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
20
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
21
21
  */ export const Checkbox = /*#__PURE__*/ forwardRef(function Checkbox(props, ref) {
22
22
  return /*#__PURE__*/ _jsx(InputToggle, {
23
23
  ...props,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Checkbox.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { type CheckboxProps, InputToggle } from \"./InputToggle.js\";\n\n/**\n * **Client Component**\n *\n * You'll generally want to use the `useCheckboxGroup` hook for managing the\n * checked state for groups of checkboxes and indeterminate checkbox behavior.\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { Checkbox } from \"@react-md/core/form/Checkbox\";\n *\n * function Example(): ReactElement {\n * return <Checkbox label=\"Checkbox\" value=\"a\" />;\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(props, ref) {\n return <InputToggle {...props} ref={ref} type=\"checkbox\" />;\n }\n);\n"],"names":["forwardRef","InputToggle","Checkbox","props","ref","type"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAA6BC,WAAW,QAAQ,mBAAmB;AAEnE;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,qBAAO,KAACH;QAAa,GAAGE,KAAK;QAAEC,KAAKA;QAAKC,MAAK;;AAChD,GACA"}
1
+ {"version":3,"sources":["../../src/form/Checkbox.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { type CheckboxProps, InputToggle } from \"./InputToggle.js\";\n\n/**\n * **Client Component**\n *\n * You'll generally want to use the `useCheckboxGroup` hook for managing the\n * checked state for groups of checkboxes and indeterminate checkbox behavior.\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { Checkbox } from \"@react-md/core/form/Checkbox\";\n *\n * function Example(): ReactElement {\n * return <Checkbox label=\"Checkbox\" value=\"a\" />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(props, ref) {\n return <InputToggle {...props} ref={ref} type=\"checkbox\" />;\n }\n);\n"],"names":["forwardRef","InputToggle","Checkbox","props","ref","type"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAA6BC,WAAW,QAAQ,mBAAmB;AAEnE;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,qBAAO,KAACH;QAAa,GAAGE,KAAK;QAAEC,KAAKA;QAAKC,MAAK;;AAChD,GACA"}
@@ -26,6 +26,6 @@ export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElemen
26
26
  * }
27
27
  * ```
28
28
  *
29
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
29
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
30
30
  */
31
31
  export declare const Fieldset: import("react").ForwardRefExoticComponent<FieldsetProps & import("react").RefAttributes<HTMLFieldSetElement>>;
@@ -20,7 +20,7 @@ import { fieldset } from "./fieldsetStyles.js";
20
20
  * }
21
21
  * ```
22
22
  *
23
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
23
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
24
24
  */ export const Fieldset = /*#__PURE__*/ forwardRef(function Fieldset(props, ref) {
25
25
  const { className, fullWidth = false, browserStyles = false, children, ...remaining } = props;
26
26
  return /*#__PURE__*/ _jsx("fieldset", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { type FieldsetHTMLAttributes, forwardRef } from \"react\";\n\nimport { type FieldsetClassNameOptions, fieldset } from \"./fieldsetStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Fieldset } from \"@react-md/core/form/Fieldset\";\n * import { Legend } from \"@react-md/core/form/Legend\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["forwardRef","fieldset","Fieldset","props","ref","className","fullWidth","browserStyles","children","remaining"],"mappings":";AAAA,SAAsCA,UAAU,QAAQ,QAAQ;AAEhE,SAAwCC,QAAQ,QAAQ,sBAAsB;AAW9E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBC,QAAQ,EACR,GAAGC,WACJ,GAAGN;IAEJ,qBACE,KAACF;QACE,GAAGQ,SAAS;QACbL,KAAKA;QACLC,WAAWJ,SAAS;YAClBI;YACAC;YACAC;QACF;kBAECC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Fieldset.tsx"],"sourcesContent":["import { type FieldsetHTMLAttributes, forwardRef } from \"react\";\n\nimport { type FieldsetClassNameOptions, fieldset } from \"./fieldsetStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `legend`, `legendStyle`,\n * `legendClassName`, and `legendSROnly` props. You must provide a `Legend`\n * yourself manually instead of using a prop.\n */\nexport interface FieldsetProps\n extends FieldsetHTMLAttributes<HTMLFieldSetElement>,\n FieldsetClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Fieldset } from \"@react-md/core/form/Fieldset\";\n * import { Legend } from \"@react-md/core/form/Legend\";\n *\n * function Example(): ReactElement {\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Some Title</Legend>\n * // form components\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}\n */\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset(props, ref) {\n const {\n className,\n fullWidth = false,\n browserStyles = false,\n children,\n ...remaining\n } = props;\n\n return (\n <fieldset\n {...remaining}\n ref={ref}\n className={fieldset({\n className,\n fullWidth,\n browserStyles,\n })}\n >\n {children}\n </fieldset>\n );\n }\n);\n"],"names":["forwardRef","fieldset","Fieldset","props","ref","className","fullWidth","browserStyles","children","remaining"],"mappings":";AAAA,SAAsCA,UAAU,QAAQ,QAAQ;AAEhE,SAAwCC,QAAQ,QAAQ,sBAAsB;AAW9E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,gBAAgB,KAAK,EACrBC,QAAQ,EACR,GAAGC,WACJ,GAAGN;IAEJ,qBACE,KAACF;QACE,GAAGQ,SAAS;QACbL,KAAKA;QACLC,WAAWJ,SAAS;YAClBI;YACAC;YACAC;QACF;kBAECC;;AAGP,GACA"}
@@ -16,6 +16,6 @@ export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
16
16
  * do much styling or logic. All this form component will do is add basic flex
17
17
  * behavior and prevent the default form submit behavior.
18
18
  *
19
- * @see {@link https://next.react-md.dev/components/form | Form Demos}
19
+ * @see {@link https://react-md.dev/components/form | Form Demos}
20
20
  */
21
21
  export declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
package/dist/form/Form.js CHANGED
@@ -11,7 +11,7 @@ const noop = ()=>{
11
11
  * do much styling or logic. All this form component will do is add basic flex
12
12
  * behavior and prevent the default form submit behavior.
13
13
  *
14
- * @see {@link https://next.react-md.dev/components/form | Form Demos}
14
+ * @see {@link https://react-md.dev/components/form | Form Demos}
15
15
  */ export const Form = /*#__PURE__*/ forwardRef(function Form(props, ref) {
16
16
  const { children, onSubmit = noop, disablePreventDefault = false, ...remaining } = props;
17
17
  return /*#__PURE__*/ _jsx("form", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FormHTMLAttributes, forwardRef } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * Boolean if the form should no longer prevent default submit behavior. If\n * you enable this prop you should honestly just use a `<form>` element\n * instead\n *\n * @defaultValue `false`\n */\n disablePreventDefault?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is probably one of the least useful components available as it doesn't\n * do much styling or logic. All this form component will do is add basic flex\n * behavior and prevent the default form submit behavior.\n *\n * @see {@link https://next.react-md.dev/components/form | Form Demos}\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(\n function Form(props, ref) {\n const {\n children,\n onSubmit = noop,\n disablePreventDefault = false,\n ...remaining\n } = props;\n\n return (\n <form\n {...remaining}\n onSubmit={(event) => {\n if (!disablePreventDefault) {\n event.preventDefault();\n }\n\n onSubmit(event);\n }}\n ref={ref}\n >\n {children}\n </form>\n );\n }\n);\n"],"names":["forwardRef","noop","Form","props","ref","children","onSubmit","disablePreventDefault","remaining","form","event","preventDefault"],"mappings":"AAAA;;AAEA,SAAkCA,UAAU,QAAQ,QAAQ;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AAaA;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,QAAQ,EACRC,WAAWL,IAAI,EACfM,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbF,UAAU,CAACI;YACT,IAAI,CAACH,uBAAuB;gBAC1BG,MAAMC,cAAc;YACtB;YAEAL,SAASI;QACX;QACAN,KAAKA;kBAEJC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FormHTMLAttributes, forwardRef } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * Boolean if the form should no longer prevent default submit behavior. If\n * you enable this prop you should honestly just use a `<form>` element\n * instead\n *\n * @defaultValue `false`\n */\n disablePreventDefault?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is probably one of the least useful components available as it doesn't\n * do much styling or logic. All this form component will do is add basic flex\n * behavior and prevent the default form submit behavior.\n *\n * @see {@link https://react-md.dev/components/form | Form Demos}\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(\n function Form(props, ref) {\n const {\n children,\n onSubmit = noop,\n disablePreventDefault = false,\n ...remaining\n } = props;\n\n return (\n <form\n {...remaining}\n onSubmit={(event) => {\n if (!disablePreventDefault) {\n event.preventDefault();\n }\n\n onSubmit(event);\n }}\n ref={ref}\n >\n {children}\n </form>\n );\n }\n);\n"],"names":["forwardRef","noop","Form","props","ref","children","onSubmit","disablePreventDefault","remaining","form","event","preventDefault"],"mappings":"AAAA;;AAEA,SAAkCA,UAAU,QAAQ,QAAQ;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AAaA;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,QAAQ,EACRC,WAAWL,IAAI,EACfM,wBAAwB,KAAK,EAC7B,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbF,UAAU,CAACI;YACT,IAAI,CAACH,uBAAuB;gBAC1BG,MAAMC,cAAc;YACtB;YAEAL,SAASI;QACX;QACAN,KAAKA;kBAEJC;;AAGP,GACA"}
@@ -8,6 +8,6 @@ import { type FormMessageInputLengthCounterProps, type FormMessageProps } from "
8
8
  * This component can also be used to create form-level validation messages by
9
9
  * setting the `role` prop to `"alert"`.
10
10
  *
11
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
11
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
12
12
  */
13
13
  export declare const FormMessage: import("react").ForwardRefExoticComponent<FormMessageProps & Partial<FormMessageInputLengthCounterProps> & import("react").RefAttributes<HTMLDivElement>>;
@@ -13,7 +13,7 @@ import { formMessage, formMessageText } from "./formMessageStyles.js";
13
13
  * This component can also be used to create form-level validation messages by
14
14
  * setting the `role` prop to `"alert"`.
15
15
  *
16
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
16
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
17
17
  */ export const FormMessage = /*#__PURE__*/ forwardRef(function FormMessage(props, ref) {
18
18
  const { id: propId, role, className, counterStyle, counterClassName, messageStyle, messageClassName, error = false, disableWrap = false, theme: propTheme, children, length, maxLength, ...remaining } = props;
19
19
  const id = useEnsuredId(propId, "form-message");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessage.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageCounter } from \"./FormMessageCounter.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { formMessage, formMessageText } from \"./formMessageStyles.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\n\n/**\n * The `FormMessage` component is used to create additional helper messages or\n * error messages and generally placed below the related `TextField`. If a\n * `length` (of the `value`) and `maxLength` are provided, a counter will also\n * be displayed to the right of the `children`.\n *\n * This component can also be used to create form-level validation messages by\n * setting the `role` prop to `\"alert\"`.\n *\n * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}\n */\nexport const FormMessage = forwardRef<\n HTMLDivElement,\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>\n>(function FormMessage(props, ref) {\n const {\n id: propId,\n role,\n className,\n counterStyle,\n counterClassName,\n messageStyle,\n messageClassName,\n error = false,\n disableWrap = false,\n theme: propTheme,\n children,\n length,\n maxLength,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"form-message\");\n const theme = getFormConfig(\"theme\", propTheme);\n\n let message = children;\n if (!disableWrap && children) {\n message = (\n <p\n id={`${id}-message`}\n style={messageStyle}\n className={formMessageText({ className: messageClassName })}\n >\n {children}\n </p>\n );\n }\n\n return (\n <div\n {...remaining}\n id={id}\n ref={ref}\n aria-live={role !== \"alert\" ? \"polite\" : undefined}\n role={role}\n className={formMessage({ error, theme, className })}\n >\n {message}\n {typeof length === \"number\" && typeof maxLength === \"number\" && (\n <FormMessageCounter\n id={`${id}-counter`}\n style={counterStyle}\n className={counterClassName}\n >\n {`${length} / ${maxLength}`}\n </FormMessageCounter>\n )}\n </div>\n );\n});\n"],"names":["forwardRef","useEnsuredId","FormMessageCounter","getFormConfig","formMessage","formMessageText","FormMessage","props","ref","id","propId","role","className","counterStyle","counterClassName","messageStyle","messageClassName","error","disableWrap","theme","propTheme","children","length","maxLength","remaining","message","p","style","div","aria-live","undefined"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,EAAEC,eAAe,QAAQ,yBAAyB;AAMtE;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,4BAAcN,WAGzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,cAAc,KAAK,EACnBC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACT,GAAGC,WACJ,GAAGjB;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAChC,MAAMS,QAAQhB,cAAc,SAASiB;IAErC,IAAIK,UAAUJ;IACd,IAAI,CAACH,eAAeG,UAAU;QAC5BI,wBACE,KAACC;YACCjB,IAAI,GAAGA,GAAG,QAAQ,CAAC;YACnBkB,OAAOZ;YACPH,WAAWP,gBAAgB;gBAAEO,WAAWI;YAAiB;sBAExDK;;IAGP;IAEA,qBACE,MAACO;QACE,GAAGJ,SAAS;QACbf,IAAIA;QACJD,KAAKA;QACLqB,aAAWlB,SAAS,UAAU,WAAWmB;QACzCnB,MAAMA;QACNC,WAAWR,YAAY;YAAEa;YAAOE;YAAOP;QAAU;;YAEhDa;YACA,OAAOH,WAAW,YAAY,OAAOC,cAAc,0BAClD,KAACrB;gBACCO,IAAI,GAAGA,GAAG,QAAQ,CAAC;gBACnBkB,OAAOd;gBACPD,WAAWE;0BAEV,GAAGQ,OAAO,GAAG,EAAEC,WAAW;;;;AAKrC,GAAG"}
1
+ {"version":3,"sources":["../../src/form/FormMessage.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageCounter } from \"./FormMessageCounter.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { formMessage, formMessageText } from \"./formMessageStyles.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\n\n/**\n * The `FormMessage` component is used to create additional helper messages or\n * error messages and generally placed below the related `TextField`. If a\n * `length` (of the `value`) and `maxLength` are provided, a counter will also\n * be displayed to the right of the `children`.\n *\n * This component can also be used to create form-level validation messages by\n * setting the `role` prop to `\"alert\"`.\n *\n * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}\n */\nexport const FormMessage = forwardRef<\n HTMLDivElement,\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>\n>(function FormMessage(props, ref) {\n const {\n id: propId,\n role,\n className,\n counterStyle,\n counterClassName,\n messageStyle,\n messageClassName,\n error = false,\n disableWrap = false,\n theme: propTheme,\n children,\n length,\n maxLength,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"form-message\");\n const theme = getFormConfig(\"theme\", propTheme);\n\n let message = children;\n if (!disableWrap && children) {\n message = (\n <p\n id={`${id}-message`}\n style={messageStyle}\n className={formMessageText({ className: messageClassName })}\n >\n {children}\n </p>\n );\n }\n\n return (\n <div\n {...remaining}\n id={id}\n ref={ref}\n aria-live={role !== \"alert\" ? \"polite\" : undefined}\n role={role}\n className={formMessage({ error, theme, className })}\n >\n {message}\n {typeof length === \"number\" && typeof maxLength === \"number\" && (\n <FormMessageCounter\n id={`${id}-counter`}\n style={counterStyle}\n className={counterClassName}\n >\n {`${length} / ${maxLength}`}\n </FormMessageCounter>\n )}\n </div>\n );\n});\n"],"names":["forwardRef","useEnsuredId","FormMessageCounter","getFormConfig","formMessage","formMessageText","FormMessage","props","ref","id","propId","role","className","counterStyle","counterClassName","messageStyle","messageClassName","error","disableWrap","theme","propTheme","children","length","maxLength","remaining","message","p","style","div","aria-live","undefined"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,EAAEC,eAAe,QAAQ,yBAAyB;AAMtE;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,4BAAcN,WAGzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,cAAc,KAAK,EACnBC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACT,GAAGC,WACJ,GAAGjB;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAChC,MAAMS,QAAQhB,cAAc,SAASiB;IAErC,IAAIK,UAAUJ;IACd,IAAI,CAACH,eAAeG,UAAU;QAC5BI,wBACE,KAACC;YACCjB,IAAI,GAAGA,GAAG,QAAQ,CAAC;YACnBkB,OAAOZ;YACPH,WAAWP,gBAAgB;gBAAEO,WAAWI;YAAiB;sBAExDK;;IAGP;IAEA,qBACE,MAACO;QACE,GAAGJ,SAAS;QACbf,IAAIA;QACJD,KAAKA;QACLqB,aAAWlB,SAAS,UAAU,WAAWmB;QACzCnB,MAAMA;QACNC,WAAWR,YAAY;YAAEa;YAAOE;YAAOP;QAAU;;YAEhDa;YACA,OAAOH,WAAW,YAAY,OAAOC,cAAc,0BAClD,KAACrB;gBACCO,IAAI,GAAGA,GAAG,QAAQ,CAAC;gBACnBkB,OAAOd;gBACPD,WAAWE;0BAEV,GAAGQ,OAAO,GAAG,EAAEC,WAAW;;;;AAKrC,GAAG"}
@@ -16,7 +16,7 @@ export interface FormMessageContainerProps extends HTMLAttributes<HTMLDivElement
16
16
  * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper
17
17
  * and renders the {@link FormMessage} component.
18
18
  *
19
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
19
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
20
20
  * @since 2.5.0
21
21
  */
22
22
  export declare const FormMessageContainer: import("react").ForwardRefExoticComponent<FormMessageContainerProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -6,7 +6,7 @@ import { formMessageContainer } from "./formMessageContainerStyles.js";
6
6
  * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper
7
7
  * and renders the {@link FormMessage} component.
8
8
  *
9
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
9
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
10
10
  * @since 2.5.0
11
11
  */ export const FormMessageContainer = /*#__PURE__*/ forwardRef(function FormMessageContainer(props, ref) {
12
12
  const { className, children, messageProps, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessageContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { FormMessage } from \"./FormMessage.js\";\nimport { formMessageContainer } from \"./formMessageContainerStyles.js\";\nimport { type FormMessageProps } from \"./types.js\";\n\n/**\n * @since 2.5.0\n */\nexport interface FormMessageContainerProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<FormMessageProps, HTMLDivElement>;\n}\n\n/**\n * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper\n * and renders the {@link FormMessage} component.\n *\n * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}\n * @since 2.5.0\n */\nexport const FormMessageContainer = forwardRef<\n HTMLDivElement,\n FormMessageContainerProps\n>(function FormMessageContainer(props, ref) {\n const { className, children, messageProps, ...remaining } = props;\n if (!messageProps) {\n return <>{children}</>;\n }\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={formMessageContainer({ className })}\n >\n {children}\n <FormMessage {...messageProps} />\n </div>\n );\n});\n"],"names":["forwardRef","FormMessage","formMessageContainer","FormMessageContainer","props","ref","className","children","messageProps","remaining","div"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAGxD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,oBAAoB,QAAQ,kCAAkC;AAgBvE;;;;;;CAMC,GACD,OAAO,MAAMC,qCAAuBH,WAGlC,SAASG,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGC,WAAW,GAAGL;IAC5D,IAAI,CAACI,cAAc;QACjB,qBAAO;sBAAGD;;IACZ;IAEA,qBACE,MAACG;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,qBAAqB;YAAEI;QAAU;;YAE3CC;0BACD,KAACN;gBAAa,GAAGO,YAAY;;;;AAGnC,GAAG"}
1
+ {"version":3,"sources":["../../src/form/FormMessageContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { FormMessage } from \"./FormMessage.js\";\nimport { formMessageContainer } from \"./formMessageContainerStyles.js\";\nimport { type FormMessageProps } from \"./types.js\";\n\n/**\n * @since 2.5.0\n */\nexport interface FormMessageContainerProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<FormMessageProps, HTMLDivElement>;\n}\n\n/**\n * Conditionally wraps the `children` in a `.rmd-form-message-container` wrapper\n * and renders the {@link FormMessage} component.\n *\n * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}\n * @since 2.5.0\n */\nexport const FormMessageContainer = forwardRef<\n HTMLDivElement,\n FormMessageContainerProps\n>(function FormMessageContainer(props, ref) {\n const { className, children, messageProps, ...remaining } = props;\n if (!messageProps) {\n return <>{children}</>;\n }\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={formMessageContainer({ className })}\n >\n {children}\n <FormMessage {...messageProps} />\n </div>\n );\n});\n"],"names":["forwardRef","FormMessage","formMessageContainer","FormMessageContainer","props","ref","className","children","messageProps","remaining","div"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAGxD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,oBAAoB,QAAQ,kCAAkC;AAgBvE;;;;;;CAMC,GACD,OAAO,MAAMC,qCAAuBH,WAGlC,SAASG,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGC,WAAW,GAAGL;IAC5D,IAAI,CAACI,cAAc;QACjB,qBAAO;sBAAGD;;IACZ;IAEA,qBACE,MAACG;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,qBAAqB;YAAEI;QAAU;;YAE3CC;0BACD,KAACN;gBAAa,GAAGO,YAAY;;;;AAGnC,GAAG"}
@@ -36,8 +36,8 @@ export interface FormMessageCounterProps extends HTMLAttributes<HTMLSpanElement>
36
36
  * }
37
37
  * ```
38
38
  *
39
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
40
- * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}
39
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
40
+ * @see {@link https://react-md.dev/components/text-field | TextField Demos}
41
41
  * @since 2.9.0
42
42
  */
43
43
  export declare function FormMessageCounter(props: FormMessageCounterProps): ReactElement;
@@ -25,8 +25,8 @@ import { formMessageCounter } from "./formMessageStyles.js";
25
25
  * }
26
26
  * ```
27
27
  *
28
- * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}
29
- * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}
28
+ * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}
29
+ * @see {@link https://react-md.dev/components/text-field | TextField Demos}
30
30
  * @since 2.9.0
31
31
  */ export function FormMessageCounter(props) {
32
32
  const { children, className, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/FormMessageCounter.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type ReactNode } from \"react\";\n\nimport { formMessageCounter } from \"./formMessageStyles.js\";\n\n/** @since 2.9.0 */\nexport interface FormMessageCounterProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The children to display in the counter. This is normally a string like:\n *\n * @example String Example\n * ```ts\n * `${min} / ${max}`\n * ```\n */\n children: ReactNode;\n}\n\n/**\n * This component can be used to create a \"counter\" within the\n * {@link FormMessage} component.\n *\n * Note: This is really only useful when using the {@link FormMessage} component\n * without a {@link TextField}.\n *\n * @example Example Usage\n * ```ts\n * interface ExampleProps {\n * min: number;\n * max: number;\n * }\n *\n * function Example({ min, max }: ExampleProps) {\n * return (\n * <FormMessage disableWrap>\n * <FormMessageCounter>\n * {`${min} / ${max}`}\n * </FormMessageCounter>\n * </FormMessage>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/form-message | FormMessage Demos}\n * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}\n * @since 2.9.0\n */\nexport function FormMessageCounter(\n props: FormMessageCounterProps\n): ReactElement {\n const { children, className, ...remaining } = props;\n\n return (\n <span {...remaining} className={formMessageCounter({ className })}>\n {children}\n </span>\n );\n}\n"],"names":["formMessageCounter","FormMessageCounter","props","children","className","remaining","span"],"mappings":";AAEA,SAASA,kBAAkB,QAAQ,yBAAyB;AAgB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC,mBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGH;IAE9C,qBACE,KAACI;QAAM,GAAGD,SAAS;QAAED,WAAWJ,mBAAmB;YAAEI;QAAU;kBAC5DD;;AAGP"}
1
+ {"version":3,"sources":["../../src/form/FormMessageCounter.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type ReactNode } from \"react\";\n\nimport { formMessageCounter } from \"./formMessageStyles.js\";\n\n/** @since 2.9.0 */\nexport interface FormMessageCounterProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * The children to display in the counter. This is normally a string like:\n *\n * @example String Example\n * ```ts\n * `${min} / ${max}`\n * ```\n */\n children: ReactNode;\n}\n\n/**\n * This component can be used to create a \"counter\" within the\n * {@link FormMessage} component.\n *\n * Note: This is really only useful when using the {@link FormMessage} component\n * without a {@link TextField}.\n *\n * @example Example Usage\n * ```ts\n * interface ExampleProps {\n * min: number;\n * max: number;\n * }\n *\n * function Example({ min, max }: ExampleProps) {\n * return (\n * <FormMessage disableWrap>\n * <FormMessageCounter>\n * {`${min} / ${max}`}\n * </FormMessageCounter>\n * </FormMessage>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/form-message | FormMessage Demos}\n * @see {@link https://react-md.dev/components/text-field | TextField Demos}\n * @since 2.9.0\n */\nexport function FormMessageCounter(\n props: FormMessageCounterProps\n): ReactElement {\n const { children, className, ...remaining } = props;\n\n return (\n <span {...remaining} className={formMessageCounter({ className })}>\n {children}\n </span>\n );\n}\n"],"names":["formMessageCounter","FormMessageCounter","props","children","className","remaining","span"],"mappings":";AAEA,SAASA,kBAAkB,QAAQ,yBAAyB;AAgB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC,mBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGH;IAE9C,qBACE,KAACI;QAAM,GAAGD,SAAS;QAAED,WAAWJ,mBAAmB;YAAEI;QAAU;kBAC5DD;;AAGP"}
@@ -178,8 +178,8 @@ export type InputToggleProps = CheckboxInputToggleProps | RadioInputToggleProps;
178
178
  /**
179
179
  * **Client Component**
180
180
  *
181
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
182
- * @see {@link https://next.react-md.dev/components/radio | Radio Demos}
181
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
182
+ * @see {@link https://react-md.dev/components/radio | Radio Demos}
183
183
  * @since 6.0.0 Now supports the `FormMessage` behavior and requires
184
184
  * different icons for each checked state.
185
185
  */
@@ -10,8 +10,8 @@ import { Label } from "./Label.js";
10
10
  /**
11
11
  * **Client Component**
12
12
  *
13
- * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}
14
- * @see {@link https://next.react-md.dev/components/radio | Radio Demos}
13
+ * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}
14
+ * @see {@link https://react-md.dev/components/radio | Radio Demos}
15
15
  * @since 6.0.0 Now supports the `FormMessage` behavior and requires
16
16
  * different icons for each checked state.
17
17
  */ export const InputToggle = /*#__PURE__*/ forwardRef(function InputToggle(props, ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/InputToggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { Label } from \"./Label.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableInputToggleIconProps {\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"normal\"`\n */\n size?: InputToggleSize;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(props.type)`\n */\n icon?: ReactNode;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(``${props.type}Checked``)`\n */\n checkedIcon?: ReactNode;\n\n /**\n * Any props that should be passed to the `<span>` that surrounds the current\n * icon element.\n */\n iconProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n\n /**\n * Optional style to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconStyle?: CSSProperties;\n\n /**\n * Optional className to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleLabelProps {\n /**\n * An optional label to display with the checkbox. If this is omitted, it is\n * recommended to provide an `aria-label` for accessibility.\n */\n label?: ReactNode;\n\n /**\n * Any props that should be passed to the `<Label>` component.\n *\n * Note: If `style` or `className` are provided in this object, they will be\n * ignored. Use the top-level `style` and `className` props instead.\n *\n * @example\n * ```\n * // bad\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * style: { color: \"red\" },\n * className: \"custom\"\n * }}\n *\n * // good\n * style={{ color: \"red\" }}\n * className=\"custom\"\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * }}\n * ```\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * @see {@link LabelClassNameOptions.gap}\n * @defaultValue `false`\n */\n disableLabelGap?: boolean;\n\n /**\n * Set this to `true` to swap the position of the {@link label} and the current\n * icon. This prop can be used with the {@link stacked} prop to change the\n * position if the icon and label:\n *\n * ____________________________________\n * | stacked | iconAfter | position |\n * ____________________________________\n * | | | icon label |\n * ____________________________________\n * | | X | label icon |\n * ____________________________________\n * | X | | icon |\n * | | | label |\n * ____________________________________\n * | X | X | label |\n * | | | icon |\n * ____________________________________\n *\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Set this to `true` if the label should be stacked instead of inline with\n * the current icon.\n *\n * @see {@link iconAfter}\n * @defaultValue `false`\n */\n stacked?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface BaseInputToggleProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\">,\n FormMessageContainerExtension,\n FormComponentStates,\n ConfigurableInputToggleIconProps,\n InputToggleLabelProps,\n ComponentWithRippleProps {\n /**\n * @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing\n * @defaultValue `type === \"checkbox\" ? \"off\" : undefined`\n */\n autoComplete?: string;\n}\n\n/**\n * @since 2.8.5\n * @since 6.0.0 Removed the `aria-controls` prop and added the\n * `indeterminateIcon` prop.\n */\nexport interface IndeterminateCheckboxProps {\n /**\n * Set this value to `true` if the checkbox is in an \"indeterminate\" state:\n *\n * - this checkbox controls the select all/select none behavior of other\n * checkboxes in a group\n * - at least one of the checkboxes have been checked\n * - the `checked` prop for this Checkbox should also be `true`\n *\n * You should normally use the `useCheckboxGroup` hook to handle this\n * behavior.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n\n /**\n * The icon to display when the checkbox is checked and the\n * {@link indeterminate} prop is `true`.\n *\n * @defaultValue `getIcon(\"checkboxIndeterminate\")`\n * @since 6.0.0\n */\n indeterminateIcon?: ReactNode;\n}\n\nexport interface CheckboxProps\n extends BaseInputToggleProps,\n IndeterminateCheckboxProps {}\n\n/** @since 6.0.0 */\nexport interface CheckboxInputToggleProps extends CheckboxProps {\n type: \"checkbox\";\n}\n\nexport interface RadioProps extends BaseInputToggleProps {\n /**\n * The value for the radio button.\n *\n * @since 6.0.0 This is now optional and no longer supports\n * `string[]` since there isn't much of a use case for array values.\n */\n value?: string | number;\n}\n\n/** @since 6.0.0 */\nexport interface RadioInputToggleProps extends RadioProps {\n type: \"radio\";\n}\n\n/**\n * @since 6.0.0 Updated to be a union between\n * `CheckboxInputToggleProps` and `RadioInputToggleProps`\n */\nexport type InputToggleProps = CheckboxInputToggleProps | RadioInputToggleProps;\n\n/**\n * **Client Component**\n *\n * @see {@link https://next.react-md.dev/components/checkbox | Checkbox Demos}\n * @see {@link https://next.react-md.dev/components/radio | Radio Demos}\n * @since 6.0.0 Now supports the `FormMessage` behavior and requires\n * different icons for each checked state.\n */\nexport const InputToggle = forwardRef<HTMLInputElement, InputToggleProps>(\n function InputToggle(props, ref) {\n const {\n id: propId,\n type,\n label,\n labelProps,\n style,\n className,\n autoComplete = type === \"checkbox\" ? \"off\" : undefined,\n disableLabelGap = false,\n stacked = false,\n iconAfter = false,\n size = \"normal\",\n error = false,\n active = false,\n indeterminate = false,\n messageProps,\n messageContainerProps,\n icon,\n checkedIcon,\n indeterminateIcon,\n iconProps,\n iconStyle,\n iconClassName,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n disableRipple,\n ...remaining\n } = props as CheckboxInputToggleProps;\n const { disabled = false, checked } = props;\n\n const id = useEnsuredId(propId, type);\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n mode: disableRipple ? \"none\" : undefined,\n disabled,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n });\n\n // set on the `remaining` object to bypass the eslint rule about\n // aria-checked not being valid for textbox role\n remaining[\"aria-checked\"] =\n (remaining[\"aria-checked\"] ?? indeterminate) ? \"mixed\" : undefined;\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n {...labelProps}\n gap={!disableLabelGap}\n style={style}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n className={className}\n >\n {label}\n <InputToggleIcon\n style={iconStyle}\n {...iconProps}\n className={cnb(\n pressedClassName,\n iconClassName,\n iconProps?.className\n )}\n error={error}\n checked={checked}\n disabled={disabled}\n size={size}\n type={type}\n icon={icon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n >\n <input\n {...remaining}\n {...handlers}\n autoComplete={autoComplete}\n id={id}\n ref={ref}\n type={type}\n className=\"rmd-hidden-input\"\n />\n {ripples}\n </InputToggleIcon>\n </Label>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["cnb","forwardRef","useElementInteraction","useEnsuredId","FormMessageContainer","InputToggleIcon","Label","InputToggle","props","ref","id","propId","type","label","labelProps","style","className","autoComplete","undefined","disableLabelGap","stacked","iconAfter","size","error","active","indeterminate","messageProps","messageContainerProps","icon","checkedIcon","indeterminateIcon","iconProps","iconStyle","iconClassName","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onDragStart","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","disableRipple","remaining","disabled","checked","pressedClassName","ripples","handlers","mode","gap","reversed","input"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAMEC,UAAU,QACL,QAAQ;AAGf,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,YAAY,QAAQ,qB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duC,KAAK,CAAClC;YACNJ,OAAOA;YACPK,SAASA;YACTkC,UAAU,CAACjC;YACXG,QAAQA;YACRD,OAAOA;YACPwB,UAAUA;YACV/B,WAAWA;;gBAEVH;8BACD,MAACR;oBACCU,OAAOiB;oBACN,GAAGD,SAAS;oBACbf,WAAWhB,IACTiD,kBACAhB,eACAF,WAAWf;oBAEbO,OAAOA;oBACPyB,SAASA;oBACTD,UAAUA;oBACVzB,MAAMA;oBACNV,MAAMA;oBACNgB,MAAMA;oBACNC,aAAaA;oBACbJ,eAAeA;oBACfK,mBAAmBA;;sCAEnB,KAACyB;4BACE,GAAGT,SAAS;4BACZ,GAAGK,QAAQ;4BACZlC,cAAcA;4BACdP,IAAIA;4BACJD,KAAKA;4BACLG,MAAMA;4BACNI,WAAU;;wBAEXkC;;;;;;AAKX,GACA"}
1
+ {"version":3,"sources":["../../src/form/InputToggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { Label } from \"./Label.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableInputToggleIconProps {\n /**\n * @see {@link InputToggleSize}\n * @defaultValue `\"normal\"`\n */\n size?: InputToggleSize;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(props.type)`\n */\n icon?: ReactNode;\n\n /**\n * The icon to use while unchecked. This defaults to the unchecked\n * checkbox/radio icon from the `ICON_CONFIG`.\n *\n * @defaultValue `getIcon(``${props.type}Checked``)`\n */\n checkedIcon?: ReactNode;\n\n /**\n * Any props that should be passed to the `<span>` that surrounds the current\n * icon element.\n */\n iconProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n\n /**\n * Optional style to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconStyle?: CSSProperties;\n\n /**\n * Optional className to set on the `<span>` that surrounds the current icon\n * element.\n */\n iconClassName?: string;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface InputToggleLabelProps {\n /**\n * An optional label to display with the checkbox. If this is omitted, it is\n * recommended to provide an `aria-label` for accessibility.\n */\n label?: ReactNode;\n\n /**\n * Any props that should be passed to the `<Label>` component.\n *\n * Note: If `style` or `className` are provided in this object, they will be\n * ignored. Use the top-level `style` and `className` props instead.\n *\n * @example\n * ```\n * // bad\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * style: { color: \"red\" },\n * className: \"custom\"\n * }}\n *\n * // good\n * style={{ color: \"red\" }}\n * className=\"custom\"\n * labelProps={{\n * \"aria-label\": \"checkbox\",\n * }}\n * ```\n */\n labelProps?: PropsWithRef<\n LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n >;\n\n /**\n * @see {@link LabelClassNameOptions.gap}\n * @defaultValue `false`\n */\n disableLabelGap?: boolean;\n\n /**\n * Set this to `true` to swap the position of the {@link label} and the current\n * icon. This prop can be used with the {@link stacked} prop to change the\n * position if the icon and label:\n *\n * ____________________________________\n * | stacked | iconAfter | position |\n * ____________________________________\n * | | | icon label |\n * ____________________________________\n * | | X | label icon |\n * ____________________________________\n * | X | | icon |\n * | | | label |\n * ____________________________________\n * | X | X | label |\n * | | | icon |\n * ____________________________________\n *\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * Set this to `true` if the label should be stacked instead of inline with\n * the current icon.\n *\n * @see {@link iconAfter}\n * @defaultValue `false`\n */\n stacked?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface BaseInputToggleProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\">,\n FormMessageContainerExtension,\n FormComponentStates,\n ConfigurableInputToggleIconProps,\n InputToggleLabelProps,\n ComponentWithRippleProps {\n /**\n * @see https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing\n * @defaultValue `type === \"checkbox\" ? \"off\" : undefined`\n */\n autoComplete?: string;\n}\n\n/**\n * @since 2.8.5\n * @since 6.0.0 Removed the `aria-controls` prop and added the\n * `indeterminateIcon` prop.\n */\nexport interface IndeterminateCheckboxProps {\n /**\n * Set this value to `true` if the checkbox is in an \"indeterminate\" state:\n *\n * - this checkbox controls the select all/select none behavior of other\n * checkboxes in a group\n * - at least one of the checkboxes have been checked\n * - the `checked` prop for this Checkbox should also be `true`\n *\n * You should normally use the `useCheckboxGroup` hook to handle this\n * behavior.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n\n /**\n * The icon to display when the checkbox is checked and the\n * {@link indeterminate} prop is `true`.\n *\n * @defaultValue `getIcon(\"checkboxIndeterminate\")`\n * @since 6.0.0\n */\n indeterminateIcon?: ReactNode;\n}\n\nexport interface CheckboxProps\n extends BaseInputToggleProps,\n IndeterminateCheckboxProps {}\n\n/** @since 6.0.0 */\nexport interface CheckboxInputToggleProps extends CheckboxProps {\n type: \"checkbox\";\n}\n\nexport interface RadioProps extends BaseInputToggleProps {\n /**\n * The value for the radio button.\n *\n * @since 6.0.0 This is now optional and no longer supports\n * `string[]` since there isn't much of a use case for array values.\n */\n value?: string | number;\n}\n\n/** @since 6.0.0 */\nexport interface RadioInputToggleProps extends RadioProps {\n type: \"radio\";\n}\n\n/**\n * @since 6.0.0 Updated to be a union between\n * `CheckboxInputToggleProps` and `RadioInputToggleProps`\n */\nexport type InputToggleProps = CheckboxInputToggleProps | RadioInputToggleProps;\n\n/**\n * **Client Component**\n *\n * @see {@link https://react-md.dev/components/checkbox | Checkbox Demos}\n * @see {@link https://react-md.dev/components/radio | Radio Demos}\n * @since 6.0.0 Now supports the `FormMessage` behavior and requires\n * different icons for each checked state.\n */\nexport const InputToggle = forwardRef<HTMLInputElement, InputToggleProps>(\n function InputToggle(props, ref) {\n const {\n id: propId,\n type,\n label,\n labelProps,\n style,\n className,\n autoComplete = type === \"checkbox\" ? \"off\" : undefined,\n disableLabelGap = false,\n stacked = false,\n iconAfter = false,\n size = \"normal\",\n error = false,\n active = false,\n indeterminate = false,\n messageProps,\n messageContainerProps,\n icon,\n checkedIcon,\n indeterminateIcon,\n iconProps,\n iconStyle,\n iconClassName,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n disableRipple,\n ...remaining\n } = props as CheckboxInputToggleProps;\n const { disabled = false, checked } = props;\n\n const id = useEnsuredId(propId, type);\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n mode: disableRipple ? \"none\" : undefined,\n disabled,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onDragStart,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n });\n\n // set on the `remaining` object to bypass the eslint rule about\n // aria-checked not being valid for textbox role\n remaining[\"aria-checked\"] =\n (remaining[\"aria-checked\"] ?? indeterminate) ? \"mixed\" : undefined;\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n {...labelProps}\n gap={!disableLabelGap}\n style={style}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n className={className}\n >\n {label}\n <InputToggleIcon\n style={iconStyle}\n {...iconProps}\n className={cnb(\n pressedClassName,\n iconClassName,\n iconProps?.className\n )}\n error={error}\n checked={checked}\n disabled={disabled}\n size={size}\n type={type}\n icon={icon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n >\n <input\n {...remaining}\n {...handlers}\n autoComplete={autoComplete}\n id={id}\n ref={ref}\n type={type}\n className=\"rmd-hidden-input\"\n />\n {ripples}\n </InputToggleIcon>\n </Label>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["cnb","forwardRef","useElementInteraction","useEnsuredId","FormMessageContainer","InputToggleIcon","Label","InputToggle","props","ref","id","propId","type","label","labelProps","style","className","autoComplete","undefined","disableLabelGap","stacked","iconAfter","size","error","active","indeterminate","messageProps","messageContainerProps","icon","checkedIcon","indeterminateIcon","iconProps","iconStyle","iconClassName","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onDragStart","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","disableRipple","remaining","disabled","checked","pressedClassName","ripples","handlers","mode","gap","reversed","input"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAMEC,UAAU,QACL,QAAQ;AAGf,SAASC,qBAAqB,QAAQ,0CAA0C;AAEhF,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,QAAQ,aAAa;AAgNnC;;;;;;;CAOC,GACD,OAAO,MAAMC,4BAAcN,WACzB,SAASM,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,IAAIC,MAAM,EACVC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,eAAeL,SAAS,aAAa,QAAQM,SAAS,EACtDC,kBAAkB,KAAK,EACvBC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,OAAO,QAAQ,EACfC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,gBAAgB,KAAK,EACrBC,YAAY,EACZC,qBAAqB,EACrBC,IAAI,E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AAKX,GACA"}
@@ -15,9 +15,9 @@ declare module "react" {
15
15
  * you need to separate the label from an existing form component or you need to
16
16
  * create a custom implementation of a form component.
17
17
  *
18
- * @see {@link https://next.react-md.dev/components/select | Select Demos}
19
- * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}
20
- * @see {@link https://next.react-md.dev/components/text-field#simple-textarea | TextArea Demos}
18
+ * @see {@link https://react-md.dev/components/select | Select Demos}
19
+ * @see {@link https://react-md.dev/components/text-field | TextField Demos}
20
+ * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}
21
21
  * @since 6.0.0 Updated to be usable externally and combines the
22
22
  * floating label styles instead of having separate components.
23
23
  */
@@ -7,9 +7,9 @@ import { label } from "./labelStyles.js";
7
7
  * you need to separate the label from an existing form component or you need to
8
8
  * create a custom implementation of a form component.
9
9
  *
10
- * @see {@link https://next.react-md.dev/components/select | Select Demos}
11
- * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}
12
- * @see {@link https://next.react-md.dev/components/text-field#simple-textarea | TextArea Demos}
10
+ * @see {@link https://react-md.dev/components/select | Select Demos}
11
+ * @see {@link https://react-md.dev/components/text-field | TextField Demos}
12
+ * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}
13
13
  * @since 6.0.0 Updated to be usable externally and combines the
14
14
  * floating label styles instead of having separate components.
15
15
  */ export const Label = /*#__PURE__*/ forwardRef(function Label(props, ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Label.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { label } from \"./labelStyles.js\";\nimport { type LabelProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-label-floating-x\"?: string | number;\n \"--rmd-label-floating-y\"?: string | number;\n \"--rmd-label-floating-active-x\"?: string | number;\n \"--rmd-label-floating-active-y\"?: string | number;\n \"--rmd-label-active-padding\"?: string | number;\n \"--rmd-label-active-background-color\"?: string;\n }\n}\n\n/**\n * Most of the form components already use this `Label` internally when a\n * `label` prop has been provided. You should generally use this component if\n * you need to separate the label from an existing form component or you need to\n * create a custom implementation of a form component.\n *\n * @see {@link https://next.react-md.dev/components/select | Select Demos}\n * @see {@link https://next.react-md.dev/components/text-field | TextField Demos}\n * @see {@link https://next.react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n * @since 6.0.0 Updated to be usable externally and combines the\n * floating label styles instead of having separate components.\n */\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n function Label(props, ref) {\n const {\n gap,\n error,\n dense,\n active,\n stacked,\n reversed,\n disabled,\n floating,\n inactive,\n floatingActive = active,\n className,\n children,\n ...remaining\n } = props;\n\n return (\n <label\n ref={ref}\n {...remaining}\n className={label({\n gap,\n error,\n dense,\n active,\n stacked,\n reversed,\n disabled,\n floating,\n floatingActive,\n inactive,\n className,\n })}\n >\n {children}\n </label>\n );\n }\n);\n"],"names":["forwardRef","label","Label","props","ref","gap","error","dense","active","stacked","reversed","disabled","floating","inactive","floatingActive","className","children","remaining"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,KAAK,QAAQ,mBAAmB;AAczC;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,sBAAQF,WACnB,SAASE,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,GAAG,EACHC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,iBAAiBN,MAAM,EACvBO,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGd;IAEJ,qBACE,KAACF;QACCG,KAAKA;QACJ,GAAGa,SAAS;QACbF,WAAWd,MAAM;YACfI;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAD;YACAE;QACF;kBAECC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Label.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { label } from \"./labelStyles.js\";\nimport { type LabelProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-label-floating-x\"?: string | number;\n \"--rmd-label-floating-y\"?: string | number;\n \"--rmd-label-floating-active-x\"?: string | number;\n \"--rmd-label-floating-active-y\"?: string | number;\n \"--rmd-label-active-padding\"?: string | number;\n \"--rmd-label-active-background-color\"?: string;\n }\n}\n\n/**\n * Most of the form components already use this `Label` internally when a\n * `label` prop has been provided. You should generally use this component if\n * you need to separate the label from an existing form component or you need to\n * create a custom implementation of a form component.\n *\n * @see {@link https://react-md.dev/components/select | Select Demos}\n * @see {@link https://react-md.dev/components/text-field | TextField Demos}\n * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n * @since 6.0.0 Updated to be usable externally and combines the\n * floating label styles instead of having separate components.\n */\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n function Label(props, ref) {\n const {\n gap,\n error,\n dense,\n active,\n stacked,\n reversed,\n disabled,\n floating,\n inactive,\n floatingActive = active,\n className,\n children,\n ...remaining\n } = props;\n\n return (\n <label\n ref={ref}\n {...remaining}\n className={label({\n gap,\n error,\n dense,\n active,\n stacked,\n reversed,\n disabled,\n floating,\n floatingActive,\n inactive,\n className,\n })}\n >\n {children}\n </label>\n );\n }\n);\n"],"names":["forwardRef","label","Label","props","ref","gap","error","dense","active","stacked","reversed","disabled","floating","inactive","floatingActive","className","children","remaining"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,KAAK,QAAQ,mBAAmB;AAczC;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,sBAAQF,WACnB,SAASE,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,GAAG,EACHC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,iBAAiBN,MAAM,EACvBO,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGd;IAEJ,qBACE,KAACF;QACCG,KAAKA;QACJ,GAAGa,SAAS;QACbF,WAAWd,MAAM;YACfI;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAD;YACAE;QACF;kBAECC;;AAGP,GACA"}
@@ -11,7 +11,7 @@ export interface LegendProps extends TypographyProps {
11
11
  /**
12
12
  * This should be used within a `Fieldset` to apply a label.
13
13
  *
14
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
14
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
15
15
  * @since 6.0.0
16
16
  */
17
17
  export declare const Legend: import("react").ForwardRefExoticComponent<LegendProps & import("react").RefAttributes<HTMLLegendElement>>;
@@ -6,7 +6,7 @@ import { Typography } from "../typography/Typography.js";
6
6
  /**
7
7
  * This should be used within a `Fieldset` to apply a label.
8
8
  *
9
- * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}
9
+ * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}
10
10
  * @since 6.0.0
11
11
  */ export const Legend = /*#__PURE__*/ forwardRef(function Legend(props, ref) {
12
12
  const { srOnly = false, className, children, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Legend.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { Typography, type TypographyProps } from \"../typography/Typography.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface LegendProps extends TypographyProps {\n /**\n * @defaultValue `false`\n */\n srOnly?: boolean;\n}\n\n/**\n * This should be used within a `Fieldset` to apply a label.\n *\n * @see {@link https://next.react-md.dev/components/fieldset | Fieldset Demos}\n * @since 6.0.0\n */\nexport const Legend = forwardRef<HTMLLegendElement, LegendProps>(\n function Legend(props, ref) {\n const { srOnly = false, className, children, ...remaining } = props;\n\n return (\n <Typography\n {...remaining}\n as=\"legend\"\n ref={ref}\n className={cnb(\"rmd-legend\", cssUtils({ srOnly }), className)}\n >\n {children}\n </Typography>\n );\n }\n);\n"],"names":["cnb","forwardRef","cssUtils","Typography","Legend","props","ref","srOnly","className","children","remaining","as"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AAEnC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,UAAU,QAA8B,8BAA8B;AAY/E;;;;;CAKC,GACD,OAAO,MAAMC,uBAASH,WACpB,SAASG,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EAAEC,SAAS,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAE9D,qBACE,KAACF;QACE,GAAGO,SAAS;QACbC,IAAG;QACHL,KAAKA;QACLE,WAAWR,IAAI,cAAcE,SAAS;YAAEK;QAAO,IAAIC;kBAElDC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/Legend.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef } from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { Typography, type TypographyProps } from \"../typography/Typography.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface LegendProps extends TypographyProps {\n /**\n * @defaultValue `false`\n */\n srOnly?: boolean;\n}\n\n/**\n * This should be used within a `Fieldset` to apply a label.\n *\n * @see {@link https://react-md.dev/components/fieldset | Fieldset Demos}\n * @since 6.0.0\n */\nexport const Legend = forwardRef<HTMLLegendElement, LegendProps>(\n function Legend(props, ref) {\n const { srOnly = false, className, children, ...remaining } = props;\n\n return (\n <Typography\n {...remaining}\n as=\"legend\"\n ref={ref}\n className={cnb(\"rmd-legend\", cssUtils({ srOnly }), className)}\n >\n {children}\n </Typography>\n );\n }\n);\n"],"names":["cnb","forwardRef","cssUtils","Typography","Legend","props","ref","srOnly","className","children","remaining","as"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAQ,QAAQ;AAEnC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,UAAU,QAA8B,8BAA8B;AAY/E;;;;;CAKC,GACD,OAAO,MAAMC,uBAASH,WACpB,SAASG,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EAAEC,SAAS,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAE9D,qBACE,KAACF;QACE,GAAGO,SAAS;QACbC,IAAG;QACHL,KAAKA;QACLE,WAAWR,IAAI,cAAcE,SAAS;YAAEK;QAAO,IAAIC;kBAElDC;;AAGP,GACA"}
@@ -82,6 +82,6 @@ export interface NativeSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectE
82
82
  * }
83
83
  * ```
84
84
  *
85
- * @see {@link https://next.react-md.dev/components/native-select | NativeSelect Demos}
85
+ * @see {@link https://react-md.dev/components/native-select | NativeSelect Demos}
86
86
  */
87
87
  export declare const NativeSelect: import("react").ForwardRefExoticComponent<NativeSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
@@ -50,7 +50,7 @@ import { nativeSelect, nativeSelectContainer } from "./nativeSelectStyles.js";
50
50
  * }
51
51
  * ```
52
52
  *
53
- * @see {@link https://next.react-md.dev/components/native-select | NativeSelect Demos}
53
+ * @see {@link https://react-md.dev/components/native-select | NativeSelect Demos}
54
54
  */ export const NativeSelect = /*#__PURE__*/ forwardRef(function NativeSelect(props, ref) {
55
55
  const { id: propId, style, className, icon: propIcon, label, labelProps, labelStyle, labelClassName, selectStyle, selectClassName, autoCompleteValue, autoComplete = autoCompleteValue, name = autoCompleteValue, dense, error, active, inline, leftAddon, rightAddon: propRightAddon, leftAddonProps, rightAddonProps, disableLeftAddonStyles, disableRightAddonStyles, theme: propTheme, underlineDirection: propUnderlineDirection, messageProps, messageContainerProps, containerProps, children, ...remaining } = props;
56
56
  const { disabled, readOnly, multiple } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/NativeSelect.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n type SelectHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { nativeSelect, nativeSelectContainer } from \"./nativeSelectStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0 Added support for {@link UserAgentAutocompleteProps}\n */\nexport interface NativeSelectProps\n extends Omit<SelectHTMLAttributes<HTMLSelectElement>, \"autoComplete\">,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * A custom dropdown icon to use instead of the browser's default select\n * dropdown icon.\n *\n * Set this to `null` if the browser's default icon should be used instead.\n *\n * @defaultValue `getIcon(\"dropdown\")`\n */\n icon?: ReactNode;\n\n /**\n * This applies custom inline styles to the `<select>` element since the\n * `style` prop is applied to the container element instead.\n */\n selectStyle?: CSSProperties;\n\n /**\n * This applies custom className to the `<select>` element since the\n * `className` prop is applied to the container element instead.\n */\n selectClassName?: string;\n\n /**\n * This should be a list of `<option>` elements for specific values within the\n * `<select>`.\n *\n * Check out the {@link NativeSelect} for examples around using \"placeholder\"\n * text and requiring a value to be selected.\n */\n children: ReactNode;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * This component is a wrapper for the native `<select>` field that applies the\n * same theming as `TextField` and `TextArea` components. This component might\n * not be used much since the `Select` offers more styling options.\n *\n * @example Simple Example\n * ```tsx\n * <NativeSelect label=\"Label\">\n * <option value=\"a\">Value 1</option>\n * <option value=\"b\">Value 2</option>\n * <option value=\"c\">Value 3</option>\n * <option value=\"d\">Value 4</option>\n * </NativeSelect>\n * ```\n *\n * @example Required Value Example\n * ```tsx\n * function Example(): ReactElement {\n * // using `defaultValue=\"\"` makes it so the first option selected by default\n * // and considered an \"invalid\" value since it is `disabled`\n * //\n * // a `name` must be set with `required` so that the form validation will\n * // fire if the value is still the empty string when the form is submitted\n * //\n * // the first `<option>` is kind of like placeholder text since it doesn't\n * // have a value and is disabled by default\n *\n * return (\n * <NativeSelect\n * label=\"State\"\n * name=\"state\"\n * required\n * defaultValue=\"\"\n * >\n * <option value=\"\" disabled>Choose a state</option>\n * {states.map(({ name, code }) => (\n * <option key={code} value={code}>{name}</option>\n * ))}\n * </NativeSelect>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/native-select | NativeSelect Demos}\n */\nexport const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(\n function NativeSelect(props, ref) {\n const {\n id: propId,\n style,\n className,\n icon: propIcon,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n selectStyle,\n selectClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n leftAddon,\n rightAddon: propRightAddon,\n leftAddonProps,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n children,\n ...remaining\n } = props;\n const { disabled, readOnly, multiple } = props;\n const id = useEnsuredId(propId, \"select\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const icon = getIcon(\"dropdown\", propIcon);\n const underlined = theme === \"underline\" || theme === \"filled\";\n\n let rightAddon = propRightAddon;\n if (typeof propRightAddon === \"undefined\" && !multiple) {\n rightAddon = icon;\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={nativeSelectContainer({\n label: !!label,\n multiple,\n underlined,\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <select\n {...remaining}\n id={id}\n ref={ref}\n autoComplete={autoComplete}\n name={name}\n disabled={disabled}\n style={selectStyle}\n className={nativeSelect({\n icon: !!icon,\n className: selectClassName,\n })}\n >\n {children}\n </select>\n {label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","getIcon","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","getFormConfig","nativeSelect","nativeSelectContainer","NativeSelect","props","ref","id","propId","style","className","icon","propIcon","label","labelProps","labelStyle","labelClassName","selectStyle","selectClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","leftAddon","rightAddon","propRightAddon","leftAddonProps","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","children","remaining","disabled","readOnly","multiple","underlined","select","htmlFor","floating"],"mappings":";AAAA,SAKEA,UAAU,QACL,QAAQ;AAEf,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,Q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,OAAOA;YACPC,WAAWP,sBAAsB;gBAC/BU,OAAO,CAAC,CAACA;gBACT+B;gBACAC;gBACAnC;YACF;YACAuB,OAAOA;YACPpB,OAAO,CAAC,CAACA;YACTU,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRmB,UAAUA;YACVD,UAAUA;YACVhB,WAAWA;YACXG,gBAAgBA;YAChBF,YAAYA;YACZG,iBAAiBA;YACjBK,oBAAoBA;YACpBJ,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACc;oBACE,GAAGL,SAAS;oBACblC,IAAIA;oBACJD,KAAKA;oBACLc,cAAcA;oBACdC,MAAMA;oBACNqB,UAAUA;oBACVjC,OAAOQ;oBACPP,WAAWR,aAAa;wBACtBS,MAAM,CAAC,CAACA;wBACRD,WAAWQ;oBACb;8BAECsB;;gBAEF3B,uBACC,KAACd;oBACE,GAAGe,UAAU;oBACdiC,SAASxC;oBACTE,OAAOK,YAAYL,SAASM;oBAC5BL,WAAWI,YAAYJ,aAAaM;oBACpCgC,QAAQ;oBACR1B,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRkB,UAAUA;8BAET7B;;;;;AAMb,GACA"}
1
+ {"version":3,"sources":["../../src/form/NativeSelect.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n type SelectHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { nativeSelect, nativeSelectContainer } from \"./nativeSelectStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * @since 6.0.0 Added support for {@link UserAgentAutocompleteProps}\n */\nexport interface NativeSelectProps\n extends Omit<SelectHTMLAttributes<HTMLSelectElement>, \"autoComplete\">,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * A custom dropdown icon to use instead of the browser's default select\n * dropdown icon.\n *\n * Set this to `null` if the browser's default icon should be used instead.\n *\n * @defaultValue `getIcon(\"dropdown\")`\n */\n icon?: ReactNode;\n\n /**\n * This applies custom inline styles to the `<select>` element since the\n * `style` prop is applied to the container element instead.\n */\n selectStyle?: CSSProperties;\n\n /**\n * This applies custom className to the `<select>` element since the\n * `className` prop is applied to the container element instead.\n */\n selectClassName?: string;\n\n /**\n * This should be a list of `<option>` elements for specific values within the\n * `<select>`.\n *\n * Check out the {@link NativeSelect} for examples around using \"placeholder\"\n * text and requiring a value to be selected.\n */\n children: ReactNode;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * This component is a wrapper for the native `<select>` field that applies the\n * same theming as `TextField` and `TextArea` components. This component might\n * not be used much since the `Select` offers more styling options.\n *\n * @example Simple Example\n * ```tsx\n * <NativeSelect label=\"Label\">\n * <option value=\"a\">Value 1</option>\n * <option value=\"b\">Value 2</option>\n * <option value=\"c\">Value 3</option>\n * <option value=\"d\">Value 4</option>\n * </NativeSelect>\n * ```\n *\n * @example Required Value Example\n * ```tsx\n * function Example(): ReactElement {\n * // using `defaultValue=\"\"` makes it so the first option selected by default\n * // and considered an \"invalid\" value since it is `disabled`\n * //\n * // a `name` must be set with `required` so that the form validation will\n * // fire if the value is still the empty string when the form is submitted\n * //\n * // the first `<option>` is kind of like placeholder text since it doesn't\n * // have a value and is disabled by default\n *\n * return (\n * <NativeSelect\n * label=\"State\"\n * name=\"state\"\n * required\n * defaultValue=\"\"\n * >\n * <option value=\"\" disabled>Choose a state</option>\n * {states.map(({ name, code }) => (\n * <option key={code} value={code}>{name}</option>\n * ))}\n * </NativeSelect>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/native-select | NativeSelect Demos}\n */\nexport const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(\n function NativeSelect(props, ref) {\n const {\n id: propId,\n style,\n className,\n icon: propIcon,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n selectStyle,\n selectClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n leftAddon,\n rightAddon: propRightAddon,\n leftAddonProps,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n children,\n ...remaining\n } = props;\n const { disabled, readOnly, multiple } = props;\n const id = useEnsuredId(propId, \"select\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const icon = getIcon(\"dropdown\", propIcon);\n const underlined = theme === \"underline\" || theme === \"filled\";\n\n let rightAddon = propRightAddon;\n if (typeof propRightAddon === \"undefined\" && !multiple) {\n rightAddon = icon;\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={nativeSelectContainer({\n label: !!label,\n multiple,\n underlined,\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <select\n {...remaining}\n id={id}\n ref={ref}\n autoComplete={autoComplete}\n name={name}\n disabled={disabled}\n style={selectStyle}\n className={nativeSelect({\n icon: !!icon,\n className: selectClassName,\n })}\n >\n {children}\n </select>\n {label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","getIcon","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","getFormConfig","nativeSelect","nativeSelectContainer","NativeSelect","props","ref","id","propId","style","className","icon","propIcon","label","labelProps","labelStyle","labelClassName","selectStyle","selectClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","leftAddon","rightAddon","propRightAddon","leftAddonProps","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","children","remaining","disabled","readOnly","multiple","underlined","select","htmlFor","floating"],"mappings":";AAAA,SAKEA,UAAU,QACL,QAAQ;AAEf,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,0BAA0B;AAoD9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CC,GACD,OAAO,MAAMC,6BAAeT,WAC1B,SAASS,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,MAAMC,QAAQ,EACdC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,eAAe,EACfC,iBAAiB,EACjBC,eAAeD,iBAAiB,EAChCE,O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Aa;wBACtBS,MAAM,CAAC,CAACA;wBACRD,WAAWQ;oBACb;8BAECsB;;gBAEF3B,uBACC,KAACd;oBACE,GAAGe,UAAU;oBACdiC,SAASxC;oBACTE,OAAOK,YAAYL,SAASM;oBAC5BL,WAAWI,YAAYJ,aAAaM;oBACpCgC,QAAQ;oBACR1B,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRkB,UAAUA;8BAET7B;;;;;AAMb,GACA"}
@@ -55,7 +55,7 @@ export interface OptGroupProps extends Omit<ListProps, "role"> {
55
55
  * }
56
56
  * ```
57
57
  *
58
- * @see {@link https://next.react-md.dev/components/select | Select Demos}
58
+ * @see {@link https://react-md.dev/components/select | Select Demos}
59
59
  * @since 6.0.0
60
60
  */
61
61
  export declare const OptGroup: import("react").ForwardRefExoticComponent<OptGroupProps & import("react").RefAttributes<ListElement>>;