@react-md/core 6.5.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/dist/app-bar/AppBar.d.ts +3 -2
  2. package/dist/app-bar/AppBar.js +3 -4
  3. package/dist/app-bar/AppBar.js.map +1 -1
  4. package/dist/app-bar/AppBarTitle.d.ts +3 -1
  5. package/dist/app-bar/AppBarTitle.js +3 -4
  6. package/dist/app-bar/AppBarTitle.js.map +1 -1
  7. package/dist/autocomplete/AutocompleteChip.d.ts +2 -1
  8. package/dist/autocomplete/AutocompleteChip.js +3 -4
  9. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  10. package/dist/autocomplete/types.d.ts +1 -0
  11. package/dist/autocomplete/types.js.map +1 -1
  12. package/dist/autocomplete/utils.d.ts +4 -4
  13. package/dist/autocomplete/utils.js.map +1 -1
  14. package/dist/avatar/Avatar.d.ts +3 -2
  15. package/dist/avatar/Avatar.js +3 -4
  16. package/dist/avatar/Avatar.js.map +1 -1
  17. package/dist/badge/Badge.d.ts +3 -2
  18. package/dist/badge/Badge.js +3 -4
  19. package/dist/badge/Badge.js.map +1 -1
  20. package/dist/box/Box.d.ts +3 -2
  21. package/dist/box/Box.js +3 -4
  22. package/dist/box/Box.js.map +1 -1
  23. package/dist/button/AsyncButton.d.ts +3 -2
  24. package/dist/button/AsyncButton.js +3 -4
  25. package/dist/button/AsyncButton.js.map +1 -1
  26. package/dist/button/Button.d.ts +3 -2
  27. package/dist/button/Button.js +3 -4
  28. package/dist/button/Button.js.map +1 -1
  29. package/dist/button/ButtonUnstyled.d.ts +5 -3
  30. package/dist/button/ButtonUnstyled.js +3 -4
  31. package/dist/button/ButtonUnstyled.js.map +1 -1
  32. package/dist/button/FloatingActionButton.d.ts +3 -2
  33. package/dist/button/FloatingActionButton.js +3 -4
  34. package/dist/button/FloatingActionButton.js.map +1 -1
  35. package/dist/button/TooltippedButton.d.ts +3 -2
  36. package/dist/button/TooltippedButton.js +3 -4
  37. package/dist/button/TooltippedButton.js.map +1 -1
  38. package/dist/card/Card.d.ts +3 -2
  39. package/dist/card/Card.js +3 -4
  40. package/dist/card/Card.js.map +1 -1
  41. package/dist/card/CardContent.d.ts +3 -2
  42. package/dist/card/CardContent.js +3 -4
  43. package/dist/card/CardContent.js.map +1 -1
  44. package/dist/card/CardFooter.d.ts +3 -1
  45. package/dist/card/CardFooter.js +3 -4
  46. package/dist/card/CardFooter.js.map +1 -1
  47. package/dist/card/CardHeader.d.ts +3 -2
  48. package/dist/card/CardHeader.js +3 -4
  49. package/dist/card/CardHeader.js.map +1 -1
  50. package/dist/card/CardSubtitle.d.ts +3 -1
  51. package/dist/card/CardSubtitle.js +3 -4
  52. package/dist/card/CardSubtitle.js.map +1 -1
  53. package/dist/card/CardTitle.d.ts +3 -1
  54. package/dist/card/CardTitle.js +3 -4
  55. package/dist/card/CardTitle.js.map +1 -1
  56. package/dist/card/ClickableCard.d.ts +3 -2
  57. package/dist/card/ClickableCard.js +3 -4
  58. package/dist/card/ClickableCard.js.map +1 -1
  59. package/dist/chip/Chip.d.ts +4 -2
  60. package/dist/chip/Chip.js +4 -4
  61. package/dist/chip/Chip.js.map +1 -1
  62. package/dist/datetime/NativeDateField.d.ts +3 -1
  63. package/dist/datetime/NativeDateField.js +3 -4
  64. package/dist/datetime/NativeDateField.js.map +1 -1
  65. package/dist/datetime/NativeTimeField.d.ts +3 -1
  66. package/dist/datetime/NativeTimeField.js +3 -4
  67. package/dist/datetime/NativeTimeField.js.map +1 -1
  68. package/dist/dialog/Dialog.d.ts +3 -2
  69. package/dist/dialog/Dialog.js +4 -4
  70. package/dist/dialog/Dialog.js.map +1 -1
  71. package/dist/dialog/DialogContainer.d.ts +3 -2
  72. package/dist/dialog/DialogContainer.js +3 -4
  73. package/dist/dialog/DialogContainer.js.map +1 -1
  74. package/dist/dialog/DialogContent.d.ts +3 -2
  75. package/dist/dialog/DialogContent.js +3 -4
  76. package/dist/dialog/DialogContent.js.map +1 -1
  77. package/dist/dialog/DialogFooter.d.ts +3 -2
  78. package/dist/dialog/DialogFooter.js +3 -4
  79. package/dist/dialog/DialogFooter.js.map +1 -1
  80. package/dist/dialog/DialogHeader.d.ts +3 -1
  81. package/dist/dialog/DialogHeader.js +3 -4
  82. package/dist/dialog/DialogHeader.js.map +1 -1
  83. package/dist/dialog/DialogTitle.d.ts +3 -1
  84. package/dist/dialog/DialogTitle.js +3 -4
  85. package/dist/dialog/DialogTitle.js.map +1 -1
  86. package/dist/dialog/FixedDialog.d.ts +4 -3
  87. package/dist/dialog/FixedDialog.js +4 -4
  88. package/dist/dialog/FixedDialog.js.map +1 -1
  89. package/dist/divider/Divider.d.ts +3 -2
  90. package/dist/divider/Divider.js +3 -4
  91. package/dist/divider/Divider.js.map +1 -1
  92. package/dist/draggable/useDraggable.d.ts +3 -3
  93. package/dist/draggable/useDraggable.js.map +1 -1
  94. package/dist/draggable/utils.d.ts +1 -1
  95. package/dist/draggable/utils.js.map +1 -1
  96. package/dist/expansion-panel/ExpansionList.d.ts +3 -2
  97. package/dist/expansion-panel/ExpansionList.js +3 -4
  98. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.d.ts +3 -2
  100. package/dist/expansion-panel/ExpansionPanel.js +3 -4
  101. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -2
  103. package/dist/expansion-panel/ExpansionPanelHeader.js +3 -4
  104. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  105. package/dist/files/FileInput.d.ts +3 -2
  106. package/dist/files/FileInput.js +3 -4
  107. package/dist/files/FileInput.js.map +1 -1
  108. package/dist/focus/useFocusContainer.d.ts +1 -1
  109. package/dist/focus/useFocusContainer.js.map +1 -1
  110. package/dist/form/Checkbox.d.ts +2 -1
  111. package/dist/form/Checkbox.js +4 -4
  112. package/dist/form/Checkbox.js.map +1 -1
  113. package/dist/form/Fieldset.d.ts +3 -2
  114. package/dist/form/Fieldset.js +3 -4
  115. package/dist/form/Fieldset.js.map +1 -1
  116. package/dist/form/Form.d.ts +3 -2
  117. package/dist/form/Form.js +3 -4
  118. package/dist/form/Form.js.map +1 -1
  119. package/dist/form/FormMessage.d.ts +8 -2
  120. package/dist/form/FormMessage.js +3 -4
  121. package/dist/form/FormMessage.js.map +1 -1
  122. package/dist/form/FormMessageContainer.d.ts +5 -4
  123. package/dist/form/FormMessageContainer.js +3 -4
  124. package/dist/form/FormMessageContainer.js.map +1 -1
  125. package/dist/form/FormMessageCounter.d.ts +3 -2
  126. package/dist/form/FormMessageCounter.js +3 -4
  127. package/dist/form/FormMessageCounter.js.map +1 -1
  128. package/dist/form/InputToggle.d.ts +3 -2
  129. package/dist/form/InputToggle.js +3 -4
  130. package/dist/form/InputToggle.js.map +1 -1
  131. package/dist/form/InputToggleIcon.d.ts +3 -2
  132. package/dist/form/InputToggleIcon.js +3 -4
  133. package/dist/form/InputToggleIcon.js.map +1 -1
  134. package/dist/form/Label.d.ts +2 -1
  135. package/dist/form/Label.js +3 -4
  136. package/dist/form/Label.js.map +1 -1
  137. package/dist/form/Legend.d.ts +3 -1
  138. package/dist/form/Legend.js +3 -4
  139. package/dist/form/Legend.js.map +1 -1
  140. package/dist/form/NativeSelect.d.ts +3 -2
  141. package/dist/form/NativeSelect.js +3 -4
  142. package/dist/form/NativeSelect.js.map +1 -1
  143. package/dist/form/OptGroup.d.ts +3 -2
  144. package/dist/form/OptGroup.js +3 -4
  145. package/dist/form/OptGroup.js.map +1 -1
  146. package/dist/form/Option.d.ts +3 -2
  147. package/dist/form/Option.js +4 -4
  148. package/dist/form/Option.js.map +1 -1
  149. package/dist/form/Password.d.ts +2 -2
  150. package/dist/form/Password.js +3 -4
  151. package/dist/form/Password.js.map +1 -1
  152. package/dist/form/Radio.d.ts +2 -1
  153. package/dist/form/Radio.js +4 -4
  154. package/dist/form/Radio.js.map +1 -1
  155. package/dist/form/ResizingTextAreaWrapper.d.ts +3 -2
  156. package/dist/form/ResizingTextAreaWrapper.js +3 -4
  157. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  158. package/dist/form/SliderContainer.d.ts +3 -2
  159. package/dist/form/SliderContainer.js +3 -4
  160. package/dist/form/SliderContainer.js.map +1 -1
  161. package/dist/form/SliderThumb.d.ts +3 -2
  162. package/dist/form/SliderThumb.js +4 -4
  163. package/dist/form/SliderThumb.js.map +1 -1
  164. package/dist/form/SliderTrack.d.ts +3 -2
  165. package/dist/form/SliderTrack.js +3 -4
  166. package/dist/form/SliderTrack.js.map +1 -1
  167. package/dist/form/Switch.d.ts +3 -2
  168. package/dist/form/Switch.js +3 -4
  169. package/dist/form/Switch.js.map +1 -1
  170. package/dist/form/SwitchTrack.d.ts +3 -2
  171. package/dist/form/SwitchTrack.js +3 -4
  172. package/dist/form/SwitchTrack.js.map +1 -1
  173. package/dist/form/TextArea.d.ts +3 -2
  174. package/dist/form/TextArea.js +3 -4
  175. package/dist/form/TextArea.js.map +1 -1
  176. package/dist/form/TextField.d.ts +3 -2
  177. package/dist/form/TextField.js +3 -4
  178. package/dist/form/TextField.js.map +1 -1
  179. package/dist/form/TextFieldAddon.d.ts +2 -1
  180. package/dist/form/TextFieldAddon.js +3 -4
  181. package/dist/form/TextFieldAddon.js.map +1 -1
  182. package/dist/form/TextFieldContainer.d.ts +3 -2
  183. package/dist/form/TextFieldContainer.js +3 -4
  184. package/dist/form/TextFieldContainer.js.map +1 -1
  185. package/dist/form/sliderUtils.d.ts +1 -1
  186. package/dist/form/sliderUtils.js.map +1 -1
  187. package/dist/form/types.d.ts +11 -5
  188. package/dist/form/types.js.map +1 -1
  189. package/dist/form/useCombobox.d.ts +6 -6
  190. package/dist/form/useCombobox.js.map +1 -1
  191. package/dist/form/useFormReset.d.ts +1 -1
  192. package/dist/form/useFormReset.js.map +1 -1
  193. package/dist/form/useTextField.d.ts +4 -4
  194. package/dist/form/useTextField.js.map +1 -1
  195. package/dist/hoverMode/useHoverMode.js +1 -1
  196. package/dist/hoverMode/useHoverMode.js.map +1 -1
  197. package/dist/hoverMode/useHoverModeProvider.d.ts +5 -5
  198. package/dist/hoverMode/useHoverModeProvider.js +1 -1
  199. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  200. package/dist/icon/FontIcon.d.ts +3 -2
  201. package/dist/icon/FontIcon.js +3 -4
  202. package/dist/icon/FontIcon.js.map +1 -1
  203. package/dist/icon/IconRotator.d.ts +3 -2
  204. package/dist/icon/IconRotator.js +4 -4
  205. package/dist/icon/IconRotator.js.map +1 -1
  206. package/dist/icon/MaterialIcon.d.ts +3 -2
  207. package/dist/icon/MaterialIcon.js +3 -4
  208. package/dist/icon/MaterialIcon.js.map +1 -1
  209. package/dist/icon/MaterialSymbol.d.ts +3 -2
  210. package/dist/icon/MaterialSymbol.js +3 -4
  211. package/dist/icon/MaterialSymbol.js.map +1 -1
  212. package/dist/icon/SVGIcon.d.ts +3 -2
  213. package/dist/icon/SVGIcon.js +3 -4
  214. package/dist/icon/SVGIcon.js.map +1 -1
  215. package/dist/layout/LayoutAppBar.d.ts +3 -1
  216. package/dist/layout/LayoutAppBar.js +3 -4
  217. package/dist/layout/LayoutAppBar.js.map +1 -1
  218. package/dist/layout/LayoutNav.d.ts +3 -2
  219. package/dist/layout/LayoutNav.js +3 -4
  220. package/dist/layout/LayoutNav.js.map +1 -1
  221. package/dist/layout/LayoutWindowSplitter.d.ts +4 -2
  222. package/dist/layout/LayoutWindowSplitter.js +4 -4
  223. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  224. package/dist/layout/Main.d.ts +4 -3
  225. package/dist/layout/Main.js +3 -4
  226. package/dist/layout/Main.js.map +1 -1
  227. package/dist/link/Link.d.ts +10 -2
  228. package/dist/link/Link.js +4 -4
  229. package/dist/link/Link.js.map +1 -1
  230. package/dist/link/SkipToMainContent.d.ts +3 -2
  231. package/dist/link/SkipToMainContent.js +4 -4
  232. package/dist/link/SkipToMainContent.js.map +1 -1
  233. package/dist/list/List.d.ts +3 -2
  234. package/dist/list/List.js +3 -4
  235. package/dist/list/List.js.map +1 -1
  236. package/dist/list/ListItem.d.ts +3 -2
  237. package/dist/list/ListItem.js +3 -4
  238. package/dist/list/ListItem.js.map +1 -1
  239. package/dist/list/ListItemLink.d.ts +3 -2
  240. package/dist/list/ListItemLink.js +3 -4
  241. package/dist/list/ListItemLink.js.map +1 -1
  242. package/dist/list/ListItemText.d.ts +3 -2
  243. package/dist/list/ListItemText.js +3 -4
  244. package/dist/list/ListItemText.js.map +1 -1
  245. package/dist/list/ListSubheader.d.ts +3 -2
  246. package/dist/list/ListSubheader.js +3 -4
  247. package/dist/list/ListSubheader.js.map +1 -1
  248. package/dist/menu/DropdownMenu.js.map +1 -1
  249. package/dist/menu/Menu.d.ts +4 -2
  250. package/dist/menu/Menu.js +5 -4
  251. package/dist/menu/Menu.js.map +1 -1
  252. package/dist/menu/MenuBar.d.ts +3 -1
  253. package/dist/menu/MenuBar.js +3 -4
  254. package/dist/menu/MenuBar.js.map +1 -1
  255. package/dist/menu/MenuButton.d.ts +2 -1
  256. package/dist/menu/MenuButton.js +3 -4
  257. package/dist/menu/MenuButton.js.map +1 -1
  258. package/dist/menu/MenuItem.d.ts +3 -1
  259. package/dist/menu/MenuItem.js +3 -4
  260. package/dist/menu/MenuItem.js.map +1 -1
  261. package/dist/menu/MenuItemButton.d.ts +2 -1
  262. package/dist/menu/MenuItemButton.js +4 -4
  263. package/dist/menu/MenuItemButton.js.map +1 -1
  264. package/dist/menu/MenuItemCheckbox.d.ts +2 -1
  265. package/dist/menu/MenuItemCheckbox.js +4 -4
  266. package/dist/menu/MenuItemCheckbox.js.map +1 -1
  267. package/dist/menu/MenuItemCircularProgress.d.ts +3 -2
  268. package/dist/menu/MenuItemCircularProgress.js +3 -4
  269. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  270. package/dist/menu/MenuItemFileInput.d.ts +2 -2
  271. package/dist/menu/MenuItemFileInput.js +3 -4
  272. package/dist/menu/MenuItemFileInput.js.map +1 -1
  273. package/dist/menu/MenuItemGroup.d.ts +3 -3
  274. package/dist/menu/MenuItemGroup.js +4 -4
  275. package/dist/menu/MenuItemGroup.js.map +1 -1
  276. package/dist/menu/MenuItemInputToggle.d.ts +3 -2
  277. package/dist/menu/MenuItemInputToggle.js +3 -4
  278. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  279. package/dist/menu/MenuItemRadio.d.ts +3 -1
  280. package/dist/menu/MenuItemRadio.js +4 -4
  281. package/dist/menu/MenuItemRadio.js.map +1 -1
  282. package/dist/menu/MenuItemSeparator.d.ts +3 -2
  283. package/dist/menu/MenuItemSeparator.js +3 -4
  284. package/dist/menu/MenuItemSeparator.js.map +1 -1
  285. package/dist/menu/MenuItemSwitch.d.ts +2 -1
  286. package/dist/menu/MenuItemSwitch.js +4 -4
  287. package/dist/menu/MenuItemSwitch.js.map +1 -1
  288. package/dist/menu/MenuItemTextField.d.ts +2 -2
  289. package/dist/menu/MenuItemTextField.js +3 -4
  290. package/dist/menu/MenuItemTextField.js.map +1 -1
  291. package/dist/menu/MenuVisibilityProvider.d.ts +3 -3
  292. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  293. package/dist/menu/MenuWidget.d.ts +4 -4
  294. package/dist/menu/MenuWidget.js +4 -4
  295. package/dist/menu/MenuWidget.js.map +1 -1
  296. package/dist/menu/useContextMenu.d.ts +4 -4
  297. package/dist/menu/useContextMenu.js.map +1 -1
  298. package/dist/movement/types.d.ts +5 -5
  299. package/dist/movement/types.js.map +1 -1
  300. package/dist/navigation/CollapsibleNavGroup.d.ts +2 -2
  301. package/dist/navigation/CollapsibleNavGroup.js +3 -4
  302. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  303. package/dist/navigation/NavGroup.d.ts +3 -2
  304. package/dist/navigation/NavGroup.js +3 -4
  305. package/dist/navigation/NavGroup.js.map +1 -1
  306. package/dist/navigation/NavItem.d.ts +3 -2
  307. package/dist/navigation/NavItem.js +3 -4
  308. package/dist/navigation/NavItem.js.map +1 -1
  309. package/dist/navigation/NavItemButton.d.ts +2 -2
  310. package/dist/navigation/NavItemButton.js +3 -4
  311. package/dist/navigation/NavItemButton.js.map +1 -1
  312. package/dist/navigation/NavItemLink.d.ts +3 -2
  313. package/dist/navigation/NavItemLink.js +4 -4
  314. package/dist/navigation/NavItemLink.js.map +1 -1
  315. package/dist/navigation/NavSubheader.d.ts +2 -1
  316. package/dist/navigation/NavSubheader.js +3 -4
  317. package/dist/navigation/NavSubheader.js.map +1 -1
  318. package/dist/navigation/Navigation.d.ts +1 -1
  319. package/dist/navigation/Navigation.js +1 -1
  320. package/dist/navigation/Navigation.js.map +1 -1
  321. package/dist/navigation/types.d.ts +5 -2
  322. package/dist/navigation/types.js.map +1 -1
  323. package/dist/navigation/useActiveHeadingId.js +1 -1
  324. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  325. package/dist/overlay/Overlay.d.ts +3 -2
  326. package/dist/overlay/Overlay.js +3 -4
  327. package/dist/overlay/Overlay.js.map +1 -1
  328. package/dist/positioning/useFixedPositioning.d.ts +1 -1
  329. package/dist/positioning/useFixedPositioning.js.map +1 -1
  330. package/dist/progress/CircularProgress.d.ts +2 -2
  331. package/dist/progress/CircularProgress.js +4 -4
  332. package/dist/progress/CircularProgress.js.map +1 -1
  333. package/dist/progress/LinearProgress.d.ts +2 -2
  334. package/dist/progress/LinearProgress.js +4 -4
  335. package/dist/progress/LinearProgress.js.map +1 -1
  336. package/dist/progress/types.d.ts +2 -0
  337. package/dist/progress/types.js.map +1 -1
  338. package/dist/responsive-item/ResponsiveItem.d.ts +3 -2
  339. package/dist/responsive-item/ResponsiveItem.js +3 -4
  340. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  341. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +3 -2
  342. package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
  343. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  344. package/dist/segmented-button/SegmentedButton.d.ts +3 -2
  345. package/dist/segmented-button/SegmentedButton.js +3 -4
  346. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  347. package/dist/segmented-button/SegmentedButtonContainer.d.ts +4 -3
  348. package/dist/segmented-button/SegmentedButtonContainer.js +4 -5
  349. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  350. package/dist/sheet/Sheet.d.ts +2 -1
  351. package/dist/sheet/Sheet.js +3 -4
  352. package/dist/sheet/Sheet.js.map +1 -1
  353. package/dist/snackbar/Snackbar.d.ts +3 -2
  354. package/dist/snackbar/Snackbar.js +3 -4
  355. package/dist/snackbar/Snackbar.js.map +1 -1
  356. package/dist/snackbar/Toast.d.ts +3 -2
  357. package/dist/snackbar/Toast.js +4 -4
  358. package/dist/snackbar/Toast.js.map +1 -1
  359. package/dist/snackbar/ToastActionButton.d.ts +2 -1
  360. package/dist/snackbar/ToastActionButton.js +3 -4
  361. package/dist/snackbar/ToastActionButton.js.map +1 -1
  362. package/dist/snackbar/ToastCloseButton.d.ts +2 -1
  363. package/dist/snackbar/ToastCloseButton.js +3 -4
  364. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  365. package/dist/snackbar/ToastContent.d.ts +3 -2
  366. package/dist/snackbar/ToastContent.js +4 -4
  367. package/dist/snackbar/ToastContent.js.map +1 -1
  368. package/dist/spinbutton/SpinButton.d.ts +4 -3
  369. package/dist/spinbutton/SpinButton.js +3 -4
  370. package/dist/spinbutton/SpinButton.js.map +1 -1
  371. package/dist/spinbutton/types.d.ts +1 -1
  372. package/dist/spinbutton/types.js.map +1 -1
  373. package/dist/table/StickyTableSection.d.ts +3 -2
  374. package/dist/table/StickyTableSection.js +3 -4
  375. package/dist/table/StickyTableSection.js.map +1 -1
  376. package/dist/table/Table.d.ts +3 -2
  377. package/dist/table/Table.js +4 -4
  378. package/dist/table/Table.js.map +1 -1
  379. package/dist/table/TableBody.d.ts +3 -2
  380. package/dist/table/TableBody.js +4 -4
  381. package/dist/table/TableBody.js.map +1 -1
  382. package/dist/table/TableCell.d.ts +3 -2
  383. package/dist/table/TableCell.js +3 -4
  384. package/dist/table/TableCell.js.map +1 -1
  385. package/dist/table/TableCellContent.d.ts +3 -2
  386. package/dist/table/TableCellContent.js +3 -4
  387. package/dist/table/TableCellContent.js.map +1 -1
  388. package/dist/table/TableCheckbox.d.ts +3 -2
  389. package/dist/table/TableCheckbox.js +3 -4
  390. package/dist/table/TableCheckbox.js.map +1 -1
  391. package/dist/table/TableContainer.d.ts +5 -3
  392. package/dist/table/TableContainer.js +4 -4
  393. package/dist/table/TableContainer.js.map +1 -1
  394. package/dist/table/TableContainerProvider.d.ts +1 -1
  395. package/dist/table/TableContainerProvider.js.map +1 -1
  396. package/dist/table/TableFooter.d.ts +3 -2
  397. package/dist/table/TableFooter.js +4 -5
  398. package/dist/table/TableFooter.js.map +1 -1
  399. package/dist/table/TableHeader.d.ts +3 -2
  400. package/dist/table/TableHeader.js +4 -5
  401. package/dist/table/TableHeader.js.map +1 -1
  402. package/dist/table/TableRadio.d.ts +3 -2
  403. package/dist/table/TableRadio.js +3 -4
  404. package/dist/table/TableRadio.js.map +1 -1
  405. package/dist/table/TableRow.d.ts +3 -2
  406. package/dist/table/TableRow.js +3 -4
  407. package/dist/table/TableRow.js.map +1 -1
  408. package/dist/tabs/SimpleTabPanel.d.ts +3 -2
  409. package/dist/tabs/SimpleTabPanel.js +3 -4
  410. package/dist/tabs/SimpleTabPanel.js.map +1 -1
  411. package/dist/tabs/SimpleTabPanels.d.ts +3 -2
  412. package/dist/tabs/SimpleTabPanels.js +3 -4
  413. package/dist/tabs/SimpleTabPanels.js.map +1 -1
  414. package/dist/tabs/TabList.d.ts +3 -2
  415. package/dist/tabs/TabList.js +4 -4
  416. package/dist/tabs/TabList.js.map +1 -1
  417. package/dist/tabs/TabListScrollButton.d.ts +3 -2
  418. package/dist/tabs/TabListScrollButton.js +4 -4
  419. package/dist/tabs/TabListScrollButton.js.map +1 -1
  420. package/dist/tabs/useTabList.d.ts +2 -2
  421. package/dist/tabs/useTabList.js.map +1 -1
  422. package/dist/theme/useCSSVariables.d.ts +1 -1
  423. package/dist/theme/useCSSVariables.js.map +1 -1
  424. package/dist/tooltip/Tooltip.d.ts +3 -2
  425. package/dist/tooltip/Tooltip.js +3 -4
  426. package/dist/tooltip/Tooltip.js.map +1 -1
  427. package/dist/tooltip/useTooltip.d.ts +3 -3
  428. package/dist/tooltip/useTooltip.js.map +1 -1
  429. package/dist/transition/SkeletonPlaceholder.d.ts +3 -2
  430. package/dist/transition/SkeletonPlaceholder.js +3 -4
  431. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  432. package/dist/transition/Slide.d.ts +3 -2
  433. package/dist/transition/Slide.js +3 -4
  434. package/dist/transition/Slide.js.map +1 -1
  435. package/dist/transition/SlideContainer.d.ts +3 -2
  436. package/dist/transition/SlideContainer.js +3 -4
  437. package/dist/transition/SlideContainer.js.map +1 -1
  438. package/dist/tree/TreeGroup.d.ts +2 -2
  439. package/dist/tree/TreeGroup.js +3 -4
  440. package/dist/tree/TreeGroup.js.map +1 -1
  441. package/dist/tree/TreeProvider.d.ts +2 -3
  442. package/dist/tree/TreeProvider.js.map +1 -1
  443. package/dist/tree/useTreeMovement.d.ts +6 -7
  444. package/dist/tree/useTreeMovement.js.map +1 -1
  445. package/dist/types.d.ts +1 -15
  446. package/dist/types.js.map +1 -1
  447. package/dist/typography/Mark.d.ts +3 -2
  448. package/dist/typography/Mark.js +3 -4
  449. package/dist/typography/Mark.js.map +1 -1
  450. package/dist/typography/SrOnly.d.ts +3 -2
  451. package/dist/typography/SrOnly.js +3 -4
  452. package/dist/typography/SrOnly.js.map +1 -1
  453. package/dist/typography/TextContainer.d.ts +3 -2
  454. package/dist/typography/TextContainer.js +3 -4
  455. package/dist/typography/TextContainer.js.map +1 -1
  456. package/dist/typography/Typography.d.ts +3 -2
  457. package/dist/typography/Typography.js +3 -4
  458. package/dist/typography/Typography.js.map +1 -1
  459. package/dist/useAsyncFunction.d.ts +3 -2
  460. package/dist/useAsyncFunction.js.map +1 -1
  461. package/dist/useDebouncedFunction.js +1 -1
  462. package/dist/useDebouncedFunction.js.map +1 -1
  463. package/dist/useDropzone.js +1 -1
  464. package/dist/useDropzone.js.map +1 -1
  465. package/dist/useEnsuredRef.d.ts +3 -3
  466. package/dist/useEnsuredRef.js +1 -1
  467. package/dist/useEnsuredRef.js.map +1 -1
  468. package/dist/useThrottledFunction.js +3 -3
  469. package/dist/useThrottledFunction.js.map +1 -1
  470. package/dist/useUnmounted.d.ts +2 -2
  471. package/dist/useUnmounted.js.map +1 -1
  472. package/dist/utils/applyRef.d.ts +1 -1
  473. package/dist/utils/applyRef.js.map +1 -1
  474. package/dist/window-splitter/WindowSplitter.d.ts +3 -2
  475. package/dist/window-splitter/WindowSplitter.js +3 -4
  476. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  477. package/package.json +9 -9
  478. package/src/app-bar/AppBar.tsx +54 -54
  479. package/src/app-bar/AppBarTitle.tsx +29 -27
  480. package/src/autocomplete/AutocompleteChip.tsx +4 -6
  481. package/src/autocomplete/types.ts +2 -0
  482. package/src/autocomplete/utils.ts +4 -4
  483. package/src/avatar/Avatar.tsx +47 -45
  484. package/src/badge/Badge.tsx +17 -11
  485. package/src/box/Box.tsx +51 -50
  486. package/src/button/AsyncButton.tsx +125 -119
  487. package/src/button/Button.tsx +74 -73
  488. package/src/button/ButtonUnstyled.tsx +9 -9
  489. package/src/button/FloatingActionButton.tsx +9 -7
  490. package/src/button/TooltippedButton.tsx +6 -6
  491. package/src/card/Card.tsx +36 -35
  492. package/src/card/CardContent.tsx +31 -28
  493. package/src/card/CardFooter.tsx +22 -16
  494. package/src/card/CardHeader.tsx +36 -30
  495. package/src/card/CardSubtitle.tsx +8 -6
  496. package/src/card/CardTitle.tsx +26 -25
  497. package/src/card/ClickableCard.tsx +57 -54
  498. package/src/chip/Chip.tsx +122 -120
  499. package/src/datetime/NativeDateField.tsx +7 -7
  500. package/src/datetime/NativeTimeField.tsx +7 -7
  501. package/src/dialog/Dialog.tsx +156 -150
  502. package/src/dialog/DialogContainer.tsx +35 -29
  503. package/src/dialog/DialogContent.tsx +26 -19
  504. package/src/dialog/DialogFooter.tsx +22 -19
  505. package/src/dialog/DialogHeader.tsx +24 -23
  506. package/src/dialog/DialogTitle.tsx +27 -26
  507. package/src/dialog/FixedDialog.tsx +70 -69
  508. package/src/divider/Divider.tsx +32 -26
  509. package/src/draggable/useDraggable.ts +3 -6
  510. package/src/draggable/utils.ts +1 -1
  511. package/src/expansion-panel/ExpansionList.tsx +24 -19
  512. package/src/expansion-panel/ExpansionPanel.tsx +11 -6
  513. package/src/expansion-panel/ExpansionPanelHeader.tsx +9 -6
  514. package/src/files/FileInput.tsx +79 -79
  515. package/src/focus/useFocusContainer.ts +1 -1
  516. package/src/form/Checkbox.tsx +6 -6
  517. package/src/form/Fieldset.tsx +33 -28
  518. package/src/form/Form.tsx +26 -25
  519. package/src/form/FormMessage.tsx +13 -7
  520. package/src/form/FormMessageContainer.tsx +12 -9
  521. package/src/form/FormMessageCounter.tsx +8 -7
  522. package/src/form/InputToggle.tsx +105 -107
  523. package/src/form/InputToggleIcon.tsx +12 -6
  524. package/src/form/Label.tsx +40 -41
  525. package/src/form/Legend.tsx +44 -43
  526. package/src/form/NativeSelect.tsx +116 -114
  527. package/src/form/OptGroup.tsx +15 -15
  528. package/src/form/Option.tsx +123 -122
  529. package/src/form/Password.tsx +66 -67
  530. package/src/form/Radio.tsx +6 -6
  531. package/src/form/ResizingTextAreaWrapper.tsx +7 -6
  532. package/src/form/SliderContainer.tsx +35 -29
  533. package/src/form/SliderThumb.tsx +8 -6
  534. package/src/form/SliderTrack.tsx +80 -80
  535. package/src/form/Switch.tsx +80 -79
  536. package/src/form/SwitchTrack.tsx +35 -34
  537. package/src/form/TextArea.tsx +167 -165
  538. package/src/form/TextField.tsx +106 -104
  539. package/src/form/TextFieldAddon.tsx +33 -32
  540. package/src/form/TextFieldContainer.tsx +8 -6
  541. package/src/form/sliderUtils.ts +1 -1
  542. package/src/form/types.ts +15 -5
  543. package/src/form/useCombobox.ts +6 -10
  544. package/src/form/useFormReset.ts +1 -1
  545. package/src/form/useTextField.ts +4 -4
  546. package/src/hoverMode/useHoverMode.ts +1 -1
  547. package/src/hoverMode/useHoverModeProvider.ts +13 -8
  548. package/src/icon/FontIcon.tsx +32 -30
  549. package/src/icon/IconRotator.tsx +30 -28
  550. package/src/icon/MaterialIcon.tsx +36 -30
  551. package/src/icon/MaterialSymbol.tsx +50 -44
  552. package/src/icon/SVGIcon.tsx +47 -41
  553. package/src/layout/LayoutAppBar.tsx +23 -28
  554. package/src/layout/LayoutNav.tsx +68 -62
  555. package/src/layout/LayoutWindowSplitter.tsx +9 -7
  556. package/src/layout/Main.tsx +30 -29
  557. package/src/link/Link.tsx +16 -11
  558. package/src/link/SkipToMainContent.tsx +6 -6
  559. package/src/list/List.tsx +31 -29
  560. package/src/list/ListItem.tsx +126 -125
  561. package/src/list/ListItemLink.tsx +128 -126
  562. package/src/list/ListItemText.tsx +42 -37
  563. package/src/list/ListSubheader.tsx +27 -26
  564. package/src/menu/DropdownMenu.tsx +2 -2
  565. package/src/menu/Menu.tsx +327 -326
  566. package/src/menu/MenuBar.tsx +51 -50
  567. package/src/menu/MenuButton.tsx +69 -70
  568. package/src/menu/MenuItem.tsx +37 -37
  569. package/src/menu/MenuItemButton.tsx +132 -133
  570. package/src/menu/MenuItemCheckbox.tsx +6 -7
  571. package/src/menu/MenuItemCircularProgress.tsx +13 -6
  572. package/src/menu/MenuItemFileInput.tsx +4 -6
  573. package/src/menu/MenuItemGroup.tsx +18 -18
  574. package/src/menu/MenuItemInputToggle.tsx +8 -6
  575. package/src/menu/MenuItemRadio.tsx +6 -6
  576. package/src/menu/MenuItemSeparator.tsx +7 -7
  577. package/src/menu/MenuItemSwitch.tsx +6 -6
  578. package/src/menu/MenuItemTextField.tsx +5 -7
  579. package/src/menu/MenuVisibilityProvider.tsx +3 -2
  580. package/src/menu/MenuWidget.tsx +123 -119
  581. package/src/menu/useContextMenu.ts +7 -4
  582. package/src/movement/types.ts +5 -9
  583. package/src/navigation/CollapsibleNavGroup.tsx +10 -6
  584. package/src/navigation/NavGroup.tsx +18 -19
  585. package/src/navigation/NavItem.tsx +16 -11
  586. package/src/navigation/NavItemButton.tsx +69 -66
  587. package/src/navigation/NavItemLink.tsx +102 -100
  588. package/src/navigation/NavSubheader.tsx +14 -16
  589. package/src/navigation/Navigation.tsx +1 -1
  590. package/src/navigation/types.ts +13 -4
  591. package/src/navigation/useActiveHeadingId.ts +1 -1
  592. package/src/overlay/Overlay.tsx +66 -65
  593. package/src/positioning/useFixedPositioning.ts +1 -1
  594. package/src/progress/CircularProgress.tsx +6 -6
  595. package/src/progress/LinearProgress.tsx +6 -6
  596. package/src/progress/types.ts +4 -0
  597. package/src/responsive-item/ResponsiveItem.tsx +29 -28
  598. package/src/responsive-item/ResponsiveItemOverlay.tsx +9 -8
  599. package/src/segmented-button/SegmentedButton.tsx +11 -6
  600. package/src/segmented-button/SegmentedButtonContainer.tsx +14 -8
  601. package/src/sheet/Sheet.tsx +42 -43
  602. package/src/snackbar/Snackbar.tsx +44 -38
  603. package/src/snackbar/Toast.tsx +110 -109
  604. package/src/snackbar/ToastActionButton.tsx +6 -6
  605. package/src/snackbar/ToastCloseButton.tsx +4 -6
  606. package/src/snackbar/ToastContent.tsx +56 -49
  607. package/src/spinbutton/SpinButton.tsx +9 -8
  608. package/src/spinbutton/types.ts +1 -1
  609. package/src/table/StickyTableSection.tsx +8 -6
  610. package/src/table/Table.tsx +47 -41
  611. package/src/table/TableBody.tsx +46 -42
  612. package/src/table/TableCell.tsx +83 -81
  613. package/src/table/TableCellContent.tsx +11 -6
  614. package/src/table/TableCheckbox.tsx +6 -6
  615. package/src/table/TableContainer.tsx +31 -26
  616. package/src/table/TableContainerProvider.ts +1 -1
  617. package/src/table/TableFooter.tsx +7 -12
  618. package/src/table/TableHeader.tsx +15 -9
  619. package/src/table/TableRadio.tsx +59 -58
  620. package/src/table/TableRow.tsx +34 -33
  621. package/src/tabs/SimpleTabPanel.tsx +18 -13
  622. package/src/tabs/SimpleTabPanels.tsx +11 -7
  623. package/src/tabs/TabList.tsx +106 -105
  624. package/src/tabs/TabListScrollButton.tsx +9 -6
  625. package/src/tabs/useTabList.ts +2 -2
  626. package/src/theme/useCSSVariables.ts +1 -1
  627. package/src/tooltip/Tooltip.tsx +61 -61
  628. package/src/tooltip/useTooltip.ts +2 -3
  629. package/src/transition/SkeletonPlaceholder.tsx +8 -6
  630. package/src/transition/Slide.tsx +54 -48
  631. package/src/transition/SlideContainer.tsx +16 -16
  632. package/src/tree/TreeGroup.tsx +54 -55
  633. package/src/tree/TreeProvider.tsx +2 -2
  634. package/src/tree/useTreeMovement.ts +6 -6
  635. package/src/types.ts +1 -16
  636. package/src/typography/Mark.tsx +16 -11
  637. package/src/typography/SrOnly.tsx +41 -35
  638. package/src/typography/TextContainer.tsx +12 -12
  639. package/src/typography/Typography.tsx +42 -41
  640. package/src/useAsyncFunction.ts +3 -3
  641. package/src/useDebouncedFunction.ts +1 -1
  642. package/src/useDropzone.ts +1 -1
  643. package/src/useEnsuredRef.ts +3 -3
  644. package/src/useThrottledFunction.ts +3 -3
  645. package/src/useUnmounted.ts +2 -4
  646. package/src/utils/applyRef.ts +2 -2
  647. package/src/window-splitter/WindowSplitter.tsx +6 -6
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes, type ReactNode } from "react";
1
+ import { type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
2
2
  /**
3
3
  * @since 2.5.0
4
4
  * @since 6.0.0 Renamed from `SliderAddons` to `SliderContainerAddonProps`
@@ -27,6 +27,7 @@ export interface SliderAddonProps {
27
27
  * a `Fieldset` instead.
28
28
  */
29
29
  export interface SliderContainerProps extends HTMLAttributes<HTMLDivElement>, SliderAddonProps {
30
+ ref?: Ref<HTMLDivElement>;
30
31
  vertical: boolean;
31
32
  }
32
33
  /**
@@ -40,4 +41,4 @@ export interface SliderContainerProps extends HTMLAttributes<HTMLDivElement>, Sl
40
41
  * @since 6.0.0 Removed the `label` support since you'll generally want to use
41
42
  * a `Fieldset` instead.
42
43
  */
43
- export declare const SliderContainer: import("react").ForwardRefExoticComponent<SliderContainerProps & import("react").RefAttributes<HTMLDivElement>>;
44
+ export declare function SliderContainer(props: SliderContainerProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { sliderContainer } from "./sliderStyles.js";
4
3
  /**
5
4
  * The `SliderContainer` component is mostly an internal component that is
@@ -11,8 +10,8 @@ import { sliderContainer } from "./sliderStyles.js";
11
10
  * @since 2.5.0
12
11
  * @since 6.0.0 Removed the `label` support since you'll generally want to use
13
12
  * a `Fieldset` instead.
14
- */ export const SliderContainer = /*#__PURE__*/ forwardRef(function SliderContainer(props, ref) {
15
- const { className, children, beforeAddon, afterAddon, vertical, ...remaining } = props;
13
+ */ export function SliderContainer(props) {
14
+ const { ref, className, children, beforeAddon, afterAddon, vertical, ...remaining } = props;
16
15
  return /*#__PURE__*/ _jsxs("div", {
17
16
  ...remaining,
18
17
  ref: ref,
@@ -28,6 +27,6 @@ import { sliderContainer } from "./sliderStyles.js";
28
27
  afterAddon
29
28
  ]
30
29
  });
31
- });
30
+ }
32
31
 
33
32
  //# sourceMappingURL=SliderContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/SliderContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { sliderContainer } from \"./sliderStyles.js\";\n\n/**\n * @since 2.5.0\n * @since 6.0.0 Renamed from `SliderAddons` to `SliderContainerAddonProps`\n */\nexport interface SliderAddonProps {\n /**\n * An optional addon to render before the slider's track. This can be anything\n * and will be wrapped in the `TextIconSpacing` component.\n *\n * When the `vertical` prop is enabled, the addon will appear underneath the\n * track.\n */\n beforeAddon?: ReactNode;\n\n /**\n * An optional addon to render after the slider's track. This can be anything\n * and will be wrapped in the `TextIconSpacing` component.\n *\n * When the `vertical` prop is enabled, the addon will appear above the track.\n */\n afterAddon?: ReactNode;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Removed the `label` support since you'll generally want to use\n * a `Fieldset` instead.\n */\nexport interface SliderContainerProps\n extends HTMLAttributes<HTMLDivElement>, SliderAddonProps {\n vertical: boolean;\n}\n\n/**\n * The `SliderContainer` component is mostly an internal component that is\n * built-in to the `Slider` and `RangeSlider` components to add addons to the\n * left or right of the `SliderTrack`. When vertical, it will add addons to the\n * bottom or top instead.\n *\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Removed the `label` support since you'll generally want to use\n * a `Fieldset` instead.\n */\nexport const SliderContainer = forwardRef<HTMLDivElement, SliderContainerProps>(\n function SliderContainer(props, ref) {\n const {\n className,\n children,\n beforeAddon,\n afterAddon,\n vertical,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={sliderContainer({\n className,\n vertical,\n beforeAddon: !!beforeAddon,\n afterAddon: !!afterAddon,\n })}\n >\n {beforeAddon}\n {children}\n {afterAddon}\n </div>\n );\n }\n);\n"],"names":["forwardRef","sliderContainer","SliderContainer","props","ref","className","children","beforeAddon","afterAddon","vertical","remaining","div"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAASC,eAAe,QAAQ,oBAAoB;AAoCpD;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,gCAAkBF,WAC7B,SAASE,gBAAgBC,KAAK,EAAEC,GAAG;IACjC,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,qBACE,MAACQ;QACE,GAAGD,SAAS;QACbN,KAAKA;QACLC,WAAWJ,gBAAgB;YACzBI;YACAI;YACAF,aAAa,CAAC,CAACA;YACfC,YAAY,CAAC,CAACA;QAChB;;YAECD;YACAD;YACAE;;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/SliderContainer.tsx"],"sourcesContent":["import {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { sliderContainer } from \"./sliderStyles.js\";\n\n/**\n * @since 2.5.0\n * @since 6.0.0 Renamed from `SliderAddons` to `SliderContainerAddonProps`\n */\nexport interface SliderAddonProps {\n /**\n * An optional addon to render before the slider's track. This can be anything\n * and will be wrapped in the `TextIconSpacing` component.\n *\n * When the `vertical` prop is enabled, the addon will appear underneath the\n * track.\n */\n beforeAddon?: ReactNode;\n\n /**\n * An optional addon to render after the slider's track. This can be anything\n * and will be wrapped in the `TextIconSpacing` component.\n *\n * When the `vertical` prop is enabled, the addon will appear above the track.\n */\n afterAddon?: ReactNode;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Removed the `label` support since you'll generally want to use\n * a `Fieldset` instead.\n */\nexport interface SliderContainerProps\n extends HTMLAttributes<HTMLDivElement>, SliderAddonProps {\n ref?: Ref<HTMLDivElement>;\n\n vertical: boolean;\n}\n\n/**\n * The `SliderContainer` component is mostly an internal component that is\n * built-in to the `Slider` and `RangeSlider` components to add addons to the\n * left or right of the `SliderTrack`. When vertical, it will add addons to the\n * bottom or top instead.\n *\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Removed the `label` support since you'll generally want to use\n * a `Fieldset` instead.\n */\nexport function SliderContainer(props: SliderContainerProps): ReactElement {\n const {\n ref,\n className,\n children,\n beforeAddon,\n afterAddon,\n vertical,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={sliderContainer({\n className,\n vertical,\n beforeAddon: !!beforeAddon,\n afterAddon: !!afterAddon,\n })}\n >\n {beforeAddon}\n {children}\n {afterAddon}\n </div>\n );\n}\n"],"names":["sliderContainer","SliderContainer","props","ref","className","children","beforeAddon","afterAddon","vertical","remaining","div"],"mappings":";AAOA,SAASA,eAAe,QAAQ,oBAAoB;AAsCpD;;;;;;;;;;CAUC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,qBACE,MAACQ;QACE,GAAGD,SAAS;QACbN,KAAKA;QACLC,WAAWJ,gBAAgB;YACzBI;YACAI;YACAF,aAAa,CAAC,CAACA;YACfC,YAAY,CAAC,CAACA;QAChB;;YAECD;YACAD;YACAE;;;AAGP"}
@@ -1,4 +1,4 @@
1
- import { type ChangeEventHandler, type HTMLAttributes, type ReactNode } from "react";
1
+ import { type ChangeEventHandler, type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
2
2
  import { type TooltipProps } from "../tooltip/Tooltip.js";
3
3
  import { type LabelRequiredForA11y } from "../types.js";
4
4
  import { type SliderValueOptions } from "./useSlider.js";
@@ -69,6 +69,7 @@ export interface ConfigurableSliderThumbProps extends Omit<HTMLAttributes<HTMLSp
69
69
  * @since 6.0.0 Internal only component.
70
70
  */
71
71
  export interface SliderThumbProps extends ConfigurableSliderThumbProps, Required<SliderValueOptions>, Required<SliderThumbPresentation> {
72
+ ref?: Ref<HTMLSpanElement>;
72
73
  id: string;
73
74
  value: number;
74
75
  index: 1 | 2;
@@ -88,4 +89,4 @@ export interface SliderThumbProps extends ConfigurableSliderThumbProps, Required
88
89
  * @since 2.5.0
89
90
  * @since 6.0.0 Internal only component.
90
91
  */
91
- export declare const SliderThumb: import("react").ForwardRefExoticComponent<LabelRequiredForA11y<SliderThumbProps> & import("react").RefAttributes<HTMLSpanElement>>;
92
+ export declare function SliderThumb(props: LabelRequiredForA11y<SliderThumbProps>): ReactElement;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { forwardRef, useEffect, useState } from "react";
3
+ import { useEffect, useState } from "react";
4
4
  import { useUserInteractionMode } from "../interaction/UserInteractionModeProvider.js";
5
5
  import { SliderValueTooltip } from "./SliderValueTooltip.js";
6
6
  import { sliderThumb, sliderThumbInput } from "./sliderStyles.js";
@@ -13,8 +13,8 @@ const noop = ()=>{
13
13
  * @internal
14
14
  * @since 2.5.0
15
15
  * @since 6.0.0 Internal only component.
16
- */ export const SliderThumb = /*#__PURE__*/ forwardRef(function SliderThumb(props, ref) {
17
- const { id, min, max, name, value, onChange, index, getValueText, step, active, animate, disabled, vertical, discrete, tabIndex = disabled ? -1 : 0, className, onFocus = noop, onKeyDown = noop, onMouseEnter = noop, onMouseLeave = noop, tooltipProps, getTooltipProps, getTooltipChildren, disableSmoothDragging, tooltipVisibility = "auto", ...remaining } = props;
16
+ */ export function SliderThumb(props) {
17
+ const { ref, id, min, max, name, value, onChange, index, getValueText, step, active, animate, disabled, vertical, discrete, tabIndex = disabled ? -1 : 0, className, onFocus = noop, onKeyDown = noop, onMouseEnter = noop, onMouseLeave = noop, tooltipProps, getTooltipProps, getTooltipChildren, disableSmoothDragging, tooltipVisibility = "auto", ...remaining } = props;
18
18
  const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy } = props;
19
19
  const isFirstThumb = index === 1;
20
20
  const mode = useUserInteractionMode();
@@ -144,6 +144,6 @@ const noop = ()=>{
144
144
  })
145
145
  ]
146
146
  });
147
- });
147
+ }
148
148
 
149
149
  //# sourceMappingURL=SliderThumb.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/SliderThumb.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ChangeEventHandler,\n type HTMLAttributes,\n type ReactNode,\n forwardRef,\n useEffect,\n useState,\n} from \"react\";\n\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type TooltipProps } from \"../tooltip/Tooltip.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { SliderValueTooltip } from \"./SliderValueTooltip.js\";\nimport { sliderThumb, sliderThumbInput } from \"./sliderStyles.js\";\nimport { type SliderValueOptions } from \"./useSlider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type SliderTooltipVisibility = \"auto\" | \"hover\" | \"always\";\n\n/**\n * @since 2.5.0\n */\nexport interface SliderThumbPresentation {\n /**\n * Boolean if the slider should act as a discrete slider which will render a\n * tooltip above the thumb while dragging to visualize the current value for\n * the slider.\n *\n * @defaultValue `false`\n */\n discrete?: boolean;\n\n /**\n * A function that is used to help with accessibility by creating a better\n * value string if just a number isn't representative enough of your range.\n *\n * Example:\n *\n * ```tsx\n * const [value, controls] = useSlider(0, {\n * // format to be `$100`, etc\n * getValueText: value => `$${value}`,\n * });\n *\n * return <Slider baseId=\"price-slider\" label=\"Price\" {...controls} />;\n * ```\n *\n * @defaultValue `() => \"\"`\n */\n getValueText?: (value: number) => string;\n\n /**\n * Set this to `true` if the slider's thumb position should only update when\n * the user has dragged to the next value instead of with the mouse.\n *\n * @see {@link marks}\n * @defaultValue `!!marks`\n */\n disableSmoothDragging?: boolean;\n\n /**\n * The discrete slider's value tooltip will only become visible when:\n *\n * - `\"auto\"` - the user is dragging with touch/mouse or focused with a keyboard\n * - `\"hover\"` - the behavior of `\"auto\"` plus while hovering the thumb with a mouse\n * - `\"always\"` - ... always\n *\n * This only applies when the {@link discrete} prop is `true`.\n *\n * @defaultValue `\"auto\"`\n */\n tooltipVisibility?: SliderTooltipVisibility;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableSliderThumbProps extends Omit<\n HTMLAttributes<HTMLSpanElement>,\n \"onChange\"\n> {\n name?: string;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Internal only component.\n */\nexport interface SliderThumbProps\n extends\n ConfigurableSliderThumbProps,\n Required<SliderValueOptions>,\n Required<SliderThumbPresentation> {\n id: string;\n value: number;\n index: 1 | 2;\n active: boolean;\n animate: boolean;\n disabled: boolean;\n vertical: boolean;\n onChange: ChangeEventHandler<HTMLInputElement>;\n tooltipProps?: Partial<TooltipProps>;\n getTooltipProps: (\n value: number,\n isFirstThumb: boolean\n ) => Partial<TooltipProps> | undefined;\n getTooltipChildren: (value: number, isFirstThumb: boolean) => ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Internal only component.\n */\nexport const SliderThumb = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<SliderThumbProps>\n>(function SliderThumb(props, ref) {\n const {\n id,\n min,\n max,\n name,\n value,\n onChange,\n index,\n getValueText,\n step,\n active,\n animate,\n disabled,\n vertical,\n discrete,\n tabIndex = disabled ? -1 : 0,\n className,\n onFocus = noop,\n onKeyDown = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n tooltipProps,\n getTooltipProps,\n getTooltipChildren,\n disableSmoothDragging,\n tooltipVisibility = \"auto\",\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } = props;\n\n const isFirstThumb = index === 1;\n const mode = useUserInteractionMode();\n const keyboard = mode === \"keyboard\";\n const touch = mode === \"touch\";\n const [mouseVisible, setMouseVisible] = useState(false);\n const [keyboardVisible, setKeyboardVisible] = useState(false);\n useEffect(() => {\n if (disabled || !discrete) {\n setKeyboardVisible(false);\n return;\n }\n\n // if the mode changes away from keyboard, need to disable the keyboard\n // state\n setKeyboardVisible((prevVisible) => prevVisible && mode === \"keyboard\");\n }, [disabled, discrete, mode]);\n useEffect(() => {\n if (disabled || !discrete) {\n setMouseVisible(false);\n return;\n }\n\n setMouseVisible((prevVisible) => prevVisible && mode !== \"touch\");\n }, [disabled, discrete, mode]);\n useEffect(() => {\n if (!keyboardVisible) {\n return;\n }\n\n const callback = (): void => {\n setKeyboardVisible(false);\n };\n\n window.addEventListener(\"blur\", callback, true);\n return () => {\n window.removeEventListener(\"blur\", callback);\n };\n }, [keyboardVisible]);\n\n const classNameOptions = {\n index,\n active,\n animate: !disableSmoothDragging && animate,\n disabled,\n vertical,\n className,\n } as const;\n\n return (\n <>\n {disabled && (\n <span\n className={sliderThumb({\n ...classNameOptions,\n mask: true,\n })}\n />\n )}\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"slider\"\n aria-disabled={disabled || undefined}\n aria-orientation={vertical ? \"vertical\" : undefined}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-valuenow={value}\n aria-valuetext={getValueText(value) || undefined}\n tabIndex={tabIndex}\n className={sliderThumb(classNameOptions)}\n onFocus={(event) => {\n onFocus(event);\n\n if (discrete && keyboard) {\n setKeyboardVisible(true);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n // this allows the tooltip to be visible when switching from mouse to\n // keyboard\n if (discrete && event.key !== \"Tab\") {\n setKeyboardVisible(true);\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter(event);\n if (discrete && tooltipVisibility === \"hover\" && !touch) {\n setMouseVisible(true);\n }\n }}\n onMouseLeave={(event) => {\n onMouseLeave(event);\n if (discrete && tooltipVisibility === \"hover\" && !touch) {\n setMouseVisible(false);\n }\n }}\n />\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-hidden\n id={`${id}-value`}\n type=\"range\"\n name={name}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={disabled}\n tabIndex={-1}\n onChange={onChange}\n className={sliderThumbInput()}\n />\n {discrete && (\n <SliderValueTooltip\n position={vertical ? \"left\" : \"above\"}\n vertical={vertical}\n animate={!disableSmoothDragging && !active}\n visible={\n tooltipVisibility === \"always\" ||\n active ||\n keyboardVisible ||\n mouseVisible\n }\n {...tooltipProps}\n {...getTooltipProps(value, isFirstThumb)}\n index={index}\n >\n {getTooltipChildren(value, isFirstThumb)}\n </SliderValueTooltip>\n )}\n </>\n );\n});\n"],"names":["forwardRef","useEffect","useState","useUserInteractionMode","SliderValueTooltip","sliderThumb","sliderThumbInput","noop","SliderThumb","props","ref","id","min","max","name","value","onChange","index","getValueText","step","active","animate","disabled","vertical","discrete","tabIndex","className","onFocus","onKeyDown","onMouseEnter","onMouseLeave","tooltipProps","getTooltipProps","getTooltipChildren","disableSmoothDragging","tooltipVisibility","remaining","ariaLabel","ariaLabelledBy","isFirstThumb","mode","keyboard","touch","mouseVisible","setMouseVisible","keyboardVisible","setKeyboardVisible","prevVisible","callback","window","addEventListener","removeEventListener","classNameOptions","span","mask","role","aria-disabled","undefined","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","event","key","input","aria-label","aria-labelledby","aria-hidden","type","position","visible"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,QAAQ;AAEf,SAASC,sBAAsB,QAAQ,gDAAgD;AAGvF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,oBAAoB;AAGlE,MAAMC,OAAO;AACX,aAAa;AACf;AAkGA;;;;;;CAMC,GACD,OAAO,MAAMC,4BAAcR,WAGzB,SAASQ,YAAYC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,EAAE,EACFC,GAAG,EACHC,GAAG,EACHC,IAAI,EACJC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,WAAWH,WAAW,CAAC,IAAI,CAAC,EAC5BI,SAAS,EACTC,UAAUpB,IAAI,EACdqB,YAAYrB,IAAI,EAChBsB,eAAetB,IAAI,EACnBuB,eAAevB,IAAI,EACnBwB,YAAY,EACZC,eAAe,EACfC,kBAAkB,EAClBC,qBAAqB,EACrBC,oBAAoB,MAAM,EAC1B,GAAGC,WACJ,GAAG3B;IACJ,MAAM,EAAE,cAAc4B,SAAS,EAAE,mBAAmBC,cAAc,EAAE,GAAG7B;IAEvE,MAAM8B,eAAetB,UAAU;IAC/B,MAAMuB,OAAO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YiB,UAAU;wBACxBK,mBAAmB;oBACrB;gBACF;gBACAlB,WAAW,CAACmC;oBACVnC,UAAUmC;oBAEV,qEAAqE;oBACrE,WAAW;oBACX,IAAIvC,YAAYuC,MAAMC,GAAG,KAAK,OAAO;wBACnClB,mBAAmB;oBACrB;gBACF;gBACAjB,cAAc,CAACkC;oBACblC,aAAakC;oBACb,IAAIvC,YAAYW,sBAAsB,WAAW,CAACO,OAAO;wBACvDE,gBAAgB;oBAClB;gBACF;gBACAd,cAAc,CAACiC;oBACbjC,aAAaiC;oBACb,IAAIvC,YAAYW,sBAAsB,WAAW,CAACO,OAAO;wBACvDE,gBAAgB;oBAClB;gBACF;;0BAEF,KAACqB;gBACCC,cAAY7B;gBACZ8B,mBAAiB7B;gBACjB8B,aAAW;gBACXzD,IAAI,GAAGA,GAAG,MAAM,CAAC;gBACjB0D,MAAK;gBACLvD,MAAMA;gBACNF,KAAKA;gBACLC,KAAKA;gBACLM,MAAMA;gBACNJ,OAAOA;gBACPO,UAAUA;gBACVG,UAAU,CAAC;gBACXT,UAAUA;gBACVU,WAAWpB;;YAEZkB,0BACC,KAACpB;gBACCkE,UAAU/C,WAAW,SAAS;gBAC9BA,UAAUA;gBACVF,SAAS,CAACa,yBAAyB,CAACd;gBACpCmD,SACEpC,sBAAsB,YACtBf,UACAyB,mBACAF;gBAED,GAAGZ,YAAY;gBACf,GAAGC,gBAAgBjB,OAAOwB,aAAa;gBACxCtB,OAAOA;0BAENgB,mBAAmBlB,OAAOwB;;;;AAKrC,GAAG"}
1
+ {"version":3,"sources":["../../src/form/SliderThumb.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ChangeEventHandler,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n useEffect,\n useState,\n} from \"react\";\n\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type TooltipProps } from \"../tooltip/Tooltip.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { SliderValueTooltip } from \"./SliderValueTooltip.js\";\nimport { sliderThumb, sliderThumbInput } from \"./sliderStyles.js\";\nimport { type SliderValueOptions } from \"./useSlider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type SliderTooltipVisibility = \"auto\" | \"hover\" | \"always\";\n\n/**\n * @since 2.5.0\n */\nexport interface SliderThumbPresentation {\n /**\n * Boolean if the slider should act as a discrete slider which will render a\n * tooltip above the thumb while dragging to visualize the current value for\n * the slider.\n *\n * @defaultValue `false`\n */\n discrete?: boolean;\n\n /**\n * A function that is used to help with accessibility by creating a better\n * value string if just a number isn't representative enough of your range.\n *\n * Example:\n *\n * ```tsx\n * const [value, controls] = useSlider(0, {\n * // format to be `$100`, etc\n * getValueText: value => `$${value}`,\n * });\n *\n * return <Slider baseId=\"price-slider\" label=\"Price\" {...controls} />;\n * ```\n *\n * @defaultValue `() => \"\"`\n */\n getValueText?: (value: number) => string;\n\n /**\n * Set this to `true` if the slider's thumb position should only update when\n * the user has dragged to the next value instead of with the mouse.\n *\n * @see {@link marks}\n * @defaultValue `!!marks`\n */\n disableSmoothDragging?: boolean;\n\n /**\n * The discrete slider's value tooltip will only become visible when:\n *\n * - `\"auto\"` - the user is dragging with touch/mouse or focused with a keyboard\n * - `\"hover\"` - the behavior of `\"auto\"` plus while hovering the thumb with a mouse\n * - `\"always\"` - ... always\n *\n * This only applies when the {@link discrete} prop is `true`.\n *\n * @defaultValue `\"auto\"`\n */\n tooltipVisibility?: SliderTooltipVisibility;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableSliderThumbProps extends Omit<\n HTMLAttributes<HTMLSpanElement>,\n \"onChange\"\n> {\n name?: string;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Internal only component.\n */\nexport interface SliderThumbProps\n extends\n ConfigurableSliderThumbProps,\n Required<SliderValueOptions>,\n Required<SliderThumbPresentation> {\n ref?: Ref<HTMLSpanElement>;\n id: string;\n value: number;\n index: 1 | 2;\n active: boolean;\n animate: boolean;\n disabled: boolean;\n vertical: boolean;\n onChange: ChangeEventHandler<HTMLInputElement>;\n tooltipProps?: Partial<TooltipProps>;\n getTooltipProps: (\n value: number,\n isFirstThumb: boolean\n ) => Partial<TooltipProps> | undefined;\n getTooltipChildren: (value: number, isFirstThumb: boolean) => ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Internal only component.\n */\nexport function SliderThumb(\n props: LabelRequiredForA11y<SliderThumbProps>\n): ReactElement {\n const {\n ref,\n id,\n min,\n max,\n name,\n value,\n onChange,\n index,\n getValueText,\n step,\n active,\n animate,\n disabled,\n vertical,\n discrete,\n tabIndex = disabled ? -1 : 0,\n className,\n onFocus = noop,\n onKeyDown = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n tooltipProps,\n getTooltipProps,\n getTooltipChildren,\n disableSmoothDragging,\n tooltipVisibility = \"auto\",\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } = props;\n\n const isFirstThumb = index === 1;\n const mode = useUserInteractionMode();\n const keyboard = mode === \"keyboard\";\n const touch = mode === \"touch\";\n const [mouseVisible, setMouseVisible] = useState(false);\n const [keyboardVisible, setKeyboardVisible] = useState(false);\n useEffect(() => {\n if (disabled || !discrete) {\n setKeyboardVisible(false);\n return;\n }\n\n // if the mode changes away from keyboard, need to disable the keyboard\n // state\n setKeyboardVisible((prevVisible) => prevVisible && mode === \"keyboard\");\n }, [disabled, discrete, mode]);\n useEffect(() => {\n if (disabled || !discrete) {\n setMouseVisible(false);\n return;\n }\n\n setMouseVisible((prevVisible) => prevVisible && mode !== \"touch\");\n }, [disabled, discrete, mode]);\n useEffect(() => {\n if (!keyboardVisible) {\n return;\n }\n\n const callback = (): void => {\n setKeyboardVisible(false);\n };\n\n window.addEventListener(\"blur\", callback, true);\n return () => {\n window.removeEventListener(\"blur\", callback);\n };\n }, [keyboardVisible]);\n\n const classNameOptions = {\n index,\n active,\n animate: !disableSmoothDragging && animate,\n disabled,\n vertical,\n className,\n } as const;\n\n return (\n <>\n {disabled && (\n <span\n className={sliderThumb({\n ...classNameOptions,\n mask: true,\n })}\n />\n )}\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"slider\"\n aria-disabled={disabled || undefined}\n aria-orientation={vertical ? \"vertical\" : undefined}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-valuenow={value}\n aria-valuetext={getValueText(value) || undefined}\n tabIndex={tabIndex}\n className={sliderThumb(classNameOptions)}\n onFocus={(event) => {\n onFocus(event);\n\n if (discrete && keyboard) {\n setKeyboardVisible(true);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n // this allows the tooltip to be visible when switching from mouse to\n // keyboard\n if (discrete && event.key !== \"Tab\") {\n setKeyboardVisible(true);\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter(event);\n if (discrete && tooltipVisibility === \"hover\" && !touch) {\n setMouseVisible(true);\n }\n }}\n onMouseLeave={(event) => {\n onMouseLeave(event);\n if (discrete && tooltipVisibility === \"hover\" && !touch) {\n setMouseVisible(false);\n }\n }}\n />\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-hidden\n id={`${id}-value`}\n type=\"range\"\n name={name}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={disabled}\n tabIndex={-1}\n onChange={onChange}\n className={sliderThumbInput()}\n />\n {discrete && (\n <SliderValueTooltip\n position={vertical ? \"left\" : \"above\"}\n vertical={vertical}\n animate={!disableSmoothDragging && !active}\n visible={\n tooltipVisibility === \"always\" ||\n active ||\n keyboardVisible ||\n mouseVisible\n }\n {...tooltipProps}\n {...getTooltipProps(value, isFirstThumb)}\n index={index}\n >\n {getTooltipChildren(value, isFirstThumb)}\n </SliderValueTooltip>\n )}\n </>\n );\n}\n"],"names":["useEffect","useState","useUserInteractionMode","SliderValueTooltip","sliderThumb","sliderThumbInput","noop","SliderThumb","props","ref","id","min","max","name","value","onChange","index","getValueText","step","active","animate","disabled","vertical","discrete","tabIndex","className","onFocus","onKeyDown","onMouseEnter","onMouseLeave","tooltipProps","getTooltipProps","getTooltipChildren","disableSmoothDragging","tooltipVisibility","remaining","ariaLabel","ariaLabelledBy","isFirstThumb","mode","keyboard","touch","mouseVisible","setMouseVisible","keyboardVisible","setKeyboardVisible","prevVisible","callback","window","addEventListener","removeEventListener","classNameOptions","span","mask","role","aria-disabled","undefined","aria-orientation","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","event","key","input","aria-label","aria-labelledby","aria-hidden","type","position","visible"],"mappings":"AAAA;;AAEA,SAMEA,SAAS,EACTC,QAAQ,QACH,QAAQ;AAEf,SAASC,sBAAsB,QAAQ,gDAAgD;AAGvF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,oBAAoB;AAGlE,MAAMC,OAAO;AACX,aAAa;AACf;AAmGA;;;;;;CAMC,GACD,OAAO,SAASC,YACdC,KAA6C;IAE7C,MAAM,EACJC,GAAG,EACHC,EAAE,EACFC,GAAG,EACHC,GAAG,EACHC,IAAI,EACJC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,WAAWH,WAAW,CAAC,IAAI,CAAC,EAC5BI,SAAS,EACTC,UAAUpB,IAAI,EACdqB,YAAYrB,IAAI,EAChBsB,eAAetB,IAAI,EACnBuB,eAAevB,IAAI,EACnBwB,YAAY,EACZC,eAAe,EACfC,kBAAkB,EAClBC,qBAAqB,EACrBC,oBAAoB,MAAM,EAC1B,GAAGC,WACJ,GAAG3B;IACJ,MAAM,EAAE,cAAc4B,SAAS,EAAE,mBAAmBC,cAAc,EAAE,GAAG7B;IAEvE,MAAM8B,eAAetB,UAAU;IAC/B,MAAMuB,OAAOrC;IACb,MAAMsC,WAAW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AAmB;oBACrB;gBACF;gBACAlB,WAAW,CAACmC;oBACVnC,UAAUmC;oBAEV,qEAAqE;oBACrE,WAAW;oBACX,IAAIvC,YAAYuC,MAAMC,GAAG,KAAK,OAAO;wBACnClB,mBAAmB;oBACrB;gBACF;gBACAjB,cAAc,CAACkC;oBACblC,aAAakC;oBACb,IAAIvC,YAAYW,sBAAsB,WAAW,CAACO,OAAO;wBACvDE,gBAAgB;oBAClB;gBACF;gBACAd,cAAc,CAACiC;oBACbjC,aAAaiC;oBACb,IAAIvC,YAAYW,sBAAsB,WAAW,CAACO,OAAO;wBACvDE,gBAAgB;oBAClB;gBACF;;0BAEF,KAACqB;gBACCC,cAAY7B;gBACZ8B,mBAAiB7B;gBACjB8B,aAAW;gBACXzD,IAAI,GAAGA,GAAG,MAAM,CAAC;gBACjB0D,MAAK;gBACLvD,MAAMA;gBACNF,KAAKA;gBACLC,KAAKA;gBACLM,MAAMA;gBACNJ,OAAOA;gBACPO,UAAUA;gBACVG,UAAU,CAAC;gBACXT,UAAUA;gBACVU,WAAWpB;;YAEZkB,0BACC,KAACpB;gBACCkE,UAAU/C,WAAW,SAAS;gBAC9BA,UAAUA;gBACVF,SAAS,CAACa,yBAAyB,CAACd;gBACpCmD,SACEpC,sBAAsB,YACtBf,UACAyB,mBACAF;gBAED,GAAGZ,YAAY;gBACf,GAAGC,gBAAgBjB,OAAOwB,aAAa;gBACxCtB,OAAOA;0BAENgB,mBAAmBlB,OAAOwB;;;;AAKrC"}
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from "react";
1
+ import { type HTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type ClosestThumbEventHandlersOptions, type ThumbOffsetsOptions } from "./sliderUtils.js";
3
3
  /**
4
4
  * @internal
@@ -6,6 +6,7 @@ import { type ClosestThumbEventHandlersOptions, type ThumbOffsetsOptions } from
6
6
  * @since 6.0.0 Updated to be internal only.
7
7
  */
8
8
  export interface SliderTrackProps extends HTMLAttributes<HTMLSpanElement>, ClosestThumbEventHandlersOptions, ThumbOffsetsOptions {
9
+ ref?: Ref<HTMLSpanElement>;
9
10
  animate: boolean;
10
11
  disabled: boolean;
11
12
  }
@@ -14,4 +15,4 @@ export interface SliderTrackProps extends HTMLAttributes<HTMLSpanElement>, Close
14
15
  * @since 2.5.0
15
16
  * @since 6.0.0 Updated to be internal only.
16
17
  */
17
- export declare const SliderTrack: import("react").ForwardRefExoticComponent<SliderTrackProps & import("react").RefAttributes<HTMLSpanElement>>;
18
+ export declare function SliderTrack(props: SliderTrackProps): ReactElement;
@@ -1,13 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { sliderTrack } from "./sliderStyles.js";
4
3
  import { getClosestThumbEventHandlers, getThumbOffsets } from "./sliderUtils.js";
5
4
  /**
6
5
  * @internal
7
6
  * @since 2.5.0
8
7
  * @since 6.0.0 Updated to be internal only.
9
- */ export const SliderTrack = /*#__PURE__*/ forwardRef(function SliderTrack(props, ref) {
10
- const { style, className, animate, vertical, disabled, min, max, thumb1Ref, thumb1Value, thumb1Dragging, thumb1DragPercentage, thumb1OnMouseUp, thumb1OnMouseDown, thumb1OnMouseMove, thumb1OnTouchStart, thumb1OnTouchMove, thumb2Ref, thumb2Value, thumb2Dragging, thumb2DragPercentage, thumb2OnMouseUp, thumb2OnMouseDown, thumb2OnMouseMove, thumb2OnTouchStart, thumb2OnTouchMove, isRangeSlider, children, ...remaining } = props;
8
+ */ export function SliderTrack(props) {
9
+ const { ref, style, className, animate, vertical, disabled, min, max, thumb1Ref, thumb1Value, thumb1Dragging, thumb1DragPercentage, thumb1OnMouseUp, thumb1OnMouseDown, thumb1OnMouseMove, thumb1OnTouchStart, thumb1OnTouchMove, thumb2Ref, thumb2Value, thumb2Dragging, thumb2DragPercentage, thumb2OnMouseUp, thumb2OnMouseDown, thumb2OnMouseMove, thumb2OnTouchStart, thumb2OnTouchMove, isRangeSlider, children, ...remaining } = props;
11
10
  return /*#__PURE__*/ _jsx("span", {
12
11
  ...remaining,
13
12
  ref: ref,
@@ -52,6 +51,6 @@ import { getClosestThumbEventHandlers, getThumbOffsets } from "./sliderUtils.js"
52
51
  }),
53
52
  children: children
54
53
  });
55
- });
54
+ }
56
55
 
57
56
  //# sourceMappingURL=SliderTrack.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/SliderTrack.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { sliderTrack } from \"./sliderStyles.js\";\nimport {\n type ClosestThumbEventHandlersOptions,\n type ThumbOffsetsOptions,\n getClosestThumbEventHandlers,\n getThumbOffsets,\n} from \"./sliderUtils.js\";\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Updated to be internal only.\n */\nexport interface SliderTrackProps\n extends\n HTMLAttributes<HTMLSpanElement>,\n ClosestThumbEventHandlersOptions,\n ThumbOffsetsOptions {\n animate: boolean;\n disabled: boolean;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Updated to be internal only.\n */\nexport const SliderTrack = forwardRef<HTMLSpanElement, SliderTrackProps>(\n function SliderTrack(props, ref) {\n const {\n style,\n className,\n animate,\n vertical,\n disabled,\n min,\n max,\n thumb1Ref,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnMouseMove,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnMouseMove,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n isRangeSlider,\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n style={{\n ...style,\n ...getThumbOffsets({\n min,\n max,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n isRangeSlider,\n }),\n }}\n className={sliderTrack({\n className,\n animate,\n disabled,\n vertical,\n isRangeSlider,\n })}\n {...getClosestThumbEventHandlers({\n vertical,\n isRangeSlider,\n thumb1Ref,\n thumb1Dragging,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnMouseMove,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Dragging,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnMouseMove,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["forwardRef","sliderTrack","getClosestThumbEventHandlers","getThumbOffsets","SliderTrack","props","ref","style","className","animate","vertical","disabled","min","max","thumb1Ref","thumb1Value","thumb1Dragging","thumb1DragPercentage","thumb1OnMouseUp","thumb1OnMouseDown","thumb1OnMouseMove","thumb1OnTouchStart","thumb1OnTouchMove","thumb2Ref","thumb2Value","thumb2Dragging","thumb2DragPercentage","thumb2OnMouseUp","thumb2OnMouseDown","thumb2OnMouseMove","thumb2OnTouchStart","thumb2OnTouchMove","isRangeSlider","children","remaining","span"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAGEC,4BAA4B,EAC5BC,eAAe,QACV,mBAAmB;AAgB1B;;;;CAIC,GACD,OAAO,MAAMC,4BAAcJ,WACzB,SAASI,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,GAAG,EACHC,SAAS,EACTC,WAAW,EACXC,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,SAAS,EACTC,WAAW,EACXC,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,QAAQ,EACR,GAAGC,WACJ,GAAG7B;IAEJ,qBACE,KAAC8B;QACE,GAAGD,SAAS;QACb5B,KAAKA;QACLC,OAAO;YACL,GAAGA,KAAK;YACR,GAAGJ,gBAAgB;gBACjBS;gBACAC;gBACAE;gBACAC;gBACAC;gBACAO;gBACAC;gBACAC;gBACAM;YACF,EAAE;QACJ;QACAxB,WAAWP,YAAY;YACrBO;YACAC;YACAE;YACAD;YACAsB;QACF;QACC,GAAG9B,6BAA6B;YAC/BQ;YACAsB;YACAlB;YACAE;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAE;YACAC;YACAC;YACAC;YACAC;QACF,EAAE;kBAEDE;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/form/SliderTrack.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { sliderTrack } from \"./sliderStyles.js\";\nimport {\n type ClosestThumbEventHandlersOptions,\n type ThumbOffsetsOptions,\n getClosestThumbEventHandlers,\n getThumbOffsets,\n} from \"./sliderUtils.js\";\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Updated to be internal only.\n */\nexport interface SliderTrackProps\n extends\n HTMLAttributes<HTMLSpanElement>,\n ClosestThumbEventHandlersOptions,\n ThumbOffsetsOptions {\n ref?: Ref<HTMLSpanElement>;\n animate: boolean;\n disabled: boolean;\n}\n\n/**\n * @internal\n * @since 2.5.0\n * @since 6.0.0 Updated to be internal only.\n */\nexport function SliderTrack(props: SliderTrackProps): ReactElement {\n const {\n ref,\n style,\n className,\n animate,\n vertical,\n disabled,\n min,\n max,\n thumb1Ref,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnMouseMove,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnMouseMove,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n isRangeSlider,\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n style={{\n ...style,\n ...getThumbOffsets({\n min,\n max,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n isRangeSlider,\n }),\n }}\n className={sliderTrack({\n className,\n animate,\n disabled,\n vertical,\n isRangeSlider,\n })}\n {...getClosestThumbEventHandlers({\n vertical,\n isRangeSlider,\n thumb1Ref,\n thumb1Dragging,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnMouseMove,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Dragging,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnMouseMove,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n })}\n >\n {children}\n </span>\n );\n}\n"],"names":["sliderTrack","getClosestThumbEventHandlers","getThumbOffsets","SliderTrack","props","ref","style","className","animate","vertical","disabled","min","max","thumb1Ref","thumb1Value","thumb1Dragging","thumb1DragPercentage","thumb1OnMouseUp","thumb1OnMouseDown","thumb1OnMouseMove","thumb1OnTouchStart","thumb1OnTouchMove","thumb2Ref","thumb2Value","thumb2Dragging","thumb2DragPercentage","thumb2OnMouseUp","thumb2OnMouseDown","thumb2OnMouseMove","thumb2OnTouchStart","thumb2OnTouchMove","isRangeSlider","children","remaining","span"],"mappings":";AAEA,SAASA,WAAW,QAAQ,oBAAoB;AAChD,SAGEC,4BAA4B,EAC5BC,eAAe,QACV,mBAAmB;AAiB1B;;;;CAIC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EACJC,GAAG,EACHC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,GAAG,EACHC,SAAS,EACTC,WAAW,EACXC,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,SAAS,EACTC,WAAW,EACXC,cAAc,EACdC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,QAAQ,EACR,GAAGC,WACJ,GAAG7B;IAEJ,qBACE,KAAC8B;QACE,GAAGD,SAAS;QACb5B,KAAKA;QACLC,OAAO;YACL,GAAGA,KAAK;YACR,GAAGJ,gBAAgB;gBACjBS;gBACAC;gBACAE;gBACAC;gBACAC;gBACAO;gBACAC;gBACAC;gBACAM;YACF,EAAE;QACJ;QACAxB,WAAWP,YAAY;YACrBO;YACAC;YACAE;YACAD;YACAsB;QACF;QACC,GAAG9B,6BAA6B;YAC/BQ;YACAsB;YACAlB;YACAE;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAE;YACAE;YACAC;YACAC;YACAC;YACAC;QACF,EAAE;kBAEDE;;AAGP"}
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type ReactNode } from "react";
1
+ import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
2
2
  import { type PropsWithRef } from "../types.js";
3
3
  import { type InputToggleLabelProps } from "./InputToggle.js";
4
4
  import { type FormComponentStates, type FormMessageContainerExtension } from "./types.js";
@@ -13,6 +13,7 @@ declare module "react" {
13
13
  * `FormMessage` behavior.
14
14
  */
15
15
  export interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, InputToggleLabelProps, FormMessageContainerExtension, FormComponentStates {
16
+ ref?: Ref<HTMLInputElement>;
16
17
  containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;
17
18
  trackProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;
18
19
  trackStyle?: CSSProperties;
@@ -49,4 +50,4 @@ export interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, Inpu
49
50
  * @see {@link https://react-md.dev/components/switch | Switch Demos}
50
51
  * @since 6.0.0 Added support for `FormMessage` behavior.
51
52
  */
52
- export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLInputElement>>;
53
+ export declare function Switch(props: SwitchProps): ReactElement;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cnb } from "cnbuilder";
3
- import { forwardRef } from "react";
4
3
  import { useEnsuredId } from "../useEnsuredId.js";
5
4
  import { FormMessageContainer } from "./FormMessageContainer.js";
6
5
  import { Label } from "./Label.js";
@@ -32,8 +31,8 @@ import { switchStyles } from "./switchStyles.js";
32
31
  *
33
32
  * @see {@link https://react-md.dev/components/switch | Switch Demos}
34
33
  * @since 6.0.0 Added support for `FormMessage` behavior.
35
- */ export const Switch = /*#__PURE__*/ forwardRef(function Switch(props, ref) {
36
- const { id: propId, label, labelProps, style, className, containerProps, ballProps, ballStyle, ballClassName, ballAddon, trackProps, trackStyle, trackClassName, messageProps, messageContainerProps, disableLabelGap = false, error = false, active = false, stacked = false, iconAfter = false, disabled = false, readOnly = false, ...remaining } = props;
34
+ */ export function Switch(props) {
35
+ const { ref, id: propId, label, labelProps, style, className, containerProps, ballProps, ballStyle, ballClassName, ballAddon, trackProps, trackStyle, trackClassName, messageProps, messageContainerProps, disableLabelGap = false, error = false, active = false, stacked = false, iconAfter = false, disabled = false, readOnly = false, ...remaining } = props;
37
36
  const id = useEnsuredId(propId, "switch");
38
37
  return /*#__PURE__*/ _jsx(FormMessageContainer, {
39
38
  ...messageContainerProps,
@@ -80,6 +79,6 @@ import { switchStyles } from "./switchStyles.js";
80
79
  ]
81
80
  })
82
81
  });
83
- });
82
+ }
84
83
 
85
84
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/Switch.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { type InputToggleLabelProps } from \"./InputToggle.js\";\nimport { Label } from \"./Label.js\";\nimport { SwitchTrack } from \"./SwitchTrack.js\";\nimport { switchStyles } from \"./switchStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n// NOTE: The augmentation appears in this file since no type definitions are\n// ever imported from the `switchStyles` file.\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-switch-track-background-color\"?: string;\n \"--rmd-switch-ball-background-color\"?: string;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps` and support for the\n * `FormMessage` behavior.\n */\nexport interface SwitchProps\n extends\n InputHTMLAttributes<HTMLInputElement>,\n InputToggleLabelProps,\n FormMessageContainerExtension,\n FormComponentStates {\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n trackProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n trackStyle?: CSSProperties;\n trackClassName?: string;\n ballAddon?: ReactNode;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Switch } from \"@react-md/core/form/Switch\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <Form>\n * <Switch\n * label=\"Label\"\n * name=\"enabled\"\n * checked={checked}\n * onChange={(event) => setChecked(event.currentTarget.checked)}\n * />\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/switch | Switch Demos}\n * @since 6.0.0 Added support for `FormMessage` behavior.\n */\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n function Switch(props, ref) {\n const {\n id: propId,\n label,\n labelProps,\n style,\n className,\n containerProps,\n ballProps,\n ballStyle,\n ballClassName,\n ballAddon,\n trackProps,\n trackStyle,\n trackClassName,\n messageProps,\n messageContainerProps,\n disableLabelGap = false,\n error = false,\n active = false,\n stacked = false,\n iconAfter = false,\n disabled = false,\n readOnly = false,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"switch\");\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n style={style}\n {...labelProps}\n className={cnb(className, labelProps?.className)}\n gap={!disableLabelGap}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n >\n {label}\n <div\n {...containerProps}\n className={switchStyles({\n clickable: !disabled && !readOnly,\n className: containerProps?.className,\n currentColor: active || error,\n })}\n >\n <SwitchTrack\n style={trackStyle}\n {...trackProps}\n className={cnb(trackClassName, trackProps?.className)}\n disabled={disabled}\n ballAddon={ballAddon}\n ballProps={ballProps}\n ballStyle={ballStyle}\n ballClassName={ballClassName}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n role=\"switch\"\n type=\"checkbox\"\n className={cnb(\n \"rmd-switch__input rmd-hidden-input\",\n disabled && \"rmd-hidden-input--disabled\"\n )}\n disabled={disabled}\n />\n </SwitchTrack>\n </div>\n </Label>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["cnb","forwardRef","useEnsuredId","FormMessageContainer","Label","SwitchTrack","switchStyles","Switch","props","ref","id","propId","label","labelProps","style","className","containerProps","ballProps","ballStyle","ballClassName","ballAddon","trackProps","trackStyle","trackClassName","messageProps","messageContainerProps","disableLabelGap","error","active","stacked","iconAfter","disabled","readOnly","remaining","gap","reversed","div","clickable","currentColor","input","role","type"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAKEC,UAAU,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AAWA;wBACXC,eAAeA;kCAEf,cAAA,KAACoB;4BACE,GAAGN,SAAS;4BACbvB,IAAIA;4BACJD,KAAKA;4BACL+B,MAAK;4BACLC,MAAK;4BACL1B,WAAWf,IACT,sCACA+B,YAAY;4BAEdA,UAAUA;;;;;;;AAOxB,GACA"}
1
+ {"version":3,"sources":["../../src/form/Switch.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { type InputToggleLabelProps } from \"./InputToggle.js\";\nimport { Label } from \"./Label.js\";\nimport { SwitchTrack } from \"./SwitchTrack.js\";\nimport { switchStyles } from \"./switchStyles.js\";\nimport {\n type FormComponentStates,\n type FormMessageContainerExtension,\n} from \"./types.js\";\n\n// NOTE: The augmentation appears in this file since no type definitions are\n// ever imported from the `switchStyles` file.\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-switch-track-background-color\"?: string;\n \"--rmd-switch-ball-background-color\"?: string;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps` and support for the\n * `FormMessage` behavior.\n */\nexport interface SwitchProps\n extends\n InputHTMLAttributes<HTMLInputElement>,\n InputToggleLabelProps,\n FormMessageContainerExtension,\n FormComponentStates {\n ref?: Ref<HTMLInputElement>;\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n trackProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n trackStyle?: CSSProperties;\n trackClassName?: string;\n ballAddon?: ReactNode;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Form } from \"@react-md/core/form/Form\";\n * import { Switch } from \"@react-md/core/form/Switch\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <Form>\n * <Switch\n * label=\"Label\"\n * name=\"enabled\"\n * checked={checked}\n * onChange={(event) => setChecked(event.currentTarget.checked)}\n * />\n * </Form>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/switch | Switch Demos}\n * @since 6.0.0 Added support for `FormMessage` behavior.\n */\nexport function Switch(props: SwitchProps): ReactElement {\n const {\n ref,\n id: propId,\n label,\n labelProps,\n style,\n className,\n containerProps,\n ballProps,\n ballStyle,\n ballClassName,\n ballAddon,\n trackProps,\n trackStyle,\n trackClassName,\n messageProps,\n messageContainerProps,\n disableLabelGap = false,\n error = false,\n active = false,\n stacked = false,\n iconAfter = false,\n disabled = false,\n readOnly = false,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"switch\");\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <Label\n style={style}\n {...labelProps}\n className={cnb(className, labelProps?.className)}\n gap={!disableLabelGap}\n stacked={stacked}\n reversed={!iconAfter}\n active={active}\n error={error}\n disabled={disabled}\n >\n {label}\n <div\n {...containerProps}\n className={switchStyles({\n clickable: !disabled && !readOnly,\n className: containerProps?.className,\n currentColor: active || error,\n })}\n >\n <SwitchTrack\n style={trackStyle}\n {...trackProps}\n className={cnb(trackClassName, trackProps?.className)}\n disabled={disabled}\n ballAddon={ballAddon}\n ballProps={ballProps}\n ballStyle={ballStyle}\n ballClassName={ballClassName}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n role=\"switch\"\n type=\"checkbox\"\n className={cnb(\n \"rmd-switch__input rmd-hidden-input\",\n disabled && \"rmd-hidden-input--disabled\"\n )}\n disabled={disabled}\n />\n </SwitchTrack>\n </div>\n </Label>\n </FormMessageContainer>\n );\n}\n"],"names":["cnb","useEnsuredId","FormMessageContainer","Label","SwitchTrack","switchStyles","Switch","props","ref","id","propId","label","labelProps","style","className","containerProps","ballProps","ballStyle","ballClassName","ballAddon","trackProps","trackStyle","trackClassName","messageProps","messageContainerProps","disableLabelGap","error","active","stacked","iconAfter","disabled","readOnly","remaining","gap","reversed","div","clickable","currentColor","input","role","type"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAWhC,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AAEjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,QAAQ,oBAAoB;AAoCjD;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,YAAY,EACZC,qBAAqB,EACrBC,kBAAkB,KAAK,EACvBC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,WAAW,KAAK,EAChBC,WAAW,KAAK,EAChB,GAAGC,WACJ,GAAGzB;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,qBACE,KAACR;QACE,GAAGsB,qBAAqB;QACzBD,cAAcA;kBAEd,cAAA,MAACpB;YACCU,OAAOA;YACN,GAAGD,UAAU;YACdE,WAAWd,IAAIc,WAAWF,YAAYE;YACtCmB,KAAK,CAACR;YACNG,SAASA;YACTM,UAAU,CAACL;YACXF,QAAQA;YACRD,OAAOA;YACPI,UAAUA;;gBAETnB;8BACD,KAACwB;oBACE,GAAGpB,cAAc;oBAClBD,WAAWT,aAAa;wBACtB+B,WAAW,CAACN,YAAY,CAACC;wBACzBjB,WAAWC,gBAAgBD;wBAC3BuB,cAAcV,UAAUD;oBAC1B;8BAEA,cAAA,KAACtB;wBACCS,OAAOQ;wBACN,GAAGD,UAAU;wBACdN,WAAWd,IAAIsB,gBAAgBF,YAAYN;wBAC3CgB,UAAUA;wBACVX,WAAWA;wBACXH,WAAWA;wBACXC,WAAWA;wBACXC,eAAeA;kCAEf,cAAA,KAACoB;4BACE,GAAGN,SAAS;4BACbvB,IAAIA;4BACJD,KAAKA;4BACL+B,MAAK;4BACLC,MAAK;4BACL1B,WAAWd,IACT,sCACA8B,YAAY;4BAEdA,UAAUA;;;;;;;AAOxB"}
@@ -1,6 +1,7 @@
1
- import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
1
+ import { type CSSProperties, type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
2
2
  import { type PropsWithRef } from "../types.js";
3
3
  export interface SwitchTrackProps extends HTMLAttributes<HTMLDivElement> {
4
+ ref?: Ref<HTMLDivElement>;
4
5
  active?: boolean;
5
6
  disabled?: boolean;
6
7
  ballAddon?: ReactNode;
@@ -12,4 +13,4 @@ export interface SwitchTrackProps extends HTMLAttributes<HTMLDivElement> {
12
13
  * Used to create the switch track styles
13
14
  * @internal
14
15
  */
15
- export declare const SwitchTrack: import("react").ForwardRefExoticComponent<SwitchTrackProps & import("react").RefAttributes<HTMLDivElement>>;
16
+ export declare function SwitchTrack(props: SwitchTrackProps): ReactElement;
@@ -1,11 +1,10 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { switchBall, switchTrack } from "./switchStyles.js";
4
3
  /**
5
4
  * Used to create the switch track styles
6
5
  * @internal
7
- */ export const SwitchTrack = /*#__PURE__*/ forwardRef(function SwitchTrack(props, ref) {
8
- const { style, className, ballAddon, ballProps, ballStyle, ballClassName, active, children, disabled = false, ...remaining } = props;
6
+ */ export function SwitchTrack(props) {
7
+ const { ref, style, className, ballAddon, ballProps, ballStyle, ballClassName, active, children, disabled = false, ...remaining } = props;
9
8
  return /*#__PURE__*/ _jsxs("div", {
10
9
  ...remaining,
11
10
  ref: ref,
@@ -30,6 +29,6 @@ import { switchBall, switchTrack } from "./switchStyles.js";
30
29
  })
31
30
  ]
32
31
  });
33
- });
32
+ }
34
33
 
35
34
  //# sourceMappingURL=SwitchTrack.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/SwitchTrack.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { switchBall, switchTrack } from \"./switchStyles.js\";\n\nexport interface SwitchTrackProps extends HTMLAttributes<HTMLDivElement> {\n active?: boolean;\n disabled?: boolean;\n ballAddon?: ReactNode;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * Used to create the switch track styles\n * @internal\n */\nexport const SwitchTrack = forwardRef<HTMLDivElement, SwitchTrackProps>(\n function SwitchTrack(props, ref) {\n const {\n style,\n className,\n ballAddon,\n ballProps,\n ballStyle,\n ballClassName,\n active,\n children,\n disabled = false,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n style={style}\n className={switchTrack({ disabled, className })}\n >\n {children}\n <span\n style={ballStyle}\n {...ballProps}\n className={switchBall({ className: ballClassName, active })}\n >\n {ballAddon}\n {ballProps?.children}\n </span>\n </div>\n );\n }\n);\n"],"names":["forwardRef","switchBall","switchTrack","SwitchTrack","props","ref","style","className","ballAddon","ballProps","ballStyle","ballClassName","active","children","disabled","remaining","div","span"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,UAAU,EAAEC,WAAW,QAAQ,oBAAoB;AAW5D;;;CAGC,GACD,OAAO,MAAMC,4BAAcH,WACzB,SAASG,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,WAAW,KAAK,EAChB,GAAGC,WACJ,GAAGX;IAEJ,qBACE,MAACY;QACE,GAAGD,SAAS;QACbV,KAAKA;QACLC,OAAOA;QACPC,WAAWL,YAAY;YAAEY;YAAUP;QAAU;;YAE5CM;0BACD,MAACI;gBACCX,OAAOI;gBACN,GAAGD,SAAS;gBACbF,WAAWN,WAAW;oBAAEM,WAAWI;oBAAeC;gBAAO;;oBAExDJ;oBACAC,WAAWI;;;;;AAIpB,GACA"}
1
+ {"version":3,"sources":["../../src/form/SwitchTrack.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { switchBall, switchTrack } from \"./switchStyles.js\";\n\nexport interface SwitchTrackProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n active?: boolean;\n disabled?: boolean;\n ballAddon?: ReactNode;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * Used to create the switch track styles\n * @internal\n */\nexport function SwitchTrack(props: SwitchTrackProps): ReactElement {\n const {\n ref,\n style,\n className,\n ballAddon,\n ballProps,\n ballStyle,\n ballClassName,\n active,\n children,\n disabled = false,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n style={style}\n className={switchTrack({ disabled, className })}\n >\n {children}\n <span\n style={ballStyle}\n {...ballProps}\n className={switchBall({ className: ballClassName, active })}\n >\n {ballAddon}\n {ballProps?.children}\n </span>\n </div>\n );\n}\n"],"names":["switchBall","switchTrack","SwitchTrack","props","ref","style","className","ballAddon","ballProps","ballStyle","ballClassName","active","children","disabled","remaining","div","span"],"mappings":";AASA,SAASA,UAAU,EAAEC,WAAW,QAAQ,oBAAoB;AAY5D;;;CAGC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EACJC,GAAG,EACHC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,WAAW,KAAK,EAChB,GAAGC,WACJ,GAAGX;IAEJ,qBACE,MAACY;QACE,GAAGD,SAAS;QACbV,KAAKA;QACLC,OAAOA;QACPC,WAAWL,YAAY;YAAEY;YAAUP;QAAU;;YAE5CM;0BACD,MAACI;gBACCX,OAAOI;gBACN,GAAGD,SAAS;gBACbF,WAAWN,WAAW;oBAAEM,WAAWI;oBAAeC;gBAAO;;oBAExDJ;oBACAC,WAAWI;;;;;AAIpB"}
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type HTMLAttributes, type TextareaHTMLAttributes } from "react";
1
+ import { type CSSProperties, type HTMLAttributes, type ReactElement, type Ref, type TextareaHTMLAttributes } from "react";
2
2
  import { type PropsWithRef } from "../types.js";
3
3
  import { type FormFieldOptions } from "./types.js";
4
4
  import { type TextAreaResize } from "./useResizingTextArea.js";
@@ -12,6 +12,7 @@ declare module "react" {
12
12
  * @since 6.0.0 Added `containerProps`.
13
13
  */
14
14
  export interface TextAreaProps extends FormFieldOptions, TextareaHTMLAttributes<HTMLTextAreaElement> {
15
+ ref?: Ref<HTMLTextAreaElement>;
15
16
  /** @defaultValue `"text-area-" + useId()` */
16
17
  id?: string;
17
18
  /**
@@ -89,4 +90,4 @@ export interface TextAreaProps extends FormFieldOptions, TextareaHTMLAttributes<
89
90
  *
90
91
  * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}
91
92
  */
92
- export declare const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
93
+ export declare function TextArea(props: TextAreaProps): ReactElement;
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { useEnsuredId } from "../useEnsuredId.js";
5
4
  import { useEnsuredRef } from "../useEnsuredRef.js";
6
5
  import { FormMessageContainer } from "./FormMessageContainer.js";
@@ -29,8 +28,8 @@ import { useResizingTextArea } from "./useResizingTextArea.js";
29
28
  * ```
30
29
  *
31
30
  * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}
32
- */ export const TextArea = /*#__PURE__*/ forwardRef(function TextArea(props, ref) {
33
- const { id: propId, style, className, label, labelProps, labelStyle, labelClassName, areaStyle, areaClassName, resizeContainerProps, resize = "auto", dense, error, active, inline: propInline, leftAddon, rightAddon, disableLeftAddonStyles, disableRightAddonStyles, theme: propTheme, underlineDirection: propUnderlineDirection, messageProps, messageContainerProps, containerProps, rows = 2, maxRows = -1, onChange: propOnChange, disableTransition: propDisableTransition, ...remaining } = props;
31
+ */ export function TextArea(props) {
32
+ const { ref, id: propId, style, className, label, labelProps, labelStyle, labelClassName, areaStyle, areaClassName, resizeContainerProps, resize = "auto", dense, error, active, inline: propInline, leftAddon, rightAddon, disableLeftAddonStyles, disableRightAddonStyles, theme: propTheme, underlineDirection: propUnderlineDirection, messageProps, messageContainerProps, containerProps, rows = 2, maxRows = -1, onChange: propOnChange, disableTransition: propDisableTransition, ...remaining } = props;
34
33
  const { disabled = false, readOnly = false, value, defaultValue } = props;
35
34
  const id = useEnsuredId(propId, "text-area");
36
35
  const theme = getFormConfig("theme", propTheme);
@@ -140,6 +139,6 @@ import { useResizingTextArea } from "./useResizingTextArea.js";
140
139
  children: children
141
140
  })
142
141
  });
143
- });
142
+ }
144
143
 
145
144
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextArea.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type TextareaHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n type TextAreaResize,\n useResizingTextArea,\n} from \"./useResizingTextArea.js\";\n\n// NOTE: The augmentation appears in this file since no type definitions are\n// ever imported from the `textAreaStylesStyles` file.\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-area-height\"?: string | number;\n \"--rmd-text-area-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions, TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\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>>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core/form/TextArea\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const {\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense,\n error,\n active,\n inline: propInline,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = 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\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n inline={inline}\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-text-area-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize === \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\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 rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,sBAAsB;AAElE,SAEEC,mBAAmB,QACd,2BAA2B;AAmFlC;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMC,yBAAWX,WACtB,SAASW,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,oBAAoB,EACpBC,SAAS,MAAM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sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n type TextareaHTMLAttributes,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n type TextAreaResize,\n useResizingTextArea,\n} from \"./useResizingTextArea.js\";\n\n// NOTE: The augmentation appears in this file since no type definitions are\n// ever imported from the `textAreaStylesStyles` file.\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-area-height\"?: string | number;\n \"--rmd-text-area-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions, TextareaHTMLAttributes<HTMLTextAreaElement> {\n ref?: Ref<HTMLTextAreaElement>;\n\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\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>>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core/form/TextArea\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n */\nexport function TextArea(props: TextAreaProps): ReactElement {\n const {\n ref,\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense,\n error,\n active,\n inline: propInline,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = 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\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n inline={inline}\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-text-area-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize === \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\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 rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n}\n"],"names":["useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"mappings":"AAAA;;AAWA,SAASA,YAAY,QAAQ,qBAAqB;AAClD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,EAAEC,iBAAiB,QAAQ,sBAAsB;AAElE,SAEEC,mBAAmB,QACd,2BAA2B;AAqFlC;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,SAASC,KAAoB;IAC3C,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAA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E;oBACrDpB,QAAQqB,OAAO,EAAEC;gBACnB;YACF;sBAECT;;;AAIT"}
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes } from "react";
1
+ import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type PropsWithRef } from "../types.js";
3
3
  import { type FormFieldOptions, type UserAgentAutocompleteProps } from "./types.js";
4
4
  /**
@@ -20,6 +20,7 @@ export type TextFieldInputAttributes = Omit<InputHTMLAttributes<HTMLInputElement
20
20
  * @since 6.0.0 Removed the `containerRef` prop.
21
21
  */
22
22
  export interface TextFieldProps extends TextFieldInputAttributes, UserAgentAutocompleteProps, FormFieldOptions {
23
+ ref?: Ref<HTMLInputElement>;
23
24
  /**
24
25
  * @defaultValue `"text-field-" + useId()`
25
26
  */
@@ -81,4 +82,4 @@ export interface TextFieldProps extends TextFieldInputAttributes, UserAgentAutoc
81
82
  *
82
83
  * @see {@link https://react-md.dev/components/textfield | TextField Demos}
83
84
  */
84
- export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
85
+ export declare function TextField(props: TextFieldProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { useEnsuredId } from "../useEnsuredId.js";
4
3
  import { FormMessageContainer } from "./FormMessageContainer.js";
5
4
  import { Label } from "./Label.js";
@@ -34,8 +33,8 @@ import { textField } from "./textFieldStyles.js";
34
33
  * ```
35
34
  *
36
35
  * @see {@link https://react-md.dev/components/textfield | TextField Demos}
37
- */ export const TextField = /*#__PURE__*/ forwardRef(function TextField(props, ref) {
38
- const { id: propId, style, className, type = "text", label, labelProps, labelStyle, labelClassName, autoCompleteValue, autoComplete = autoCompleteValue, name = autoCompleteValue, dense, error, active, inline, leftAddon, leftAddonProps, rightAddon, rightAddonProps, disableLeftAddonStyles, disableRightAddonStyles, inputStyle, inputClassName, theme, underlineDirection, messageProps, messageContainerProps, containerProps, ...remaining } = props;
36
+ */ export function TextField(props) {
37
+ const { ref, id: propId, style, className, type = "text", label, labelProps, labelStyle, labelClassName, autoCompleteValue, autoComplete = autoCompleteValue, name = autoCompleteValue, dense, error, active, inline, leftAddon, leftAddonProps, rightAddon, rightAddonProps, disableLeftAddonStyles, disableRightAddonStyles, inputStyle, inputClassName, theme, underlineDirection, messageProps, messageContainerProps, containerProps, ...remaining } = props;
39
38
  const { disabled, readOnly } = props;
40
39
  const id = useEnsuredId(propId, "text-field");
41
40
  let { placeholder = "" } = props;
@@ -101,6 +100,6 @@ import { textField } from "./textFieldStyles.js";
101
100
  ]
102
101
  })
103
102
  });
104
- });
103
+ }
105
104
 
106
105
  //# sourceMappingURL=TextField.js.map