@react-md/core 1.0.0-next.19 → 1.0.0-next.20

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 (1071) hide show
  1. package/dist/CoreProviders.js.map +1 -1
  2. package/dist/NoSsr.js.map +1 -1
  3. package/dist/RootHtml.js.map +1 -1
  4. package/dist/SsrProvider.js.map +1 -1
  5. package/dist/_core.scss +10 -9
  6. package/dist/app-bar/AppBar.js.map +1 -1
  7. package/dist/app-bar/AppBarTitle.js.map +1 -1
  8. package/dist/app-bar/_app-bar.scss +0 -4
  9. package/dist/app-bar/styles.js.map +1 -1
  10. package/dist/autocomplete/Autocomplete.js.map +1 -1
  11. package/dist/autocomplete/AutocompleteChip.js +1 -1
  12. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  13. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  14. package/dist/autocomplete/AutocompleteClearButton.js +1 -1
  15. package/dist/autocomplete/AutocompleteClearButton.js.map +1 -1
  16. package/dist/autocomplete/AutocompleteDropdownButton.js +1 -1
  17. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  18. package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -1
  19. package/dist/autocomplete/_autocomplete.scss +15 -13
  20. package/dist/autocomplete/autocompleteStyles.js.map +1 -1
  21. package/dist/autocomplete/types.js.map +1 -1
  22. package/dist/autocomplete/useAutocomplete.js +1 -1
  23. package/dist/autocomplete/useAutocomplete.js.map +1 -1
  24. package/dist/autocomplete/utils.js.map +1 -1
  25. package/dist/avatar/Avatar.js.map +1 -1
  26. package/dist/avatar/styles.js.map +1 -1
  27. package/dist/badge/Badge.js.map +1 -1
  28. package/dist/badge/styles.js.map +1 -1
  29. package/dist/box/Box.js +2 -1
  30. package/dist/box/Box.js.map +1 -1
  31. package/dist/box/_box.scss +24 -1
  32. package/dist/box/styles.d.ts +11 -0
  33. package/dist/box/styles.js +4 -3
  34. package/dist/box/styles.js.map +1 -1
  35. package/dist/button/AsyncButton.js.map +1 -1
  36. package/dist/button/Button.js.map +1 -1
  37. package/dist/button/ButtonUnstyled.js.map +1 -1
  38. package/dist/button/FloatingActionButton.js.map +1 -1
  39. package/dist/button/TooltippedButton.js.map +1 -1
  40. package/dist/button/buttonStyles.js.map +1 -1
  41. package/dist/card/Card.d.ts +4 -13
  42. package/dist/card/Card.js +3 -3
  43. package/dist/card/Card.js.map +1 -1
  44. package/dist/card/CardContent.js.map +1 -1
  45. package/dist/card/CardFooter.js.map +1 -1
  46. package/dist/card/CardHeader.js.map +1 -1
  47. package/dist/card/CardSubtitle.js.map +1 -1
  48. package/dist/card/CardTitle.js.map +1 -1
  49. package/dist/card/ClickableCard.js.map +1 -1
  50. package/dist/card/_card.scss +5 -0
  51. package/dist/card/styles.js.map +1 -1
  52. package/dist/chip/Chip.js +1 -1
  53. package/dist/chip/Chip.js.map +1 -1
  54. package/dist/chip/styles.js.map +1 -1
  55. package/dist/dialog/Dialog.d.ts +4 -4
  56. package/dist/dialog/Dialog.js.map +1 -1
  57. package/dist/dialog/DialogContent.js.map +1 -1
  58. package/dist/dialog/DialogFooter.js.map +1 -1
  59. package/dist/dialog/DialogHeader.js.map +1 -1
  60. package/dist/dialog/DialogTitle.js.map +1 -1
  61. package/dist/dialog/FixedDialog.js +8 -5
  62. package/dist/dialog/FixedDialog.js.map +1 -1
  63. package/dist/dialog/NestedDialogProvider.js.map +1 -1
  64. package/dist/dialog/styles.d.ts +12 -3
  65. package/dist/dialog/styles.js.map +1 -1
  66. package/dist/divider/Divider.js.map +1 -1
  67. package/dist/divider/styles.js.map +1 -1
  68. package/dist/draggable/useDraggable.d.ts +3 -0
  69. package/dist/draggable/useDraggable.js +20 -5
  70. package/dist/draggable/useDraggable.js.map +1 -1
  71. package/dist/draggable/utils.js.map +1 -1
  72. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  73. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  74. package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
  75. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  76. package/dist/expansion-panel/expansionPanelStyles.js.map +1 -1
  77. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  78. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  79. package/dist/files/FileInput.js +1 -1
  80. package/dist/files/FileInput.js.map +1 -1
  81. package/dist/files/styles.js.map +1 -1
  82. package/dist/files/useFileUpload.js.map +1 -1
  83. package/dist/files/utils.d.ts +31 -1
  84. package/dist/files/utils.js +30 -0
  85. package/dist/files/utils.js.map +1 -1
  86. package/dist/focus/useFocusContainer.d.ts +5 -7
  87. package/dist/focus/useFocusContainer.js +5 -7
  88. package/dist/focus/useFocusContainer.js.map +1 -1
  89. package/dist/form/Checkbox.js.map +1 -1
  90. package/dist/form/Fieldset.js.map +1 -1
  91. package/dist/form/Form.js.map +1 -1
  92. package/dist/form/FormMessage.js.map +1 -1
  93. package/dist/form/FormMessageContainer.js.map +1 -1
  94. package/dist/form/FormMessageCounter.js.map +1 -1
  95. package/dist/form/InputToggle.js.map +1 -1
  96. package/dist/form/InputToggleIcon.js +1 -1
  97. package/dist/form/InputToggleIcon.js.map +1 -1
  98. package/dist/form/Label.js.map +1 -1
  99. package/dist/form/Legend.js.map +1 -1
  100. package/dist/form/Listbox.js.map +1 -1
  101. package/dist/form/ListboxProvider.js.map +1 -1
  102. package/dist/form/MenuItemCheckbox.js.map +1 -1
  103. package/dist/form/MenuItemFileInput.d.ts +1 -4
  104. package/dist/form/MenuItemFileInput.js +15 -6
  105. package/dist/form/MenuItemFileInput.js.map +1 -1
  106. package/dist/form/MenuItemInputToggle.js.map +1 -1
  107. package/dist/form/MenuItemRadio.js.map +1 -1
  108. package/dist/form/MenuItemSwitch.js.map +1 -1
  109. package/dist/form/MenuItemTextField.js.map +1 -1
  110. package/dist/form/NativeSelect.js +1 -1
  111. package/dist/form/NativeSelect.js.map +1 -1
  112. package/dist/form/OptGroup.js.map +1 -1
  113. package/dist/form/Option.js +4 -4
  114. package/dist/form/Option.js.map +1 -1
  115. package/dist/form/Password.js +2 -2
  116. package/dist/form/Password.js.map +1 -1
  117. package/dist/form/Radio.js.map +1 -1
  118. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  119. package/dist/form/Select.js +1 -1
  120. package/dist/form/Select.js.map +1 -1
  121. package/dist/form/SelectedOption.js.map +1 -1
  122. package/dist/form/Slider.js +9 -62
  123. package/dist/form/Slider.js.map +1 -1
  124. package/dist/form/SliderContainer.js.map +1 -1
  125. package/dist/form/SliderMark.js.map +1 -1
  126. package/dist/form/SliderMarkLabel.js.map +1 -1
  127. package/dist/form/SliderThumb.js +1 -0
  128. package/dist/form/SliderThumb.js.map +1 -1
  129. package/dist/form/SliderTrack.js.map +1 -1
  130. package/dist/form/SliderValueMarks.js.map +1 -1
  131. package/dist/form/SliderValueTooltip.js.map +1 -1
  132. package/dist/form/Switch.js.map +1 -1
  133. package/dist/form/SwitchTrack.js.map +1 -1
  134. package/dist/form/TextArea.js.map +1 -1
  135. package/dist/form/TextField.js.map +1 -1
  136. package/dist/form/TextFieldAddon.js.map +1 -1
  137. package/dist/form/TextFieldContainer.js.map +1 -1
  138. package/dist/form/_form.scss +313 -269
  139. package/dist/form/formMessageContainerStyles.js.map +1 -1
  140. package/dist/form/formMessageStyles.js.map +1 -1
  141. package/dist/form/inputToggleStyles.js.map +1 -1
  142. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  143. package/dist/form/nativeSelectStyles.js.map +1 -1
  144. package/dist/form/optionStyles.js.map +1 -1
  145. package/dist/form/passwordStyles.js.map +1 -1
  146. package/dist/form/selectStyles.js.map +1 -1
  147. package/dist/form/selectUtils.js.map +1 -1
  148. package/dist/form/sliderUtils.d.ts +2 -7
  149. package/dist/form/sliderUtils.js +5 -5
  150. package/dist/form/sliderUtils.js.map +1 -1
  151. package/dist/form/switchStyles.js.map +1 -1
  152. package/dist/form/textAreaStyles.js.map +1 -1
  153. package/dist/form/textFieldContainerStyles.js.map +1 -1
  154. package/dist/form/textFieldStyles.js.map +1 -1
  155. package/dist/form/types.js.map +1 -1
  156. package/dist/form/useCheckboxGroup.d.ts +2 -2
  157. package/dist/form/useCheckboxGroup.js.map +1 -1
  158. package/dist/form/useCombobox.js.map +1 -1
  159. package/dist/form/useEditableCombobox.js.map +1 -1
  160. package/dist/form/useFormReset.js.map +1 -1
  161. package/dist/form/useNumberField.js.map +1 -1
  162. package/dist/form/useRadioGroup.d.ts +1 -1
  163. package/dist/form/useRadioGroup.js.map +1 -1
  164. package/dist/form/useRangeSlider.d.ts +1 -0
  165. package/dist/form/useRangeSlider.js.map +1 -1
  166. package/dist/form/useResizingTextArea.js.map +1 -1
  167. package/dist/form/useSelectCombobox.js.map +1 -1
  168. package/dist/form/useSlider.d.ts +1 -3
  169. package/dist/form/useSlider.js.map +1 -1
  170. package/dist/form/useSliderDraggable.d.ts +9 -0
  171. package/dist/form/useSliderDraggable.js +44 -0
  172. package/dist/form/useSliderDraggable.js.map +1 -0
  173. package/dist/form/useTextField.d.ts +24 -14
  174. package/dist/form/useTextField.js +7 -5
  175. package/dist/form/useTextField.js.map +1 -1
  176. package/dist/form/useTextFieldContainerAddons.js.map +1 -1
  177. package/dist/form/validation.js +2 -0
  178. package/dist/form/validation.js.map +1 -1
  179. package/dist/hoverMode/useHoverMode.d.ts +64 -3
  180. package/dist/hoverMode/useHoverMode.js.map +1 -1
  181. package/dist/hoverMode/useHoverModeProvider.d.ts +22 -12
  182. package/dist/hoverMode/useHoverModeProvider.js +21 -11
  183. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  184. package/dist/icon/FontIcon.js.map +1 -1
  185. package/dist/icon/IconRotator.js.map +1 -1
  186. package/dist/icon/MaterialIcon.js.map +1 -1
  187. package/dist/icon/MaterialSymbol.js.map +1 -1
  188. package/dist/icon/SVGIcon.js.map +1 -1
  189. package/dist/icon/TextIconSpacing.js.map +1 -1
  190. package/dist/icon/{iconConfig.js → config.js} +1 -1
  191. package/dist/icon/config.js.map +1 -0
  192. package/dist/icon/materialConfig.js.map +1 -1
  193. package/dist/icon/styles.js.map +1 -1
  194. package/dist/interaction/Ripple.js.map +1 -1
  195. package/dist/interaction/RippleContainer.js.map +1 -1
  196. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  197. package/dist/interaction/_interaction.scss +2 -2
  198. package/dist/interaction/useElementInteraction.d.ts +24 -25
  199. package/dist/interaction/useElementInteraction.js +20 -21
  200. package/dist/interaction/useElementInteraction.js.map +1 -1
  201. package/dist/interaction/useHigherContrastChildren.d.ts +8 -6
  202. package/dist/interaction/useHigherContrastChildren.js +10 -8
  203. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  204. package/dist/interaction/utils.js.map +1 -1
  205. package/dist/layout/LayoutAppBar.js.map +1 -1
  206. package/dist/layout/LayoutNav.js.map +1 -1
  207. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  208. package/dist/layout/Main.js.map +1 -1
  209. package/dist/layout/_layout.scss +4 -0
  210. package/dist/layout/layoutNavStyles.js.map +1 -1
  211. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  212. package/dist/layout/mainStyles.js.map +1 -1
  213. package/dist/layout/useExpandableLayout.d.ts +12 -14
  214. package/dist/layout/useExpandableLayout.js +13 -15
  215. package/dist/layout/useExpandableLayout.js.map +1 -1
  216. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  217. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  218. package/dist/layout/useLayoutTree.d.ts +4 -3
  219. package/dist/layout/useLayoutTree.js +4 -3
  220. package/dist/layout/useLayoutTree.js.map +1 -1
  221. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  222. package/dist/layout/useMainTabIndex.js.map +1 -1
  223. package/dist/layout/useResizableLayout.d.ts +13 -16
  224. package/dist/layout/useResizableLayout.js +13 -16
  225. package/dist/layout/useResizableLayout.js.map +1 -1
  226. package/dist/layout/useTemporaryLayout.d.ts +14 -9
  227. package/dist/layout/useTemporaryLayout.js +12 -10
  228. package/dist/layout/useTemporaryLayout.js.map +1 -1
  229. package/dist/link/Link.js.map +1 -1
  230. package/dist/link/SkipToMainContent.js.map +1 -1
  231. package/dist/link/styles.js.map +1 -1
  232. package/dist/list/List.js.map +1 -1
  233. package/dist/list/ListItem.js +1 -1
  234. package/dist/list/ListItem.js.map +1 -1
  235. package/dist/list/ListItemAddon.js.map +1 -1
  236. package/dist/list/ListItemChildren.js.map +1 -1
  237. package/dist/list/ListItemLink.js.map +1 -1
  238. package/dist/list/ListItemText.js.map +1 -1
  239. package/dist/list/ListSubheader.js.map +1 -1
  240. package/dist/list/listItemStyles.js.map +1 -1
  241. package/dist/list/listStyles.js.map +1 -1
  242. package/dist/list/types.js.map +1 -1
  243. package/dist/media-queries/AppSizeProvider.d.ts +1 -1
  244. package/dist/media-queries/AppSizeProvider.js +1 -1
  245. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  246. package/dist/media-queries/useMediaQuery.d.ts +3 -3
  247. package/dist/media-queries/useMediaQuery.js +3 -3
  248. package/dist/media-queries/useMediaQuery.js.map +1 -1
  249. package/dist/menu/DropdownMenu.js.map +1 -1
  250. package/dist/menu/Menu.js.map +1 -1
  251. package/dist/menu/MenuBar.js.map +1 -1
  252. package/dist/menu/MenuButton.js +1 -1
  253. package/dist/menu/MenuButton.js.map +1 -1
  254. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  255. package/dist/menu/MenuItem.js.map +1 -1
  256. package/dist/menu/MenuItemButton.js +1 -1
  257. package/dist/menu/MenuItemButton.js.map +1 -1
  258. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  259. package/dist/menu/MenuItemGroup.js.map +1 -1
  260. package/dist/menu/MenuItemSeparator.js.map +1 -1
  261. package/dist/menu/MenuSheet.js.map +1 -1
  262. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  263. package/dist/menu/MenuWidget.js.map +1 -1
  264. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  265. package/dist/menu/useContextMenu.js.map +1 -1
  266. package/dist/menu/useMenuBarProvider.js.map +1 -1
  267. package/dist/movement/types.js.map +1 -1
  268. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  269. package/dist/movement/utils.js.map +1 -1
  270. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  271. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  272. package/dist/navigation/NavGroup.js.map +1 -1
  273. package/dist/navigation/NavItem.js.map +1 -1
  274. package/dist/navigation/NavItemButton.js +1 -1
  275. package/dist/navigation/NavItemButton.js.map +1 -1
  276. package/dist/navigation/NavItemLink.js.map +1 -1
  277. package/dist/navigation/NavSubheader.d.ts +1 -1
  278. package/dist/navigation/NavSubheader.js +1 -1
  279. package/dist/navigation/NavSubheader.js.map +1 -1
  280. package/dist/navigation/Navigation.js.map +1 -1
  281. package/dist/navigation/navGroupStyles.js.map +1 -1
  282. package/dist/navigation/navItemStyles.js.map +1 -1
  283. package/dist/navigation/types.js.map +1 -1
  284. package/dist/navigation/useActiveHeadingId.d.ts +1 -1
  285. package/dist/navigation/useActiveHeadingId.js +4 -4
  286. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  287. package/dist/navigation/useNavigationExpansion.js.map +1 -1
  288. package/dist/navigation/useTableOfContentsHeadings.d.ts +75 -0
  289. package/dist/navigation/useTableOfContentsHeadings.js +91 -0
  290. package/dist/navigation/useTableOfContentsHeadings.js.map +1 -0
  291. package/dist/objectFit.js.map +1 -1
  292. package/dist/overlay/Overlay.js +1 -1
  293. package/dist/overlay/Overlay.js.map +1 -1
  294. package/dist/overlay/overlayStyles.d.ts +7 -3
  295. package/dist/overlay/overlayStyles.js.map +1 -1
  296. package/dist/portal/Portal.js.map +1 -1
  297. package/dist/portal/PortalContainerProvider.js.map +1 -1
  298. package/dist/positioning/createHorizontalPosition.js.map +1 -1
  299. package/dist/positioning/createVerticalPosition.js.map +1 -1
  300. package/dist/positioning/useFixedPositioning.d.ts +11 -8
  301. package/dist/positioning/useFixedPositioning.js +7 -6
  302. package/dist/positioning/useFixedPositioning.js.map +1 -1
  303. package/dist/progress/CircularProgress.js.map +1 -1
  304. package/dist/progress/LinearProgress.js.map +1 -1
  305. package/dist/progress/_progress.scss +2 -1
  306. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  307. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  308. package/dist/responsive-item/responsiveItemOverlayStyles.js.map +1 -1
  309. package/dist/responsive-item/responsiveItemStyles.js.map +1 -1
  310. package/dist/scroll/ScrollLock.js.map +1 -1
  311. package/dist/scroll/useScrollLock.d.ts +1 -1
  312. package/dist/scroll/useScrollLock.js +1 -1
  313. package/dist/scroll/useScrollLock.js.map +1 -1
  314. package/dist/searching/fuzzy.d.ts +1 -1
  315. package/dist/searching/fuzzy.js.map +1 -1
  316. package/dist/searching/useFuzzyMatch.js.map +1 -1
  317. package/dist/segmented-button/SegmentedButton.js +1 -1
  318. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  319. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  320. package/dist/segmented-button/_segmented-button.scss +40 -0
  321. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  322. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  323. package/dist/sheet/Sheet.js.map +1 -1
  324. package/dist/sheet/styles.js.map +1 -1
  325. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  326. package/dist/snackbar/Snackbar.js.map +1 -1
  327. package/dist/snackbar/Toast.js.map +1 -1
  328. package/dist/snackbar/ToastActionButton.js.map +1 -1
  329. package/dist/snackbar/ToastCloseButton.js +1 -1
  330. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  331. package/dist/snackbar/ToastContent.js.map +1 -1
  332. package/dist/snackbar/ToastManager.js.map +1 -1
  333. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  334. package/dist/snackbar/snackbarStyles.js.map +1 -1
  335. package/dist/snackbar/toastContentStyles.js.map +1 -1
  336. package/dist/snackbar/toastStyles.js.map +1 -1
  337. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  338. package/dist/storage/internalUtils.d.ts +19 -0
  339. package/dist/storage/internalUtils.js +22 -0
  340. package/dist/storage/internalUtils.js.map +1 -0
  341. package/dist/storage/types.d.ts +75 -0
  342. package/dist/storage/types.js +3 -0
  343. package/dist/storage/types.js.map +1 -0
  344. package/dist/storage/useStorage.d.ts +113 -0
  345. package/dist/storage/useStorage.js +247 -0
  346. package/dist/storage/useStorage.js.map +1 -0
  347. package/dist/storage/utils.d.ts +94 -0
  348. package/dist/storage/utils.js +106 -0
  349. package/dist/storage/utils.js.map +1 -0
  350. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  351. package/dist/suspense/NullSuspense.js.map +1 -1
  352. package/dist/table/StickyTableSection.js.map +1 -1
  353. package/dist/table/Table.js.map +1 -1
  354. package/dist/table/TableBody.js.map +1 -1
  355. package/dist/table/TableCell.js +1 -1
  356. package/dist/table/TableCell.js.map +1 -1
  357. package/dist/table/TableCellContent.js.map +1 -1
  358. package/dist/table/TableCheckbox.js.map +1 -1
  359. package/dist/table/TableConfigurationProvider.js.map +1 -1
  360. package/dist/table/TableContainer.js.map +1 -1
  361. package/dist/table/TableContainerProvider.js.map +1 -1
  362. package/dist/table/TableFooter.js.map +1 -1
  363. package/dist/table/TableHeader.js.map +1 -1
  364. package/dist/table/TableRadio.js.map +1 -1
  365. package/dist/table/TableRow.js.map +1 -1
  366. package/dist/table/_table.scss +0 -1
  367. package/dist/table/tableCellStyles.js.map +1 -1
  368. package/dist/table/tableFooterStyles.js.map +1 -1
  369. package/dist/table/tableHeaderStyles.js.map +1 -1
  370. package/dist/table/tableRowStyles.js.map +1 -1
  371. package/dist/table/tableStyles.js.map +1 -1
  372. package/dist/table/useStickyTableSection.js.map +1 -1
  373. package/dist/table/useTableSectionConfig.js.map +1 -1
  374. package/dist/tabs/SimpleTabPanel.d.ts +17 -0
  375. package/dist/tabs/SimpleTabPanel.js +21 -0
  376. package/dist/tabs/SimpleTabPanel.js.map +1 -0
  377. package/dist/tabs/SimpleTabPanels.d.ts +17 -0
  378. package/dist/tabs/SimpleTabPanels.js +18 -0
  379. package/dist/tabs/SimpleTabPanels.js.map +1 -0
  380. package/dist/tabs/Tab.js.map +1 -1
  381. package/dist/tabs/TabList.d.ts +8 -25
  382. package/dist/tabs/TabList.js +4 -6
  383. package/dist/tabs/TabList.js.map +1 -1
  384. package/dist/tabs/TabListScrollButton.js +2 -1
  385. package/dist/tabs/TabListScrollButton.js.map +1 -1
  386. package/dist/tabs/_tabs.scss +50 -14
  387. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  388. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  389. package/dist/tabs/tabListStyles.d.ts +9 -0
  390. package/dist/tabs/tabListStyles.js +2 -1
  391. package/dist/tabs/tabListStyles.js.map +1 -1
  392. package/dist/tabs/tabStyles.d.ts +7 -0
  393. package/dist/tabs/tabStyles.js.map +1 -1
  394. package/dist/tabs/types.d.ts +25 -0
  395. package/dist/tabs/types.js +24 -0
  396. package/dist/tabs/types.js.map +1 -0
  397. package/dist/tabs/useMaxTabPanelHeight.d.ts +82 -0
  398. package/dist/tabs/useMaxTabPanelHeight.js +95 -0
  399. package/dist/tabs/useMaxTabPanelHeight.js.map +1 -0
  400. package/dist/tabs/useTabList.d.ts +4 -2
  401. package/dist/tabs/useTabList.js +24 -6
  402. package/dist/tabs/useTabList.js.map +1 -1
  403. package/dist/tabs/useTabs.d.ts +53 -68
  404. package/dist/tabs/useTabs.js +6 -2
  405. package/dist/tabs/useTabs.js.map +1 -1
  406. package/dist/tabs/utils.d.ts +4 -0
  407. package/dist/tabs/utils.js +5 -0
  408. package/dist/tabs/utils.js.map +1 -1
  409. package/dist/test-utils/drag.d.ts +1 -0
  410. package/dist/test-utils/index.d.ts +6 -4
  411. package/dist/test-utils/index.js +6 -4
  412. package/dist/test-utils/index.js.map +1 -1
  413. package/dist/test-utils/jest-globals/index.d.ts +4 -0
  414. package/dist/test-utils/jest-globals/index.js +6 -0
  415. package/dist/test-utils/jest-globals/index.js.map +1 -0
  416. package/dist/test-utils/jest-globals/match-media.d.ts +32 -0
  417. package/dist/test-utils/jest-globals/match-media.js +35 -0
  418. package/dist/test-utils/jest-globals/match-media.js.map +1 -0
  419. package/dist/test-utils/jest-globals/resize-observer.d.ts +5 -0
  420. package/dist/test-utils/jest-globals/resize-observer.js +10 -0
  421. package/dist/test-utils/jest-globals/resize-observer.js.map +1 -0
  422. package/dist/test-utils/jest-globals/setup.d.ts +1 -0
  423. package/dist/test-utils/{jest-setup.js → jest-globals/setup.js} +4 -3
  424. package/dist/test-utils/jest-globals/setup.js.map +1 -0
  425. package/dist/test-utils/{timers.d.ts → jest-globals/timers.d.ts} +2 -2
  426. package/dist/test-utils/{timers.js → jest-globals/timers.js} +2 -2
  427. package/dist/test-utils/jest-globals/timers.js.map +1 -0
  428. package/dist/test-utils/jest-globals/uploadMenuItemFileInput.d.ts +32 -0
  429. package/dist/test-utils/jest-globals/uploadMenuItemFileInput.js +39 -0
  430. package/dist/test-utils/jest-globals/uploadMenuItemFileInput.js.map +1 -0
  431. package/dist/test-utils/mocks/IntersectionObserver.js.map +1 -0
  432. package/dist/test-utils/{ResizeObserver.d.ts → mocks/ResizeObserver.d.ts} +16 -23
  433. package/dist/test-utils/{ResizeObserver.js → mocks/ResizeObserver.js} +17 -38
  434. package/dist/test-utils/mocks/ResizeObserver.js.map +1 -0
  435. package/dist/test-utils/mocks/match-media-implementation.d.ts +42 -0
  436. package/dist/test-utils/mocks/match-media-implementation.js +46 -0
  437. package/dist/test-utils/mocks/match-media-implementation.js.map +1 -0
  438. package/dist/test-utils/mocks/match-media.d.ts +32 -0
  439. package/dist/test-utils/mocks/match-media.js +39 -0
  440. package/dist/test-utils/mocks/match-media.js.map +1 -0
  441. package/dist/test-utils/polyfills/IntersectionObserver.js +1 -1
  442. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  443. package/dist/test-utils/polyfills/ResizeObserver.js +1 -1
  444. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  445. package/dist/test-utils/polyfills/matchMedia.js +1 -1
  446. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  447. package/dist/test-utils/queries/index.d.ts +2 -0
  448. package/dist/test-utils/queries/index.js +4 -0
  449. package/dist/test-utils/queries/index.js.map +1 -0
  450. package/dist/test-utils/queries/select.d.ts +67 -0
  451. package/dist/test-utils/queries/select.js +69 -0
  452. package/dist/test-utils/queries/select.js.map +1 -0
  453. package/dist/test-utils/queries/slider.d.ts +126 -0
  454. package/dist/test-utils/queries/slider.js +136 -0
  455. package/dist/test-utils/queries/slider.js.map +1 -0
  456. package/dist/test-utils/queries/types.d.ts +8 -0
  457. package/dist/test-utils/queries/types.js +5 -0
  458. package/dist/test-utils/queries/types.js.map +1 -0
  459. package/dist/test-utils/render.js.map +1 -1
  460. package/dist/test-utils/utils/createFileList.d.ts +4 -0
  461. package/dist/test-utils/utils/createFileList.js +27 -0
  462. package/dist/test-utils/utils/createFileList.js.map +1 -0
  463. package/dist/test-utils/utils/createResizeObserverEntry.d.ts +18 -0
  464. package/dist/test-utils/utils/createResizeObserverEntry.js +33 -0
  465. package/dist/test-utils/utils/createResizeObserverEntry.js.map +1 -0
  466. package/dist/test-utils/vitest/index.d.ts +4 -0
  467. package/dist/test-utils/vitest/index.js +6 -0
  468. package/dist/test-utils/vitest/index.js.map +1 -0
  469. package/dist/test-utils/vitest/match-media.d.ts +32 -0
  470. package/dist/test-utils/vitest/match-media.js +35 -0
  471. package/dist/test-utils/vitest/match-media.js.map +1 -0
  472. package/dist/test-utils/vitest/resize-observer.d.ts +5 -0
  473. package/dist/test-utils/vitest/resize-observer.js +10 -0
  474. package/dist/test-utils/vitest/resize-observer.js.map +1 -0
  475. package/dist/test-utils/vitest/setup.d.ts +1 -0
  476. package/dist/test-utils/vitest/setup.js +14 -0
  477. package/dist/test-utils/vitest/setup.js.map +1 -0
  478. package/dist/test-utils/vitest/timers.d.ts +42 -0
  479. package/dist/test-utils/vitest/timers.js +42 -0
  480. package/dist/test-utils/vitest/timers.js.map +1 -0
  481. package/dist/test-utils/vitest/uploadMenuItemFileInput.d.ts +32 -0
  482. package/dist/test-utils/vitest/uploadMenuItemFileInput.js +39 -0
  483. package/dist/test-utils/vitest/uploadMenuItemFileInput.js.map +1 -0
  484. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +17 -17
  485. package/dist/theme/LocalStorageColorSchemeProvider.js +19 -19
  486. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  487. package/dist/theme/ThemeProvider.d.ts +2 -2
  488. package/dist/theme/ThemeProvider.js +4 -4
  489. package/dist/theme/ThemeProvider.js.map +1 -1
  490. package/dist/theme/_theme.scss +0 -4
  491. package/dist/theme/isColorScheme.d.ts +5 -5
  492. package/dist/theme/isColorScheme.js +5 -5
  493. package/dist/theme/isColorScheme.js.map +1 -1
  494. package/dist/theme/types.d.ts +10 -22
  495. package/dist/theme/types.js.map +1 -1
  496. package/dist/theme/useCSSVariables.d.ts +8 -15
  497. package/dist/theme/useCSSVariables.js.map +1 -1
  498. package/dist/theme/useColorScheme.d.ts +15 -13
  499. package/dist/theme/useColorScheme.js +17 -15
  500. package/dist/theme/useColorScheme.js.map +1 -1
  501. package/dist/theme/useColorSchemeMetaTag.d.ts +15 -2
  502. package/dist/theme/useColorSchemeMetaTag.js +13 -0
  503. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  504. package/dist/theme/useColorSchemeProvider.d.ts +18 -20
  505. package/dist/theme/useColorSchemeProvider.js +13 -13
  506. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  507. package/dist/theme/{usePrefersDarkScheme.js → usePrefersDarkTheme.js} +1 -1
  508. package/dist/theme/usePrefersDarkTheme.js.map +1 -0
  509. package/dist/tooltip/Tooltip.js.map +1 -1
  510. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  511. package/dist/tooltip/tooltipStyles.js.map +1 -1
  512. package/dist/tooltip/useTooltip.d.ts +5 -2
  513. package/dist/tooltip/useTooltip.js.map +1 -1
  514. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  515. package/dist/transition/CSSTransition.js.map +1 -1
  516. package/dist/transition/Collapse.js.map +1 -1
  517. package/dist/transition/CrossFade.d.ts +1 -1
  518. package/dist/transition/CrossFade.js +1 -1
  519. package/dist/transition/CrossFade.js.map +1 -1
  520. package/dist/transition/ScaleTransition.js.map +1 -1
  521. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  522. package/dist/transition/Slide.js.map +1 -1
  523. package/dist/transition/SlideContainer.js.map +1 -1
  524. package/dist/transition/collapseStyles.js.map +1 -1
  525. package/dist/transition/config.d.ts +4 -1
  526. package/dist/transition/config.js.map +1 -1
  527. package/dist/transition/maxWidthTransition.d.ts +6 -0
  528. package/dist/transition/maxWidthTransition.js +3 -1
  529. package/dist/transition/maxWidthTransition.js.map +1 -1
  530. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  531. package/dist/transition/types.d.ts +0 -1
  532. package/dist/transition/types.js.map +1 -1
  533. package/dist/transition/useCSSTransition.d.ts +8 -4
  534. package/dist/transition/useCSSTransition.js +8 -4
  535. package/dist/transition/useCSSTransition.js.map +1 -1
  536. package/dist/transition/useCarousel.js.map +1 -1
  537. package/dist/transition/useCollapseTransition.d.ts +13 -8
  538. package/dist/transition/useCollapseTransition.js +11 -6
  539. package/dist/transition/useCollapseTransition.js.map +1 -1
  540. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  541. package/dist/transition/useMaxWidthTransition.d.ts +9 -0
  542. package/dist/transition/useMaxWidthTransition.js +9 -0
  543. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  544. package/dist/transition/useScaleTransition.d.ts +27 -6
  545. package/dist/transition/useScaleTransition.js +4 -2
  546. package/dist/transition/useScaleTransition.js.map +1 -1
  547. package/dist/transition/useSkeletonPlaceholder.d.ts +16 -0
  548. package/dist/transition/useSkeletonPlaceholder.js +13 -1
  549. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  550. package/dist/transition/useSlideTransition.d.ts +12 -16
  551. package/dist/transition/useSlideTransition.js +12 -16
  552. package/dist/transition/useSlideTransition.js.map +1 -1
  553. package/dist/transition/useTransition.js +1 -1
  554. package/dist/transition/useTransition.js.map +1 -1
  555. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  556. package/dist/tree/Tree.js.map +1 -1
  557. package/dist/tree/TreeGroup.js.map +1 -1
  558. package/dist/tree/TreeItem.js.map +1 -1
  559. package/dist/tree/TreeItemExpander.js +1 -1
  560. package/dist/tree/TreeItemExpander.js.map +1 -1
  561. package/dist/tree/TreeProvider.js.map +1 -1
  562. package/dist/tree/_tree.scss +0 -1
  563. package/dist/tree/styles.js.map +1 -1
  564. package/dist/tree/types.js.map +1 -1
  565. package/dist/tree/useTree.js.map +1 -1
  566. package/dist/tree/useTreeExpansion.js.map +1 -1
  567. package/dist/tree/useTreeItems.d.ts +1 -1
  568. package/dist/tree/useTreeItems.js.map +1 -1
  569. package/dist/tree/useTreeMovement.js.map +1 -1
  570. package/dist/tree/useTreeSelection.js.map +1 -1
  571. package/dist/typography/SrOnly.js.map +1 -1
  572. package/dist/typography/TextContainer.js.map +1 -1
  573. package/dist/typography/Typography.js.map +1 -1
  574. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  575. package/dist/typography/textContainerStyles.js.map +1 -1
  576. package/dist/typography/typographyStyles.js.map +1 -1
  577. package/dist/useAsyncFunction.d.ts +20 -0
  578. package/dist/useAsyncFunction.js.map +1 -1
  579. package/dist/useDebouncedFunction.js.map +1 -1
  580. package/dist/useDropzone.d.ts +18 -11
  581. package/dist/useDropzone.js +27 -23
  582. package/dist/useDropzone.js.map +1 -1
  583. package/dist/useElementSize.d.ts +3 -3
  584. package/dist/useElementSize.js +1 -1
  585. package/dist/useElementSize.js.map +1 -1
  586. package/dist/useEnsuredId.d.ts +1 -1
  587. package/dist/useEnsuredId.js +1 -1
  588. package/dist/useEnsuredId.js.map +1 -1
  589. package/dist/useEnsuredRef.d.ts +1 -1
  590. package/dist/useEnsuredRef.js +1 -1
  591. package/dist/useEnsuredRef.js.map +1 -1
  592. package/dist/useEnsuredState.js.map +1 -1
  593. package/dist/useHtmlClassName.d.ts +11 -0
  594. package/dist/useHtmlClassName.js +11 -0
  595. package/dist/useHtmlClassName.js.map +1 -1
  596. package/dist/useIntersectionObserver.d.ts +3 -3
  597. package/dist/useIntersectionObserver.js +2 -2
  598. package/dist/useIntersectionObserver.js.map +1 -1
  599. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  600. package/dist/useMutationObserver.d.ts +3 -3
  601. package/dist/useMutationObserver.js +4 -4
  602. package/dist/useMutationObserver.js.map +1 -1
  603. package/dist/useOrientation.d.ts +0 -1
  604. package/dist/useOrientation.js +0 -1
  605. package/dist/useOrientation.js.map +1 -1
  606. package/dist/usePageInactive.d.ts +7 -2
  607. package/dist/usePageInactive.js +7 -2
  608. package/dist/usePageInactive.js.map +1 -1
  609. package/dist/useReadonlySet.d.ts +5 -4
  610. package/dist/useReadonlySet.js +4 -3
  611. package/dist/useReadonlySet.js.map +1 -1
  612. package/dist/useResizeListener.d.ts +6 -4
  613. package/dist/useResizeListener.js +6 -4
  614. package/dist/useResizeListener.js.map +1 -1
  615. package/dist/useResizeObserver.d.ts +1 -1
  616. package/dist/useResizeObserver.js +1 -1
  617. package/dist/useResizeObserver.js.map +1 -1
  618. package/dist/useThrottledFunction.js.map +1 -1
  619. package/dist/useToggle.d.ts +3 -3
  620. package/dist/useToggle.js +3 -3
  621. package/dist/useToggle.js.map +1 -1
  622. package/dist/useUnmounted.js.map +1 -1
  623. package/dist/useWindowSize.d.ts +1 -1
  624. package/dist/useWindowSize.js +1 -1
  625. package/dist/useWindowSize.js.map +1 -1
  626. package/dist/utils/RenderRecursively.d.ts +88 -32
  627. package/dist/utils/RenderRecursively.js +88 -32
  628. package/dist/utils/RenderRecursively.js.map +1 -1
  629. package/dist/utils/alphaNumericSort.d.ts +5 -0
  630. package/dist/utils/alphaNumericSort.js +5 -4
  631. package/dist/utils/alphaNumericSort.js.map +1 -1
  632. package/dist/utils/bem.d.ts +49 -6
  633. package/dist/utils/bem.js +5 -14
  634. package/dist/utils/bem.js.map +1 -1
  635. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  636. package/dist/utils/isElementVisible.d.ts +1 -1
  637. package/dist/utils/isElementVisible.js +1 -1
  638. package/dist/utils/isElementVisible.js.map +1 -1
  639. package/dist/utils/loop.d.ts +2 -0
  640. package/dist/utils/loop.js.map +1 -1
  641. package/dist/utils/parseCssLengthUnit.d.ts +1 -1
  642. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  643. package/dist/utils/wait.d.ts +4 -4
  644. package/dist/utils/wait.js +6 -4
  645. package/dist/utils/wait.js.map +1 -1
  646. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  647. package/dist/window-splitter/styles.js.map +1 -1
  648. package/dist/window-splitter/useWindowSplitter.d.ts +4 -1
  649. package/dist/window-splitter/useWindowSplitter.js +4 -1
  650. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  651. package/package.json +26 -22
  652. package/src/CoreProviders.tsx +8 -6
  653. package/src/NoSsr.tsx +3 -1
  654. package/src/RootHtml.tsx +1 -0
  655. package/src/SsrProvider.tsx +3 -2
  656. package/src/app-bar/AppBar.tsx +3 -2
  657. package/src/app-bar/AppBarTitle.tsx +1 -0
  658. package/src/app-bar/styles.ts +1 -0
  659. package/src/autocomplete/Autocomplete.tsx +2 -0
  660. package/src/autocomplete/AutocompleteChip.tsx +2 -1
  661. package/src/autocomplete/AutocompleteCircularProgress.tsx +1 -0
  662. package/src/autocomplete/AutocompleteClearButton.tsx +3 -1
  663. package/src/autocomplete/AutocompleteDropdownButton.tsx +3 -1
  664. package/src/autocomplete/AutocompleteListboxChildren.tsx +2 -0
  665. package/src/autocomplete/autocompleteStyles.ts +1 -0
  666. package/src/autocomplete/types.ts +1 -0
  667. package/src/autocomplete/useAutocomplete.ts +4 -2
  668. package/src/autocomplete/utils.ts +1 -0
  669. package/src/avatar/Avatar.tsx +3 -2
  670. package/src/avatar/styles.ts +2 -1
  671. package/src/badge/Badge.tsx +3 -2
  672. package/src/badge/styles.ts +1 -0
  673. package/src/box/Box.tsx +5 -2
  674. package/src/box/styles.ts +17 -2
  675. package/src/button/AsyncButton.tsx +3 -1
  676. package/src/button/Button.tsx +4 -2
  677. package/src/button/ButtonUnstyled.tsx +2 -1
  678. package/src/button/FloatingActionButton.tsx +2 -1
  679. package/src/button/TooltippedButton.tsx +4 -2
  680. package/src/button/buttonStyles.ts +2 -1
  681. package/src/card/Card.tsx +10 -23
  682. package/src/card/CardContent.tsx +3 -2
  683. package/src/card/CardFooter.tsx +1 -0
  684. package/src/card/CardHeader.tsx +2 -1
  685. package/src/card/CardSubtitle.tsx +1 -0
  686. package/src/card/CardTitle.tsx +1 -0
  687. package/src/card/ClickableCard.tsx +3 -1
  688. package/src/card/styles.ts +1 -0
  689. package/src/chip/Chip.tsx +4 -2
  690. package/src/chip/styles.ts +1 -0
  691. package/src/dialog/Dialog.tsx +10 -6
  692. package/src/dialog/DialogContent.tsx +3 -2
  693. package/src/dialog/DialogFooter.tsx +3 -2
  694. package/src/dialog/DialogHeader.tsx +2 -1
  695. package/src/dialog/DialogTitle.tsx +2 -1
  696. package/src/dialog/FixedDialog.tsx +14 -9
  697. package/src/dialog/NestedDialogProvider.ts +1 -0
  698. package/src/dialog/styles.ts +5 -4
  699. package/src/divider/Divider.tsx +3 -2
  700. package/src/divider/styles.ts +1 -0
  701. package/src/draggable/useDraggable.ts +25 -12
  702. package/src/draggable/utils.ts +2 -1
  703. package/src/expansion-panel/ExpansionList.tsx +3 -1
  704. package/src/expansion-panel/ExpansionPanel.tsx +3 -1
  705. package/src/expansion-panel/ExpansionPanelHeader.tsx +3 -2
  706. package/src/expansion-panel/expansionPanelStyles.ts +1 -0
  707. package/src/expansion-panel/useExpansionList.ts +2 -0
  708. package/src/expansion-panel/useExpansionPanels.ts +1 -0
  709. package/src/files/FileInput.tsx +4 -2
  710. package/src/files/styles.ts +1 -0
  711. package/src/files/useFileUpload.ts +7 -5
  712. package/src/files/utils.ts +31 -1
  713. package/src/focus/useFocusContainer.ts +10 -10
  714. package/src/form/Checkbox.tsx +2 -1
  715. package/src/form/Fieldset.tsx +2 -1
  716. package/src/form/Form.tsx +2 -1
  717. package/src/form/FormMessage.tsx +1 -0
  718. package/src/form/FormMessageContainer.tsx +2 -1
  719. package/src/form/FormMessageCounter.tsx +1 -0
  720. package/src/form/InputToggle.tsx +3 -1
  721. package/src/form/InputToggleIcon.tsx +4 -3
  722. package/src/form/Label.tsx +1 -0
  723. package/src/form/Legend.tsx +1 -0
  724. package/src/form/Listbox.tsx +1 -0
  725. package/src/form/ListboxProvider.ts +2 -0
  726. package/src/form/MenuItemCheckbox.tsx +5 -3
  727. package/src/form/MenuItemFileInput.tsx +25 -13
  728. package/src/form/MenuItemInputToggle.tsx +3 -1
  729. package/src/form/MenuItemRadio.tsx +4 -2
  730. package/src/form/MenuItemSwitch.tsx +2 -0
  731. package/src/form/MenuItemTextField.tsx +3 -1
  732. package/src/form/NativeSelect.tsx +3 -2
  733. package/src/form/OptGroup.tsx +3 -1
  734. package/src/form/Option.tsx +6 -4
  735. package/src/form/Password.tsx +5 -3
  736. package/src/form/Radio.tsx +2 -0
  737. package/src/form/ResizingTextAreaWrapper.tsx +2 -1
  738. package/src/form/Select.tsx +6 -4
  739. package/src/form/SelectedOption.tsx +1 -0
  740. package/src/form/Slider.tsx +13 -71
  741. package/src/form/SliderContainer.tsx +2 -1
  742. package/src/form/SliderMark.tsx +1 -0
  743. package/src/form/SliderMarkLabel.tsx +2 -1
  744. package/src/form/SliderThumb.tsx +6 -3
  745. package/src/form/SliderTrack.tsx +4 -3
  746. package/src/form/SliderValueMarks.tsx +3 -2
  747. package/src/form/SliderValueTooltip.tsx +2 -0
  748. package/src/form/Switch.tsx +2 -1
  749. package/src/form/SwitchTrack.tsx +2 -1
  750. package/src/form/TextArea.tsx +4 -2
  751. package/src/form/TextField.tsx +2 -1
  752. package/src/form/TextFieldAddon.tsx +1 -0
  753. package/src/form/TextFieldContainer.tsx +3 -1
  754. package/src/form/formMessageContainerStyles.ts +1 -0
  755. package/src/form/formMessageStyles.ts +1 -0
  756. package/src/form/inputToggleStyles.ts +1 -0
  757. package/src/form/menuItemInputToggleStyles.ts +1 -0
  758. package/src/form/nativeSelectStyles.ts +1 -0
  759. package/src/form/optionStyles.ts +1 -0
  760. package/src/form/passwordStyles.ts +1 -0
  761. package/src/form/selectStyles.ts +1 -0
  762. package/src/form/selectUtils.ts +2 -1
  763. package/src/form/sliderUtils.ts +8 -7
  764. package/src/form/switchStyles.ts +1 -0
  765. package/src/form/textAreaStyles.ts +2 -1
  766. package/src/form/textFieldContainerStyles.ts +2 -1
  767. package/src/form/textFieldStyles.ts +1 -0
  768. package/src/form/types.ts +1 -0
  769. package/src/form/useCheckboxGroup.ts +4 -2
  770. package/src/form/useCombobox.ts +4 -2
  771. package/src/form/useEditableCombobox.ts +2 -0
  772. package/src/form/useFormReset.ts +4 -2
  773. package/src/form/useNumberField.ts +3 -1
  774. package/src/form/useRadioGroup.ts +5 -3
  775. package/src/form/useRangeSlider.ts +3 -0
  776. package/src/form/useResizingTextArea.ts +5 -3
  777. package/src/form/useSelectCombobox.ts +2 -1
  778. package/src/form/useSlider.ts +3 -3
  779. package/src/form/useSliderDraggable.ts +71 -0
  780. package/src/form/useTextField.ts +40 -26
  781. package/src/form/useTextFieldContainerAddons.ts +4 -2
  782. package/src/form/validation.ts +2 -0
  783. package/src/hoverMode/useHoverMode.ts +76 -4
  784. package/src/hoverMode/useHoverModeProvider.ts +24 -12
  785. package/src/icon/FontIcon.tsx +3 -2
  786. package/src/icon/IconRotator.tsx +5 -4
  787. package/src/icon/MaterialIcon.tsx +3 -2
  788. package/src/icon/MaterialSymbol.tsx +4 -3
  789. package/src/icon/SVGIcon.tsx +3 -2
  790. package/src/icon/TextIconSpacing.tsx +2 -2
  791. package/src/icon/{iconConfig.tsx → config.tsx} +1 -0
  792. package/src/icon/materialConfig.ts +1 -0
  793. package/src/icon/styles.ts +2 -1
  794. package/src/interaction/Ripple.tsx +2 -0
  795. package/src/interaction/RippleContainer.tsx +1 -0
  796. package/src/interaction/UserInteractionModeProvider.tsx +3 -2
  797. package/src/interaction/useElementInteraction.tsx +39 -36
  798. package/src/interaction/useHigherContrastChildren.tsx +11 -8
  799. package/src/interaction/utils.ts +1 -0
  800. package/src/layout/LayoutAppBar.tsx +2 -0
  801. package/src/layout/LayoutNav.tsx +4 -2
  802. package/src/layout/LayoutWindowSplitter.tsx +4 -2
  803. package/src/layout/Main.tsx +4 -2
  804. package/src/layout/layoutNavStyles.ts +1 -0
  805. package/src/layout/layoutWindowSplitterStyles.ts +1 -0
  806. package/src/layout/mainStyles.ts +1 -0
  807. package/src/layout/useExpandableLayout.ts +17 -17
  808. package/src/layout/useHorizontalLayoutTransition.ts +2 -0
  809. package/src/layout/useLayoutAppBarHeight.ts +3 -1
  810. package/src/layout/useLayoutTree.ts +6 -3
  811. package/src/layout/useLayoutWindowSplitter.ts +2 -1
  812. package/src/layout/useMainTabIndex.ts +1 -0
  813. package/src/layout/useResizableLayout.ts +14 -17
  814. package/src/layout/useTemporaryLayout.ts +18 -11
  815. package/src/link/Link.tsx +3 -2
  816. package/src/link/SkipToMainContent.tsx +4 -2
  817. package/src/link/styles.ts +1 -0
  818. package/src/list/List.tsx +2 -1
  819. package/src/list/ListItem.tsx +4 -2
  820. package/src/list/ListItemAddon.tsx +2 -1
  821. package/src/list/ListItemChildren.tsx +1 -0
  822. package/src/list/ListItemLink.tsx +4 -2
  823. package/src/list/ListItemText.tsx +2 -1
  824. package/src/list/ListSubheader.tsx +2 -1
  825. package/src/list/listItemStyles.ts +1 -0
  826. package/src/list/listStyles.ts +1 -0
  827. package/src/list/types.ts +1 -0
  828. package/src/media-queries/AppSizeProvider.tsx +7 -5
  829. package/src/media-queries/useMediaQuery.ts +5 -3
  830. package/src/menu/DropdownMenu.tsx +5 -3
  831. package/src/menu/Menu.tsx +8 -6
  832. package/src/menu/MenuBar.tsx +2 -0
  833. package/src/menu/MenuButton.tsx +3 -1
  834. package/src/menu/MenuConfigurationProvider.tsx +4 -2
  835. package/src/menu/MenuItem.tsx +2 -0
  836. package/src/menu/MenuItemButton.tsx +3 -1
  837. package/src/menu/MenuItemCircularProgress.tsx +2 -1
  838. package/src/menu/MenuItemGroup.tsx +3 -1
  839. package/src/menu/MenuItemSeparator.tsx +3 -1
  840. package/src/menu/MenuSheet.tsx +3 -1
  841. package/src/menu/MenuVisibilityProvider.tsx +4 -2
  842. package/src/menu/MenuWidget.tsx +3 -1
  843. package/src/menu/MenuWidgetKeyboardProvider.tsx +2 -0
  844. package/src/menu/useContextMenu.ts +2 -0
  845. package/src/menu/useMenuBarProvider.ts +2 -0
  846. package/src/movement/types.ts +1 -0
  847. package/src/movement/useKeyboardMovementProvider.ts +2 -0
  848. package/src/movement/utils.ts +1 -0
  849. package/src/navigation/CollapsibleNavGroup.tsx +3 -1
  850. package/src/navigation/DefaultNavigationRenderer.tsx +1 -0
  851. package/src/navigation/NavGroup.tsx +2 -1
  852. package/src/navigation/NavItem.tsx +2 -1
  853. package/src/navigation/NavItemButton.tsx +4 -2
  854. package/src/navigation/NavItemLink.tsx +4 -2
  855. package/src/navigation/NavSubheader.tsx +2 -1
  856. package/src/navigation/Navigation.tsx +3 -2
  857. package/src/navigation/navGroupStyles.ts +1 -0
  858. package/src/navigation/navItemStyles.ts +1 -0
  859. package/src/navigation/types.ts +1 -0
  860. package/src/navigation/useActiveHeadingId.ts +8 -6
  861. package/src/navigation/useNavigationExpansion.ts +2 -0
  862. package/src/navigation/useTableOfContentsHeadings.ts +150 -0
  863. package/src/objectFit.ts +1 -0
  864. package/src/overlay/Overlay.tsx +4 -2
  865. package/src/overlay/overlayStyles.ts +10 -10
  866. package/src/portal/Portal.tsx +1 -0
  867. package/src/portal/PortalContainerProvider.tsx +4 -3
  868. package/src/positioning/createHorizontalPosition.ts +1 -1
  869. package/src/positioning/createVerticalPosition.ts +1 -1
  870. package/src/positioning/useFixedPositioning.ts +17 -12
  871. package/src/progress/CircularProgress.tsx +3 -2
  872. package/src/progress/LinearProgress.tsx +3 -2
  873. package/src/responsive-item/ResponsiveItem.tsx +3 -2
  874. package/src/responsive-item/ResponsiveItemOverlay.tsx +3 -2
  875. package/src/responsive-item/responsiveItemOverlayStyles.ts +1 -0
  876. package/src/responsive-item/responsiveItemStyles.ts +1 -0
  877. package/src/scroll/ScrollLock.tsx +1 -0
  878. package/src/scroll/useScrollLock.ts +3 -1
  879. package/src/searching/fuzzy.ts +1 -1
  880. package/src/searching/useFuzzyMatch.ts +2 -0
  881. package/src/segmented-button/SegmentedButton.tsx +4 -2
  882. package/src/segmented-button/SegmentedButtonContainer.tsx +3 -2
  883. package/src/segmented-button/segmentedButtonContainerStyles.ts +1 -0
  884. package/src/segmented-button/segmentedButtonStyles.ts +1 -0
  885. package/src/sheet/Sheet.tsx +4 -2
  886. package/src/sheet/styles.ts +3 -3
  887. package/src/snackbar/DefaultToastRenderer.tsx +5 -3
  888. package/src/snackbar/Snackbar.tsx +4 -2
  889. package/src/snackbar/Toast.tsx +4 -2
  890. package/src/snackbar/ToastActionButton.tsx +2 -0
  891. package/src/snackbar/ToastCloseButton.tsx +3 -1
  892. package/src/snackbar/ToastContent.tsx +3 -1
  893. package/src/snackbar/ToastManager.tsx +1 -0
  894. package/src/snackbar/ToastManagerProvider.tsx +4 -3
  895. package/src/snackbar/snackbarStyles.ts +1 -0
  896. package/src/snackbar/toastContentStyles.ts +1 -0
  897. package/src/snackbar/toastStyles.ts +2 -1
  898. package/src/snackbar/useCurrentToastActions.ts +1 -0
  899. package/src/storage/internalUtils.ts +43 -0
  900. package/src/storage/types.ts +88 -0
  901. package/src/storage/useStorage.ts +277 -0
  902. package/src/storage/utils.ts +156 -0
  903. package/src/suspense/CircularProgressSuspense.tsx +2 -1
  904. package/src/suspense/NullSuspense.tsx +1 -1
  905. package/src/table/StickyTableSection.tsx +3 -1
  906. package/src/table/Table.tsx +3 -1
  907. package/src/table/TableBody.tsx +3 -1
  908. package/src/table/TableCell.tsx +4 -2
  909. package/src/table/TableCellContent.tsx +2 -1
  910. package/src/table/TableCheckbox.tsx +3 -1
  911. package/src/table/TableConfigurationProvider.tsx +2 -0
  912. package/src/table/TableContainer.tsx +4 -2
  913. package/src/table/TableContainerProvider.tsx +2 -1
  914. package/src/table/TableFooter.tsx +3 -1
  915. package/src/table/TableHeader.tsx +3 -1
  916. package/src/table/TableRadio.tsx +3 -1
  917. package/src/table/TableRow.tsx +3 -1
  918. package/src/table/tableCellStyles.ts +1 -0
  919. package/src/table/tableFooterStyles.ts +1 -0
  920. package/src/table/tableHeaderStyles.ts +1 -0
  921. package/src/table/tableRowStyles.ts +1 -0
  922. package/src/table/tableStyles.ts +1 -0
  923. package/src/table/useStickyTableSection.tsx +4 -2
  924. package/src/table/useTableSectionConfig.ts +2 -0
  925. package/src/tabs/SimpleTabPanel.tsx +35 -0
  926. package/src/tabs/SimpleTabPanels.tsx +28 -0
  927. package/src/tabs/Tab.tsx +4 -3
  928. package/src/tabs/TabList.tsx +38 -51
  929. package/src/tabs/TabListScrollButton.tsx +6 -3
  930. package/src/tabs/tabIndicatorStyles.ts +1 -0
  931. package/src/tabs/tabListScrollButtonStyles.ts +1 -0
  932. package/src/tabs/tabListStyles.ts +22 -2
  933. package/src/tabs/tabStyles.ts +8 -0
  934. package/src/tabs/types.ts +30 -0
  935. package/src/tabs/useMaxTabPanelHeight.ts +138 -0
  936. package/src/tabs/useTabList.ts +45 -8
  937. package/src/tabs/useTabs.ts +64 -79
  938. package/src/tabs/utils.ts +9 -0
  939. package/src/test-utils/drag.ts +10 -2
  940. package/src/test-utils/index.ts +6 -5
  941. package/src/test-utils/jest-globals/index.ts +4 -0
  942. package/src/test-utils/jest-globals/match-media.ts +41 -0
  943. package/src/test-utils/jest-globals/resize-observer.ts +11 -0
  944. package/src/test-utils/{jest-setup.ts → jest-globals/setup.ts} +4 -2
  945. package/src/test-utils/{timers.ts → jest-globals/timers.ts} +2 -2
  946. package/src/test-utils/jest-globals/uploadMenuItemFileInput.ts +52 -0
  947. package/src/test-utils/{ResizeObserver.ts → mocks/ResizeObserver.ts} +25 -59
  948. package/src/test-utils/mocks/match-media-implementation.ts +111 -0
  949. package/src/test-utils/mocks/match-media.ts +63 -0
  950. package/src/test-utils/polyfills/IntersectionObserver.ts +1 -1
  951. package/src/test-utils/polyfills/ResizeObserver.ts +1 -1
  952. package/src/test-utils/polyfills/matchMedia.ts +1 -1
  953. package/src/test-utils/queries/index.ts +2 -0
  954. package/src/test-utils/queries/select.ts +116 -0
  955. package/src/test-utils/queries/slider.ts +247 -0
  956. package/src/test-utils/queries/types.ts +13 -0
  957. package/src/test-utils/render.tsx +2 -1
  958. package/src/test-utils/utils/createFileList.ts +27 -0
  959. package/src/test-utils/utils/createResizeObserverEntry.ts +47 -0
  960. package/src/test-utils/vitest/index.ts +4 -0
  961. package/src/test-utils/vitest/match-media.ts +41 -0
  962. package/src/test-utils/vitest/resize-observer.ts +11 -0
  963. package/src/test-utils/vitest/setup.ts +15 -0
  964. package/src/test-utils/vitest/timers.ts +48 -0
  965. package/src/test-utils/vitest/uploadMenuItemFileInput.ts +52 -0
  966. package/src/theme/LocalStorageColorSchemeProvider.tsx +30 -30
  967. package/src/theme/ThemeProvider.tsx +9 -7
  968. package/src/theme/isColorScheme.ts +8 -6
  969. package/src/theme/types.ts +11 -23
  970. package/src/theme/useCSSVariables.ts +10 -15
  971. package/src/theme/useColorScheme.ts +19 -15
  972. package/src/theme/useColorSchemeMetaTag.ts +17 -2
  973. package/src/theme/useColorSchemeProvider.ts +36 -37
  974. package/src/theme/{usePrefersDarkScheme.ts → usePrefersDarkTheme.ts} +1 -0
  975. package/src/tooltip/Tooltip.tsx +3 -1
  976. package/src/tooltip/TooltipHoverModeProvider.tsx +6 -4
  977. package/src/tooltip/tooltipStyles.ts +2 -1
  978. package/src/tooltip/useTooltip.ts +15 -10
  979. package/src/tooltip/useTooltipPosition.ts +2 -0
  980. package/src/transition/CSSTransition.tsx +3 -1
  981. package/src/transition/Collapse.tsx +4 -2
  982. package/src/transition/CrossFade.tsx +5 -3
  983. package/src/transition/ScaleTransition.tsx +4 -2
  984. package/src/transition/SkeletonPlaceholder.tsx +4 -2
  985. package/src/transition/Slide.tsx +3 -1
  986. package/src/transition/SlideContainer.tsx +2 -1
  987. package/src/transition/collapseStyles.ts +1 -0
  988. package/src/transition/config.ts +4 -1
  989. package/src/transition/maxWidthTransition.ts +7 -0
  990. package/src/transition/skeletonPlaceholderUtils.ts +1 -0
  991. package/src/transition/types.ts +0 -2
  992. package/src/transition/useCSSTransition.ts +10 -4
  993. package/src/transition/useCarousel.ts +2 -0
  994. package/src/transition/useCollapseTransition.ts +20 -14
  995. package/src/transition/useCrossFadeTransition.ts +1 -0
  996. package/src/transition/useMaxWidthTransition.ts +11 -0
  997. package/src/transition/useScaleTransition.ts +12 -10
  998. package/src/transition/useSkeletonPlaceholder.ts +20 -2
  999. package/src/transition/useSlideTransition.ts +14 -16
  1000. package/src/transition/useTransition.ts +3 -1
  1001. package/src/tree/DefaultTreeItemRenderer.tsx +1 -0
  1002. package/src/tree/Tree.tsx +3 -1
  1003. package/src/tree/TreeGroup.tsx +3 -1
  1004. package/src/tree/TreeItem.tsx +4 -2
  1005. package/src/tree/TreeItemExpander.tsx +5 -3
  1006. package/src/tree/TreeProvider.tsx +4 -2
  1007. package/src/tree/styles.ts +1 -0
  1008. package/src/tree/types.ts +1 -0
  1009. package/src/tree/useTree.ts +3 -2
  1010. package/src/tree/useTreeExpansion.ts +1 -0
  1011. package/src/tree/useTreeItems.ts +4 -3
  1012. package/src/tree/useTreeMovement.ts +2 -0
  1013. package/src/tree/useTreeSelection.ts +1 -0
  1014. package/src/typography/SrOnly.tsx +2 -1
  1015. package/src/typography/TextContainer.tsx +3 -2
  1016. package/src/typography/Typography.tsx +3 -2
  1017. package/src/typography/WritingDirectionProvider.tsx +4 -2
  1018. package/src/typography/textContainerStyles.ts +1 -0
  1019. package/src/typography/typographyStyles.ts +2 -1
  1020. package/src/useAsyncFunction.ts +23 -0
  1021. package/src/useDebouncedFunction.ts +2 -0
  1022. package/src/useDropzone.ts +50 -34
  1023. package/src/useElementSize.ts +7 -5
  1024. package/src/useEnsuredId.ts +1 -1
  1025. package/src/useEnsuredRef.ts +3 -1
  1026. package/src/useEnsuredState.ts +1 -0
  1027. package/src/useHtmlClassName.ts +12 -0
  1028. package/src/useIntersectionObserver.ts +5 -3
  1029. package/src/useIsomorphicLayoutEffect.ts +1 -0
  1030. package/src/useMutationObserver.ts +7 -6
  1031. package/src/useOrientation.ts +1 -1
  1032. package/src/usePageInactive.ts +8 -2
  1033. package/src/useReadonlySet.ts +7 -4
  1034. package/src/useResizeListener.ts +8 -4
  1035. package/src/useResizeObserver.ts +4 -3
  1036. package/src/useThrottledFunction.ts +2 -0
  1037. package/src/useToggle.ts +5 -3
  1038. package/src/useUnmounted.ts +2 -0
  1039. package/src/useWindowSize.ts +4 -2
  1040. package/src/utils/RenderRecursively.tsx +88 -32
  1041. package/src/utils/alphaNumericSort.ts +10 -4
  1042. package/src/utils/bem.ts +58 -26
  1043. package/src/utils/getRangeDefaultValue.ts +1 -1
  1044. package/src/utils/isElementVisible.ts +1 -1
  1045. package/src/utils/loop.ts +2 -0
  1046. package/src/utils/parseCssLengthUnit.ts +1 -1
  1047. package/src/utils/wait.ts +6 -5
  1048. package/src/window-splitter/WindowSplitter.tsx +2 -2
  1049. package/src/window-splitter/styles.ts +1 -0
  1050. package/src/window-splitter/useWindowSplitter.ts +7 -2
  1051. package/dist/icon/iconConfig.js.map +0 -1
  1052. package/dist/test-utils/IntersectionObserver.js.map +0 -1
  1053. package/dist/test-utils/ResizeObserver.js.map +0 -1
  1054. package/dist/test-utils/jest-setup.d.ts +0 -1
  1055. package/dist/test-utils/jest-setup.js.map +0 -1
  1056. package/dist/test-utils/matchMedia.d.ts +0 -97
  1057. package/dist/test-utils/matchMedia.js +0 -112
  1058. package/dist/test-utils/matchMedia.js.map +0 -1
  1059. package/dist/test-utils/timers.js.map +0 -1
  1060. package/dist/theme/usePrefersDarkScheme.js.map +0 -1
  1061. package/dist/useLocalStorage.d.ts +0 -368
  1062. package/dist/useLocalStorage.js +0 -377
  1063. package/dist/useLocalStorage.js.map +0 -1
  1064. package/src/test-utils/README.md +0 -150
  1065. package/src/test-utils/matchMedia.ts +0 -194
  1066. package/src/useLocalStorage.ts +0 -584
  1067. /package/dist/icon/{iconConfig.d.ts → config.d.ts} +0 -0
  1068. /package/dist/test-utils/{IntersectionObserver.d.ts → mocks/IntersectionObserver.d.ts} +0 -0
  1069. /package/dist/test-utils/{IntersectionObserver.js → mocks/IntersectionObserver.js} +0 -0
  1070. /package/dist/theme/{usePrefersDarkScheme.d.ts → usePrefersDarkTheme.d.ts} +0 -0
  1071. /package/src/test-utils/{IntersectionObserver.ts → mocks/IntersectionObserver.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/SVGIcon.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { icon, type SVGIconClassNameOptions } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Added the `inline` and `theme` props.\n */\nexport interface SVGIconProps\n extends HTMLAttributes<SVGSVGElement>,\n SVGIconClassNameOptions {\n /**\n * Boolean if the SVG should gain the `focusable` attribute. This is disabled\n * by default since IE11 and Edge actually default this to true and keyboard's\n * will tab focus all SVGs.\n *\n * @defaultValue `false`\n */\n focusable?: \"false\" | \"true\" | boolean;\n\n /**\n * The `viewBox` attribute allows you to specify that a given set of graphics\n * stretch to fit a particular container element.\n *\n * The value of the `viewBox` attribute is a list of four numbers min-x,\n * min-y, width and height, separated by white space and/or a comma, which\n * specify a rectangle in user space which should be mapped to the bounds of\n * the viewport established by the given element, taking into account\n * attribute `preserveAspectRatio`.\n *\n * Negative values for width or height are not permitted and a value of zero\n * disables rendering of the element. An optional `viewbox` for the SVG.\n *\n * For example, if the SVG element is 250 (width) by 200 (height) and you\n * provide `viewBox=\"0 0 25 20\"`, the coordinates inside the SVG will go from\n * the top left corner (0, 0) to the bottom right (25, 20) and each unit will\n * be worth `10px`.\n *\n * @defaultValue `\"0 0 24 24\"`\n */\n viewBox?: string;\n\n /**\n * An optional `xmlns` string to provide. The `use` prop will not work without\n * this prop defined.\n *\n *\n * Note: The default value will be `undefined` unless the {@link use} prop is\n * defined.\n *\n * @defaultValue `\"http://www.w3.org/2000/svg\"`\n */\n xmlns?: string;\n\n /**\n * This should be a link to a part of an SVG sprite map. So normally one of\n * the following:\n * - `'#some-custom-svg'`\n * - `'/images/spritemap.svg#some-custom-svg'`\n *\n * This prop **should not** be used with the `children` prop as only one will\n * be rendered.\n *\n *\n * NOTE: IE **does not support** external SVGs. Please see the demo for more\n * details.\n */\n use?: string;\n\n /**\n * Any `<svg>` children to render to create your icon. This can not be used\n * with the `use` prop.\n */\n children?: ReactNode;\n}\n\n/**\n * The `SVGIcon` component is used to render inline SVG icons or SVG icons in a\n * sprite map as an icon.\n */\nexport const SVGIcon = forwardRef<SVGSVGElement, SVGIconProps>(\n function SVGIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n focusable = \"false\",\n use,\n xmlns = use ? \"http://www.w3.org/2000/svg\" : undefined,\n viewBox = \"0 0 24 24\",\n dense = false,\n className,\n theme,\n inline,\n children: propChildren,\n ...remaining\n } = props;\n\n let children = propChildren;\n if (!children && use) {\n children = <use xlinkHref={use} />;\n }\n\n return (\n <svg\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"svg\",\n dense,\n theme,\n inline,\n className,\n })}\n focusable={focusable}\n xmlns={xmlns}\n viewBox={viewBox}\n >\n {children}\n </svg>\n );\n }\n);\n"],"names":["forwardRef","icon","SVGIcon","props","ref","ariaHidden","focusable","use","xmlns","undefined","viewBox","dense","className","theme","inline","children","propChildren","remaining","xlinkHref","svg","aria-hidden","type"],"mappings":";AAAA,SAASA,UAAU,QAA6C,QAAQ;AACxE,SAASC,IAAI,QAAsC,cAAc;AAyEjE;;;CAGC,GACD,OAAO,MAAMC,wBAAUF,WACrB,SAASE,QAAQC,KAAK,EAAEC,GAAG;IACzB,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,YAAY,OAAO,EACnBC,GAAG,EACHC,QAAQD,MAAM,+BAA+BE,SAAS,EACtDC,UAAU,WAAW,EACrBC,QAAQ,KAAK,EACbC,SAAS,EACTC,KAAK,EACLC,MAAM,EACNC,UAAUC,YAAY,EACtB,GAAGC,WACJ,GAAGd;IAEJ,IAAIY,WAAWC;IACf,IAAI,CAACD,YAAYR,KAAK;QACpBQ,yBAAW,KAACR;YAAIW,WAAWX;;IAC7B;IAEA,qBACE,KAACY;QACE,GAAGF,SAAS;QACbG,eAAaf;QACbD,KAAKA;QACLQ,WAAWX,KAAK;YACdoB,MAAM;YACNV;YACAE;YACAC;YACAF;QACF;QACAN,WAAWA;QACXE,OAAOA;QACPE,SAASA;kBAERK;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/icon/SVGIcon.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type SVGIconClassNameOptions, icon } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Added the `inline` and `theme` props.\n */\nexport interface SVGIconProps\n extends HTMLAttributes<SVGSVGElement>,\n SVGIconClassNameOptions {\n /**\n * Boolean if the SVG should gain the `focusable` attribute. This is disabled\n * by default since IE11 and Edge actually default this to true and keyboard's\n * will tab focus all SVGs.\n *\n * @defaultValue `false`\n */\n focusable?: \"false\" | \"true\" | boolean;\n\n /**\n * The `viewBox` attribute allows you to specify that a given set of graphics\n * stretch to fit a particular container element.\n *\n * The value of the `viewBox` attribute is a list of four numbers min-x,\n * min-y, width and height, separated by white space and/or a comma, which\n * specify a rectangle in user space which should be mapped to the bounds of\n * the viewport established by the given element, taking into account\n * attribute `preserveAspectRatio`.\n *\n * Negative values for width or height are not permitted and a value of zero\n * disables rendering of the element. An optional `viewbox` for the SVG.\n *\n * For example, if the SVG element is 250 (width) by 200 (height) and you\n * provide `viewBox=\"0 0 25 20\"`, the coordinates inside the SVG will go from\n * the top left corner (0, 0) to the bottom right (25, 20) and each unit will\n * be worth `10px`.\n *\n * @defaultValue `\"0 0 24 24\"`\n */\n viewBox?: string;\n\n /**\n * An optional `xmlns` string to provide. The `use` prop will not work without\n * this prop defined.\n *\n *\n * Note: The default value will be `undefined` unless the {@link use} prop is\n * defined.\n *\n * @defaultValue `\"http://www.w3.org/2000/svg\"`\n */\n xmlns?: string;\n\n /**\n * This should be a link to a part of an SVG sprite map. So normally one of\n * the following:\n * - `'#some-custom-svg'`\n * - `'/images/spritemap.svg#some-custom-svg'`\n *\n * This prop **should not** be used with the `children` prop as only one will\n * be rendered.\n *\n *\n * NOTE: IE **does not support** external SVGs. Please see the demo for more\n * details.\n */\n use?: string;\n\n /**\n * Any `<svg>` children to render to create your icon. This can not be used\n * with the `use` prop.\n */\n children?: ReactNode;\n}\n\n/**\n * The `SVGIcon` component is used to render inline SVG icons or SVG icons in a\n * sprite map as an icon.\n */\nexport const SVGIcon = forwardRef<SVGSVGElement, SVGIconProps>(\n function SVGIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n focusable = \"false\",\n use,\n xmlns = use ? \"http://www.w3.org/2000/svg\" : undefined,\n viewBox = \"0 0 24 24\",\n dense = false,\n className,\n theme,\n inline,\n children: propChildren,\n ...remaining\n } = props;\n\n let children = propChildren;\n if (!children && use) {\n children = <use xlinkHref={use} />;\n }\n\n return (\n <svg\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"svg\",\n dense,\n theme,\n inline,\n className,\n })}\n focusable={focusable}\n xmlns={xmlns}\n viewBox={viewBox}\n >\n {children}\n </svg>\n );\n }\n);\n"],"names":["forwardRef","icon","SVGIcon","props","ref","ariaHidden","focusable","use","xmlns","undefined","viewBox","dense","className","theme","inline","children","propChildren","remaining","xlinkHref","svg","aria-hidden","type"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAAuCC,IAAI,QAAQ,cAAc;AAyEjE;;;CAGC,GACD,OAAO,MAAMC,wBAAUF,WACrB,SAASE,QAAQC,KAAK,EAAEC,GAAG;IACzB,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,YAAY,OAAO,EACnBC,GAAG,EACHC,QAAQD,MAAM,+BAA+BE,SAAS,EACtDC,UAAU,WAAW,EACrBC,QAAQ,KAAK,EACbC,SAAS,EACTC,KAAK,EACLC,MAAM,EACNC,UAAUC,YAAY,EACtB,GAAGC,WACJ,GAAGd;IAEJ,IAAIY,WAAWC;IACf,IAAI,CAACD,YAAYR,KAAK;QACpBQ,yBAAW,KAACR;YAAIW,WAAWX;;IAC7B;IAEA,qBACE,KAACY;QACE,GAAGF,SAAS;QACbG,eAAaf;QACbD,KAAKA;QACLQ,WAAWX,KAAK;YACdoB,MAAM;YACNV;YACAE;YACAC;YACAF;QACF;QACAN,WAAWA;QACXE,OAAOA;QACPE,SAASA;kBAERK;;AAGP,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/TextIconSpacing.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n Children,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\nexport interface TextIconSpacingProps {\n /**\n * An optional className to apply to the surrounding `<span>` when the\n * `forceIconWrap` prop is enabled or the icon is not a valid React Element.\n * If the `forceIconWrap` prop is not enabled, it will be cloned into the icon\n * instead.\n */\n className?: string;\n\n /**\n * An optional icon to display with a text button. This is invalid for icon\n * buttons. If this is a single element, a new class name will be cloned into\n * the element to get correct spacing so if you have a custom icon element,\n * you **must** also pass that class name down. If you are using one of the\n * react-md icon component packages, this is handled automatically.\n *\n * If this is not a valid react element, the icon will be wrapped in a\n * `<span>` instead with the class names applied.\n */\n icon?: ReactElement<{ className?: string }> | ReactNode;\n\n /**\n * Boolean if the icon should appear after the text instead of before.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * The children to render before or after the provided icon. This is defaulted\n * to `null` so that providing a `null` icon will correctly render without\n * React crashing.\n *\n * @defaultValue `null`\n */\n children?: ReactNode;\n\n /**\n * The class name to use for an icon that is placed before text.\n *\n * @defaultValue `\"rmd-icon--before\"`\n */\n beforeClassName?: string;\n\n /**\n * The class name to use for an icon that is placed after text.\n *\n * @defaultValue `\"rmd-icon--after\"`\n */\n afterClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * disabled or omitted.\n *\n * @defaultValue `\"rmd-icon--above\"`\n */\n aboveClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * enabled.\n *\n * @defaultValue `\"rmd-icon--below\"`\n */\n belowClassName?: string;\n\n /**\n * Boolean if the icon should be forced into a `<span>` with the class names\n * applied instead of attempting to clone into the provided icon.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n\n /**\n * Boolean if the icon and text should be stacked instead of inline. Note:\n * You'll normally want to update the container element to have\n * `display: flex` and `flex-direction: column` for this to work.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Boolean if the icon and content are in a `column-reverse` or `row-reverse`\n * `flex-direction`. This will swap the different classnames as needed.\n *\n * @since 2.5.0\n * @defaultValue `false`\n */\n flexReverse?: boolean;\n}\n\n/**\n * Note: This component **must** be rendered within a flex container unless the\n * {@link TextIconSpacingProps.forceIconWrap} is set to `true`.\n *\n * @example Simple Example\n * ```tsx\n * import { TextIconSpacing, FontIcon } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>}>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @example Stacked Example\n * ```tsx\n * import { TextIconSpacing, FontIcon } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>} stacked>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n */\nexport function TextIconSpacing(props: TextIconSpacingProps): ReactElement {\n const {\n className,\n icon: propIcon,\n children = null,\n stacked = false,\n iconAfter = false,\n flexReverse = false,\n forceIconWrap = false,\n beforeClassName = \"rmd-icon--before\",\n afterClassName = \"rmd-icon--after\",\n aboveClassName = \"rmd-icon--above\",\n belowClassName = \"rmd-icon--below\",\n } = props;\n\n if (!propIcon) {\n return <>{children}</>;\n }\n\n const isAfter = flexReverse ? !iconAfter : iconAfter;\n const baseClassName = cnb(\n {\n [beforeClassName]: !stacked && !isAfter,\n [afterClassName]: !stacked && isAfter,\n [aboveClassName]: stacked && !isAfter,\n [belowClassName]: stacked && isAfter,\n },\n className\n );\n\n let iconEl = propIcon;\n let content = children;\n if (!forceIconWrap && isValidElement<{ className?: string }>(propIcon)) {\n const icon = Children.only(propIcon);\n iconEl = cloneElement(icon, {\n className: cnb(baseClassName, icon.props.className),\n });\n } else if (propIcon) {\n iconEl = (\n <span className={cnb(\"rmd-text-icon-spacing\", baseClassName)}>\n {propIcon}\n </span>\n );\n }\n\n if (iconEl) {\n content = (\n <>\n {!iconAfter && iconEl}\n {children}\n {iconAfter && iconEl}\n </>\n );\n }\n\n return <>{content}</>;\n}\n"],"names":["cnb","Children","cloneElement","isValidElement","TextIconSpacing","props","className","icon","propIcon","children","stacked","iconAfter","flexReverse","forceIconWrap","beforeClassName","afterClassName","aboveClassName","belowClassName","isAfter","baseClassName","iconEl","content","only","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,QAAQ,EACRC,YAAY,EACZC,cAAc,QAGT,QAAQ;AAkGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EACJC,SAAS,EACTC,MAAMC,QAAQ,EACdC,WAAW,IAAI,EACfC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,cAAc,KAAK,EACnBC,gBAAgB,KAAK,EACrBC,kBAAkB,kBAAkB,EACpCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EACnC,GAAGZ;IAEJ,IAAI,CAACG,UAAU;QACb,qBAAO;sBAAGC;;IACZ;IAEA,MAAMS,UAAUN,cAAc,CAACD,YAAYA;IAC3C,MAAMQ,gBAAgBnB,IACpB;QACE,CAACc,gBAAgB,EAAE,CAACJ,WAAW,CAACQ;QAChC,CAACH,eAAe,EAAE,CAACL,WAAWQ;QAC9B,CAACF,eAAe,EAAEN,WAAW,CAACQ;QAC9B,CAACD,eAAe,EAAEP,WAAWQ;IAC/B,GACAZ;IAGF,IAAIc,SAASZ;IACb,IAAIa,UAAUZ;IACd,IAAI,CAACI,+BAAiBV,eAAuCK,WAAW;QACtE,MAAMD,OAAON,SAASqB,IAAI,CAACd;QAC3BY,uBAASlB,aAAaK,MAAM;YAC1BD,WAAWN,IAAImB,eAAeZ,KAAKF,KAAK,CAACC,SAAS;QACpD;IACF,OAAO,IAAIE,UAAU;QACnBY,uBACE,KAACG;YAAKjB,WAAWN,IAAI,yBAAyBmB;sBAC3CX;;IAGP;IAEA,IAAIY,QAAQ;QACVC,wBACE;;gBACG,CAACV,aAAaS;gBACdX;gBACAE,aAAaS;;;IAGpB;IAEA,qBAAO;kBAAGC;;AACZ"}
1
+ {"version":3,"sources":["../../src/icon/TextIconSpacing.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n Children,\n type ReactElement,\n type ReactNode,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nexport interface TextIconSpacingProps {\n /**\n * An optional className to apply to the surrounding `<span>` when the\n * `forceIconWrap` prop is enabled or the icon is not a valid React Element.\n * If the `forceIconWrap` prop is not enabled, it will be cloned into the icon\n * instead.\n */\n className?: string;\n\n /**\n * An optional icon to display with a text button. This is invalid for icon\n * buttons. If this is a single element, a new class name will be cloned into\n * the element to get correct spacing so if you have a custom icon element,\n * you **must** also pass that class name down. If you are using one of the\n * react-md icon component packages, this is handled automatically.\n *\n * If this is not a valid react element, the icon will be wrapped in a\n * `<span>` instead with the class names applied.\n */\n icon?: ReactElement<{ className?: string }> | ReactNode;\n\n /**\n * Boolean if the icon should appear after the text instead of before.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * The children to render before or after the provided icon. This is defaulted\n * to `null` so that providing a `null` icon will correctly render without\n * React crashing.\n *\n * @defaultValue `null`\n */\n children?: ReactNode;\n\n /**\n * The class name to use for an icon that is placed before text.\n *\n * @defaultValue `\"rmd-icon--before\"`\n */\n beforeClassName?: string;\n\n /**\n * The class name to use for an icon that is placed after text.\n *\n * @defaultValue `\"rmd-icon--after\"`\n */\n afterClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * disabled or omitted.\n *\n * @defaultValue `\"rmd-icon--above\"`\n */\n aboveClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * enabled.\n *\n * @defaultValue `\"rmd-icon--below\"`\n */\n belowClassName?: string;\n\n /**\n * Boolean if the icon should be forced into a `<span>` with the class names\n * applied instead of attempting to clone into the provided icon.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n\n /**\n * Boolean if the icon and text should be stacked instead of inline. Note:\n * You'll normally want to update the container element to have\n * `display: flex` and `flex-direction: column` for this to work.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Boolean if the icon and content are in a `column-reverse` or `row-reverse`\n * `flex-direction`. This will swap the different classnames as needed.\n *\n * @since 2.5.0\n * @defaultValue `false`\n */\n flexReverse?: boolean;\n}\n\n/**\n * Note: This component **must** be rendered within a flex container unless the\n * {@link TextIconSpacingProps.forceIconWrap} is set to `true`.\n *\n * @example Simple Example\n * ```tsx\n * import { TextIconSpacing, FontIcon } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>}>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @example Stacked Example\n * ```tsx\n * import { TextIconSpacing, FontIcon } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>} stacked>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n */\nexport function TextIconSpacing(props: TextIconSpacingProps): ReactElement {\n const {\n className,\n icon: propIcon,\n children = null,\n stacked = false,\n iconAfter = false,\n flexReverse = false,\n forceIconWrap = false,\n beforeClassName = \"rmd-icon--before\",\n afterClassName = \"rmd-icon--after\",\n aboveClassName = \"rmd-icon--above\",\n belowClassName = \"rmd-icon--below\",\n } = props;\n\n if (!propIcon) {\n return <>{children}</>;\n }\n\n const isAfter = flexReverse ? !iconAfter : iconAfter;\n const baseClassName = cnb(\n {\n [beforeClassName]: !stacked && !isAfter,\n [afterClassName]: !stacked && isAfter,\n [aboveClassName]: stacked && !isAfter,\n [belowClassName]: stacked && isAfter,\n },\n className\n );\n\n let iconEl = propIcon;\n let content = children;\n if (!forceIconWrap && isValidElement<{ className?: string }>(propIcon)) {\n const icon = Children.only(propIcon);\n iconEl = cloneElement(icon, {\n className: cnb(baseClassName, icon.props.className),\n });\n } else if (propIcon) {\n iconEl = (\n <span className={cnb(\"rmd-text-icon-spacing\", baseClassName)}>\n {propIcon}\n </span>\n );\n }\n\n if (iconEl) {\n content = (\n <>\n {!iconAfter && iconEl}\n {children}\n {iconAfter && iconEl}\n </>\n );\n }\n\n return <>{content}</>;\n}\n"],"names":["cnb","Children","cloneElement","isValidElement","TextIconSpacing","props","className","icon","propIcon","children","stacked","iconAfter","flexReverse","forceIconWrap","beforeClassName","afterClassName","aboveClassName","belowClassName","isAfter","baseClassName","iconEl","content","only","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,QAAQ,EAGRC,YAAY,EACZC,cAAc,QACT,QAAQ;AAkGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EACJC,SAAS,EACTC,MAAMC,QAAQ,EACdC,WAAW,IAAI,EACfC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,cAAc,KAAK,EACnBC,gBAAgB,KAAK,EACrBC,kBAAkB,kBAAkB,EACpCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EACnC,GAAGZ;IAEJ,IAAI,CAACG,UAAU;QACb,qBAAO;sBAAGC;;IACZ;IAEA,MAAMS,UAAUN,cAAc,CAACD,YAAYA;IAC3C,MAAMQ,gBAAgBnB,IACpB;QACE,CAACc,gBAAgB,EAAE,CAACJ,WAAW,CAACQ;QAChC,CAACH,eAAe,EAAE,CAACL,WAAWQ;QAC9B,CAACF,eAAe,EAAEN,WAAW,CAACQ;QAC9B,CAACD,eAAe,EAAEP,WAAWQ;IAC/B,GACAZ;IAGF,IAAIc,SAASZ;IACb,IAAIa,UAAUZ;IACd,IAAI,CAACI,+BAAiBV,eAAuCK,WAAW;QACtE,MAAMD,OAAON,SAASqB,IAAI,CAACd;QAC3BY,uBAASlB,aAAaK,MAAM;YAC1BD,WAAWN,IAAImB,eAAeZ,KAAKF,KAAK,CAACC,SAAS;QACpD;IACF,OAAO,IAAIE,UAAU;QACnBY,uBACE,KAACG;YAAKjB,WAAWN,IAAI,yBAAyBmB;sBAC3CX;;IAGP;IAEA,IAAIY,QAAQ;QACVC,wBACE;;gBACG,CAACV,aAAaS;gBACdX;gBACAE,aAAaS;;;IAGpB;IAEA,qBAAO;kBAAGC;;AACZ"}
@@ -181,4 +181,4 @@ import { FontIcon } from "./FontIcon.js";
181
181
  return ICON_CONFIG[name];
182
182
  }
183
183
 
184
- //# sourceMappingURL=iconConfig.js.map
184
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/icon/config.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\n\nimport { FontIcon } from \"./FontIcon.js\";\n\n/**\n * @since 5.0.0 The `download` icon has been renamed to `upload`.\n */\nexport interface ConfigurableIcons {\n /**\n * The icon for navigating backwards or closing an item to the left.\n *\n * @defaultValue `<FontIcon>keyboard_arrow_left</FontIcon>`\n */\n back?: ReactNode;\n\n /**\n * The icon to use when clearing content from a text field.\n *\n * @defaultValue `<FontIcon>clear</FontIcon>`\n * @since 6.0.0\n */\n clear?: ReactNode;\n\n /**\n * @defaultValue `<FontIcon>close</FontIcon>`\n *\n * @since 6.0.0\n */\n close?: ReactNode;\n\n /**\n * The icon to use for unchecked checkboxes.\n *\n * @defaultValue `<FontIcon>check_box_outline_blank</FontIcon>`\n * @since 6.0.0 This icon now represents the unchecked state for\n * checkboxes.\n */\n checkbox?: ReactNode;\n\n /**\n * The icon to use for checked checkboxes.\n *\n * @defaultValue `<FontIcon>check_box</FontIcon>`\n * @since 6.0.0\n */\n checkboxChecked?: ReactNode;\n\n /**\n * The icon to use for indeterminate checkboxes.\n *\n * @defaultValue `<FontIcon>indeterminate_check_box</FontIcon>`\n * @since 6.0.0\n */\n checkboxIndeterminate?: ReactNode;\n\n /**\n * The icon to use for dropdown menus or content that expands vertically in a\n * new material instead of inline like the `expander` icon.\n *\n * @defaultValue `<FontIcon>arrow_drop_down</FontIcon>`\n */\n dropdown?: ReactNode;\n\n /**\n * The icon to use when there are form errors.\n *\n * @since 2.5.0\n * @defaultValue `<FontIcon>error_outline</FontIcon>`\n */\n error?: ReactNode;\n\n /**\n * The icon to use for expanding content vertically.\n *\n * @defaultValue `<FontIcon>keyboard_arrow_down</FontIcon>`\n */\n expander?: ReactNode;\n\n /**\n * The icon for navigating forwards or closing an item to the right. This is\n * also used internally for nested dropdown menus.\n *\n * @defaultValue `<FontIcon>keyboard_arrow_right</FontIcon>`\n */\n forward?: ReactNode;\n\n /**\n * The general to use for displaying a main navigation menu (usually a\n * hamburger menu).\n *\n * @defaultValue `<FontIcon>menu</FontIcon>`\n */\n menu?: ReactNode;\n\n /**\n * The icon for displaying notifications. This is used internally in the\n * `BadgedButton` in the `@react-md/badge` package.\n *\n * @defaultValue `<FontIcon>notifications</FontIcon>`\n */\n notification?: ReactNode;\n\n /**\n * The icon for temporarily displaying a password's field value as plain text.\n *\n * @defaultValue `<FontIcon>remove_red_eye</FontIcon>`\n */\n password?: ReactNode;\n\n /**\n * The icon to use for unchecked radio buttons.\n *\n * @defaultValue `<FontIcon>radio_button_unchecked</FontIcon>`\n * @since 6.0.0 This icon now represents the unchecked state for\n * radios.\n */\n radio?: ReactNode;\n\n /**\n * The icon to use for checked radio buttons.\n *\n * @defaultValue `<FontIcon>radio_button_checked</FontIcon>`\n */\n radioChecked?: ReactNode;\n\n /**\n * The icon to use when removing elements.\n *\n * @defaultValue `<FontIcon>cancel</FontIcon>`\n */\n remove?: ReactNode;\n\n /**\n * The icon to use for showing that something has been selected that is not a\n * radio or checkbox. This is used internally for the `Chip` in the\n * `@react-md/core` package.\n *\n * @defaultValue `<FontIcon>check</FontIcon>`\n */\n selected?: ReactNode;\n\n /**\n * The icon to represent sorting content.\n *\n * @defaultValue `<FontIcon>arrow_upward</FontIcon>`\n */\n sort?: ReactNode;\n\n /**\n * The icon to use for the `FileInput` component (normally file\n * uploads).\n *\n * @since 5.0.0\n * @defaultValue `<FontIcon>file_upload</FontIcon>`\n */\n upload?: ReactNode;\n}\n\nexport type ConfiguredIcons = Required<ConfigurableIcons>;\n\n/**\n * @since 6.0.0\n */\nexport type ConfigurableIconName = keyof ConfigurableIcons;\n\n/**\n * This is a **mutable** object of icons that `react-md` will use for rendering\n * icons within components. The defaults will use the font versions of material\n * icons.\n *\n * @see {@link configureIcons} for a quick way of overriding the configuration\n * or the example below.\n *\n * @example Mutating this object\n * ```tsx\n * import { ICON_CONFIG } from \"@react-md/core\";\n * import ArrowDropDownIcon from \"@react-md/material-icons/ArrowDropDownIcon\";\n * import ArrowUpwardIcon from \"@react-md/material-icons/ArrowUpwardIcon\";\n * import CancelIcon from \"@react-md/material-icons/CancelIcon\";\n * import CheckBoxIcon from \"@react-md/material-icons/CheckBoxIcon\";\n * import CheckBoxOutlineBlankIcon from \"@react-md/material-icons/CheckBoxOutlineBlankIcon\";\n * import CheckIcon from \"@react-md/material-icons/CheckIcon\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import ErrorOutlineIcon from \"@react-md/material-icons/ErrorOutlineIcon\";\n * import FileUploadIcon from \"@react-md/material-icons/FileUploadIcon\";\n * import IndeterminateCheckBoxIcon from \"@react-md/material-icons/IndeterminateCheckBoxIcon\";\n * import KeyboardArrowDownIcon from \"@react-md/material-icons/KeyboardArrowDownIcon\";\n * import KeyboardArrowLeftIcon from \"@react-md/material-icons/KeyboardArrowLeftIcon\";\n * import KeyboardArrowRightIcon from \"@react-md/material-icons/KeyboardArrowRightIcon\";\n * import MenuIcon from \"@react-md/material-icons/MenuIcon\";\n * import NotificationsIcon from \"@react-md/material-icons/NotificationsIcon\";\n * import RadioButtonCheckedIcon from \"@react-md/material-icons/RadioButtonCheckedIcon\";\n * import RadioButtonUncheckedIcon from \"@react-md/material-icons/RadioButtonUncheckedIcon\";\n * import RemoveRedEyeIcon from \"@react-md/material-icons/RemoveRedEyeIcon\";\n *\n * ICON_CONFIG.back = <KeyboardArrowLeftIcon />;\n * ICON_CONFIG.close = <CloseIcon />;\n * ICON_CONFIG.checkbox = <CheckBoxOutlineBlankIcon />;\n * ICON_CONFIG.checkboxChecked = <CheckBoxIcon />;\n * ICON_CONFIG.checkboxIndeterminate = <IndeterminateCheckBoxIcon />;\n * ICON_CONFIG.dropdown = <ArrowDropDownIcon />;\n * ICON_CONFIG.error = <ErrorOutlineIcon />;\n * ICON_CONFIG.expander = <KeyboardArrowDownIcon />;\n * ICON_CONFIG.forward = <KeyboardArrowRightIcon />;\n * ICON_CONFIG.menu = <MenuIcon />;\n * ICON_CONFIG.notification = <NotificationsIcon />;\n * ICON_CONFIG.password = <RemoveRedEyeIcon />;\n * ICON_CONFIG.radio = <RadioButtonUncheckedIcon />;\n * ICON_CONFIG.radioChecked = <RadioButtonCheckedIcon />;\n * ICON_CONFIG.remove = <CancelIcon />;\n * ICON_CONFIG.selected = <CheckIcon />;\n * ICON_CONFIG.sort = <ArrowUpwardIcon />;\n * ICON_CONFIG.upload = <FileUploadIcon />;\n * ```\n *\n *\n * @since 6.0.0\n */\nexport const ICON_CONFIG: ConfiguredIcons = {\n back: <FontIcon>keyboard_arrow_left</FontIcon>,\n clear: <FontIcon>clear</FontIcon>,\n close: <FontIcon>close</FontIcon>,\n checkbox: <FontIcon>check_box_outline_blank</FontIcon>,\n checkboxChecked: <FontIcon>check_box</FontIcon>,\n checkboxIndeterminate: <FontIcon>indeterminate_check_box</FontIcon>,\n dropdown: <FontIcon>arrow_drop_down</FontIcon>,\n error: <FontIcon>error_outline</FontIcon>,\n expander: <FontIcon>keyboard_arrow_down</FontIcon>,\n forward: <FontIcon>keyboard_arrow_right</FontIcon>,\n menu: <FontIcon>menu</FontIcon>,\n notification: <FontIcon>notifications</FontIcon>,\n password: <FontIcon>remove_red_eye</FontIcon>,\n radio: <FontIcon>radio_button_unchecked</FontIcon>,\n radioChecked: <FontIcon>radio_button_checked</FontIcon>,\n remove: <FontIcon>cancel</FontIcon>,\n selected: <FontIcon>check</FontIcon>,\n sort: <FontIcon>arrow_upward</FontIcon>,\n upload: <FontIcon>file_upload</FontIcon>,\n};\n\n/**\n * A convenience helper to reconfigure icons within `react-md`.\n *\n * @example Using SVG Material Icons\n * ```tsx\n * \"use client\";\n * import { configureIcons } from \"@react-md/core\";\n * import ArrowDropDownIcon from \"@react-md/material-icons/ArrowDropDownIcon\";\n * import ArrowUpwardIcon from \"@react-md/material-icons/ArrowUpwardIcon\";\n * import CancelIcon from \"@react-md/material-icons/CancelIcon\";\n * import CheckBoxIcon from \"@react-md/material-icons/CheckBoxIcon\";\n * import CheckBoxOutlineBlankIcon from \"@react-md/material-icons/CheckBoxOutlineBlankIcon\";\n * import CheckIcon from \"@react-md/material-icons/CheckIcon\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import ErrorOutlineIcon from \"@react-md/material-icons/ErrorOutlineIcon\";\n * import FileUploadIcon from \"@react-md/material-icons/FileUploadIcon\";\n * import IndeterminateCheckBoxIcon from \"@react-md/material-icons/IndeterminateCheckBoxIcon\";\n * import KeyboardArrowDownIcon from \"@react-md/material-icons/KeyboardArrowDownIcon\";\n * import KeyboardArrowLeftIcon from \"@react-md/material-icons/KeyboardArrowLeftIcon\";\n * import KeyboardArrowRightIcon from \"@react-md/material-icons/KeyboardArrowRightIcon\";\n * import MenuIcon from \"@react-md/material-icons/MenuIcon\";\n * import NotificationsIcon from \"@react-md/material-icons/NotificationsIcon\";\n * import RadioButtonCheckedIcon from \"@react-md/material-icons/RadioButtonCheckedIcon\";\n * import RadioButtonUncheckedIcon from \"@react-md/material-icons/RadioButtonUncheckedIcon\";\n * import RemoveRedEyeIcon from \"@react-md/material-icons/RemoveRedEyeIcon\";\n *\n * configureIcons({\n * back: <KeyboardArrowLeftIcon />,\n * close: <CloseIcon />,\n * checkbox: <CheckBoxOutlineBlankIcon />,\n * checkboxChecked: <CheckBoxIcon />,\n * checkboxIndeterminate: <IndeterminateCheckBoxIcon />,\n * dropdown: <ArrowDropDownIcon />,\n * error: <ErrorOutlineIcon />,\n * expander: <KeyboardArrowDownIcon />,\n * forward: <KeyboardArrowRightIcon />,\n * menu: <MenuIcon />,\n * notification: <NotificationsIcon />,\n * password: <RemoveRedEyeIcon />,\n * radio: <RadioButtonUncheckedIcon />,\n * radioChecked: <RadioButtonCheckedIcon />,\n * remove: <CancelIcon />,\n * selected: <CheckIcon />,\n * sort: <ArrowUpwardIcon />,\n * upload: <FileUploadIcon />,\n * });\n * ```\n *\n * @since 6.0.0\n */\nexport function configureIcons(overrides: ConfiguredIcons): void {\n Object.entries(overrides).forEach(([name, value]) => {\n if (process.env.NODE_ENV !== \"production\" && !(name in ICON_CONFIG)) {\n throw new Error(`${name} is an invalid react-md icon name.`);\n }\n\n ICON_CONFIG[name as keyof ConfiguredIcons] = value;\n });\n}\n\n/**\n * This is mostly an internal helper to get a specific icon by name and allowing\n * a custom prop to override this behavior. The main benefit of this function is\n * that icons can be removed if the override is set to `null`.\n *\n * @since 6.0.0\n */\nexport function getIcon(\n name: ConfigurableIconName,\n override?: ReactNode\n): ReactNode {\n if (typeof override !== \"undefined\") {\n return override;\n }\n\n return ICON_CONFIG[name];\n}\n"],"names":["FontIcon","ICON_CONFIG","back","clear","close","checkbox","checkboxChecked","checkboxIndeterminate","dropdown","error","expander","forward","menu","notification","password","radio","radioChecked","remove","selected","sort","upload","configureIcons","overrides","Object","entries","forEach","name","value","process","env","NODE_ENV","Error","getIcon","override"],"mappings":";AAEA,SAASA,QAAQ,QAAQ,gBAAgB;AAmKzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDC,GACD,OAAO,MAAMC,cAA+B;IAC1CC,oBAAM,KAACF;kBAAS;;IAChBG,qBAAO,KAACH;kBAAS;;IACjBI,qBAAO,KAACJ;kBAAS;;IACjBK,wBAAU,KAACL;kBAAS;;IACpBM,+BAAiB,KAACN;kBAAS;;IAC3BO,qCAAuB,KAACP;kBAAS;;IACjCQ,wBAAU,KAACR;kBAAS;;IACpBS,qBAAO,KAACT;kBAAS;;IACjBU,wBAAU,KAACV;kBAAS;;IACpBW,uBAAS,KAACX;kBAAS;;IACnBY,oBAAM,KAACZ;kBAAS;;IAChBa,4BAAc,KAACb;kBAAS;;IACxBc,wBAAU,KAACd;kBAAS;;IACpBe,qBAAO,KAACf;kBAAS;;IACjBgB,4BAAc,KAAChB;kBAAS;;IACxBiB,sBAAQ,KAACjB;kBAAS;;IAClBkB,wBAAU,KAAClB;kBAAS;;IACpBmB,oBAAM,KAACnB;kBAAS;;IAChBoB,sBAAQ,KAACpB;kBAAS;;AACpB,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDC,GACD,OAAO,SAASqB,eAAeC,SAA0B;IACvDC,OAAOC,OAAO,CAACF,WAAWG,OAAO,CAAC,CAAC,CAACC,MAAMC,MAAM;QAC9C,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgB,CAAEJ,CAAAA,QAAQzB,WAAU,GAAI;YACnE,MAAM,IAAI8B,MAAM,GAAGL,KAAK,kCAAkC,CAAC;QAC7D;QAEAzB,WAAW,CAACyB,KAA8B,GAAGC;IAC/C;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,QACdN,IAA0B,EAC1BO,QAAoB;IAEpB,IAAI,OAAOA,aAAa,aAAa;QACnC,OAAOA;IACT;IAEA,OAAOhC,WAAW,CAACyB,KAAK;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/materialConfig.ts"],"sourcesContent":["import { type CSSProperties } from \"react\";\nimport {\n type MaterialIconFamily,\n type MaterialSymbolFamily,\n} from \"./material.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialIconCustomization {\n /**\n * @defaultValue `\"filled\"`\n */\n iconFamily?: MaterialIconFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialIconConfiguration = Required<MaterialIconCustomization>;\n\n/**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolFill = 0 | 1;\n\n/**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;\n\n/**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolGrade = -25 | 0 | 200;\n\n/**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolOpticalSize = 20 | 24 | 40 | 48;\n\n/**\n * The comments for each customizable part was copied from\n * https://fonts.google.com/icons?icon.set=Material+Symbols and clicking the\n * info icon next to each property.\n *\n * @see https://fonts.google.com/icons?icon.set=Material+Symbols\n * @since 6.0.0\n */\nexport interface MaterialSymbolCustomization {\n /**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @defaultValue `0`\n */\n fill?: MaterialSymbolFill;\n\n /**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @defaultValue `400`\n */\n weight?: MaterialSymbolWeight;\n\n /**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @defaultValue `0`\n */\n grade?: MaterialSymbolGrade;\n\n /**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @defaultValue `48`\n */\n opticalSize?: MaterialSymbolOpticalSize;\n\n /**\n * @defaultValue `\"outlined\"`\n */\n family?: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialSymbolConfiguration = Required<MaterialSymbolCustomization>;\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialConfiguration\n extends MaterialIconConfiguration,\n MaterialSymbolConfiguration {}\n\n/**\n * @since 6.0.0\n */\nexport const MATERIAL_CONFIG: MaterialConfiguration = {\n fill: 0,\n weight: 400,\n grade: 0,\n opticalSize: 48,\n iconFamily: \"filled\",\n family: \"outlined\",\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolFontVariationSettings {\n style?: CSSProperties;\n family: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function getFontVariationSettings(\n options: MaterialSymbolCustomization & { style?: CSSProperties }\n): MaterialSymbolFontVariationSettings {\n let { style } = options;\n const {\n fill = MATERIAL_CONFIG.fill,\n grade = MATERIAL_CONFIG.grade,\n opticalSize = MATERIAL_CONFIG.opticalSize,\n weight = MATERIAL_CONFIG.weight,\n family: symbolFamily = MATERIAL_CONFIG.family,\n } = options;\n if (\n !style?.fontVariationSettings &&\n (fill !== MATERIAL_CONFIG.fill ||\n grade !== MATERIAL_CONFIG.grade ||\n opticalSize !== MATERIAL_CONFIG.opticalSize ||\n weight !== MATERIAL_CONFIG.weight)\n ) {\n style = {\n ...style,\n fontVariationSettings: `\"FILL\" ${fill}, \"wght\" ${weight}, \"GRAD\" ${grade}, \"opsz\" ${opticalSize}`,\n };\n }\n\n return { family: symbolFamily, style };\n}\n"],"names":["MATERIAL_CONFIG","fill","weight","grade","opticalSize","iconFamily","family","getFontVariationSettings","options","style","symbolFamily","fontVariationSettings"],"mappings":"AA4JA;;CAEC,GACD,OAAO,MAAMA,kBAAyC;IACpDC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,aAAa;IACbC,YAAY;IACZC,QAAQ;AACV,EAAE;AAUF;;;CAGC,GACD,OAAO,SAASC,yBACdC,OAAgE;IAEhE,IAAI,EAAEC,KAAK,EAAE,GAAGD;IAChB,MAAM,EACJP,OAAOD,gBAAgBC,IAAI,EAC3BE,QAAQH,gBAAgBG,KAAK,EAC7BC,cAAcJ,gBAAgBI,WAAW,EACzCF,SAASF,gBAAgBE,MAAM,EAC/BI,QAAQI,eAAeV,gBAAgBM,MAAM,EAC9C,GAAGE;IACJ,IACE,CAACC,OAAOE,yBACPV,CAAAA,SAASD,gBAAgBC,IAAI,IAC5BE,UAAUH,gBAAgBG,KAAK,IAC/BC,gBAAgBJ,gBAAgBI,WAAW,IAC3CF,WAAWF,gBAAgBE,MAAM,AAAD,GAClC;QACAO,QAAQ;YACN,GAAGA,KAAK;YACRE,uBAAuB,CAAC,OAAO,EAAEV,KAAK,SAAS,EAAEC,OAAO,SAAS,EAAEC,MAAM,SAAS,EAAEC,aAAa;QACnG;IACF;IAEA,OAAO;QAAEE,QAAQI;QAAcD;IAAM;AACvC"}
1
+ {"version":3,"sources":["../../src/icon/materialConfig.ts"],"sourcesContent":["import { type CSSProperties } from \"react\";\n\nimport {\n type MaterialIconFamily,\n type MaterialSymbolFamily,\n} from \"./material.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialIconCustomization {\n /**\n * @defaultValue `\"filled\"`\n */\n iconFamily?: MaterialIconFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialIconConfiguration = Required<MaterialIconCustomization>;\n\n/**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolFill = 0 | 1;\n\n/**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;\n\n/**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolGrade = -25 | 0 | 200;\n\n/**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolOpticalSize = 20 | 24 | 40 | 48;\n\n/**\n * The comments for each customizable part was copied from\n * https://fonts.google.com/icons?icon.set=Material+Symbols and clicking the\n * info icon next to each property.\n *\n * @see https://fonts.google.com/icons?icon.set=Material+Symbols\n * @since 6.0.0\n */\nexport interface MaterialSymbolCustomization {\n /**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @defaultValue `0`\n */\n fill?: MaterialSymbolFill;\n\n /**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @defaultValue `400`\n */\n weight?: MaterialSymbolWeight;\n\n /**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @defaultValue `0`\n */\n grade?: MaterialSymbolGrade;\n\n /**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @defaultValue `48`\n */\n opticalSize?: MaterialSymbolOpticalSize;\n\n /**\n * @defaultValue `\"outlined\"`\n */\n family?: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialSymbolConfiguration = Required<MaterialSymbolCustomization>;\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialConfiguration\n extends MaterialIconConfiguration,\n MaterialSymbolConfiguration {}\n\n/**\n * @since 6.0.0\n */\nexport const MATERIAL_CONFIG: MaterialConfiguration = {\n fill: 0,\n weight: 400,\n grade: 0,\n opticalSize: 48,\n iconFamily: \"filled\",\n family: \"outlined\",\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolFontVariationSettings {\n style?: CSSProperties;\n family: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function getFontVariationSettings(\n options: MaterialSymbolCustomization & { style?: CSSProperties }\n): MaterialSymbolFontVariationSettings {\n let { style } = options;\n const {\n fill = MATERIAL_CONFIG.fill,\n grade = MATERIAL_CONFIG.grade,\n opticalSize = MATERIAL_CONFIG.opticalSize,\n weight = MATERIAL_CONFIG.weight,\n family: symbolFamily = MATERIAL_CONFIG.family,\n } = options;\n if (\n !style?.fontVariationSettings &&\n (fill !== MATERIAL_CONFIG.fill ||\n grade !== MATERIAL_CONFIG.grade ||\n opticalSize !== MATERIAL_CONFIG.opticalSize ||\n weight !== MATERIAL_CONFIG.weight)\n ) {\n style = {\n ...style,\n fontVariationSettings: `\"FILL\" ${fill}, \"wght\" ${weight}, \"GRAD\" ${grade}, \"opsz\" ${opticalSize}`,\n };\n }\n\n return { family: symbolFamily, style };\n}\n"],"names":["MATERIAL_CONFIG","fill","weight","grade","opticalSize","iconFamily","family","getFontVariationSettings","options","style","symbolFamily","fontVariationSettings"],"mappings":"AA6JA;;CAEC,GACD,OAAO,MAAMA,kBAAyC;IACpDC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,aAAa;IACbC,YAAY;IACZC,QAAQ;AACV,EAAE;AAUF;;;CAGC,GACD,OAAO,SAASC,yBACdC,OAAgE;IAEhE,IAAI,EAAEC,KAAK,EAAE,GAAGD;IAChB,MAAM,EACJP,OAAOD,gBAAgBC,IAAI,EAC3BE,QAAQH,gBAAgBG,KAAK,EAC7BC,cAAcJ,gBAAgBI,WAAW,EACzCF,SAASF,gBAAgBE,MAAM,EAC/BI,QAAQI,eAAeV,gBAAgBM,MAAM,EAC9C,GAAGE;IACJ,IACE,CAACC,OAAOE,yBACPV,CAAAA,SAASD,gBAAgBC,IAAI,IAC5BE,UAAUH,gBAAgBG,KAAK,IAC/BC,gBAAgBJ,gBAAgBI,WAAW,IAC3CF,WAAWF,gBAAgBE,MAAM,AAAD,GAClC;QACAO,QAAQ;YACN,GAAGA,KAAK;YACRE,uBAAuB,CAAC,OAAO,EAAEV,KAAK,SAAS,EAAEC,OAAO,SAAS,EAAEC,MAAM,SAAS,EAAEC,aAAa;QACnG;IACF;IAEA,OAAO;QAAEE,QAAQI;QAAcD;IAAM;AACvC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/icon/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextColor, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport type { MaterialIconFamily, MaterialSymbolFamily } from \"./material.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-icon-color\"?: string;\n \"--rmd-icon-size\"?: string | number;\n \"--rmd-icon-spacing\"?: string | number;\n \"--rmd-icon-rotate-from\"?: string | number;\n \"--rmd-icon-rotate-to\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-icon\");\nconst rotatorStyles = bem(\"rmd-icon-rotator\");\n\n/** @since 6.0.0 */\nexport interface SVGIconClassNameOptions {\n className?: string;\n\n /**\n * An optional theme color to apply to the icon. When this is `undefined`, the\n * default icon color will be used instead.\n *\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-primary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n */\n theme?: ThemeColor | TextColor;\n\n /**\n * Boolean if the font icon should use the dense spec.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` if the icon should display inline with other text (like\n * a paragraph) by applying `vertical-align: bottom`.\n *\n * @example\n * ```tsx\n * <Typography>\n * <InfoIcon inline className=\"rmd-icon--before\" />\n * Some additional information around xyz.\n * </Typography>\n * ```\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FontIconClassNameOptions extends SVGIconClassNameOptions {\n /**\n * The font icon class name to use.\n *\n * @defaultValue `\"material-icons\"`\n */\n iconClassName?: string;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialIconClassNameOptions extends SVGIconClassNameOptions {\n family: MaterialIconFamily;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialSymbolClassNameOptions\n extends SVGIconClassNameOptions {\n family: MaterialSymbolFamily;\n}\n\n/** @since 6.0.0 */\nexport type IconClassNameOptions =\n | ({ type: \"font\" } & FontIconClassNameOptions)\n | ({ type: \"svg\" } & SVGIconClassNameOptions)\n | ({ type: \"material\" } & MaterialIconClassNameOptions)\n | ({ type: \"symbol\" } & MaterialSymbolClassNameOptions);\n\n/**\n *\n * @since 6.0.0\n */\nexport function icon(options: IconClassNameOptions): string {\n const {\n className,\n type,\n theme,\n family = \"\",\n dense = false,\n inline = false,\n iconClassName,\n } = options as FontIconClassNameOptions &\n SVGIconClassNameOptions & {\n type: \"font\" | \"svg\" | \"symbol\" | \"material\";\n family?: MaterialIconFamily;\n };\n\n const isFont = type === \"font\";\n const isSvg = type === \"svg\";\n const isSymbol = type === \"symbol\";\n const isMaterial = type === \"material\";\n\n return cnb(\n styles({\n svg: isSvg,\n font: isFont || isMaterial,\n symbol: isSymbol,\n vam: inline,\n dense,\n }),\n isSymbol && `material-symbols-${family}`,\n isMaterial &&\n `material-icons${\n family === \"filled\" ? \"\" : `-${family === \"rounded\" ? \"round\" : family}`\n }`,\n cssUtils({\n textColor: theme,\n }),\n iconClassName,\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface IconRotatorClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the icon is currently rotated.\n */\n rotated: boolean;\n\n /**\n * Boolean if changing the {@link rotated} state should no longer transition.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n *\n * @since 6.0.0\n */\nexport function iconRotator(options: IconRotatorClassNameOptions): string {\n const { className, rotated, disableTransition = false } = options;\n\n return cnb(\n rotatorStyles({\n animate: !disableTransition,\n rotated,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","rotatorStyles","icon","options","className","type","theme","family","dense","inline","iconClassName","isFont","isSvg","isSymbol","isMaterial","svg","font","symbol","vam","textColor","iconRotator","rotated","disableTransition","animate"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAyC,iBAAiB;AAC3E,SAASC,GAAG,QAAQ,kBAAkB;AAatC,MAAMC,SAASD,IAAI;AACnB,MAAME,gBAAgBF,IAAI;AA0E1B;;;CAGC,GACD,OAAO,SAASG,KAAKC,OAA6B;IAChD,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,KAAK,EACLC,SAAS,EAAE,EACXC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,aAAa,EACd,GAAGP;IAMJ,MAAMQ,SAASN,SAAS;IACxB,MAAMO,QAAQP,SAAS;IACvB,MAAMQ,WAAWR,SAAS;IAC1B,MAAMS,aAAaT,SAAS;IAE5B,OAAOR,IACLG,OAAO;QACLe,KAAKH;QACLI,MAAML,UAAUG;QAChBG,QAAQJ;QACRK,KAAKT;QACLD;IACF,IACAK,YAAY,CAAC,iBAAiB,EAAEN,QAAQ,EACxCO,cACE,CAAC,cAAc,EACbP,WAAW,WAAW,KAAK,CAAC,CAAC,EAAEA,WAAW,YAAY,UAAUA,QAAQ,EACxE,EACJT,SAAS;QACPqB,WAAWb;IACb,IACAI,eACAN;AAEJ;AAmBA;;;CAGC,GACD,OAAO,SAASgB,YAAYjB,OAAoC;IAC9D,MAAM,EAAEC,SAAS,EAAEiB,OAAO,EAAEC,oBAAoB,KAAK,EAAE,GAAGnB;IAE1D,OAAON,IACLI,cAAc;QACZsB,SAAS,CAACD;QACVD;IACF,IACAjB;AAEJ"}
1
+ {"version":3,"sources":["../../src/icon/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\n\nimport { type TextColor, type ThemeColor, cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport type { MaterialIconFamily, MaterialSymbolFamily } from \"./material.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-icon-color\"?: string;\n \"--rmd-icon-size\"?: string | number;\n \"--rmd-icon-spacing\"?: string | number;\n \"--rmd-icon-rotate-from\"?: string | number;\n \"--rmd-icon-rotate-to\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-icon\");\nconst rotatorStyles = bem(\"rmd-icon-rotator\");\n\n/** @since 6.0.0 */\nexport interface SVGIconClassNameOptions {\n className?: string;\n\n /**\n * An optional theme color to apply to the icon. When this is `undefined`, the\n * default icon color will be used instead.\n *\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-primary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n */\n theme?: ThemeColor | TextColor;\n\n /**\n * Boolean if the font icon should use the dense spec.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` if the icon should display inline with other text (like\n * a paragraph) by applying `vertical-align: bottom`.\n *\n * @example\n * ```tsx\n * <Typography>\n * <InfoIcon inline className=\"rmd-icon--before\" />\n * Some additional information around xyz.\n * </Typography>\n * ```\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FontIconClassNameOptions extends SVGIconClassNameOptions {\n /**\n * The font icon class name to use.\n *\n * @defaultValue `\"material-icons\"`\n */\n iconClassName?: string;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialIconClassNameOptions extends SVGIconClassNameOptions {\n family: MaterialIconFamily;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialSymbolClassNameOptions\n extends SVGIconClassNameOptions {\n family: MaterialSymbolFamily;\n}\n\n/** @since 6.0.0 */\nexport type IconClassNameOptions =\n | ({ type: \"font\" } & FontIconClassNameOptions)\n | ({ type: \"svg\" } & SVGIconClassNameOptions)\n | ({ type: \"material\" } & MaterialIconClassNameOptions)\n | ({ type: \"symbol\" } & MaterialSymbolClassNameOptions);\n\n/**\n *\n * @since 6.0.0\n */\nexport function icon(options: IconClassNameOptions): string {\n const {\n className,\n type,\n theme,\n family = \"\",\n dense = false,\n inline = false,\n iconClassName,\n } = options as FontIconClassNameOptions &\n SVGIconClassNameOptions & {\n type: \"font\" | \"svg\" | \"symbol\" | \"material\";\n family?: MaterialIconFamily;\n };\n\n const isFont = type === \"font\";\n const isSvg = type === \"svg\";\n const isSymbol = type === \"symbol\";\n const isMaterial = type === \"material\";\n\n return cnb(\n styles({\n svg: isSvg,\n font: isFont || isMaterial,\n symbol: isSymbol,\n vam: inline,\n dense,\n }),\n isSymbol && `material-symbols-${family}`,\n isMaterial &&\n `material-icons${\n family === \"filled\" ? \"\" : `-${family === \"rounded\" ? \"round\" : family}`\n }`,\n cssUtils({\n textColor: theme,\n }),\n iconClassName,\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface IconRotatorClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the icon is currently rotated.\n */\n rotated: boolean;\n\n /**\n * Boolean if changing the {@link rotated} state should no longer transition.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n *\n * @since 6.0.0\n */\nexport function iconRotator(options: IconRotatorClassNameOptions): string {\n const { className, rotated, disableTransition = false } = options;\n\n return cnb(\n rotatorStyles({\n animate: !disableTransition,\n rotated,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","rotatorStyles","icon","options","className","type","theme","family","dense","inline","iconClassName","isFont","isSvg","isSymbol","isMaterial","svg","font","symbol","vam","textColor","iconRotator","rotated","disableTransition","animate"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAEhC,SAA0CC,QAAQ,QAAQ,iBAAiB;AAC3E,SAASC,GAAG,QAAQ,kBAAkB;AAatC,MAAMC,SAASD,IAAI;AACnB,MAAME,gBAAgBF,IAAI;AA0E1B;;;CAGC,GACD,OAAO,SAASG,KAAKC,OAA6B;IAChD,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,KAAK,EACLC,SAAS,EAAE,EACXC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,aAAa,EACd,GAAGP;IAMJ,MAAMQ,SAASN,SAAS;IACxB,MAAMO,QAAQP,SAAS;IACvB,MAAMQ,WAAWR,SAAS;IAC1B,MAAMS,aAAaT,SAAS;IAE5B,OAAOR,IACLG,OAAO;QACLe,KAAKH;QACLI,MAAML,UAAUG;QAChBG,QAAQJ;QACRK,KAAKT;QACLD;IACF,IACAK,YAAY,CAAC,iBAAiB,EAAEN,QAAQ,EACxCO,cACE,CAAC,cAAc,EACbP,WAAW,WAAW,KAAK,CAAC,CAAC,EAAEA,WAAW,YAAY,UAAUA,QAAQ,EACxE,EACJT,SAAS;QACPqB,WAAWb;IACb,IACAI,eACAN;AAEJ;AAmBA;;;CAGC,GACD,OAAO,SAASgB,YAAYjB,OAAoC;IAC9D,MAAM,EAAEC,SAAS,EAAEiB,OAAO,EAAEC,oBAAoB,KAAK,EAAE,GAAGnB;IAE1D,OAAON,IACLI,cAAc;QACZsB,SAAS,CAACD;QACVD;IACF,IACAjB;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interaction/Ripple.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport {\n type CSSTransitionClassNames,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { type RippleState, type RippleTransitionCallbacks } from \"./types.js\";\n\n/** @internal */\nexport const DEFAULT_RIPPLE_CLASSNAMES: Readonly<CSSTransitionClassNames> = {\n enter: \"rmd-ripple--animating\",\n enterActive: \"rmd-ripple--scaling\",\n enterDone: \"rmd-ripple--animating rmd-ripple--scaling\",\n exit: \"rmd-ripple--animating rmd-ripple--scaling\",\n exitActive: \"rmd-ripple--fading\",\n};\n\n/** @internal */\nexport const DEFAULT_RIPPLE_TIMEOUT: Readonly<TransitionTimeout> = {\n enter: 150,\n exit: 300,\n};\n\n/** @internal */\nexport interface RippleProps extends RippleTransitionCallbacks {\n className?: string;\n timeout?: TransitionTimeout;\n classNames?: CSSTransitionClassNames;\n ripple: RippleState;\n}\n\n/**\n * **Client Component**\n *\n * This component should only be used by the `RippleContainer` component.\n *\n * @internal\n */\nexport function Ripple(props: RippleProps): ReactElement {\n const {\n className,\n timeout = DEFAULT_RIPPLE_TIMEOUT,\n classNames = DEFAULT_RIPPLE_CLASSNAMES,\n ripple,\n onEntered,\n onExited,\n } = props;\n const { style, exiting } = ripple;\n const { elementProps, rendered } = useCSSTransition({\n appear: true,\n className: cnb(\"rmd-ripple\", className),\n transitionIn: !exiting,\n timeout,\n classNames,\n onEntered() {\n onEntered(ripple);\n },\n onExited() {\n onExited(ripple);\n },\n });\n\n return <>{rendered && <span style={style} {...elementProps} />}</>;\n}\n"],"names":["cnb","useCSSTransition","DEFAULT_RIPPLE_CLASSNAMES","enter","enterActive","enterDone","exit","exitActive","DEFAULT_RIPPLE_TIMEOUT","Ripple","props","className","timeout","classNames","ripple","onEntered","onExited","style","exiting","elementProps","rendered","appear","transitionIn","span"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAMhC,SAASC,gBAAgB,QAAQ,oCAAoC;AAGrE,cAAc,GACd,OAAO,MAAMC,4BAA+D;IAC1EC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;IACNC,YAAY;AACd,EAAE;AAEF,cAAc,GACd,OAAO,MAAMC,yBAAsD;IACjEL,OAAO;IACPG,MAAM;AACR,EAAE;AAUF;;;;;;CAMC,GACD,OAAO,SAASG,OAAOC,KAAkB;IACvC,MAAM,EACJC,SAAS,EACTC,UAAUJ,sBAAsB,EAChCK,aAAaX,yBAAyB,EACtCY,MAAM,EACNC,SAAS,EACTC,QAAQ,EACT,GAAGN;IACJ,MAAM,EAAEO,KAAK,EAAEC,OAAO,EAAE,GAAGJ;IAC3B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGnB,iBAAiB;QAClDoB,QAAQ;QACRV,WAAWX,IAAI,cAAcW;QAC7BW,cAAc,CAACJ;QACfN;QACAC;QACAE;YACEA,UAAUD;QACZ;QACAE;YACEA,SAASF;QACX;IACF;IAEA,qBAAO;kBAAGM,0BAAY,KAACG;YAAKN,OAAOA;YAAQ,GAAGE,YAAY;;;AAC5D"}
1
+ {"version":3,"sources":["../../src/interaction/Ripple.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\n\nimport {\n type CSSTransitionClassNames,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { type RippleState, type RippleTransitionCallbacks } from \"./types.js\";\n\n/** @internal */\nexport const DEFAULT_RIPPLE_CLASSNAMES: Readonly<CSSTransitionClassNames> = {\n enter: \"rmd-ripple--animating\",\n enterActive: \"rmd-ripple--scaling\",\n enterDone: \"rmd-ripple--animating rmd-ripple--scaling\",\n exit: \"rmd-ripple--animating rmd-ripple--scaling\",\n exitActive: \"rmd-ripple--fading\",\n};\n\n/** @internal */\nexport const DEFAULT_RIPPLE_TIMEOUT: Readonly<TransitionTimeout> = {\n enter: 150,\n exit: 300,\n};\n\n/** @internal */\nexport interface RippleProps extends RippleTransitionCallbacks {\n className?: string;\n timeout?: TransitionTimeout;\n classNames?: CSSTransitionClassNames;\n ripple: RippleState;\n}\n\n/**\n * **Client Component**\n *\n * This component should only be used by the `RippleContainer` component.\n *\n * @internal\n */\nexport function Ripple(props: RippleProps): ReactElement {\n const {\n className,\n timeout = DEFAULT_RIPPLE_TIMEOUT,\n classNames = DEFAULT_RIPPLE_CLASSNAMES,\n ripple,\n onEntered,\n onExited,\n } = props;\n const { style, exiting } = ripple;\n const { elementProps, rendered } = useCSSTransition({\n appear: true,\n className: cnb(\"rmd-ripple\", className),\n transitionIn: !exiting,\n timeout,\n classNames,\n onEntered() {\n onEntered(ripple);\n },\n onExited() {\n onExited(ripple);\n },\n });\n\n return <>{rendered && <span style={style} {...elementProps} />}</>;\n}\n"],"names":["cnb","useCSSTransition","DEFAULT_RIPPLE_CLASSNAMES","enter","enterActive","enterDone","exit","exitActive","DEFAULT_RIPPLE_TIMEOUT","Ripple","props","className","timeout","classNames","ripple","onEntered","onExited","style","exiting","elementProps","rendered","appear","transitionIn","span"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAOhC,SAASC,gBAAgB,QAAQ,oCAAoC;AAGrE,cAAc,GACd,OAAO,MAAMC,4BAA+D;IAC1EC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;IACNC,YAAY;AACd,EAAE;AAEF,cAAc,GACd,OAAO,MAAMC,yBAAsD;IACjEL,OAAO;IACPG,MAAM;AACR,EAAE;AAUF;;;;;;CAMC,GACD,OAAO,SAASG,OAAOC,KAAkB;IACvC,MAAM,EACJC,SAAS,EACTC,UAAUJ,sBAAsB,EAChCK,aAAaX,yBAAyB,EACtCY,MAAM,EACNC,SAAS,EACTC,QAAQ,EACT,GAAGN;IACJ,MAAM,EAAEO,KAAK,EAAEC,OAAO,EAAE,GAAGJ;IAC3B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGnB,iBAAiB;QAClDoB,QAAQ;QACRV,WAAWX,IAAI,cAAcW;QAC7BW,cAAc,CAACJ;QACfN;QACAC;QACAE;YACEA,UAAUD;QACZ;QACAE;YACEA,SAASF;QACX;IACF;IAEA,qBAAO;kBAAGM,0BAAY,KAACG;YAAKN,OAAOA;YAAQ,GAAGE,YAAY;;;AAC5D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interaction/RippleContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport { Ripple } from \"./Ripple.js\";\nimport { type ProvidedRippleContainerProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-inset\"?: string | number;\n \"--rmd-ripple-border-radius\"?: string | number;\n }\n}\n\n/** @internal */\nexport interface RippleContainerProps extends ProvidedRippleContainerProps {\n className?: string;\n}\n\n/**\n * This component should generally only be used internally within `react-md`\n * unless you are implementing a custom component interaction with\n * `useElementInteraction`.\n *\n * @see {@link useElementInteraction} for example usage.\n */\nexport function RippleContainer(props: RippleContainerProps): ReactElement {\n const { className, ripples, onEntered, onExited } = props;\n\n return (\n <span className={cnb(\"rmd-ripple-container\", className)}>\n {ripples.map((ripple) => (\n <Ripple\n key={ripple.startTime}\n ripple={ripple}\n onEntered={onEntered}\n onExited={onExited}\n />\n ))}\n </span>\n );\n}\n"],"names":["cnb","Ripple","RippleContainer","props","className","ripples","onEntered","onExited","span","map","ripple","startTime"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAEhC,SAASC,MAAM,QAAQ,cAAc;AAerC;;;;;;CAMC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAEpD,qBACE,KAACK;QAAKJ,WAAWJ,IAAI,wBAAwBI;kBAC1CC,QAAQI,GAAG,CAAC,CAACC,uBACZ,KAACT;gBAECS,QAAQA;gBACRJ,WAAWA;gBACXC,UAAUA;eAHLG,OAAOC,SAAS;;AAQ/B"}
1
+ {"version":3,"sources":["../../src/interaction/RippleContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\n\nimport { Ripple } from \"./Ripple.js\";\nimport { type ProvidedRippleContainerProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-inset\"?: string | number;\n \"--rmd-ripple-border-radius\"?: string | number;\n }\n}\n\n/** @internal */\nexport interface RippleContainerProps extends ProvidedRippleContainerProps {\n className?: string;\n}\n\n/**\n * This component should generally only be used internally within `react-md`\n * unless you are implementing a custom component interaction with\n * `useElementInteraction`.\n *\n * @see {@link useElementInteraction} for example usage.\n */\nexport function RippleContainer(props: RippleContainerProps): ReactElement {\n const { className, ripples, onEntered, onExited } = props;\n\n return (\n <span className={cnb(\"rmd-ripple-container\", className)}>\n {ripples.map((ripple) => (\n <Ripple\n key={ripple.startTime}\n ripple={ripple}\n onEntered={onEntered}\n onExited={onExited}\n />\n ))}\n </span>\n );\n}\n"],"names":["cnb","Ripple","RippleContainer","props","className","ripples","onEntered","onExited","span","map","ripple","startTime"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,MAAM,QAAQ,cAAc;AAerC;;;;;;CAMC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAEpD,qBACE,KAACK;QAAKJ,WAAWJ,IAAI,wBAAwBI;kBAC1CC,QAAQI,GAAG,CAAC,CAACC,uBACZ,KAACT;gBAECS,QAAQA;gBACRJ,WAAWA;gBACXC,UAAUA;eAHLG,OAAOC,SAAS;;AAQ/B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interaction/UserInteractionModeProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\n/**\n * This is the current mode for how your user is interacting with your app. This\n * will be used to determine which type of state styles should be applied at the\n * time of interacting with an element on your page.\n *\n * @defaultValue `\"mouse\"`\n */\nexport type UserInteractionMode = \"keyboard\" | \"mouse\" | \"touch\";\n\n/** @internal */\ninterface UserInteractionModeContext {\n __root: boolean;\n mode: UserInteractionMode;\n}\n\nconst context = createContext<UserInteractionModeContext>({\n __root: false,\n mode: \"mouse\",\n});\ncontext.displayName = \"UserInteractionMode\";\nconst { Provider } = context;\n\n/**\n * @returns the current user interaction mode\n */\nexport function useUserInteractionMode(): UserInteractionMode {\n return useContext(context).mode;\n}\n\n/** @internal */\nconst TOUCH_TIMEOUT = 1200;\n\nexport interface UserInteractionModeProviderProps {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to determine how a user is interacting with your app\n * to update component functionality and applying the following class names to\n * the `document.body`:\n *\n * - `\"rmd-mouse-mode\"`\n * - `\"rmd-keyboard-mode\"`\n * - `\"rmd-touch-mode\"`\n *\n * Within `react-md`, these classes are used for the following behavior:\n * - only display `:focus` outlines while in `\"rmd-keyboard-mode\"`\n * - do not display `:hover` effects while in `\"rmd-touch-mode\"`\n *\n * @example Mount at the root of your app\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { UserInteractionModeProvider } from \"@react-md/core\";\n * import App from \"./App\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <UserInteractionModeProvider>\n * <App />\n * </UserInteractionModeProvider>\n * );\n * ```\n *\n * @throws \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n * if this component is mounted multiple times in your app.\n */\nexport function UserInteractionModeProvider(\n props: UserInteractionModeProviderProps\n): ReactElement {\n const { children } = props;\n const { __root } = useContext(context);\n if (__root) {\n throw new Error(\n \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n );\n }\n\n const [mode, setMode] = useState<UserInteractionMode>(\"mouse\");\n const lastTouchTime = useRef(0);\n const isTouchContextMenu = useRef(false);\n\n /**\n * This effect helps determine the current interaction mode by attaching the\n * required event listeners to the window. The `mode` will always be defaulted\n * to `mouse` at first since it has the least possibilities of causing errors\n * with styles since the mouse-only styles are normally just `:hover` effects.\n *\n * ## Switching between modes:\n *\n * ### While in `mouse` mode:\n *\n * - any `keydown` event will switch to `keyboard` mode\n * - this does have the side effect of meta keys also causing the switch over,\n * but it feels fine since it helps show the current focus in the document\n * as well\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `keyboard` mode:\n *\n * - any `mousedown` event will switch to `mouse` mode\n * - it is perfectly okay to move the mouse while in keyboard mode, but still\n * want to keep the keyboard styles until the user actually starts clicking\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `touch` mode:\n *\n * - any `mousemove` event will switch to `mouse` mode, but **only** if there\n * hasn't been a `contextmenu` event within the last `1.2s`\n * - you can really only switch back to `mouse` mode if you are using the\n * devtools to emulate devices OR using a touch-desktop. I don't know how\n * common this really is though.\n * - touching the screen will always fire a `mousemove` event (which is why\n * the `:hover` styles are normally with `rmd-utils-mouse-only`) and even\n * after the `contextmenu` event. Normally want to go back to `mouse` mode\n * when the mouse re-enters the `window`\n *\n * Note: It's currently impossible to switch from `touch` to `keyboard`\n * immediately. You'd first need to switch to `mouse` and then to `keyboard`. I\n * don't really know of any use-cases other than the weird touch-desktop stuff\n * and I have no experience using them.\n */\n useEffect(() => {\n const enableMouseMode = (): void => {\n setMode(\"mouse\");\n };\n const enableKeyboardMode = (): void => {\n setMode(\"keyboard\");\n };\n\n const handleTouchStart = (): void => {\n lastTouchTime.current = Date.now();\n isTouchContextMenu.current = false;\n setMode(\"touch\");\n };\n\n const handleMouseMove = (): void => {\n if (\n isTouchContextMenu.current ||\n Date.now() - lastTouchTime.current < TOUCH_TIMEOUT\n ) {\n isTouchContextMenu.current = false;\n return;\n }\n\n enableMouseMode();\n };\n const handleContextMenu = (): void => {\n isTouchContextMenu.current = true;\n };\n\n const className = `rmd-${mode}-mode`;\n document.body.classList.add(className);\n window.addEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.addEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.addEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.addEventListener(\"mousemove\", handleMouseMove, true);\n window.addEventListener(\"contextmenu\", handleContextMenu, true);\n }\n\n return () => {\n document.body.classList.remove(className);\n window.removeEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.removeEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.removeEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.removeEventListener(\"mousemove\", handleMouseMove, true);\n window.removeEventListener(\"contextmenu\", handleContextMenu, true);\n }\n };\n }, [mode]);\n\n const value = useMemo<UserInteractionModeContext>(\n () => ({\n mode,\n __root: true,\n }),\n [mode]\n );\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useMemo","useRef","useState","context","__root","mode","displayName","Provider","useUserInteractionMode","TOUCH_TIMEOUT","UserInteractionModeProvider","props","children","Error","setMode","lastTouchTime","isTouchContextMenu","enableMouseMode","enableKeyboardMode","handleTouchStart","current","Date","now","handleMouseMove","handleContextMenu","className","document","body","classList","add","window","addEventListener","remove","removeEventListener","value"],"mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAGH,QAAQ;AAiBf,MAAMC,wBAAUN,cAA0C;IACxDO,QAAQ;IACRC,MAAM;AACR;AACAF,QAAQG,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGJ;AAErB;;CAEC,GACD,OAAO,SAASK;IACd,OAAOV,WAAWK,SAASE,IAAI;AACjC;AAEA,cAAc,GACd,MAAMI,gBAAgB;AAMtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,SAASC,4BACdC,KAAuC;IAEvC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAM,EAAEP,MAAM,EAAE,GAAGN,WAAWK;IAC9B,IAAIC,QAAQ;QACV,MAAM,IAAIS,MACR;IAEJ;IAEA,MAAM,CAACR,MAAMS,QAAQ,GAAGZ,SAA8B;IACtD,MAAMa,gBAAgBd,OAAO;IAC7B,MAAMe,qBAAqBf,OAAO;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCC,GACDF,UAAU;QACR,MAAMkB,kBAAkB;YACtBH,QAAQ;QACV;QACA,MAAMI,qBAAqB;YACzBJ,QAAQ;QACV;QAEA,MAAMK,mBAAmB;YACvBJ,cAAcK,OAAO,GAAGC,KAAKC,GAAG;YAChCN,mBAAmBI,OAAO,GAAG;YAC7BN,QAAQ;QACV;QAEA,MAAMS,kBAAkB;YACtB,IACEP,mBAAmBI,OAAO,IAC1BC,KAAKC,GAAG,KAAKP,cAAcK,OAAO,GAAGX,eACrC;gBACAO,mBAAmBI,OAAO,GAAG;gBAC7B;YACF;YAEAH;QACF;QACA,MAAMO,oBAAoB;YACxBR,mBAAmBI,OAAO,GAAG;QAC/B;QAEA,MAAMK,YAAY,CAAC,IAAI,EAAEpB,KAAK,KAAK,CAAC;QACpCqB,SAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAACJ;QAC5BK,OAAOC,gBAAgB,CAAC,cAAcZ,kBAAkB;QACxD,IAAId,SAAS,SAAS;YACpByB,OAAOC,gBAAgB,CAAC,WAAWb,oBAAoB;QACzD,OAAO,IAAIb,SAAS,YAAY;YAC9ByB,OAAOC,gBAAgB,CAAC,aAAad,iBAAiB;QACxD,OAAO;YACLa,OAAOC,gBAAgB,CAAC,aAAaR,iBAAiB;YACtDO,OAAOC,gBAAgB,CAAC,eAAeP,mBAAmB;QAC5D;QAEA,OAAO;YACLE,SAASC,IAAI,CAACC,SAAS,CAACI,MAAM,CAACP;YAC/BK,OAAOG,mBAAmB,CAAC,cAAcd,kBAAkB;YAC3D,IAAId,SAAS,SAAS;gBACpByB,OAAOG,mBAAmB,CAAC,WAAWf,oBAAoB;YAC5D,OAAO,IAAIb,SAAS,YAAY;gBAC9ByB,OAAOG,mBAAmB,CAAC,aAAahB,iBAAiB;YAC3D,OAAO;gBACLa,OAAOG,mBAAmB,CAAC,aAAaV,iBAAiB;gBACzDO,OAAOG,mBAAmB,CAAC,eAAeT,mBAAmB;YAC/D;QACF;IACF,GAAG;QAACnB;KAAK;IAET,MAAM6B,QAAQlC,QACZ,IAAO,CAAA;YACLK;YACAD,QAAQ;QACV,CAAA,GACA;QAACC;KAAK;IAER,qBAAO,KAACE;QAAS2B,OAAOA;kBAAQtB;;AAClC"}
1
+ {"version":3,"sources":["../../src/interaction/UserInteractionModeProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\n/**\n * This is the current mode for how your user is interacting with your app. This\n * will be used to determine which type of state styles should be applied at the\n * time of interacting with an element on your page.\n *\n * @defaultValue `\"mouse\"`\n */\nexport type UserInteractionMode = \"keyboard\" | \"mouse\" | \"touch\";\n\n/** @internal */\ninterface UserInteractionModeContext {\n __root: boolean;\n mode: UserInteractionMode;\n}\n\nconst context = createContext<UserInteractionModeContext>({\n __root: false,\n mode: \"mouse\",\n});\ncontext.displayName = \"UserInteractionMode\";\nconst { Provider } = context;\n\n/**\n * @returns the current user interaction mode\n */\nexport function useUserInteractionMode(): UserInteractionMode {\n return useContext(context).mode;\n}\n\n/** @internal */\nconst TOUCH_TIMEOUT = 1200;\n\nexport interface UserInteractionModeProviderProps {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to determine how a user is interacting with your app\n * to update component functionality and applying the following class names to\n * the `document.body`:\n *\n * - `\"rmd-mouse-mode\"`\n * - `\"rmd-keyboard-mode\"`\n * - `\"rmd-touch-mode\"`\n *\n * Within `react-md`, these classes are used for the following behavior:\n * - only display `:focus` outlines while in `\"rmd-keyboard-mode\"`\n * - do not display `:hover` effects while in `\"rmd-touch-mode\"`\n *\n * @example Mount at the root of your app\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { UserInteractionModeProvider } from \"@react-md/core\";\n * import App from \"./App\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <UserInteractionModeProvider>\n * <App />\n * </UserInteractionModeProvider>\n * );\n * ```\n *\n * @throws \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n * if this component is mounted multiple times in your app.\n */\nexport function UserInteractionModeProvider(\n props: UserInteractionModeProviderProps\n): ReactElement {\n const { children } = props;\n const { __root } = useContext(context);\n if (__root) {\n throw new Error(\n \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n );\n }\n\n const [mode, setMode] = useState<UserInteractionMode>(\"mouse\");\n const lastTouchTime = useRef(0);\n const isTouchContextMenu = useRef(false);\n\n /**\n * This effect helps determine the current interaction mode by attaching the\n * required event listeners to the window. The `mode` will always be defaulted\n * to `mouse` at first since it has the least possibilities of causing errors\n * with styles since the mouse-only styles are normally just `:hover` effects.\n *\n * ## Switching between modes:\n *\n * ### While in `mouse` mode:\n *\n * - any `keydown` event will switch to `keyboard` mode\n * - this does have the side effect of meta keys also causing the switch over,\n * but it feels fine since it helps show the current focus in the document\n * as well\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `keyboard` mode:\n *\n * - any `mousedown` event will switch to `mouse` mode\n * - it is perfectly okay to move the mouse while in keyboard mode, but still\n * want to keep the keyboard styles until the user actually starts clicking\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `touch` mode:\n *\n * - any `mousemove` event will switch to `mouse` mode, but **only** if there\n * hasn't been a `contextmenu` event within the last `1.2s`\n * - you can really only switch back to `mouse` mode if you are using the\n * devtools to emulate devices OR using a touch-desktop. I don't know how\n * common this really is though.\n * - touching the screen will always fire a `mousemove` event (which is why\n * the `:hover` styles are normally with `rmd-utils-mouse-only`) and even\n * after the `contextmenu` event. Normally want to go back to `mouse` mode\n * when the mouse re-enters the `window`\n *\n * Note: It's currently impossible to switch from `touch` to `keyboard`\n * immediately. You'd first need to switch to `mouse` and then to `keyboard`. I\n * don't really know of any use-cases other than the weird touch-desktop stuff\n * and I have no experience using them.\n */\n useEffect(() => {\n const enableMouseMode = (): void => {\n setMode(\"mouse\");\n };\n const enableKeyboardMode = (): void => {\n setMode(\"keyboard\");\n };\n\n const handleTouchStart = (): void => {\n lastTouchTime.current = Date.now();\n isTouchContextMenu.current = false;\n setMode(\"touch\");\n };\n\n const handleMouseMove = (): void => {\n if (\n isTouchContextMenu.current ||\n Date.now() - lastTouchTime.current < TOUCH_TIMEOUT\n ) {\n isTouchContextMenu.current = false;\n return;\n }\n\n enableMouseMode();\n };\n const handleContextMenu = (): void => {\n isTouchContextMenu.current = true;\n };\n\n const className = `rmd-${mode}-mode`;\n document.body.classList.add(className);\n window.addEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.addEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.addEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.addEventListener(\"mousemove\", handleMouseMove, true);\n window.addEventListener(\"contextmenu\", handleContextMenu, true);\n }\n\n return () => {\n document.body.classList.remove(className);\n window.removeEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.removeEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.removeEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.removeEventListener(\"mousemove\", handleMouseMove, true);\n window.removeEventListener(\"contextmenu\", handleContextMenu, true);\n }\n };\n }, [mode]);\n\n const value = useMemo<UserInteractionModeContext>(\n () => ({\n mode,\n __root: true,\n }),\n [mode]\n );\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useMemo","useRef","useState","context","__root","mode","displayName","Provider","useUserInteractionMode","TOUCH_TIMEOUT","UserInteractionModeProvider","props","children","Error","setMode","lastTouchTime","isTouchContextMenu","enableMouseMode","enableKeyboardMode","handleTouchStart","current","Date","now","handleMouseMove","handleContextMenu","className","document","body","classList","add","window","addEventListener","remove","removeEventListener","value"],"mappings":"AAAA;;AAEA,SAGEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAiBf,MAAMC,wBAAUN,cAA0C;IACxDO,QAAQ;IACRC,MAAM;AACR;AACAF,QAAQG,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGJ;AAErB;;CAEC,GACD,OAAO,SAASK;IACd,OAAOV,WAAWK,SAASE,IAAI;AACjC;AAEA,cAAc,GACd,MAAMI,gBAAgB;AAMtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,SAASC,4BACdC,KAAuC;IAEvC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAM,EAAEP,MAAM,EAAE,GAAGN,WAAWK;IAC9B,IAAIC,QAAQ;QACV,MAAM,IAAIS,MACR;IAEJ;IAEA,MAAM,CAACR,MAAMS,QAAQ,GAAGZ,SAA8B;IACtD,MAAMa,gBAAgBd,OAAO;IAC7B,MAAMe,qBAAqBf,OAAO;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCC,GACDF,UAAU;QACR,MAAMkB,kBAAkB;YACtBH,QAAQ;QACV;QACA,MAAMI,qBAAqB;YACzBJ,QAAQ;QACV;QAEA,MAAMK,mBAAmB;YACvBJ,cAAcK,OAAO,GAAGC,KAAKC,GAAG;YAChCN,mBAAmBI,OAAO,GAAG;YAC7BN,QAAQ;QACV;QAEA,MAAMS,kBAAkB;YACtB,IACEP,mBAAmBI,OAAO,IAC1BC,KAAKC,GAAG,KAAKP,cAAcK,OAAO,GAAGX,eACrC;gBACAO,mBAAmBI,OAAO,GAAG;gBAC7B;YACF;YAEAH;QACF;QACA,MAAMO,oBAAoB;YACxBR,mBAAmBI,OAAO,GAAG;QAC/B;QAEA,MAAMK,YAAY,CAAC,IAAI,EAAEpB,KAAK,KAAK,CAAC;QACpCqB,SAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAACJ;QAC5BK,OAAOC,gBAAgB,CAAC,cAAcZ,kBAAkB;QACxD,IAAId,SAAS,SAAS;YACpByB,OAAOC,gBAAgB,CAAC,WAAWb,oBAAoB;QACzD,OAAO,IAAIb,SAAS,YAAY;YAC9ByB,OAAOC,gBAAgB,CAAC,aAAad,iBAAiB;QACxD,OAAO;YACLa,OAAOC,gBAAgB,CAAC,aAAaR,iBAAiB;YACtDO,OAAOC,gBAAgB,CAAC,eAAeP,mBAAmB;QAC5D;QAEA,OAAO;YACLE,SAASC,IAAI,CAACC,SAAS,CAACI,MAAM,CAACP;YAC/BK,OAAOG,mBAAmB,CAAC,cAAcd,kBAAkB;YAC3D,IAAId,SAAS,SAAS;gBACpByB,OAAOG,mBAAmB,CAAC,WAAWf,oBAAoB;YAC5D,OAAO,IAAIb,SAAS,YAAY;gBAC9ByB,OAAOG,mBAAmB,CAAC,aAAahB,iBAAiB;YAC3D,OAAO;gBACLa,OAAOG,mBAAmB,CAAC,aAAaV,iBAAiB;gBACzDO,OAAOG,mBAAmB,CAAC,eAAeT,mBAAmB;YAC/D;QACF;IACF,GAAG;QAACnB;KAAK;IAET,MAAM6B,QAAQlC,QACZ,IAAO,CAAA;YACLK;YACAD,QAAQ;QACV,CAAA,GACA;QAACC;KAAK;IAER,qBAAO,KAACE;QAAS2B,OAAOA;kBAAQtB;;AAClC"}
@@ -324,8 +324,8 @@ $variables: (
324
324
  }
325
325
 
326
326
  transition-duration: transition.$linear-duration;
327
- transition-property: background-color,
328
- if($focus-box-shadow, box-shadow, outline-color);
327
+ transition-property:
328
+ background-color, if($focus-box-shadow, box-shadow, outline-color);
329
329
  transition-timing-function: transition.$linear-timing-function;
330
330
  }
331
331
 
@@ -1,5 +1,5 @@
1
- import type { ReactElement } from "react";
2
- import type { ElementInteractionHandlers, ElementInteractionMode } from "./types.js";
1
+ import { type ReactElement } from "react";
2
+ import { type ElementInteractionHandlers, type ElementInteractionMode } from "./types.js";
3
3
  declare module "react" {
4
4
  interface CSSProperties {
5
5
  "--rmd-surface-inset"?: string | number;
@@ -25,7 +25,7 @@ export interface ElementInteractionOptions<E extends HTMLElement> extends Partia
25
25
  disabled?: boolean;
26
26
  }
27
27
  /** @since 6.0.0 */
28
- export interface ElementInteractionHookReturnValue<E extends HTMLElement> {
28
+ export interface ElementInteractionImplementation<E extends HTMLElement> {
29
29
  /**
30
30
  * The event handlers required for element interaction.
31
31
  */
@@ -53,9 +53,9 @@ export interface ElementInteractionHookReturnValue<E extends HTMLElement> {
53
53
  *
54
54
  * @example Providing Element Interaction
55
55
  * ```tsx
56
- * import { useElementInteraction } from "@react-md/core";
56
+ * import { useElementInteraction } from "@react-md/core/interaction/useElementInteraction";
57
57
  * import { cnb } from "cnbuilder";
58
- * import type { ReactElement } from "react";
58
+ * import { type ReactElement } from "react";
59
59
  *
60
60
  * import styles from "./CustomComponent.module.scss";
61
61
  *
@@ -77,26 +77,25 @@ export interface ElementInteractionHookReturnValue<E extends HTMLElement> {
77
77
  * onTouchStart,
78
78
  * onTouchMove,
79
79
  * onTouchEnd,
80
- * ...remaining,
80
+ * ...remaining
81
81
  * } = props;
82
82
  *
83
- * const { handlers, pressed, ripples } =
84
- * useElementInteraction({
85
- * disabled,
86
- * // pass remaining props so that if any event handlers were provided to
87
- * // the component, they will be merged with the element interaction
88
- * // handlers
89
- * onBlur,
90
- * onClick,
91
- * onKeyDown,
92
- * onKeyUp,
93
- * onMouseDown,
94
- * onMouseUp,
95
- * onMouseLeave,
96
- * onTouchStart,
97
- * onTouchMove,
98
- * onTouchEnd,
99
- * })
83
+ * const { handlers, pressed, ripples } = useElementInteraction({
84
+ * disabled,
85
+ * // pass remaining props so that if any event handlers were provided to
86
+ * // the component, they will be merged with the element interaction
87
+ * // handlers
88
+ * onBlur,
89
+ * onClick,
90
+ * onKeyDown,
91
+ * onKeyUp,
92
+ * onMouseDown,
93
+ * onMouseUp,
94
+ * onMouseLeave,
95
+ * onTouchStart,
96
+ * onTouchMove,
97
+ * onTouchEnd,
98
+ * });
100
99
  *
101
100
  * return (
102
101
  * <div
@@ -116,9 +115,9 @@ export interface ElementInteractionHookReturnValue<E extends HTMLElement> {
116
115
  *
117
116
  * @param options - An object of {@link ElementInteractionOptions} that is used
118
117
  * to merge event handlers or disable the interactions.
119
- * @returns the {@link ElementInteractionHookReturnValue}
118
+ * @returns the {@link ElementInteractionImplementation}
120
119
  * @since 6.0.0 Touch interactions were removed since it never looked
121
120
  * good if the user touched a clickable element right before scrolling. The
122
121
  * ripple effect will only be fired on click now for touch devices.
123
122
  */
124
- export declare function useElementInteraction<E extends HTMLElement>(options?: ElementInteractionOptions<E>): ElementInteractionHookReturnValue<E>;
123
+ export declare function useElementInteraction<E extends HTMLElement>(options?: ElementInteractionOptions<E>): ElementInteractionImplementation<E>;
@@ -15,9 +15,9 @@ const noop = ()=>{
15
15
  *
16
16
  * @example Providing Element Interaction
17
17
  * ```tsx
18
- * import { useElementInteraction } from "@react-md/core";
18
+ * import { useElementInteraction } from "@react-md/core/interaction/useElementInteraction";
19
19
  * import { cnb } from "cnbuilder";
20
- * import type { ReactElement } from "react";
20
+ * import { type ReactElement } from "react";
21
21
  *
22
22
  * import styles from "./CustomComponent.module.scss";
23
23
  *
@@ -39,26 +39,25 @@ const noop = ()=>{
39
39
  * onTouchStart,
40
40
  * onTouchMove,
41
41
  * onTouchEnd,
42
- * ...remaining,
42
+ * ...remaining
43
43
  * } = props;
44
44
  *
45
- * const { handlers, pressed, ripples } =
46
- * useElementInteraction({
47
- * disabled,
48
- * // pass remaining props so that if any event handlers were provided to
49
- * // the component, they will be merged with the element interaction
50
- * // handlers
51
- * onBlur,
52
- * onClick,
53
- * onKeyDown,
54
- * onKeyUp,
55
- * onMouseDown,
56
- * onMouseUp,
57
- * onMouseLeave,
58
- * onTouchStart,
59
- * onTouchMove,
60
- * onTouchEnd,
61
- * })
45
+ * const { handlers, pressed, ripples } = useElementInteraction({
46
+ * disabled,
47
+ * // pass remaining props so that if any event handlers were provided to
48
+ * // the component, they will be merged with the element interaction
49
+ * // handlers
50
+ * onBlur,
51
+ * onClick,
52
+ * onKeyDown,
53
+ * onKeyUp,
54
+ * onMouseDown,
55
+ * onMouseUp,
56
+ * onMouseLeave,
57
+ * onTouchStart,
58
+ * onTouchMove,
59
+ * onTouchEnd,
60
+ * });
62
61
  *
63
62
  * return (
64
63
  * <div
@@ -78,7 +77,7 @@ const noop = ()=>{
78
77
  *
79
78
  * @param options - An object of {@link ElementInteractionOptions} that is used
80
79
  * to merge event handlers or disable the interactions.
81
- * @returns the {@link ElementInteractionHookReturnValue}
80
+ * @returns the {@link ElementInteractionImplementation}
82
81
  * @since 6.0.0 Touch interactions were removed since it never looked
83
82
  * good if the user touched a clickable element right before scrolling. The
84
83
  * ripple effect will only be fired on click now for touch devices.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\nimport type {\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactElement,\n TouchEvent,\n} from \"react\";\nimport { useCallback, useReducer, useRef } from \"react\";\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport type {\n ElementInteractionHandlers,\n ElementInteractionMode,\n ElementInteractionState,\n RippleState,\n RippleStyle,\n} from \"./types.js\";\nimport { getRippleStyle, releaseRipple, updateRipplesState } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-surface-inset\"?: string | number;\n \"--rmd-surface-border-radius\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport const PRESSED_CLASS_NAME = \"rmd-pressed\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionOptions<E extends HTMLElement>\n extends Partial<ElementInteractionHandlers<E>> {\n /**\n * This can be used to override the {@link INTERACTION_CONFIG.mode}\n *\n * @defaultValue `INTERACTION_CONFIG.mode`\n */\n mode?: ElementInteractionMode;\n\n /**\n * Boolean if the element is currently disabled which will prevent any of the\n * element interaction states from happening.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface ElementInteractionHookReturnValue<E extends HTMLElement> {\n /**\n * The event handlers required for element interaction.\n */\n handlers: Readonly<ElementInteractionHandlers<E>>;\n\n /**\n * Boolean if the element is currently pressed. This will always be `false` if\n * the {@link ElementInteractionMode} is set to `\"none\"`\n */\n pressed: boolean;\n\n /**\n * This will be set to {@link PRESSED_CLASS_NAME} only when {@link pressed} is\n * `true` and the {@link ElementInteractionMode} is set to `\"press\"`. It will\n * be `undefined` otherwise.\n */\n pressedClassName: string | undefined;\n\n /**\n * The ripple click/touch interaction. This will be `undefined` when the {@link ElementInteractionMode}\n * is set to `\"none\"` or `\"press\"`.\n */\n ripples?: ReactElement;\n}\n\ntype ElementInteractionAction =\n | { type: \"press\"; style?: RippleStyle; programmatic?: boolean }\n | { type: \"release\" | \"cancel\" }\n | { type: \"entered\" | \"exited\"; ripple: RippleState };\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This hook is used to apply the required element interaction based on the\n * {@link ElementInteractionMode} and should generally be used internally only.\n *\n * @example Providing Element Interaction\n * ```tsx\n * import { useElementInteraction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement } from \"react\";\n *\n * import styles from \"./CustomComponent.module.scss\";\n *\n * interface Props extends HTMLAttributes<HTMLDivElement> {\n * disabled?: boolean;\n * }\n *\n * function CustomComponent(props: Props): ReactElement {\n * const {\n * disabled = false,\n * className,\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * ...remaining,\n * } = props;\n *\n * const { handlers, pressed, ripples } =\n * useElementInteraction({\n * disabled,\n * // pass remaining props so that if any event handlers were provided to\n * // the component, they will be merged with the element interaction\n * // handlers\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * })\n *\n * return (\n * <div\n * {...remaining}\n * {...handlers}\n * aria-disabled={disabled}\n * role=\"button\"\n * className={cnb(styles.button, pressed && styles.pressed)}\n * tabIndex={disabled ? undefined : 0}\n * >\n * {children}\n * {ripples}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - An object of {@link ElementInteractionOptions} that is used\n * to merge event handlers or disable the interactions.\n * @returns the {@link ElementInteractionHookReturnValue}\n * @since 6.0.0 Touch interactions were removed since it never looked\n * good if the user touched a clickable element right before scrolling. The\n * ripple effect will only be fired on click now for touch devices.\n */\nexport function useElementInteraction<E extends HTMLElement>(\n options: ElementInteractionOptions<E> = {}\n): ElementInteractionHookReturnValue<E> {\n const {\n onBlur = noop,\n onClick = noop,\n onMouseDown = noop,\n onMouseUp = noop,\n onMouseLeave = noop,\n onKeyUp = noop,\n onKeyDown = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onTouchMove = noop,\n onDragStart = noop,\n mode = INTERACTION_CONFIG.mode,\n disabled = false,\n } = options;\n\n const holding = useRef(false);\n const disableClick = useRef(false);\n const userMode = useUserInteractionMode();\n const isInteractionDisabled = disabled || mode === \"none\";\n const [state, dispatch] = useReducer(\n function reducer(\n state: ElementInteractionState,\n action: ElementInteractionAction\n ): ElementInteractionState {\n switch (action.type) {\n case \"press\": {\n const { style } = action;\n let { ripples } = state;\n if (style) {\n ripples = [\n ...ripples,\n {\n style,\n entered: false,\n exiting: false,\n startTime: Date.now(),\n },\n ];\n }\n\n return {\n pressed: true,\n ripples,\n };\n }\n case \"cancel\":\n // Note: unlike previous react-md versions, this will immediately\n // remove ALL ripple effects instead of trying to fade out. this seems\n // much nicer for touch devices when they are trying to scroll\n return {\n pressed: false,\n ripples: [],\n };\n case \"release\": {\n if (mode === \"press\") {\n return { ...state, pressed: false };\n }\n\n return releaseRipple(state);\n }\n case \"entered\":\n return updateRipplesState({\n type: \"entered\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n case \"exited\":\n return updateRipplesState({\n type: \"exited\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n\n default:\n return state;\n }\n },\n { pressed: false, ripples: [] }\n );\n const { pressed } = state;\n\n let ripples: ReactElement | undefined;\n if (mode == \"ripple\") {\n ripples = (\n <RippleContainer\n ripples={state.ripples}\n onEntered={(ripple) => {\n dispatch({ type: \"entered\", ripple });\n }}\n onExited={(ripple) => {\n dispatch({ type: \"exited\", ripple });\n }}\n />\n );\n }\n\n return {\n pressed,\n pressedClassName:\n pressed && mode === \"press\" ? PRESSED_CLASS_NAME : undefined,\n ripples,\n handlers: {\n onBlur: useCallback(\n (event: FocusEvent<E>) => {\n onBlur(event);\n if (holding.current) {\n holding.current = false;\n dispatch({ type: \"release\" });\n }\n },\n [onBlur]\n ),\n onClick: useCallback(\n (event: MouseEvent<E>) => {\n if (disabled) {\n return;\n }\n\n onClick(event);\n if (\n event.isPropagationStopped() ||\n userMode === \"touch\" ||\n mode !== \"ripple\" ||\n disableClick.current ||\n holding.current ||\n document.activeElement === event.currentTarget\n ) {\n disableClick.current = false;\n return;\n }\n\n dispatch({\n type: \"press\",\n style: getRippleStyle(event, true),\n });\n },\n [disabled, mode, onClick, userMode]\n ),\n onMouseDown: useCallback(\n (event: MouseEvent<E>) => {\n onMouseDown(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n event.shiftKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.button !== 0\n ) {\n return;\n }\n\n // prevent text selection on double click\n // https://stackoverflow.com/a/43321596\n if (event.detail > 1) {\n event.preventDefault();\n }\n\n holding.current = true;\n disableClick.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [onMouseDown, isInteractionDisabled, userMode, mode]\n ),\n onMouseUp: useCallback(\n (event: MouseEvent<E>) => {\n onMouseUp(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onMouseUp]\n ),\n onMouseLeave: useCallback(\n (event: MouseEvent<E>) => {\n onMouseLeave(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onMouseLeave, userMode]\n ),\n onDragStart(event) {\n onDragStart(event);\n if (\n event.isPropagationStopped() ||\n !holding.current ||\n userMode !== \"mouse\"\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n onKeyDown: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyDown(event);\n const { key } = event;\n const { tagName } = event.currentTarget;\n\n if (\n event.isPropagationStopped() ||\n userMode !== \"keyboard\" ||\n disabled ||\n (key !== \" \" && key !== \"Enter\") ||\n // links do not support clicking on space\n (key === \" \" && tagName === \"A\") ||\n // inputs submit a form instead of clicking on enter\n (key === \"Enter\" && tagName === \"INPUT\")\n ) {\n return;\n }\n\n // stop propagation since we're starting to do custom event behavior\n // to click the element for everything except elements that the\n // browser clicks natively\n event.stopPropagation();\n\n if (tagName !== \"BUTTON\" && tagName !== \"A\") {\n if (key === \" \") {\n // prevent the pager from scrolling\n event.preventDefault();\n }\n\n event.currentTarget.click();\n }\n\n if (holding.current || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n dispatch({ type: \"press\", style: getRippleStyle(event, false) });\n },\n [disabled, isInteractionDisabled, onKeyDown, userMode]\n ),\n onKeyUp: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyUp(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"keyboard\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onKeyUp, userMode]\n ),\n onTouchStart: useCallback(\n (event: TouchEvent<E>) => {\n onTouchStart(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [mode, isInteractionDisabled, onTouchStart]\n ),\n onTouchEnd: useCallback(\n (event: TouchEvent<E>) => {\n onTouchEnd(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onTouchEnd]\n ),\n onTouchMove: useCallback(\n (event: TouchEvent<E>) => {\n onTouchMove(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onTouchMove]\n ),\n },\n };\n}\n"],"names":["useCallback","useReducer","useRef","RippleContainer","useUserInteractionMode","INTERACTION_CONFIG","getRippleStyle","releaseRipple","updateRipplesState","PRESSED_CLASS_NAME","noop","useElementInteraction","options","onBlur","onClick","onMouseDown","onMouseUp","onMouseLeave","onKeyUp","onKeyDown","onTouchStart","onTouchEnd","onTouchMove","onDragStart","mode","disabled","holding","disableClick","userMode","isInteractionDisabled","state","dispatch","reducer","action","type","style","ripples","entered","exiting","startTime","Date","now","pressed","ripple","current","onEntered","onExited","pressedClassName","undefined","handlers","event","isPropagationStopped","document","activeElement","currentTarget","shiftKey","ctrlKey","metaKey","altKey","button","detail","preventDefault","key","tagName","stopPropagation","click"],"mappings":"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"}
1
+ {"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type TouchEvent,\n useCallback,\n useReducer,\n useRef,\n} from \"react\";\n\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport {\n type ElementInteractionHandlers,\n type ElementInteractionMode,\n type ElementInteractionState,\n type RippleState,\n type RippleStyle,\n} from \"./types.js\";\nimport { getRippleStyle, releaseRipple, updateRipplesState } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-surface-inset\"?: string | number;\n \"--rmd-surface-border-radius\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport const PRESSED_CLASS_NAME = \"rmd-pressed\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionOptions<E extends HTMLElement>\n extends Partial<ElementInteractionHandlers<E>> {\n /**\n * This can be used to override the {@link INTERACTION_CONFIG.mode}\n *\n * @defaultValue `INTERACTION_CONFIG.mode`\n */\n mode?: ElementInteractionMode;\n\n /**\n * Boolean if the element is currently disabled which will prevent any of the\n * element interaction states from happening.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface ElementInteractionImplementation<E extends HTMLElement> {\n /**\n * The event handlers required for element interaction.\n */\n handlers: Readonly<ElementInteractionHandlers<E>>;\n\n /**\n * Boolean if the element is currently pressed. This will always be `false` if\n * the {@link ElementInteractionMode} is set to `\"none\"`\n */\n pressed: boolean;\n\n /**\n * This will be set to {@link PRESSED_CLASS_NAME} only when {@link pressed} is\n * `true` and the {@link ElementInteractionMode} is set to `\"press\"`. It will\n * be `undefined` otherwise.\n */\n pressedClassName: string | undefined;\n\n /**\n * The ripple click/touch interaction. This will be `undefined` when the {@link ElementInteractionMode}\n * is set to `\"none\"` or `\"press\"`.\n */\n ripples?: ReactElement;\n}\n\ntype ElementInteractionAction =\n | { type: \"press\"; style?: RippleStyle; programmatic?: boolean }\n | { type: \"release\" | \"cancel\" }\n | { type: \"entered\" | \"exited\"; ripple: RippleState };\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This hook is used to apply the required element interaction based on the\n * {@link ElementInteractionMode} and should generally be used internally only.\n *\n * @example Providing Element Interaction\n * ```tsx\n * import { useElementInteraction } from \"@react-md/core/interaction/useElementInteraction\";\n * import { cnb } from \"cnbuilder\";\n * import { type ReactElement } from \"react\";\n *\n * import styles from \"./CustomComponent.module.scss\";\n *\n * interface Props extends HTMLAttributes<HTMLDivElement> {\n * disabled?: boolean;\n * }\n *\n * function CustomComponent(props: Props): ReactElement {\n * const {\n * disabled = false,\n * className,\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * ...remaining\n * } = props;\n *\n * const { handlers, pressed, ripples } = useElementInteraction({\n * disabled,\n * // pass remaining props so that if any event handlers were provided to\n * // the component, they will be merged with the element interaction\n * // handlers\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * });\n *\n * return (\n * <div\n * {...remaining}\n * {...handlers}\n * aria-disabled={disabled}\n * role=\"button\"\n * className={cnb(styles.button, pressed && styles.pressed)}\n * tabIndex={disabled ? undefined : 0}\n * >\n * {children}\n * {ripples}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - An object of {@link ElementInteractionOptions} that is used\n * to merge event handlers or disable the interactions.\n * @returns the {@link ElementInteractionImplementation}\n * @since 6.0.0 Touch interactions were removed since it never looked\n * good if the user touched a clickable element right before scrolling. The\n * ripple effect will only be fired on click now for touch devices.\n */\nexport function useElementInteraction<E extends HTMLElement>(\n options: ElementInteractionOptions<E> = {}\n): ElementInteractionImplementation<E> {\n const {\n onBlur = noop,\n onClick = noop,\n onMouseDown = noop,\n onMouseUp = noop,\n onMouseLeave = noop,\n onKeyUp = noop,\n onKeyDown = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onTouchMove = noop,\n onDragStart = noop,\n mode = INTERACTION_CONFIG.mode,\n disabled = false,\n } = options;\n\n const holding = useRef(false);\n const disableClick = useRef(false);\n const userMode = useUserInteractionMode();\n const isInteractionDisabled = disabled || mode === \"none\";\n const [state, dispatch] = useReducer(\n function reducer(\n state: ElementInteractionState,\n action: ElementInteractionAction\n ): ElementInteractionState {\n switch (action.type) {\n case \"press\": {\n const { style } = action;\n let { ripples } = state;\n if (style) {\n ripples = [\n ...ripples,\n {\n style,\n entered: false,\n exiting: false,\n startTime: Date.now(),\n },\n ];\n }\n\n return {\n pressed: true,\n ripples,\n };\n }\n case \"cancel\":\n // Note: unlike previous react-md versions, this will immediately\n // remove ALL ripple effects instead of trying to fade out. this seems\n // much nicer for touch devices when they are trying to scroll\n return {\n pressed: false,\n ripples: [],\n };\n case \"release\": {\n if (mode === \"press\") {\n return { ...state, pressed: false };\n }\n\n return releaseRipple(state);\n }\n case \"entered\":\n return updateRipplesState({\n type: \"entered\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n case \"exited\":\n return updateRipplesState({\n type: \"exited\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n\n default:\n return state;\n }\n },\n { pressed: false, ripples: [] }\n );\n const { pressed } = state;\n\n let ripples: ReactElement | undefined;\n if (mode == \"ripple\") {\n ripples = (\n <RippleContainer\n ripples={state.ripples}\n onEntered={(ripple) => {\n dispatch({ type: \"entered\", ripple });\n }}\n onExited={(ripple) => {\n dispatch({ type: \"exited\", ripple });\n }}\n />\n );\n }\n\n return {\n pressed,\n pressedClassName:\n pressed && mode === \"press\" ? PRESSED_CLASS_NAME : undefined,\n ripples,\n handlers: {\n onBlur: useCallback(\n (event: FocusEvent<E>) => {\n onBlur(event);\n if (holding.current) {\n holding.current = false;\n dispatch({ type: \"release\" });\n }\n },\n [onBlur]\n ),\n onClick: useCallback(\n (event: MouseEvent<E>) => {\n if (disabled) {\n return;\n }\n\n onClick(event);\n if (\n event.isPropagationStopped() ||\n userMode === \"touch\" ||\n mode !== \"ripple\" ||\n disableClick.current ||\n holding.current ||\n document.activeElement === event.currentTarget\n ) {\n disableClick.current = false;\n return;\n }\n\n dispatch({\n type: \"press\",\n style: getRippleStyle(event, true),\n });\n },\n [disabled, mode, onClick, userMode]\n ),\n onMouseDown: useCallback(\n (event: MouseEvent<E>) => {\n onMouseDown(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n event.shiftKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.button !== 0\n ) {\n return;\n }\n\n // prevent text selection on double click\n // https://stackoverflow.com/a/43321596\n if (event.detail > 1) {\n event.preventDefault();\n }\n\n holding.current = true;\n disableClick.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [onMouseDown, isInteractionDisabled, userMode, mode]\n ),\n onMouseUp: useCallback(\n (event: MouseEvent<E>) => {\n onMouseUp(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onMouseUp]\n ),\n onMouseLeave: useCallback(\n (event: MouseEvent<E>) => {\n onMouseLeave(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onMouseLeave, userMode]\n ),\n onDragStart(event) {\n onDragStart(event);\n if (\n event.isPropagationStopped() ||\n !holding.current ||\n userMode !== \"mouse\"\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n onKeyDown: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyDown(event);\n const { key } = event;\n const { tagName } = event.currentTarget;\n\n if (\n event.isPropagationStopped() ||\n userMode !== \"keyboard\" ||\n disabled ||\n (key !== \" \" && key !== \"Enter\") ||\n // links do not support clicking on space\n (key === \" \" && tagName === \"A\") ||\n // inputs submit a form instead of clicking on enter\n (key === \"Enter\" && tagName === \"INPUT\")\n ) {\n return;\n }\n\n // stop propagation since we're starting to do custom event behavior\n // to click the element for everything except elements that the\n // browser clicks natively\n event.stopPropagation();\n\n if (tagName !== \"BUTTON\" && tagName !== \"A\") {\n if (key === \" \") {\n // prevent the pager from scrolling\n event.preventDefault();\n }\n\n event.currentTarget.click();\n }\n\n if (holding.current || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n dispatch({ type: \"press\", style: getRippleStyle(event, false) });\n },\n [disabled, isInteractionDisabled, onKeyDown, userMode]\n ),\n onKeyUp: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyUp(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"keyboard\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onKeyUp, userMode]\n ),\n onTouchStart: useCallback(\n (event: TouchEvent<E>) => {\n onTouchStart(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [mode, isInteractionDisabled, onTouchStart]\n ),\n onTouchEnd: useCallback(\n (event: TouchEvent<E>) => {\n onTouchEnd(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onTouchEnd]\n ),\n onTouchMove: useCallback(\n (event: TouchEvent<E>) => {\n onTouchMove(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onTouchMove]\n ),\n },\n };\n}\n"],"names":["useCallback","useReducer","useRef","RippleContainer","useUserInteractionMode","INTERACTION_CONFIG","getRippleStyle","releaseRipple","updateRipplesState","PRESSED_CLASS_NAME","noop","useElementInteraction","options","onBlur","onClick","onMouseDown","onMouseUp","onMouseLeave","onKeyUp","onKeyDown","onTouchStart","onTouchEnd","onTouchMove","onDragStart","mode","disabled","holding","disableClick","userMode","isInteractionDisabled","state","dispatch","reducer","action","type","style","ripples","entered","exiting","startTime","Date","now","pressed","ripple","current","onEntered","onExited","pressedClassName","undefined","handlers","event","isPropagationStopped","document","activeElement","currentTarget","shiftKey","ctrlKey","metaKey","altKey","button","detail","preventDefault","key","tagName","stopPropagation","click"],"mappings":"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"}
@@ -12,11 +12,13 @@ import { type ReactNode } from "react";
12
12
  *
13
13
  * @example Simple Example
14
14
  * ```tsx
15
+ * import { useElementInteraction } from "@react-md/core/interaction/useElementInteraction";
16
+ * import { useHigherContrastChildren, } from "@react-md/core/interaction/useHigherContrastChildren";
15
17
  * import {
16
- * useElementInteraction,
17
- * useHigherContrastChildren,
18
- * } from "@react-md/core";
19
- * import type { ButtonHTMLAttributes, ReactElement, ReactNode } from "react";
18
+ * type ButtonHTMLAttributes,
19
+ * type ReactElement,
20
+ * type ReactNode,
21
+ * } from "react";
20
22
  *
21
23
  * function Example(props: ButtonHTMLAttributes<HTMLButtonElement>): ReactElement {
22
24
  * const {
@@ -58,7 +60,7 @@ import { type ReactNode } from "react";
58
60
  * }
59
61
  * ```
60
62
  *
61
- * @param propChildren - The children to conditionally wrap in spans.
63
+ * @param children - The children to conditionally wrap in spans.
62
64
  * @param disable - Manually disable this functionality even if the higher
63
65
  * contrast mode is enabled. This is really used within `ListItem`s so there
64
66
  * aren't unneeded `<span>`s for string/number children when there are addons.
@@ -66,4 +68,4 @@ import { type ReactNode } from "react";
66
68
  * @since 6.0.0
67
69
  * @internal
68
70
  */
69
- export declare function useHigherContrastChildren(propChildren: ReactNode, disable?: boolean): ReactNode;
71
+ export declare function useHigherContrastChildren(children: ReactNode, disable?: boolean): ReactNode;
@@ -14,11 +14,13 @@ import { INTERACTION_CONFIG } from "./config.js";
14
14
  *
15
15
  * @example Simple Example
16
16
  * ```tsx
17
+ * import { useElementInteraction } from "@react-md/core/interaction/useElementInteraction";
18
+ * import { useHigherContrastChildren, } from "@react-md/core/interaction/useHigherContrastChildren";
17
19
  * import {
18
- * useElementInteraction,
19
- * useHigherContrastChildren,
20
- * } from "@react-md/core";
21
- * import type { ButtonHTMLAttributes, ReactElement, ReactNode } from "react";
20
+ * type ButtonHTMLAttributes,
21
+ * type ReactElement,
22
+ * type ReactNode,
23
+ * } from "react";
22
24
  *
23
25
  * function Example(props: ButtonHTMLAttributes<HTMLButtonElement>): ReactElement {
24
26
  * const {
@@ -60,20 +62,20 @@ import { INTERACTION_CONFIG } from "./config.js";
60
62
  * }
61
63
  * ```
62
64
  *
63
- * @param propChildren - The children to conditionally wrap in spans.
65
+ * @param children - The children to conditionally wrap in spans.
64
66
  * @param disable - Manually disable this functionality even if the higher
65
67
  * contrast mode is enabled. This is really used within `ListItem`s so there
66
68
  * aren't unneeded `<span>`s for string/number children when there are addons.
67
69
  * @returns the children to render
68
70
  * @since 6.0.0
69
71
  * @internal
70
- */ export function useHigherContrastChildren(propChildren, disable = false) {
72
+ */ export function useHigherContrastChildren(children, disable = false) {
71
73
  if (!INTERACTION_CONFIG.higherContrast || disable) {
72
- return propChildren;
74
+ return children;
73
75
  }
74
76
  // Note: This will fail if the child is wrapped in a Fragment, but that use
75
77
  // case doesn't matter to me
76
- return Children.map(propChildren, (child)=>{
78
+ return Children.map(children, (child)=>{
77
79
  const t = typeof child;
78
80
  if (t === "string" || t === "number") {
79
81
  return /*#__PURE__*/ _jsx("span", {