@react-md/core 1.0.0-next.3 → 1.0.0-next.4

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 (1134) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +3 -3
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/CHANGELOG.md +6 -0
  5. package/coverage/clover.xml +529 -437
  6. package/coverage/coverage-final.json +3 -3
  7. package/coverage/lcov-report/ListItem.tsx.html +2 -2
  8. package/coverage/lcov-report/ListItemLink.tsx.html +616 -0
  9. package/coverage/lcov-report/getListItemHeight.ts.html +298 -0
  10. package/coverage/lcov-report/index.html +38 -23
  11. package/coverage/lcov.info +423 -317
  12. package/dist/_core.scss +1 -1
  13. package/dist/form/_form.scss +1 -1
  14. package/dist/list/getListItemHeight.d.ts +0 -1
  15. package/dist/list/types.d.ts +1 -1
  16. package/dist/menu/_menu.scss +0 -2
  17. package/dist/src/CoreProviders.js.map +1 -0
  18. package/dist/src/NoSsr.js.map +1 -0
  19. package/dist/src/SsrProvider.js.map +1 -0
  20. package/dist/src/app-bar/AppBar.js.map +1 -0
  21. package/dist/src/app-bar/AppBarTitle.js.map +1 -0
  22. package/dist/src/avatar/Avatar.js.map +1 -0
  23. package/dist/src/avatar/styles.js.map +1 -0
  24. package/dist/src/badge/Badge.js.map +1 -0
  25. package/dist/src/box/Box.js.map +1 -0
  26. package/dist/src/box/styles.js.map +1 -0
  27. package/dist/src/button/AsyncButton.js.map +1 -0
  28. package/dist/src/button/Button.js.map +1 -0
  29. package/dist/src/button/ButtonUnstyled.js.map +1 -0
  30. package/dist/src/button/FloatingActionButton.js.map +1 -0
  31. package/dist/src/button/TooltippedButton.js.map +1 -0
  32. package/dist/src/button/buttonStyles.js.map +1 -0
  33. package/dist/src/button/buttonUnstyledStyles.js.map +1 -0
  34. package/dist/src/card/Card.js.map +1 -0
  35. package/dist/src/card/CardContent.js.map +1 -0
  36. package/dist/src/card/CardFooter.js.map +1 -0
  37. package/dist/src/card/CardHeader.js.map +1 -0
  38. package/dist/src/card/CardSubtitle.js.map +1 -0
  39. package/dist/src/card/CardTitle.js.map +1 -0
  40. package/dist/src/card/ClickableCard.js.map +1 -0
  41. package/dist/src/card/styles.js.map +1 -0
  42. package/dist/src/chip/Chip.js.map +1 -0
  43. package/dist/src/chip/styles.js.map +1 -0
  44. package/dist/src/cssUtils.js.map +1 -0
  45. package/dist/src/delegateEvent.js.map +1 -0
  46. package/dist/src/dialog/Dialog.js.map +1 -0
  47. package/dist/src/dialog/DialogContainer.js.map +1 -0
  48. package/dist/src/dialog/DialogContent.js.map +1 -0
  49. package/dist/src/dialog/DialogFooter.js.map +1 -0
  50. package/dist/src/dialog/DialogHeader.js.map +1 -0
  51. package/dist/src/dialog/DialogTitle.js.map +1 -0
  52. package/dist/src/dialog/FixedDialog.js.map +1 -0
  53. package/dist/src/dialog/NestedDialogProvider.js.map +1 -0
  54. package/dist/src/dialog/styles.js.map +1 -0
  55. package/dist/src/divider/Divider.js.map +1 -0
  56. package/dist/src/divider/styles.js.map +1 -0
  57. package/dist/src/draggable/useDraggable.js.map +1 -0
  58. package/dist/src/draggable/utils.js.map +1 -0
  59. package/dist/src/expansion-panel/ExpansionList.js.map +1 -0
  60. package/dist/src/expansion-panel/ExpansionPanel.js.map +1 -0
  61. package/dist/src/expansion-panel/ExpansionPanelHeader.js.map +1 -0
  62. package/dist/src/expansion-panel/useExpansionList.js.map +1 -0
  63. package/dist/src/expansion-panel/useExpansionPanels.js.map +1 -0
  64. package/dist/src/focus/useFocusContainer.js.map +1 -0
  65. package/dist/src/focus/utils.js.map +1 -0
  66. package/dist/src/form/Checkbox.js.map +1 -0
  67. package/dist/src/form/Fieldset.js.map +1 -0
  68. package/dist/src/form/FileInput.js.map +1 -0
  69. package/dist/src/form/Form.js.map +1 -0
  70. package/dist/src/form/FormMessage.js.map +1 -0
  71. package/dist/src/form/FormMessageContainer.js.map +1 -0
  72. package/dist/src/form/FormMessageCounter.js.map +1 -0
  73. package/dist/src/form/InputToggle.js.map +1 -0
  74. package/dist/src/form/InputToggleIcon.js.map +1 -0
  75. package/dist/src/form/Label.js.map +1 -0
  76. package/dist/src/form/Legend.js.map +1 -0
  77. package/dist/src/form/MenuItemCheckbox.js.map +1 -0
  78. package/dist/src/form/MenuItemFileInput.js.map +1 -0
  79. package/dist/src/form/MenuItemInputToggle.js.map +1 -0
  80. package/dist/src/form/MenuItemRadio.js.map +1 -0
  81. package/dist/src/form/MenuItemSwitch.js.map +1 -0
  82. package/dist/src/form/MenuItemTextField.js.map +1 -0
  83. package/dist/src/form/NativeSelect.js.map +1 -0
  84. package/dist/src/form/OptGroup.js.map +1 -0
  85. package/dist/src/form/Option.js.map +1 -0
  86. package/dist/src/form/Password.js.map +1 -0
  87. package/dist/src/form/Radio.js.map +1 -0
  88. package/dist/src/form/Select.js.map +1 -0
  89. package/dist/src/form/SelectValue.js.map +1 -0
  90. package/dist/src/form/Slider.js.map +1 -0
  91. package/dist/src/form/SliderContainer.js.map +1 -0
  92. package/dist/src/form/SliderMark.js.map +1 -0
  93. package/dist/src/form/SliderMarkLabel.js.map +1 -0
  94. package/dist/src/form/SliderThumb.js.map +1 -0
  95. package/dist/src/form/SliderTrack.js.map +1 -0
  96. package/dist/src/form/SliderValueMarks.js.map +1 -0
  97. package/dist/src/form/SliderValueTooltip.js.map +1 -0
  98. package/dist/src/form/Switch.js.map +1 -0
  99. package/dist/src/form/SwitchTrack.js.map +1 -0
  100. package/dist/src/form/TextArea.js.map +1 -0
  101. package/dist/src/form/TextField.js.map +1 -0
  102. package/dist/src/form/TextFieldAddon.js.map +1 -0
  103. package/dist/src/form/TextFieldContainer.js.map +1 -0
  104. package/dist/src/form/TextFieldContainerStyles.js.map +1 -0
  105. package/dist/src/form/fileUtils.js.map +1 -0
  106. package/dist/src/form/formConfig.js.map +1 -0
  107. package/dist/src/form/formMessageStyles.js.map +1 -0
  108. package/dist/src/form/inputToggleStyles.js.map +1 -0
  109. package/dist/src/form/nativeSelectStyles.js.map +1 -0
  110. package/dist/src/form/optionStyles.js.map +1 -0
  111. package/dist/src/form/passwordStyles.js.map +1 -0
  112. package/dist/src/form/selectStyles.js.map +1 -0
  113. package/dist/src/form/selectUtils.js.map +1 -0
  114. package/dist/src/form/sliderUtils.js.map +1 -0
  115. package/dist/src/form/switchStyles.js.map +1 -0
  116. package/dist/src/form/textAreaStyles.js.map +1 -0
  117. package/dist/src/form/textFieldStyles.js.map +1 -0
  118. package/dist/src/form/types.js.map +1 -0
  119. package/dist/src/form/useCheckboxGroup.js.map +1 -0
  120. package/dist/src/form/useFileUpload.js.map +1 -0
  121. package/dist/src/form/useListboxProvider.js.map +1 -0
  122. package/dist/src/form/useNumberField.js.map +1 -0
  123. package/dist/src/form/useRadioGroup.js.map +1 -0
  124. package/dist/src/form/useRangeSlider.js.map +1 -0
  125. package/dist/src/form/useResizingTextArea.js.map +1 -0
  126. package/dist/src/form/useSlider.js.map +1 -0
  127. package/dist/src/form/useTextField.js.map +1 -0
  128. package/dist/src/form/utils.js.map +1 -0
  129. package/dist/src/form/validation.js.map +1 -0
  130. package/dist/src/hoverMode/useHoverMode.js.map +1 -0
  131. package/dist/src/hoverMode/useHoverModeProvider.js.map +1 -0
  132. package/dist/src/icon/FontIcon.js.map +1 -0
  133. package/dist/src/icon/IconRotator.js.map +1 -0
  134. package/dist/src/icon/MaterialIcon.js.map +1 -0
  135. package/dist/src/icon/MaterialSymbol.js.map +1 -0
  136. package/dist/src/icon/SVGIcon.js.map +1 -0
  137. package/dist/src/icon/TextIconSpacing.js.map +1 -0
  138. package/dist/src/icon/iconConfig.js.map +1 -0
  139. package/dist/src/icon/material.js.map +1 -0
  140. package/dist/src/icon/materialConfig.js.map +1 -0
  141. package/dist/src/icon/styles.js.map +1 -0
  142. package/dist/src/index.js.map +1 -0
  143. package/dist/src/interaction/Ripple.js.map +1 -0
  144. package/dist/src/interaction/RippleContainer.js.map +1 -0
  145. package/dist/src/interaction/UserInteractionModeProvider.js.map +1 -0
  146. package/dist/src/interaction/config.js.map +1 -0
  147. package/dist/src/interaction/types.js.map +1 -0
  148. package/dist/src/interaction/useElementInteraction.js.map +1 -0
  149. package/dist/src/interaction/useHigherContrastChildren.js.map +1 -0
  150. package/dist/src/interaction/utils.js.map +1 -0
  151. package/dist/src/layout/LayoutAppBar.js.map +1 -0
  152. package/dist/src/layout/LayoutNav.js.map +1 -0
  153. package/dist/src/layout/LayoutWindowSplitter.js.map +1 -0
  154. package/dist/src/layout/Main.js.map +1 -0
  155. package/dist/src/layout/layoutNavStyles.js.map +1 -0
  156. package/dist/src/layout/layoutWindowSplitterStyles.js.map +1 -0
  157. package/dist/src/layout/mainStyles.js.map +1 -0
  158. package/dist/src/layout/useExpandableLayout.js.map +1 -0
  159. package/dist/src/layout/useHorizontalLayoutTransition.js.map +1 -0
  160. package/dist/src/layout/useLayoutAppBarHeight.js.map +1 -0
  161. package/dist/src/layout/useLayoutTree.js.map +1 -0
  162. package/dist/src/layout/useLayoutWindowSplitter.js.map +1 -0
  163. package/dist/src/layout/useMainTabIndex.js.map +1 -0
  164. package/dist/src/layout/useResizableLayout.js.map +1 -0
  165. package/dist/src/layout/useTemporaryLayout.js.map +1 -0
  166. package/dist/src/link/Link.js.map +1 -0
  167. package/dist/src/link/SkipToMainContent.js.map +1 -0
  168. package/dist/src/link/styles.js.map +1 -0
  169. package/dist/src/list/List.js.map +1 -0
  170. package/dist/src/list/ListItem.js +148 -0
  171. package/dist/src/list/ListItem.js.map +1 -0
  172. package/dist/src/list/ListItemAddon.js.map +1 -0
  173. package/dist/src/list/ListItemChildren.js.map +1 -0
  174. package/dist/src/list/ListItemLink.js +89 -0
  175. package/dist/src/list/ListItemLink.js.map +1 -0
  176. package/dist/src/list/ListItemText.js.map +1 -0
  177. package/dist/src/list/ListSubheader.js.map +1 -0
  178. package/dist/src/list/getListItemHeight.js +28 -0
  179. package/dist/src/list/getListItemHeight.js.map +1 -0
  180. package/dist/src/list/listItemStyles.js.map +1 -0
  181. package/dist/src/list/types.js.map +1 -0
  182. package/dist/src/media-queries/AppSizeProvider.js.map +1 -0
  183. package/dist/src/media-queries/appSize.js.map +1 -0
  184. package/dist/src/media-queries/useMediaQuery.js.map +1 -0
  185. package/dist/src/menu/DropdownMenu.js.map +1 -0
  186. package/dist/src/menu/Menu.js.map +1 -0
  187. package/dist/src/menu/MenuBar.js.map +1 -0
  188. package/dist/src/menu/MenuButton.js.map +1 -0
  189. package/dist/src/menu/MenuConfigurationProvider.js.map +1 -0
  190. package/dist/src/menu/MenuItem.js.map +1 -0
  191. package/dist/src/menu/MenuItemButton.js.map +1 -0
  192. package/dist/src/menu/MenuItemGroup.js.map +1 -0
  193. package/dist/src/menu/MenuItemSeparator.js.map +1 -0
  194. package/dist/src/menu/MenuSheet.js.map +1 -0
  195. package/dist/src/menu/MenuVisibilityProvider.js.map +1 -0
  196. package/dist/src/menu/MenuWidget.js.map +1 -0
  197. package/dist/src/menu/MenuWidgetKeyboardProvider.js.map +1 -0
  198. package/dist/src/menu/useContextMenu.js.map +1 -0
  199. package/dist/src/menu/useMenuBarProvider.js.map +1 -0
  200. package/dist/src/menu/utils.js.map +1 -0
  201. package/dist/src/movement/constants.js.map +1 -0
  202. package/dist/src/movement/findMatchIndex.js.map +1 -0
  203. package/dist/src/movement/types.js.map +1 -0
  204. package/dist/src/movement/useKeyboardMovementProvider.js.map +1 -0
  205. package/dist/src/movement/utils.js.map +1 -0
  206. package/dist/src/overlay/Overlay.js.map +1 -0
  207. package/dist/src/overlay/overlayStyles.js.map +1 -0
  208. package/dist/src/portal/Portal.js.map +1 -0
  209. package/dist/src/portal/PortalContainerProvider.js.map +1 -0
  210. package/dist/src/positioning/constants.js.map +1 -0
  211. package/dist/src/positioning/createHorizontalPosition.js.map +1 -0
  212. package/dist/src/positioning/createVerticalPosition.js.map +1 -0
  213. package/dist/src/positioning/getFixedPosition.js.map +1 -0
  214. package/dist/src/positioning/types.js.map +1 -0
  215. package/dist/src/positioning/useFixedPositioning.js.map +1 -0
  216. package/dist/src/positioning/utils.js.map +1 -0
  217. package/dist/src/progress/CircularProgress.js.map +1 -0
  218. package/dist/src/progress/LinearProgress.js.map +1 -0
  219. package/dist/src/progress/getProgressA11y.js.map +1 -0
  220. package/dist/src/progress/types.js.map +1 -0
  221. package/dist/src/responsive-item/ResponsiveItemContainer.js.map +1 -0
  222. package/dist/src/responsive-item/ResponsiveItemOverlay.js.map +1 -0
  223. package/dist/src/responsive-item/styles.js.map +1 -0
  224. package/dist/src/scroll/ScrollLock.js.map +1 -0
  225. package/dist/src/scroll/getScrollbarWidth.js.map +1 -0
  226. package/dist/src/scroll/useScrollLock.js.map +1 -0
  227. package/dist/src/segmented-button/SegmentedButton.js.map +1 -0
  228. package/dist/src/segmented-button/SegmentedButtonContainer.js.map +1 -0
  229. package/dist/src/segmented-button/segmentedButtonContainerStyles.js.map +1 -0
  230. package/dist/src/segmented-button/segmentedButtonStyles.js.map +1 -0
  231. package/dist/src/sheet/Sheet.js.map +1 -0
  232. package/dist/src/sheet/styles.js.map +1 -0
  233. package/dist/src/snackbar/DefaultToastRenderer.js.map +1 -0
  234. package/dist/src/snackbar/Snackbar.js.map +1 -0
  235. package/dist/src/snackbar/Toast.js.map +1 -0
  236. package/dist/src/snackbar/ToastActionButton.js.map +1 -0
  237. package/dist/src/snackbar/ToastCloseButton.js.map +1 -0
  238. package/dist/src/snackbar/ToastContent.js.map +1 -0
  239. package/dist/src/snackbar/ToastManager.js.map +1 -0
  240. package/dist/src/snackbar/ToastManagerProvider.js.map +1 -0
  241. package/dist/src/snackbar/snackbarStyles.js.map +1 -0
  242. package/dist/src/snackbar/toastContentStyles.js.map +1 -0
  243. package/dist/src/snackbar/toastStyles.js.map +1 -0
  244. package/dist/src/snackbar/useCurrentToastActions.js.map +1 -0
  245. package/dist/src/suspense/CircularProgressSuspense.js.map +1 -0
  246. package/dist/src/suspense/NullSuspense.js.map +1 -0
  247. package/dist/src/table/Table.js.map +1 -0
  248. package/dist/src/table/TableBody.js.map +1 -0
  249. package/dist/src/table/TableCell.js.map +1 -0
  250. package/dist/src/table/TableCellContent.js.map +1 -0
  251. package/dist/src/table/TableCheckbox.js.map +1 -0
  252. package/dist/src/table/TableConfigurationProvider.js.map +1 -0
  253. package/dist/src/table/TableContainer.js.map +1 -0
  254. package/dist/src/table/TableContainerProvider.js.map +1 -0
  255. package/dist/src/table/TableFooter.js.map +1 -0
  256. package/dist/src/table/TableHeader.js.map +1 -0
  257. package/dist/src/table/TableRadio.js.map +1 -0
  258. package/dist/src/table/TableRow.js.map +1 -0
  259. package/dist/src/table/tableCellStyles.js.map +1 -0
  260. package/dist/src/table/tableContainerStyles.js.map +1 -0
  261. package/dist/src/table/tableFooterStyles.js.map +1 -0
  262. package/dist/src/table/tableHeaderStyles.js.map +1 -0
  263. package/dist/src/table/tableRowStyles.js.map +1 -0
  264. package/dist/src/table/tableStyles.js.map +1 -0
  265. package/dist/src/table/types.js.map +1 -0
  266. package/dist/src/tabs/Tab.js.map +1 -0
  267. package/dist/src/tabs/TabList.js.map +1 -0
  268. package/dist/src/tabs/TabListScrollButton.js.map +1 -0
  269. package/dist/src/tabs/tabIndicatorStyles.js.map +1 -0
  270. package/dist/src/tabs/tabListScrollButtonStyles.js.map +1 -0
  271. package/dist/src/tabs/tabListStyles.js.map +1 -0
  272. package/dist/src/tabs/tabStyles.js.map +1 -0
  273. package/dist/src/tabs/useTabList.js.map +1 -0
  274. package/dist/src/tabs/useTabs.js.map +1 -0
  275. package/dist/src/tabs/utils.js.map +1 -0
  276. package/dist/src/test-utils/IntersectionObserver.js.map +1 -0
  277. package/dist/src/test-utils/ResizeObserver.js.map +1 -0
  278. package/dist/src/test-utils/data-testid.js.map +1 -0
  279. package/dist/src/test-utils/index.js.map +1 -0
  280. package/dist/src/test-utils/jest-setup.js.map +1 -0
  281. package/dist/src/test-utils/matchMedia.js.map +1 -0
  282. package/dist/src/test-utils/polyfills/IntersectionObserver.js.map +1 -0
  283. package/dist/src/test-utils/polyfills/ResizeObserver.js.map +1 -0
  284. package/dist/src/test-utils/polyfills/index.js.map +1 -0
  285. package/dist/src/test-utils/polyfills/matchMedia.js.map +1 -0
  286. package/dist/src/test-utils/polyfills/offsetParent.js.map +1 -0
  287. package/dist/src/test-utils/polyfills/scrollIntoView.js.map +1 -0
  288. package/dist/src/test-utils/render.js.map +1 -0
  289. package/dist/src/test-utils/timers.js.map +1 -0
  290. package/dist/src/theme/LocalStorageColorSchemeProvider.js.map +1 -0
  291. package/dist/src/theme/ThemeProvider.js.map +1 -0
  292. package/dist/src/theme/colors.js.map +1 -0
  293. package/dist/src/theme/cssVars.js.map +1 -0
  294. package/dist/src/theme/types.js.map +1 -0
  295. package/dist/src/theme/useCSSVariables.js.map +1 -0
  296. package/dist/src/theme/useColorScheme.js.map +1 -0
  297. package/dist/src/theme/useColorSchemeMetaTag.js.map +1 -0
  298. package/dist/src/theme/useColorSchemeProvider.js.map +1 -0
  299. package/dist/src/theme/usePrefersColorScheme.js.map +1 -0
  300. package/dist/src/theme/utils.js.map +1 -0
  301. package/dist/src/tooltip/Tooltip.js.map +1 -0
  302. package/dist/src/tooltip/TooltipHoverModeProvider.js.map +1 -0
  303. package/dist/src/tooltip/constants.js.map +1 -0
  304. package/dist/src/tooltip/tooltipStyles.js.map +1 -0
  305. package/dist/src/tooltip/useTooltip.js.map +1 -0
  306. package/dist/src/tooltip/useTooltipPosition.js.map +1 -0
  307. package/dist/src/tooltip/utils.js.map +1 -0
  308. package/dist/src/transition/CSSTransition.js.map +1 -0
  309. package/dist/src/transition/Collapse.js.map +1 -0
  310. package/dist/src/transition/CrossFade.js.map +1 -0
  311. package/dist/src/transition/ScaleTransition.js.map +1 -0
  312. package/dist/src/transition/SkeletonPlaceholder.js.map +1 -0
  313. package/dist/src/transition/Slide.js.map +1 -0
  314. package/dist/src/transition/SlideContainer.js.map +1 -0
  315. package/dist/src/transition/collapseStyles.js.map +1 -0
  316. package/dist/src/transition/config.js.map +1 -0
  317. package/dist/src/transition/maxWidthTransition.js.map +1 -0
  318. package/dist/src/transition/skeletonPlaceholderUtils.js.map +1 -0
  319. package/dist/src/transition/types.js.map +1 -0
  320. package/dist/src/transition/useCSSTransition.js.map +1 -0
  321. package/dist/src/transition/useCarousel.js.map +1 -0
  322. package/dist/src/transition/useCollapseTransition.js.map +1 -0
  323. package/dist/src/transition/useCrossFadeTransition.js.map +1 -0
  324. package/dist/src/transition/useMaxWidthTransition.js.map +1 -0
  325. package/dist/src/transition/useScaleTransition.js.map +1 -0
  326. package/dist/src/transition/useSkeletonPlaceholder.js.map +1 -0
  327. package/dist/src/transition/useSlideTransition.js.map +1 -0
  328. package/dist/src/transition/useTransition.js.map +1 -0
  329. package/dist/src/transition/utils.js.map +1 -0
  330. package/dist/src/tree/DefaultTreeItemRenderer.js.map +1 -0
  331. package/dist/src/tree/Tree.js.map +1 -0
  332. package/dist/src/tree/TreeGroup.js.map +1 -0
  333. package/dist/src/tree/TreeItem.js.map +1 -0
  334. package/dist/src/tree/TreeItemExpander.js.map +1 -0
  335. package/dist/src/tree/TreeProvider.js.map +1 -0
  336. package/dist/src/tree/styles.js.map +1 -0
  337. package/dist/src/tree/types.js.map +1 -0
  338. package/dist/src/tree/useTree.js.map +1 -0
  339. package/dist/src/tree/useTreeExpansion.js.map +1 -0
  340. package/dist/src/tree/useTreeItems.js.map +1 -0
  341. package/dist/src/tree/useTreeMovement.js.map +1 -0
  342. package/dist/src/tree/useTreeSelection.js.map +1 -0
  343. package/dist/src/tree/utils.js.map +1 -0
  344. package/dist/src/types.js.map +1 -0
  345. package/dist/src/typography/SrOnly.js.map +1 -0
  346. package/dist/src/typography/TextContainer.js.map +1 -0
  347. package/dist/src/typography/Typography.js.map +1 -0
  348. package/dist/src/typography/WritingDirectionProvider.js.map +1 -0
  349. package/dist/src/useAsyncAction.js.map +1 -0
  350. package/dist/src/useDebouncedFunction.js.map +1 -0
  351. package/dist/src/useDropzone.js.map +1 -0
  352. package/dist/src/useElementSize.js.map +1 -0
  353. package/dist/src/useEnsuredId.js.map +1 -0
  354. package/dist/src/useEnsuredRef.js.map +1 -0
  355. package/dist/src/useEnsuredState.js.map +1 -0
  356. package/dist/src/useHtmlClassName.js.map +1 -0
  357. package/dist/src/useIntersectionObserver.js.map +1 -0
  358. package/dist/src/useIsomorphicLayoutEffect.js.map +1 -0
  359. package/dist/src/useLocalStorage.js.map +1 -0
  360. package/dist/src/useOrientation.js.map +1 -0
  361. package/dist/src/usePageInactive.js.map +1 -0
  362. package/dist/src/useResizeListener.js.map +1 -0
  363. package/dist/src/useResizeObserver.js.map +1 -0
  364. package/dist/src/useThrottledFunction.js.map +1 -0
  365. package/dist/src/useToggle.js.map +1 -0
  366. package/dist/src/useUnmounted.js.map +1 -0
  367. package/dist/src/useWindowSize.js.map +1 -0
  368. package/dist/src/utils/RenderRecursively.js.map +1 -0
  369. package/dist/src/utils/alphaNumericSort.js.map +1 -0
  370. package/dist/src/utils/applyRef.js.map +1 -0
  371. package/dist/src/utils/bem.js.map +1 -0
  372. package/dist/src/utils/filters.js.map +1 -0
  373. package/dist/src/utils/getClientPosition.js.map +1 -0
  374. package/dist/src/utils/getMiddleOfRange.js.map +1 -0
  375. package/dist/src/utils/getPercentage.js.map +1 -0
  376. package/dist/src/utils/getRangeDefaultValue.js.map +1 -0
  377. package/dist/src/utils/getRangeSteps.js.map +1 -0
  378. package/dist/src/utils/identity.js.map +1 -0
  379. package/dist/src/utils/isElementVisible.js.map +1 -0
  380. package/dist/src/utils/loop.js.map +1 -0
  381. package/dist/src/utils/nearest.js.map +1 -0
  382. package/dist/src/utils/parseCssLengthUnit.js.map +1 -0
  383. package/dist/src/utils/randomInt.js.map +1 -0
  384. package/dist/src/utils/wait.js.map +1 -0
  385. package/dist/src/utils/withinRange.js.map +1 -0
  386. package/dist/src/window-splitter/WindowSplitter.js.map +1 -0
  387. package/dist/src/window-splitter/useWindowSplitter.js.map +1 -0
  388. package/dist/theme/_theme.scss +20 -10
  389. package/package.json +8 -8
  390. package/src/_core.scss +1 -1
  391. package/src/form/_form.scss +1 -1
  392. package/src/list/ListItem.tsx +1 -1
  393. package/src/list/ListItemLink.tsx +1 -1
  394. package/src/list/__tests__/getListItemHeight.ts +2 -2
  395. package/src/list/getListItemHeight.ts +2 -3
  396. package/src/list/types.ts +1 -1
  397. package/src/menu/_menu.scss +0 -2
  398. package/src/theme/_theme.scss +20 -10
  399. package/dist/CoreProviders.js.map +0 -1
  400. package/dist/NoSsr.js.map +0 -1
  401. package/dist/SsrProvider.js.map +0 -1
  402. package/dist/app-bar/AppBar.js.map +0 -1
  403. package/dist/app-bar/AppBarTitle.js.map +0 -1
  404. package/dist/avatar/Avatar.js.map +0 -1
  405. package/dist/avatar/styles.js.map +0 -1
  406. package/dist/badge/Badge.js.map +0 -1
  407. package/dist/box/Box.js.map +0 -1
  408. package/dist/box/styles.js.map +0 -1
  409. package/dist/button/AsyncButton.js.map +0 -1
  410. package/dist/button/Button.js.map +0 -1
  411. package/dist/button/ButtonUnstyled.js.map +0 -1
  412. package/dist/button/FloatingActionButton.js.map +0 -1
  413. package/dist/button/TooltippedButton.js.map +0 -1
  414. package/dist/button/buttonStyles.js.map +0 -1
  415. package/dist/button/buttonUnstyledStyles.js.map +0 -1
  416. package/dist/card/Card.js.map +0 -1
  417. package/dist/card/CardContent.js.map +0 -1
  418. package/dist/card/CardFooter.js.map +0 -1
  419. package/dist/card/CardHeader.js.map +0 -1
  420. package/dist/card/CardSubtitle.js.map +0 -1
  421. package/dist/card/CardTitle.js.map +0 -1
  422. package/dist/card/ClickableCard.js.map +0 -1
  423. package/dist/card/styles.js.map +0 -1
  424. package/dist/chip/Chip.js.map +0 -1
  425. package/dist/chip/styles.js.map +0 -1
  426. package/dist/cssUtils.js.map +0 -1
  427. package/dist/delegateEvent.js.map +0 -1
  428. package/dist/dialog/Dialog.js.map +0 -1
  429. package/dist/dialog/DialogContainer.js.map +0 -1
  430. package/dist/dialog/DialogContent.js.map +0 -1
  431. package/dist/dialog/DialogFooter.js.map +0 -1
  432. package/dist/dialog/DialogHeader.js.map +0 -1
  433. package/dist/dialog/DialogTitle.js.map +0 -1
  434. package/dist/dialog/FixedDialog.js.map +0 -1
  435. package/dist/dialog/NestedDialogProvider.js.map +0 -1
  436. package/dist/dialog/styles.js.map +0 -1
  437. package/dist/divider/Divider.js.map +0 -1
  438. package/dist/divider/styles.js.map +0 -1
  439. package/dist/draggable/useDraggable.js.map +0 -1
  440. package/dist/draggable/utils.js.map +0 -1
  441. package/dist/expansion-panel/ExpansionList.js.map +0 -1
  442. package/dist/expansion-panel/ExpansionPanel.js.map +0 -1
  443. package/dist/expansion-panel/ExpansionPanelHeader.js.map +0 -1
  444. package/dist/expansion-panel/useExpansionList.js.map +0 -1
  445. package/dist/expansion-panel/useExpansionPanels.js.map +0 -1
  446. package/dist/focus/useFocusContainer.js.map +0 -1
  447. package/dist/focus/utils.js.map +0 -1
  448. package/dist/form/Checkbox.js.map +0 -1
  449. package/dist/form/Fieldset.js.map +0 -1
  450. package/dist/form/FileInput.js.map +0 -1
  451. package/dist/form/Form.js.map +0 -1
  452. package/dist/form/FormMessage.js.map +0 -1
  453. package/dist/form/FormMessageContainer.js.map +0 -1
  454. package/dist/form/FormMessageCounter.js.map +0 -1
  455. package/dist/form/InputToggle.js.map +0 -1
  456. package/dist/form/InputToggleIcon.js.map +0 -1
  457. package/dist/form/Label.js.map +0 -1
  458. package/dist/form/Legend.js.map +0 -1
  459. package/dist/form/MenuItemCheckbox.js.map +0 -1
  460. package/dist/form/MenuItemFileInput.js.map +0 -1
  461. package/dist/form/MenuItemInputToggle.js.map +0 -1
  462. package/dist/form/MenuItemRadio.js.map +0 -1
  463. package/dist/form/MenuItemSwitch.js.map +0 -1
  464. package/dist/form/MenuItemTextField.js.map +0 -1
  465. package/dist/form/NativeSelect.js.map +0 -1
  466. package/dist/form/OptGroup.js.map +0 -1
  467. package/dist/form/Option.js.map +0 -1
  468. package/dist/form/Password.js.map +0 -1
  469. package/dist/form/Radio.js.map +0 -1
  470. package/dist/form/Select.js.map +0 -1
  471. package/dist/form/SelectValue.js.map +0 -1
  472. package/dist/form/Slider.js.map +0 -1
  473. package/dist/form/SliderContainer.js.map +0 -1
  474. package/dist/form/SliderMark.js.map +0 -1
  475. package/dist/form/SliderMarkLabel.js.map +0 -1
  476. package/dist/form/SliderThumb.js.map +0 -1
  477. package/dist/form/SliderTrack.js.map +0 -1
  478. package/dist/form/SliderValueMarks.js.map +0 -1
  479. package/dist/form/SliderValueTooltip.js.map +0 -1
  480. package/dist/form/Switch.js.map +0 -1
  481. package/dist/form/SwitchTrack.js.map +0 -1
  482. package/dist/form/TextArea.js.map +0 -1
  483. package/dist/form/TextField.js.map +0 -1
  484. package/dist/form/TextFieldAddon.js.map +0 -1
  485. package/dist/form/TextFieldContainer.js.map +0 -1
  486. package/dist/form/TextFieldContainerStyles.js.map +0 -1
  487. package/dist/form/fileUtils.js.map +0 -1
  488. package/dist/form/formConfig.js.map +0 -1
  489. package/dist/form/formMessageStyles.js.map +0 -1
  490. package/dist/form/inputToggleStyles.js.map +0 -1
  491. package/dist/form/nativeSelectStyles.js.map +0 -1
  492. package/dist/form/optionStyles.js.map +0 -1
  493. package/dist/form/passwordStyles.js.map +0 -1
  494. package/dist/form/selectStyles.js.map +0 -1
  495. package/dist/form/selectUtils.js.map +0 -1
  496. package/dist/form/sliderUtils.js.map +0 -1
  497. package/dist/form/switchStyles.js.map +0 -1
  498. package/dist/form/textAreaStyles.js.map +0 -1
  499. package/dist/form/textFieldStyles.js.map +0 -1
  500. package/dist/form/types.js.map +0 -1
  501. package/dist/form/useCheckboxGroup.js.map +0 -1
  502. package/dist/form/useFileUpload.js.map +0 -1
  503. package/dist/form/useListboxProvider.js.map +0 -1
  504. package/dist/form/useNumberField.js.map +0 -1
  505. package/dist/form/useRadioGroup.js.map +0 -1
  506. package/dist/form/useRangeSlider.js.map +0 -1
  507. package/dist/form/useResizingTextArea.js.map +0 -1
  508. package/dist/form/useSlider.js.map +0 -1
  509. package/dist/form/useTextField.js.map +0 -1
  510. package/dist/form/utils.js.map +0 -1
  511. package/dist/form/validation.js.map +0 -1
  512. package/dist/hoverMode/useHoverMode.js.map +0 -1
  513. package/dist/hoverMode/useHoverModeProvider.js.map +0 -1
  514. package/dist/icon/FontIcon.js.map +0 -1
  515. package/dist/icon/IconRotator.js.map +0 -1
  516. package/dist/icon/MaterialIcon.js.map +0 -1
  517. package/dist/icon/MaterialSymbol.js.map +0 -1
  518. package/dist/icon/SVGIcon.js.map +0 -1
  519. package/dist/icon/TextIconSpacing.js.map +0 -1
  520. package/dist/icon/iconConfig.js.map +0 -1
  521. package/dist/icon/material.js.map +0 -1
  522. package/dist/icon/materialConfig.js.map +0 -1
  523. package/dist/icon/styles.js.map +0 -1
  524. package/dist/index.js.map +0 -1
  525. package/dist/interaction/Ripple.js.map +0 -1
  526. package/dist/interaction/RippleContainer.js.map +0 -1
  527. package/dist/interaction/UserInteractionModeProvider.js.map +0 -1
  528. package/dist/interaction/config.js.map +0 -1
  529. package/dist/interaction/types.js.map +0 -1
  530. package/dist/interaction/useElementInteraction.js.map +0 -1
  531. package/dist/interaction/useHigherContrastChildren.js.map +0 -1
  532. package/dist/interaction/utils.js.map +0 -1
  533. package/dist/layout/LayoutAppBar.js.map +0 -1
  534. package/dist/layout/LayoutNav.js.map +0 -1
  535. package/dist/layout/LayoutWindowSplitter.js.map +0 -1
  536. package/dist/layout/Main.js.map +0 -1
  537. package/dist/layout/layoutNavStyles.js.map +0 -1
  538. package/dist/layout/layoutWindowSplitterStyles.js.map +0 -1
  539. package/dist/layout/mainStyles.js.map +0 -1
  540. package/dist/layout/useExpandableLayout.js.map +0 -1
  541. package/dist/layout/useHorizontalLayoutTransition.js.map +0 -1
  542. package/dist/layout/useLayoutAppBarHeight.js.map +0 -1
  543. package/dist/layout/useLayoutTree.js.map +0 -1
  544. package/dist/layout/useLayoutWindowSplitter.js.map +0 -1
  545. package/dist/layout/useMainTabIndex.js.map +0 -1
  546. package/dist/layout/useResizableLayout.js.map +0 -1
  547. package/dist/layout/useTemporaryLayout.js.map +0 -1
  548. package/dist/link/Link.js.map +0 -1
  549. package/dist/link/SkipToMainContent.js.map +0 -1
  550. package/dist/link/styles.js.map +0 -1
  551. package/dist/list/List.js.map +0 -1
  552. package/dist/list/ListItem.js +0 -148
  553. package/dist/list/ListItem.js.map +0 -1
  554. package/dist/list/ListItemAddon.js.map +0 -1
  555. package/dist/list/ListItemChildren.js.map +0 -1
  556. package/dist/list/ListItemLink.js +0 -89
  557. package/dist/list/ListItemLink.js.map +0 -1
  558. package/dist/list/ListItemText.js.map +0 -1
  559. package/dist/list/ListSubheader.js.map +0 -1
  560. package/dist/list/getListItemHeight.js +0 -28
  561. package/dist/list/getListItemHeight.js.map +0 -1
  562. package/dist/list/listItemStyles.js.map +0 -1
  563. package/dist/list/types.js.map +0 -1
  564. package/dist/media-queries/AppSizeProvider.js.map +0 -1
  565. package/dist/media-queries/appSize.js.map +0 -1
  566. package/dist/media-queries/useMediaQuery.js.map +0 -1
  567. package/dist/menu/DropdownMenu.js.map +0 -1
  568. package/dist/menu/Menu.js.map +0 -1
  569. package/dist/menu/MenuBar.js.map +0 -1
  570. package/dist/menu/MenuButton.js.map +0 -1
  571. package/dist/menu/MenuConfigurationProvider.js.map +0 -1
  572. package/dist/menu/MenuItem.js.map +0 -1
  573. package/dist/menu/MenuItemButton.js.map +0 -1
  574. package/dist/menu/MenuItemGroup.js.map +0 -1
  575. package/dist/menu/MenuItemSeparator.js.map +0 -1
  576. package/dist/menu/MenuSheet.js.map +0 -1
  577. package/dist/menu/MenuVisibilityProvider.js.map +0 -1
  578. package/dist/menu/MenuWidget.js.map +0 -1
  579. package/dist/menu/MenuWidgetKeyboardProvider.js.map +0 -1
  580. package/dist/menu/useContextMenu.js.map +0 -1
  581. package/dist/menu/useMenuBarProvider.js.map +0 -1
  582. package/dist/menu/utils.js.map +0 -1
  583. package/dist/movement/constants.js.map +0 -1
  584. package/dist/movement/findMatchIndex.js.map +0 -1
  585. package/dist/movement/types.js.map +0 -1
  586. package/dist/movement/useKeyboardMovementProvider.js.map +0 -1
  587. package/dist/movement/utils.js.map +0 -1
  588. package/dist/overlay/Overlay.js.map +0 -1
  589. package/dist/overlay/overlayStyles.js.map +0 -1
  590. package/dist/portal/Portal.js.map +0 -1
  591. package/dist/portal/PortalContainerProvider.js.map +0 -1
  592. package/dist/positioning/constants.js.map +0 -1
  593. package/dist/positioning/createHorizontalPosition.js.map +0 -1
  594. package/dist/positioning/createVerticalPosition.js.map +0 -1
  595. package/dist/positioning/getFixedPosition.js.map +0 -1
  596. package/dist/positioning/types.js.map +0 -1
  597. package/dist/positioning/useFixedPositioning.js.map +0 -1
  598. package/dist/positioning/utils.js.map +0 -1
  599. package/dist/progress/CircularProgress.js.map +0 -1
  600. package/dist/progress/LinearProgress.js.map +0 -1
  601. package/dist/progress/getProgressA11y.js.map +0 -1
  602. package/dist/progress/types.js.map +0 -1
  603. package/dist/responsive-item/ResponsiveItemContainer.js.map +0 -1
  604. package/dist/responsive-item/ResponsiveItemOverlay.js.map +0 -1
  605. package/dist/responsive-item/styles.js.map +0 -1
  606. package/dist/scroll/ScrollLock.js.map +0 -1
  607. package/dist/scroll/getScrollbarWidth.js.map +0 -1
  608. package/dist/scroll/useScrollLock.js.map +0 -1
  609. package/dist/segmented-button/SegmentedButton.js.map +0 -1
  610. package/dist/segmented-button/SegmentedButtonContainer.js.map +0 -1
  611. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +0 -1
  612. package/dist/segmented-button/segmentedButtonStyles.js.map +0 -1
  613. package/dist/sheet/Sheet.js.map +0 -1
  614. package/dist/sheet/styles.js.map +0 -1
  615. package/dist/snackbar/DefaultToastRenderer.js.map +0 -1
  616. package/dist/snackbar/Snackbar.js.map +0 -1
  617. package/dist/snackbar/Toast.js.map +0 -1
  618. package/dist/snackbar/ToastActionButton.js.map +0 -1
  619. package/dist/snackbar/ToastCloseButton.js.map +0 -1
  620. package/dist/snackbar/ToastContent.js.map +0 -1
  621. package/dist/snackbar/ToastManager.js.map +0 -1
  622. package/dist/snackbar/ToastManagerProvider.js.map +0 -1
  623. package/dist/snackbar/snackbarStyles.js.map +0 -1
  624. package/dist/snackbar/toastContentStyles.js.map +0 -1
  625. package/dist/snackbar/toastStyles.js.map +0 -1
  626. package/dist/snackbar/useCurrentToastActions.js.map +0 -1
  627. package/dist/suspense/CircularProgressSuspense.js.map +0 -1
  628. package/dist/suspense/NullSuspense.js.map +0 -1
  629. package/dist/table/Table.js.map +0 -1
  630. package/dist/table/TableBody.js.map +0 -1
  631. package/dist/table/TableCell.js.map +0 -1
  632. package/dist/table/TableCellContent.js.map +0 -1
  633. package/dist/table/TableCheckbox.js.map +0 -1
  634. package/dist/table/TableConfigurationProvider.js.map +0 -1
  635. package/dist/table/TableContainer.js.map +0 -1
  636. package/dist/table/TableContainerProvider.js.map +0 -1
  637. package/dist/table/TableFooter.js.map +0 -1
  638. package/dist/table/TableHeader.js.map +0 -1
  639. package/dist/table/TableRadio.js.map +0 -1
  640. package/dist/table/TableRow.js.map +0 -1
  641. package/dist/table/tableCellStyles.js.map +0 -1
  642. package/dist/table/tableContainerStyles.js.map +0 -1
  643. package/dist/table/tableFooterStyles.js.map +0 -1
  644. package/dist/table/tableHeaderStyles.js.map +0 -1
  645. package/dist/table/tableRowStyles.js.map +0 -1
  646. package/dist/table/tableStyles.js.map +0 -1
  647. package/dist/table/types.js.map +0 -1
  648. package/dist/tabs/Tab.js.map +0 -1
  649. package/dist/tabs/TabList.js.map +0 -1
  650. package/dist/tabs/TabListScrollButton.js.map +0 -1
  651. package/dist/tabs/tabIndicatorStyles.js.map +0 -1
  652. package/dist/tabs/tabListScrollButtonStyles.js.map +0 -1
  653. package/dist/tabs/tabListStyles.js.map +0 -1
  654. package/dist/tabs/tabStyles.js.map +0 -1
  655. package/dist/tabs/useTabList.js.map +0 -1
  656. package/dist/tabs/useTabs.js.map +0 -1
  657. package/dist/tabs/utils.js.map +0 -1
  658. package/dist/test-utils/IntersectionObserver.js.map +0 -1
  659. package/dist/test-utils/ResizeObserver.js.map +0 -1
  660. package/dist/test-utils/data-testid.js.map +0 -1
  661. package/dist/test-utils/index.js.map +0 -1
  662. package/dist/test-utils/jest-setup.js.map +0 -1
  663. package/dist/test-utils/matchMedia.js.map +0 -1
  664. package/dist/test-utils/polyfills/IntersectionObserver.js.map +0 -1
  665. package/dist/test-utils/polyfills/ResizeObserver.js.map +0 -1
  666. package/dist/test-utils/polyfills/index.js.map +0 -1
  667. package/dist/test-utils/polyfills/matchMedia.js.map +0 -1
  668. package/dist/test-utils/polyfills/offsetParent.js.map +0 -1
  669. package/dist/test-utils/polyfills/scrollIntoView.js.map +0 -1
  670. package/dist/test-utils/render.js.map +0 -1
  671. package/dist/test-utils/timers.js.map +0 -1
  672. package/dist/theme/LocalStorageColorSchemeProvider.js.map +0 -1
  673. package/dist/theme/ThemeProvider.js.map +0 -1
  674. package/dist/theme/colors.js.map +0 -1
  675. package/dist/theme/cssVars.js.map +0 -1
  676. package/dist/theme/types.js.map +0 -1
  677. package/dist/theme/useCSSVariables.js.map +0 -1
  678. package/dist/theme/useColorScheme.js.map +0 -1
  679. package/dist/theme/useColorSchemeMetaTag.js.map +0 -1
  680. package/dist/theme/useColorSchemeProvider.js.map +0 -1
  681. package/dist/theme/usePrefersColorScheme.js.map +0 -1
  682. package/dist/theme/utils.js.map +0 -1
  683. package/dist/tooltip/Tooltip.js.map +0 -1
  684. package/dist/tooltip/TooltipHoverModeProvider.js.map +0 -1
  685. package/dist/tooltip/constants.js.map +0 -1
  686. package/dist/tooltip/tooltipStyles.js.map +0 -1
  687. package/dist/tooltip/useTooltip.js.map +0 -1
  688. package/dist/tooltip/useTooltipPosition.js.map +0 -1
  689. package/dist/tooltip/utils.js.map +0 -1
  690. package/dist/transition/CSSTransition.js.map +0 -1
  691. package/dist/transition/Collapse.js.map +0 -1
  692. package/dist/transition/CrossFade.js.map +0 -1
  693. package/dist/transition/ScaleTransition.js.map +0 -1
  694. package/dist/transition/SkeletonPlaceholder.js.map +0 -1
  695. package/dist/transition/Slide.js.map +0 -1
  696. package/dist/transition/SlideContainer.js.map +0 -1
  697. package/dist/transition/collapseStyles.js.map +0 -1
  698. package/dist/transition/config.js.map +0 -1
  699. package/dist/transition/maxWidthTransition.js.map +0 -1
  700. package/dist/transition/skeletonPlaceholderUtils.js.map +0 -1
  701. package/dist/transition/types.js.map +0 -1
  702. package/dist/transition/useCSSTransition.js.map +0 -1
  703. package/dist/transition/useCarousel.js.map +0 -1
  704. package/dist/transition/useCollapseTransition.js.map +0 -1
  705. package/dist/transition/useCrossFadeTransition.js.map +0 -1
  706. package/dist/transition/useMaxWidthTransition.js.map +0 -1
  707. package/dist/transition/useScaleTransition.js.map +0 -1
  708. package/dist/transition/useSkeletonPlaceholder.js.map +0 -1
  709. package/dist/transition/useSlideTransition.js.map +0 -1
  710. package/dist/transition/useTransition.js.map +0 -1
  711. package/dist/transition/utils.js.map +0 -1
  712. package/dist/tree/DefaultTreeItemRenderer.js.map +0 -1
  713. package/dist/tree/Tree.js.map +0 -1
  714. package/dist/tree/TreeGroup.js.map +0 -1
  715. package/dist/tree/TreeItem.js.map +0 -1
  716. package/dist/tree/TreeItemExpander.js.map +0 -1
  717. package/dist/tree/TreeProvider.js.map +0 -1
  718. package/dist/tree/styles.js.map +0 -1
  719. package/dist/tree/types.js.map +0 -1
  720. package/dist/tree/useTree.js.map +0 -1
  721. package/dist/tree/useTreeExpansion.js.map +0 -1
  722. package/dist/tree/useTreeItems.js.map +0 -1
  723. package/dist/tree/useTreeMovement.js.map +0 -1
  724. package/dist/tree/useTreeSelection.js.map +0 -1
  725. package/dist/tree/utils.js.map +0 -1
  726. package/dist/types.js.map +0 -1
  727. package/dist/typography/SrOnly.js.map +0 -1
  728. package/dist/typography/TextContainer.js.map +0 -1
  729. package/dist/typography/Typography.js.map +0 -1
  730. package/dist/typography/WritingDirectionProvider.js.map +0 -1
  731. package/dist/useAsyncAction.js.map +0 -1
  732. package/dist/useDebouncedFunction.js.map +0 -1
  733. package/dist/useDropzone.js.map +0 -1
  734. package/dist/useElementSize.js.map +0 -1
  735. package/dist/useEnsuredId.js.map +0 -1
  736. package/dist/useEnsuredRef.js.map +0 -1
  737. package/dist/useEnsuredState.js.map +0 -1
  738. package/dist/useHtmlClassName.js.map +0 -1
  739. package/dist/useIntersectionObserver.js.map +0 -1
  740. package/dist/useIsomorphicLayoutEffect.js.map +0 -1
  741. package/dist/useLocalStorage.js.map +0 -1
  742. package/dist/useOrientation.js.map +0 -1
  743. package/dist/usePageInactive.js.map +0 -1
  744. package/dist/useResizeListener.js.map +0 -1
  745. package/dist/useResizeObserver.js.map +0 -1
  746. package/dist/useThrottledFunction.js.map +0 -1
  747. package/dist/useToggle.js.map +0 -1
  748. package/dist/useUnmounted.js.map +0 -1
  749. package/dist/useWindowSize.js.map +0 -1
  750. package/dist/utils/RenderRecursively.js.map +0 -1
  751. package/dist/utils/alphaNumericSort.js.map +0 -1
  752. package/dist/utils/applyRef.js.map +0 -1
  753. package/dist/utils/bem.js.map +0 -1
  754. package/dist/utils/filters.js.map +0 -1
  755. package/dist/utils/getClientPosition.js.map +0 -1
  756. package/dist/utils/getMiddleOfRange.js.map +0 -1
  757. package/dist/utils/getPercentage.js.map +0 -1
  758. package/dist/utils/getRangeDefaultValue.js.map +0 -1
  759. package/dist/utils/getRangeSteps.js.map +0 -1
  760. package/dist/utils/identity.js.map +0 -1
  761. package/dist/utils/isElementVisible.js.map +0 -1
  762. package/dist/utils/loop.js.map +0 -1
  763. package/dist/utils/nearest.js.map +0 -1
  764. package/dist/utils/parseCssLengthUnit.js.map +0 -1
  765. package/dist/utils/randomInt.js.map +0 -1
  766. package/dist/utils/wait.js.map +0 -1
  767. package/dist/utils/withinRange.js.map +0 -1
  768. package/dist/window-splitter/WindowSplitter.js.map +0 -1
  769. package/dist/window-splitter/useWindowSplitter.js.map +0 -1
  770. /package/dist/{CoreProviders.js → src/CoreProviders.js} +0 -0
  771. /package/dist/{NoSsr.js → src/NoSsr.js} +0 -0
  772. /package/dist/{SsrProvider.js → src/SsrProvider.js} +0 -0
  773. /package/dist/{app-bar → src/app-bar}/AppBar.js +0 -0
  774. /package/dist/{app-bar → src/app-bar}/AppBarTitle.js +0 -0
  775. /package/dist/{avatar → src/avatar}/Avatar.js +0 -0
  776. /package/dist/{avatar → src/avatar}/styles.js +0 -0
  777. /package/dist/{badge → src/badge}/Badge.js +0 -0
  778. /package/dist/{box → src/box}/Box.js +0 -0
  779. /package/dist/{box → src/box}/styles.js +0 -0
  780. /package/dist/{button → src/button}/AsyncButton.js +0 -0
  781. /package/dist/{button → src/button}/Button.js +0 -0
  782. /package/dist/{button → src/button}/ButtonUnstyled.js +0 -0
  783. /package/dist/{button → src/button}/FloatingActionButton.js +0 -0
  784. /package/dist/{button → src/button}/TooltippedButton.js +0 -0
  785. /package/dist/{button → src/button}/buttonStyles.js +0 -0
  786. /package/dist/{button → src/button}/buttonUnstyledStyles.js +0 -0
  787. /package/dist/{card → src/card}/Card.js +0 -0
  788. /package/dist/{card → src/card}/CardContent.js +0 -0
  789. /package/dist/{card → src/card}/CardFooter.js +0 -0
  790. /package/dist/{card → src/card}/CardHeader.js +0 -0
  791. /package/dist/{card → src/card}/CardSubtitle.js +0 -0
  792. /package/dist/{card → src/card}/CardTitle.js +0 -0
  793. /package/dist/{card → src/card}/ClickableCard.js +0 -0
  794. /package/dist/{card → src/card}/styles.js +0 -0
  795. /package/dist/{chip → src/chip}/Chip.js +0 -0
  796. /package/dist/{chip → src/chip}/styles.js +0 -0
  797. /package/dist/{cssUtils.js → src/cssUtils.js} +0 -0
  798. /package/dist/{delegateEvent.js → src/delegateEvent.js} +0 -0
  799. /package/dist/{dialog → src/dialog}/Dialog.js +0 -0
  800. /package/dist/{dialog → src/dialog}/DialogContainer.js +0 -0
  801. /package/dist/{dialog → src/dialog}/DialogContent.js +0 -0
  802. /package/dist/{dialog → src/dialog}/DialogFooter.js +0 -0
  803. /package/dist/{dialog → src/dialog}/DialogHeader.js +0 -0
  804. /package/dist/{dialog → src/dialog}/DialogTitle.js +0 -0
  805. /package/dist/{dialog → src/dialog}/FixedDialog.js +0 -0
  806. /package/dist/{dialog → src/dialog}/NestedDialogProvider.js +0 -0
  807. /package/dist/{dialog → src/dialog}/styles.js +0 -0
  808. /package/dist/{divider → src/divider}/Divider.js +0 -0
  809. /package/dist/{divider → src/divider}/styles.js +0 -0
  810. /package/dist/{draggable → src/draggable}/useDraggable.js +0 -0
  811. /package/dist/{draggable → src/draggable}/utils.js +0 -0
  812. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionList.js +0 -0
  813. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionPanel.js +0 -0
  814. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionPanelHeader.js +0 -0
  815. /package/dist/{expansion-panel → src/expansion-panel}/useExpansionList.js +0 -0
  816. /package/dist/{expansion-panel → src/expansion-panel}/useExpansionPanels.js +0 -0
  817. /package/dist/{focus → src/focus}/useFocusContainer.js +0 -0
  818. /package/dist/{focus → src/focus}/utils.js +0 -0
  819. /package/dist/{form → src/form}/Checkbox.js +0 -0
  820. /package/dist/{form → src/form}/Fieldset.js +0 -0
  821. /package/dist/{form → src/form}/FileInput.js +0 -0
  822. /package/dist/{form → src/form}/Form.js +0 -0
  823. /package/dist/{form → src/form}/FormMessage.js +0 -0
  824. /package/dist/{form → src/form}/FormMessageContainer.js +0 -0
  825. /package/dist/{form → src/form}/FormMessageCounter.js +0 -0
  826. /package/dist/{form → src/form}/InputToggle.js +0 -0
  827. /package/dist/{form → src/form}/InputToggleIcon.js +0 -0
  828. /package/dist/{form → src/form}/Label.js +0 -0
  829. /package/dist/{form → src/form}/Legend.js +0 -0
  830. /package/dist/{form → src/form}/MenuItemCheckbox.js +0 -0
  831. /package/dist/{form → src/form}/MenuItemFileInput.js +0 -0
  832. /package/dist/{form → src/form}/MenuItemInputToggle.js +0 -0
  833. /package/dist/{form → src/form}/MenuItemRadio.js +0 -0
  834. /package/dist/{form → src/form}/MenuItemSwitch.js +0 -0
  835. /package/dist/{form → src/form}/MenuItemTextField.js +0 -0
  836. /package/dist/{form → src/form}/NativeSelect.js +0 -0
  837. /package/dist/{form → src/form}/OptGroup.js +0 -0
  838. /package/dist/{form → src/form}/Option.js +0 -0
  839. /package/dist/{form → src/form}/Password.js +0 -0
  840. /package/dist/{form → src/form}/Radio.js +0 -0
  841. /package/dist/{form → src/form}/Select.js +0 -0
  842. /package/dist/{form → src/form}/SelectValue.js +0 -0
  843. /package/dist/{form → src/form}/Slider.js +0 -0
  844. /package/dist/{form → src/form}/SliderContainer.js +0 -0
  845. /package/dist/{form → src/form}/SliderMark.js +0 -0
  846. /package/dist/{form → src/form}/SliderMarkLabel.js +0 -0
  847. /package/dist/{form → src/form}/SliderThumb.js +0 -0
  848. /package/dist/{form → src/form}/SliderTrack.js +0 -0
  849. /package/dist/{form → src/form}/SliderValueMarks.js +0 -0
  850. /package/dist/{form → src/form}/SliderValueTooltip.js +0 -0
  851. /package/dist/{form → src/form}/Switch.js +0 -0
  852. /package/dist/{form → src/form}/SwitchTrack.js +0 -0
  853. /package/dist/{form → src/form}/TextArea.js +0 -0
  854. /package/dist/{form → src/form}/TextField.js +0 -0
  855. /package/dist/{form → src/form}/TextFieldAddon.js +0 -0
  856. /package/dist/{form → src/form}/TextFieldContainer.js +0 -0
  857. /package/dist/{form → src/form}/TextFieldContainerStyles.js +0 -0
  858. /package/dist/{form → src/form}/fileUtils.js +0 -0
  859. /package/dist/{form → src/form}/formConfig.js +0 -0
  860. /package/dist/{form → src/form}/formMessageStyles.js +0 -0
  861. /package/dist/{form → src/form}/inputToggleStyles.js +0 -0
  862. /package/dist/{form → src/form}/nativeSelectStyles.js +0 -0
  863. /package/dist/{form → src/form}/optionStyles.js +0 -0
  864. /package/dist/{form → src/form}/passwordStyles.js +0 -0
  865. /package/dist/{form → src/form}/selectStyles.js +0 -0
  866. /package/dist/{form → src/form}/selectUtils.js +0 -0
  867. /package/dist/{form → src/form}/sliderUtils.js +0 -0
  868. /package/dist/{form → src/form}/switchStyles.js +0 -0
  869. /package/dist/{form → src/form}/textAreaStyles.js +0 -0
  870. /package/dist/{form → src/form}/textFieldStyles.js +0 -0
  871. /package/dist/{form → src/form}/types.js +0 -0
  872. /package/dist/{form → src/form}/useCheckboxGroup.js +0 -0
  873. /package/dist/{form → src/form}/useFileUpload.js +0 -0
  874. /package/dist/{form → src/form}/useListboxProvider.js +0 -0
  875. /package/dist/{form → src/form}/useNumberField.js +0 -0
  876. /package/dist/{form → src/form}/useRadioGroup.js +0 -0
  877. /package/dist/{form → src/form}/useRangeSlider.js +0 -0
  878. /package/dist/{form → src/form}/useResizingTextArea.js +0 -0
  879. /package/dist/{form → src/form}/useSlider.js +0 -0
  880. /package/dist/{form → src/form}/useTextField.js +0 -0
  881. /package/dist/{form → src/form}/utils.js +0 -0
  882. /package/dist/{form → src/form}/validation.js +0 -0
  883. /package/dist/{hoverMode → src/hoverMode}/useHoverMode.js +0 -0
  884. /package/dist/{hoverMode → src/hoverMode}/useHoverModeProvider.js +0 -0
  885. /package/dist/{icon → src/icon}/FontIcon.js +0 -0
  886. /package/dist/{icon → src/icon}/IconRotator.js +0 -0
  887. /package/dist/{icon → src/icon}/MaterialIcon.js +0 -0
  888. /package/dist/{icon → src/icon}/MaterialSymbol.js +0 -0
  889. /package/dist/{icon → src/icon}/SVGIcon.js +0 -0
  890. /package/dist/{icon → src/icon}/TextIconSpacing.js +0 -0
  891. /package/dist/{icon → src/icon}/iconConfig.js +0 -0
  892. /package/dist/{icon → src/icon}/material.js +0 -0
  893. /package/dist/{icon → src/icon}/materialConfig.js +0 -0
  894. /package/dist/{icon → src/icon}/styles.js +0 -0
  895. /package/dist/{index.js → src/index.js} +0 -0
  896. /package/dist/{interaction → src/interaction}/Ripple.js +0 -0
  897. /package/dist/{interaction → src/interaction}/RippleContainer.js +0 -0
  898. /package/dist/{interaction → src/interaction}/UserInteractionModeProvider.js +0 -0
  899. /package/dist/{interaction → src/interaction}/config.js +0 -0
  900. /package/dist/{interaction → src/interaction}/types.js +0 -0
  901. /package/dist/{interaction → src/interaction}/useElementInteraction.js +0 -0
  902. /package/dist/{interaction → src/interaction}/useHigherContrastChildren.js +0 -0
  903. /package/dist/{interaction → src/interaction}/utils.js +0 -0
  904. /package/dist/{layout → src/layout}/LayoutAppBar.js +0 -0
  905. /package/dist/{layout → src/layout}/LayoutNav.js +0 -0
  906. /package/dist/{layout → src/layout}/LayoutWindowSplitter.js +0 -0
  907. /package/dist/{layout → src/layout}/Main.js +0 -0
  908. /package/dist/{layout → src/layout}/layoutNavStyles.js +0 -0
  909. /package/dist/{layout → src/layout}/layoutWindowSplitterStyles.js +0 -0
  910. /package/dist/{layout → src/layout}/mainStyles.js +0 -0
  911. /package/dist/{layout → src/layout}/useExpandableLayout.js +0 -0
  912. /package/dist/{layout → src/layout}/useHorizontalLayoutTransition.js +0 -0
  913. /package/dist/{layout → src/layout}/useLayoutAppBarHeight.js +0 -0
  914. /package/dist/{layout → src/layout}/useLayoutTree.js +0 -0
  915. /package/dist/{layout → src/layout}/useLayoutWindowSplitter.js +0 -0
  916. /package/dist/{layout → src/layout}/useMainTabIndex.js +0 -0
  917. /package/dist/{layout → src/layout}/useResizableLayout.js +0 -0
  918. /package/dist/{layout → src/layout}/useTemporaryLayout.js +0 -0
  919. /package/dist/{link → src/link}/Link.js +0 -0
  920. /package/dist/{link → src/link}/SkipToMainContent.js +0 -0
  921. /package/dist/{link → src/link}/styles.js +0 -0
  922. /package/dist/{list → src/list}/List.js +0 -0
  923. /package/dist/{list → src/list}/ListItemAddon.js +0 -0
  924. /package/dist/{list → src/list}/ListItemChildren.js +0 -0
  925. /package/dist/{list → src/list}/ListItemText.js +0 -0
  926. /package/dist/{list → src/list}/ListSubheader.js +0 -0
  927. /package/dist/{list → src/list}/listItemStyles.js +0 -0
  928. /package/dist/{list → src/list}/types.js +0 -0
  929. /package/dist/{media-queries → src/media-queries}/AppSizeProvider.js +0 -0
  930. /package/dist/{media-queries → src/media-queries}/appSize.js +0 -0
  931. /package/dist/{media-queries → src/media-queries}/useMediaQuery.js +0 -0
  932. /package/dist/{menu → src/menu}/DropdownMenu.js +0 -0
  933. /package/dist/{menu → src/menu}/Menu.js +0 -0
  934. /package/dist/{menu → src/menu}/MenuBar.js +0 -0
  935. /package/dist/{menu → src/menu}/MenuButton.js +0 -0
  936. /package/dist/{menu → src/menu}/MenuConfigurationProvider.js +0 -0
  937. /package/dist/{menu → src/menu}/MenuItem.js +0 -0
  938. /package/dist/{menu → src/menu}/MenuItemButton.js +0 -0
  939. /package/dist/{menu → src/menu}/MenuItemGroup.js +0 -0
  940. /package/dist/{menu → src/menu}/MenuItemSeparator.js +0 -0
  941. /package/dist/{menu → src/menu}/MenuSheet.js +0 -0
  942. /package/dist/{menu → src/menu}/MenuVisibilityProvider.js +0 -0
  943. /package/dist/{menu → src/menu}/MenuWidget.js +0 -0
  944. /package/dist/{menu → src/menu}/MenuWidgetKeyboardProvider.js +0 -0
  945. /package/dist/{menu → src/menu}/useContextMenu.js +0 -0
  946. /package/dist/{menu → src/menu}/useMenuBarProvider.js +0 -0
  947. /package/dist/{menu → src/menu}/utils.js +0 -0
  948. /package/dist/{movement → src/movement}/constants.js +0 -0
  949. /package/dist/{movement → src/movement}/findMatchIndex.js +0 -0
  950. /package/dist/{movement → src/movement}/types.js +0 -0
  951. /package/dist/{movement → src/movement}/useKeyboardMovementProvider.js +0 -0
  952. /package/dist/{movement → src/movement}/utils.js +0 -0
  953. /package/dist/{overlay → src/overlay}/Overlay.js +0 -0
  954. /package/dist/{overlay → src/overlay}/overlayStyles.js +0 -0
  955. /package/dist/{portal → src/portal}/Portal.js +0 -0
  956. /package/dist/{portal → src/portal}/PortalContainerProvider.js +0 -0
  957. /package/dist/{positioning → src/positioning}/constants.js +0 -0
  958. /package/dist/{positioning → src/positioning}/createHorizontalPosition.js +0 -0
  959. /package/dist/{positioning → src/positioning}/createVerticalPosition.js +0 -0
  960. /package/dist/{positioning → src/positioning}/getFixedPosition.js +0 -0
  961. /package/dist/{positioning → src/positioning}/types.js +0 -0
  962. /package/dist/{positioning → src/positioning}/useFixedPositioning.js +0 -0
  963. /package/dist/{positioning → src/positioning}/utils.js +0 -0
  964. /package/dist/{progress → src/progress}/CircularProgress.js +0 -0
  965. /package/dist/{progress → src/progress}/LinearProgress.js +0 -0
  966. /package/dist/{progress → src/progress}/getProgressA11y.js +0 -0
  967. /package/dist/{progress → src/progress}/types.js +0 -0
  968. /package/dist/{responsive-item → src/responsive-item}/ResponsiveItemContainer.js +0 -0
  969. /package/dist/{responsive-item → src/responsive-item}/ResponsiveItemOverlay.js +0 -0
  970. /package/dist/{responsive-item → src/responsive-item}/styles.js +0 -0
  971. /package/dist/{scroll → src/scroll}/ScrollLock.js +0 -0
  972. /package/dist/{scroll → src/scroll}/getScrollbarWidth.js +0 -0
  973. /package/dist/{scroll → src/scroll}/useScrollLock.js +0 -0
  974. /package/dist/{segmented-button → src/segmented-button}/SegmentedButton.js +0 -0
  975. /package/dist/{segmented-button → src/segmented-button}/SegmentedButtonContainer.js +0 -0
  976. /package/dist/{segmented-button → src/segmented-button}/segmentedButtonContainerStyles.js +0 -0
  977. /package/dist/{segmented-button → src/segmented-button}/segmentedButtonStyles.js +0 -0
  978. /package/dist/{sheet → src/sheet}/Sheet.js +0 -0
  979. /package/dist/{sheet → src/sheet}/styles.js +0 -0
  980. /package/dist/{snackbar → src/snackbar}/DefaultToastRenderer.js +0 -0
  981. /package/dist/{snackbar → src/snackbar}/Snackbar.js +0 -0
  982. /package/dist/{snackbar → src/snackbar}/Toast.js +0 -0
  983. /package/dist/{snackbar → src/snackbar}/ToastActionButton.js +0 -0
  984. /package/dist/{snackbar → src/snackbar}/ToastCloseButton.js +0 -0
  985. /package/dist/{snackbar → src/snackbar}/ToastContent.js +0 -0
  986. /package/dist/{snackbar → src/snackbar}/ToastManager.js +0 -0
  987. /package/dist/{snackbar → src/snackbar}/ToastManagerProvider.js +0 -0
  988. /package/dist/{snackbar → src/snackbar}/snackbarStyles.js +0 -0
  989. /package/dist/{snackbar → src/snackbar}/toastContentStyles.js +0 -0
  990. /package/dist/{snackbar → src/snackbar}/toastStyles.js +0 -0
  991. /package/dist/{snackbar → src/snackbar}/useCurrentToastActions.js +0 -0
  992. /package/dist/{suspense → src/suspense}/CircularProgressSuspense.js +0 -0
  993. /package/dist/{suspense → src/suspense}/NullSuspense.js +0 -0
  994. /package/dist/{table → src/table}/Table.js +0 -0
  995. /package/dist/{table → src/table}/TableBody.js +0 -0
  996. /package/dist/{table → src/table}/TableCell.js +0 -0
  997. /package/dist/{table → src/table}/TableCellContent.js +0 -0
  998. /package/dist/{table → src/table}/TableCheckbox.js +0 -0
  999. /package/dist/{table → src/table}/TableConfigurationProvider.js +0 -0
  1000. /package/dist/{table → src/table}/TableContainer.js +0 -0
  1001. /package/dist/{table → src/table}/TableContainerProvider.js +0 -0
  1002. /package/dist/{table → src/table}/TableFooter.js +0 -0
  1003. /package/dist/{table → src/table}/TableHeader.js +0 -0
  1004. /package/dist/{table → src/table}/TableRadio.js +0 -0
  1005. /package/dist/{table → src/table}/TableRow.js +0 -0
  1006. /package/dist/{table → src/table}/tableCellStyles.js +0 -0
  1007. /package/dist/{table → src/table}/tableContainerStyles.js +0 -0
  1008. /package/dist/{table → src/table}/tableFooterStyles.js +0 -0
  1009. /package/dist/{table → src/table}/tableHeaderStyles.js +0 -0
  1010. /package/dist/{table → src/table}/tableRowStyles.js +0 -0
  1011. /package/dist/{table → src/table}/tableStyles.js +0 -0
  1012. /package/dist/{table → src/table}/types.js +0 -0
  1013. /package/dist/{tabs → src/tabs}/Tab.js +0 -0
  1014. /package/dist/{tabs → src/tabs}/TabList.js +0 -0
  1015. /package/dist/{tabs → src/tabs}/TabListScrollButton.js +0 -0
  1016. /package/dist/{tabs → src/tabs}/tabIndicatorStyles.js +0 -0
  1017. /package/dist/{tabs → src/tabs}/tabListScrollButtonStyles.js +0 -0
  1018. /package/dist/{tabs → src/tabs}/tabListStyles.js +0 -0
  1019. /package/dist/{tabs → src/tabs}/tabStyles.js +0 -0
  1020. /package/dist/{tabs → src/tabs}/useTabList.js +0 -0
  1021. /package/dist/{tabs → src/tabs}/useTabs.js +0 -0
  1022. /package/dist/{tabs → src/tabs}/utils.js +0 -0
  1023. /package/dist/{test-utils → src/test-utils}/IntersectionObserver.js +0 -0
  1024. /package/dist/{test-utils → src/test-utils}/ResizeObserver.js +0 -0
  1025. /package/dist/{test-utils → src/test-utils}/data-testid.js +0 -0
  1026. /package/dist/{test-utils → src/test-utils}/index.js +0 -0
  1027. /package/dist/{test-utils → src/test-utils}/jest-setup.js +0 -0
  1028. /package/dist/{test-utils → src/test-utils}/matchMedia.js +0 -0
  1029. /package/dist/{test-utils → src/test-utils}/polyfills/IntersectionObserver.js +0 -0
  1030. /package/dist/{test-utils → src/test-utils}/polyfills/ResizeObserver.js +0 -0
  1031. /package/dist/{test-utils → src/test-utils}/polyfills/index.js +0 -0
  1032. /package/dist/{test-utils → src/test-utils}/polyfills/matchMedia.js +0 -0
  1033. /package/dist/{test-utils → src/test-utils}/polyfills/offsetParent.js +0 -0
  1034. /package/dist/{test-utils → src/test-utils}/polyfills/scrollIntoView.js +0 -0
  1035. /package/dist/{test-utils → src/test-utils}/render.js +0 -0
  1036. /package/dist/{test-utils → src/test-utils}/timers.js +0 -0
  1037. /package/dist/{theme → src/theme}/LocalStorageColorSchemeProvider.js +0 -0
  1038. /package/dist/{theme → src/theme}/ThemeProvider.js +0 -0
  1039. /package/dist/{theme → src/theme}/colors.js +0 -0
  1040. /package/dist/{theme → src/theme}/cssVars.js +0 -0
  1041. /package/dist/{theme → src/theme}/types.js +0 -0
  1042. /package/dist/{theme → src/theme}/useCSSVariables.js +0 -0
  1043. /package/dist/{theme → src/theme}/useColorScheme.js +0 -0
  1044. /package/dist/{theme → src/theme}/useColorSchemeMetaTag.js +0 -0
  1045. /package/dist/{theme → src/theme}/useColorSchemeProvider.js +0 -0
  1046. /package/dist/{theme → src/theme}/usePrefersColorScheme.js +0 -0
  1047. /package/dist/{theme → src/theme}/utils.js +0 -0
  1048. /package/dist/{tooltip → src/tooltip}/Tooltip.js +0 -0
  1049. /package/dist/{tooltip → src/tooltip}/TooltipHoverModeProvider.js +0 -0
  1050. /package/dist/{tooltip → src/tooltip}/constants.js +0 -0
  1051. /package/dist/{tooltip → src/tooltip}/tooltipStyles.js +0 -0
  1052. /package/dist/{tooltip → src/tooltip}/useTooltip.js +0 -0
  1053. /package/dist/{tooltip → src/tooltip}/useTooltipPosition.js +0 -0
  1054. /package/dist/{tooltip → src/tooltip}/utils.js +0 -0
  1055. /package/dist/{transition → src/transition}/CSSTransition.js +0 -0
  1056. /package/dist/{transition → src/transition}/Collapse.js +0 -0
  1057. /package/dist/{transition → src/transition}/CrossFade.js +0 -0
  1058. /package/dist/{transition → src/transition}/ScaleTransition.js +0 -0
  1059. /package/dist/{transition → src/transition}/SkeletonPlaceholder.js +0 -0
  1060. /package/dist/{transition → src/transition}/Slide.js +0 -0
  1061. /package/dist/{transition → src/transition}/SlideContainer.js +0 -0
  1062. /package/dist/{transition → src/transition}/collapseStyles.js +0 -0
  1063. /package/dist/{transition → src/transition}/config.js +0 -0
  1064. /package/dist/{transition → src/transition}/maxWidthTransition.js +0 -0
  1065. /package/dist/{transition → src/transition}/skeletonPlaceholderUtils.js +0 -0
  1066. /package/dist/{transition → src/transition}/types.js +0 -0
  1067. /package/dist/{transition → src/transition}/useCSSTransition.js +0 -0
  1068. /package/dist/{transition → src/transition}/useCarousel.js +0 -0
  1069. /package/dist/{transition → src/transition}/useCollapseTransition.js +0 -0
  1070. /package/dist/{transition → src/transition}/useCrossFadeTransition.js +0 -0
  1071. /package/dist/{transition → src/transition}/useMaxWidthTransition.js +0 -0
  1072. /package/dist/{transition → src/transition}/useScaleTransition.js +0 -0
  1073. /package/dist/{transition → src/transition}/useSkeletonPlaceholder.js +0 -0
  1074. /package/dist/{transition → src/transition}/useSlideTransition.js +0 -0
  1075. /package/dist/{transition → src/transition}/useTransition.js +0 -0
  1076. /package/dist/{transition → src/transition}/utils.js +0 -0
  1077. /package/dist/{tree → src/tree}/DefaultTreeItemRenderer.js +0 -0
  1078. /package/dist/{tree → src/tree}/Tree.js +0 -0
  1079. /package/dist/{tree → src/tree}/TreeGroup.js +0 -0
  1080. /package/dist/{tree → src/tree}/TreeItem.js +0 -0
  1081. /package/dist/{tree → src/tree}/TreeItemExpander.js +0 -0
  1082. /package/dist/{tree → src/tree}/TreeProvider.js +0 -0
  1083. /package/dist/{tree → src/tree}/styles.js +0 -0
  1084. /package/dist/{tree → src/tree}/types.js +0 -0
  1085. /package/dist/{tree → src/tree}/useTree.js +0 -0
  1086. /package/dist/{tree → src/tree}/useTreeExpansion.js +0 -0
  1087. /package/dist/{tree → src/tree}/useTreeItems.js +0 -0
  1088. /package/dist/{tree → src/tree}/useTreeMovement.js +0 -0
  1089. /package/dist/{tree → src/tree}/useTreeSelection.js +0 -0
  1090. /package/dist/{tree → src/tree}/utils.js +0 -0
  1091. /package/dist/{types.js → src/types.js} +0 -0
  1092. /package/dist/{typography → src/typography}/SrOnly.js +0 -0
  1093. /package/dist/{typography → src/typography}/TextContainer.js +0 -0
  1094. /package/dist/{typography → src/typography}/Typography.js +0 -0
  1095. /package/dist/{typography → src/typography}/WritingDirectionProvider.js +0 -0
  1096. /package/dist/{useAsyncAction.js → src/useAsyncAction.js} +0 -0
  1097. /package/dist/{useDebouncedFunction.js → src/useDebouncedFunction.js} +0 -0
  1098. /package/dist/{useDropzone.js → src/useDropzone.js} +0 -0
  1099. /package/dist/{useElementSize.js → src/useElementSize.js} +0 -0
  1100. /package/dist/{useEnsuredId.js → src/useEnsuredId.js} +0 -0
  1101. /package/dist/{useEnsuredRef.js → src/useEnsuredRef.js} +0 -0
  1102. /package/dist/{useEnsuredState.js → src/useEnsuredState.js} +0 -0
  1103. /package/dist/{useHtmlClassName.js → src/useHtmlClassName.js} +0 -0
  1104. /package/dist/{useIntersectionObserver.js → src/useIntersectionObserver.js} +0 -0
  1105. /package/dist/{useIsomorphicLayoutEffect.js → src/useIsomorphicLayoutEffect.js} +0 -0
  1106. /package/dist/{useLocalStorage.js → src/useLocalStorage.js} +0 -0
  1107. /package/dist/{useOrientation.js → src/useOrientation.js} +0 -0
  1108. /package/dist/{usePageInactive.js → src/usePageInactive.js} +0 -0
  1109. /package/dist/{useResizeListener.js → src/useResizeListener.js} +0 -0
  1110. /package/dist/{useResizeObserver.js → src/useResizeObserver.js} +0 -0
  1111. /package/dist/{useThrottledFunction.js → src/useThrottledFunction.js} +0 -0
  1112. /package/dist/{useToggle.js → src/useToggle.js} +0 -0
  1113. /package/dist/{useUnmounted.js → src/useUnmounted.js} +0 -0
  1114. /package/dist/{useWindowSize.js → src/useWindowSize.js} +0 -0
  1115. /package/dist/{utils → src/utils}/RenderRecursively.js +0 -0
  1116. /package/dist/{utils → src/utils}/alphaNumericSort.js +0 -0
  1117. /package/dist/{utils → src/utils}/applyRef.js +0 -0
  1118. /package/dist/{utils → src/utils}/bem.js +0 -0
  1119. /package/dist/{utils → src/utils}/filters.js +0 -0
  1120. /package/dist/{utils → src/utils}/getClientPosition.js +0 -0
  1121. /package/dist/{utils → src/utils}/getMiddleOfRange.js +0 -0
  1122. /package/dist/{utils → src/utils}/getPercentage.js +0 -0
  1123. /package/dist/{utils → src/utils}/getRangeDefaultValue.js +0 -0
  1124. /package/dist/{utils → src/utils}/getRangeSteps.js +0 -0
  1125. /package/dist/{utils → src/utils}/identity.js +0 -0
  1126. /package/dist/{utils → src/utils}/isElementVisible.js +0 -0
  1127. /package/dist/{utils → src/utils}/loop.js +0 -0
  1128. /package/dist/{utils → src/utils}/nearest.js +0 -0
  1129. /package/dist/{utils → src/utils}/parseCssLengthUnit.js +0 -0
  1130. /package/dist/{utils → src/utils}/randomInt.js +0 -0
  1131. /package/dist/{utils → src/utils}/wait.js +0 -0
  1132. /package/dist/{utils → src/utils}/withinRange.js +0 -0
  1133. /package/dist/{window-splitter → src/window-splitter}/WindowSplitter.js +0 -0
  1134. /package/dist/{window-splitter → src/window-splitter}/useWindowSplitter.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/sliderUtils.ts"],"sourcesContent":["import { type RefObject } from \"react\";\nimport {\n type DraggableEventHandlers,\n type DraggableImplementation,\n type DraggableMouseEventHandlers,\n type DraggableTouchEventHandlers,\n} from \"../draggable/useDraggable.js\";\nimport { type RenameKeysWithPrefix } from \"../types.js\";\nimport {\n getClientPosition,\n type ClientPositionEvent,\n} from \"../utils/getClientPosition.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { getRangeSteps } from \"../utils/getRangeSteps.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ninterface JumpOptions {\n min: number;\n max: number;\n step: number;\n jump: number | undefined;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const getJumpValue = (options: JumpOptions): number => {\n const { min, max, step, jump } = options;\n\n const steps = getRangeSteps({ min, max, step });\n const value = jump ?? (steps / 10) * step;\n if (Number.isInteger(step)) {\n return Math.ceil(value);\n }\n\n return value;\n};\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ntype RequiredThumbProps = Pick<\n DraggableImplementation<HTMLElement>,\n | \"dragging\"\n | keyof DraggableMouseEventHandlers<HTMLElement>\n | keyof DraggableTouchEventHandlers<HTMLElement>\n> & { ref: RefObject<HTMLSpanElement> };\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type ClosestThumbEventHandlersOptions = RenameKeysWithPrefix<\n RequiredThumbProps,\n \"thumb1\"\n> &\n RenameKeysWithPrefix<RequiredThumbProps, \"thumb2\"> & {\n vertical: boolean;\n isRangeSlider: boolean;\n };\n\n/**\n * NOTE: I do not need the mousemove events for this one to work.\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const getClosestThumbEventHandlers = (\n options: ClosestThumbEventHandlersOptions\n): DraggableEventHandlers<HTMLElement> => {\n const {\n thumb1Ref,\n thumb1Dragging,\n thumb1OnMouseUp,\n thumb1OnMouseDown,\n thumb1OnTouchStart,\n thumb1OnTouchMove,\n thumb2Ref,\n thumb2Dragging,\n thumb2OnMouseUp,\n thumb2OnMouseDown,\n thumb2OnTouchStart,\n thumb2OnTouchMove,\n isRangeSlider,\n vertical,\n } = options;\n\n if (!isRangeSlider) {\n return {\n onMouseDown: thumb1OnMouseDown,\n onMouseUp: thumb1OnMouseUp,\n onTouchStart: thumb1OnTouchStart,\n onTouchMove: thumb1OnTouchMove,\n };\n }\n\n const isThumbOneClosest = (event: ClientPositionEvent): boolean => {\n if (thumb2Dragging) {\n return false;\n }\n\n const thumb1 = thumb1Ref.current;\n const thumb2 = thumb2Ref.current;\n if (!thumb1Dragging && thumb1 && thumb2) {\n const clientPosition = getClientPosition({ event, vertical });\n const thumb1Rect = thumb1.getBoundingClientRect();\n const thumb2Rect = thumb2.getBoundingClientRect();\n const thumb1Position = vertical ? thumb1Rect.y : thumb1Rect.x;\n const thumb2Position = vertical ? thumb2Rect.y : thumb2Rect.x;\n\n return (\n Math.abs(clientPosition - thumb1Position) <\n Math.abs(clientPosition - thumb2Position)\n );\n }\n\n return true;\n };\n\n return {\n onMouseDown(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseDown(event);\n } else {\n thumb2OnMouseDown(event);\n }\n },\n onMouseUp(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnMouseUp(event);\n } else {\n thumb2OnMouseUp(event);\n }\n },\n onTouchStart(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchStart(event);\n } else {\n thumb2OnTouchStart(event);\n }\n },\n onTouchMove(event) {\n if (isThumbOneClosest(event)) {\n thumb1OnTouchMove(event);\n } else {\n thumb2OnTouchMove(event);\n }\n },\n };\n};\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function getThumbOffset(\n offset: number | undefined,\n fallback: number\n): string | undefined {\n if (typeof offset !== \"number\") {\n return;\n }\n\n // the `offset` will be NaN when there are no possible steps to take because\n // the first thumb is at the maximum value or the second thumb is at the\n // minimum value\n const value = Number.isNaN(offset) ? fallback : offset;\n return `${value * 100}%`;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface ThumbOffsetsOptions {\n min: number;\n max: number;\n thumb1Value: number;\n thumb1Dragging: boolean;\n thumb1DragPercentage: number;\n thumb2Value: number;\n thumb2Dragging: boolean;\n thumb2DragPercentage: number;\n isRangeSlider: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ninterface ThumbOffsets {\n \"--rmd-slider-offset-1\"?: string;\n \"--rmd-slider-offset-2\"?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const getThumbOffsets = (options: ThumbOffsetsOptions): ThumbOffsets => {\n const {\n min,\n max,\n thumb1Value,\n thumb1Dragging,\n thumb1DragPercentage,\n thumb2Value,\n thumb2Dragging,\n thumb2DragPercentage,\n isRangeSlider,\n } = options;\n let thumb1Percentage = thumb1Dragging\n ? thumb1DragPercentage\n : getPercentage({ min, max, value: thumb1Value });\n\n let thumb2Percentage: number | undefined;\n if (isRangeSlider) {\n const percentage = getPercentage({ min, max, value: thumb2Value });\n\n thumb1Percentage = Math.min(thumb1Percentage, percentage);\n thumb2Percentage = thumb2Dragging\n ? Math.max(thumb1Percentage, thumb2DragPercentage)\n : percentage;\n }\n\n return {\n \"--rmd-slider-offset-1\": getThumbOffset(thumb1Percentage, 0),\n \"--rmd-slider-offset-2\": getThumbOffset(thumb2Percentage, 1),\n };\n};\n"],"names":["getClientPosition","getPercentage","getRangeSteps","getJumpValue","options","min","max","step","jump","steps","value","Number","isInteger","Math","ceil","getClosestThumbEventHandlers","thumb1Ref","thumb1Dragging","thumb1OnMouseUp","thumb1OnMouseDown","thumb1OnTouchStart","thumb1OnTouchMove","thumb2Ref","thumb2Dragging","thumb2OnMouseUp","thumb2OnMouseDown","thumb2OnTouchStart","thumb2OnTouchMove","isRangeSlider","vertical","onMouseDown","onMouseUp","onTouchStart","onTouchMove","isThumbOneClosest","event","thumb1","current","thumb2","clientPosition","thumb1Rect","getBoundingClientRect","thumb2Rect","thumb1Position","y","x","thumb2Position","abs","getThumbOffset","offset","fallback","isNaN","getThumbOffsets","thumb1Value","thumb1DragPercentage","thumb2Value","thumb2DragPercentage","thumb1Percentage","thumb2Percentage","percentage"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/switchStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-switch-track-background-color\"?: string;\n \"--rmd-switch-ball-background-color\"?: string;\n }\n}\n\nconst styles = bem(\"rmd-switch\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SwitchClassNameOptions {\n className?: string;\n clickable?: boolean;\n currentColor?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function switchStyles(options: SwitchClassNameOptions = {}): string {\n const { className, clickable, currentColor } = options;\n\n return cnb(styles({ \"current-color\": currentColor, clickable }), className);\n}\n"],"names":["cnb","bem","styles","switchStyles","options","className","clickable","currentColor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAWnB;;CAEC,GACD,OAAO,SAASE,aAAaC,UAAkC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGH;IAE/C,OAAOJ,IAAIE,OAAO;QAAE,iBAAiBK;QAAcD;IAAU,IAAID;AACnE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/textAreaStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n textField,\n type TextFieldClassNameOptions,\n} from \"./textFieldStyles.js\";\nimport { type TextAreaResize } from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-textarea-height\"?: string | number;\n \"--rmd-textarea-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-textarea\");\nconst containerStyles = bem(\"rmd-textarea-container\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TextareaClassNameOptions extends TextFieldClassNameOptions {\n className?: string;\n\n /**\n * This should not be used externally and is only used for creating the hidden\n * textarea mask for the auto resizing behavior.\n *\n * @defaultValue `false`\n */\n mask?: boolean;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * Set this to `true` if the textarea should display a scrollbar.\n *\n * @defaultValue `false`\n */\n scrollable?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function textArea(options: TextareaClassNameOptions = {}): string {\n const {\n className,\n mask,\n resize = \"auto\",\n scrollable,\n placeholderHidden,\n } = options;\n\n return cnb(\n textField({ placeholderHidden }),\n styles({\n rh: resize === \"horizontal\",\n rv: resize === \"vertical\",\n rn: resize === \"auto\" || resize === \"none\",\n mask,\n scrollable: scrollable || resize === \"none\",\n }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TextareaContainerClassNameOptions {\n className?: string;\n height?: boolean;\n disabled?: boolean;\n animate?: boolean;\n underlineLabelled?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function textAreaContainer(\n options: TextareaContainerClassNameOptions = {}\n): string {\n const { className, height, animate, disabled, underlineLabelled } = options;\n\n return cnb(\n containerStyles({\n height,\n animate,\n cursor: !disabled,\n \"underline-labelled\": underlineLabelled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","textField","styles","containerStyles","textArea","options","className","mask","resize","scrollable","placeholderHidden","rh","rv","rn","textAreaContainer","height","animate","disabled","underlineLabelled","cursor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SACEC,SAAS,QAEJ,uBAAuB;AAU9B,MAAMC,SAASF,IAAI;AACnB,MAAMG,kBAAkBH,IAAI;AA8B5B;;CAEC,GACD,OAAO,SAASI,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,SAAS,MAAM,EACfC,UAAU,EACVC,iBAAiB,EAClB,GAAGL;IAEJ,OAAON,IACLE,UAAU;QAAES;IAAkB,IAC9BR,OAAO;QACLS,IAAIH,WAAW;QACfI,IAAIJ,WAAW;QACfK,IAAIL,WAAW,UAAUA,WAAW;QACpCD;QACAE,YAAYA,cAAcD,WAAW;IACvC,IACAF;AAEJ;AAaA;;CAEC,GACD,OAAO,SAASQ,kBACdT,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEC,SAAS,EAAES,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGb;IAEpE,OAAON,IACLI,gBAAgB;QACdY;QACAC;QACAG,QAAQ,CAACF;QACT,sBAAsBC;IACxB,IACAZ;AAEJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/textFieldStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-text-field\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextFieldClassNameOptions {\n className?: string;\n\n /**\n * Set this value to `true` when a text field has a floating label the text\n * field is not focused or valued so that the placeholder is hidden by setting\n * the opacity to 0. This makes it so the placeholder and label to not cover\n * each other.\n *\n * @defaultValue `false`\n */\n placeholderHidden?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function textField(options: TextFieldClassNameOptions = {}): string {\n const { className, placeholderHidden = false } = options;\n\n return cnb(\n styles({\n \"placeholder-hidden\": placeholderHidden,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","textField","options","className","placeholderHidden"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,oBAAoB,KAAK,EAAE,GAAGF;IAEjD,OAAOJ,IACLE,OAAO;QACL,sBAAsBI;IACxB,IACAD;AAEJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutoCompleteValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface UserAgentAutoCompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutoCompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutoCompleteValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutoCompleteProps.name}\n */\n autoCompleteValue?: AutoCompleteValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @remarks \\@since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0 Added support for `leftAddonProps` and\n * `rightAddonProps`.\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * Set this to `true` if this component should stretch to fill a flex or grid\n * container using `flex: 1 1 auto`.\n *\n * @defaultValue `false`\n */\n stretch?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAihBA,WAmDC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useCheckboxGroup.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\n\nconst EMPTY_LIST = [] as const;\n\n/** @remarks \\@since 6.0.0 */\nexport interface CheckboxGroupOptions<V> {\n /**\n * A `name` to apply to all the checkboxes within the group. This is required\n * if the {@link menu} option is set to `true`.\n */\n name?: string;\n\n /**\n * Set this to `true` if using the `MenuItemCheckbox` component instead of the\n * `Checkbox` so the correct props can be provided.\n *\n * @defaultValue `false`\n */\n menu?: boolean;\n\n /**\n * This prop **must** be defined to enable the indeterminate checkbox feature\n * from the hook. This should be a list of all the possible checkbox values in\n * the group. This will be used to select all values when the indeterminate\n * checkbox is checked and determine if all the checkboxes have manually be\n * selected.\n *\n * @example\n * Indeterminate Behavior\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues,\n * } = useCheckboxGroup({ name: \"group\", values: VALUES });\n * ```\n */\n values?: readonly V[];\n\n /**\n * Set this to a list of checkbox values that should be checked by default.\n *\n * @defaultValue `[]`\n */\n defaultCheckedValues?: UseStateInitializer<readonly V[]>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface CheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name: string;\n value: V;\n checked: boolean;\n onChange(): void;\n };\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface IndeterminateCheckboxGroupImplementation<V extends string>\n extends CheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n name: string;\n checked: boolean;\n indeterminate: boolean;\n onChange(): void;\n };\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface MenuItemCheckboxGroupImplementation<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n checked: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface IndeterminateMenuItemCheckboxGroupImplementation<\n V extends string,\n> extends MenuItemCheckboxGroupImplementation<V> {\n getIndeterminateProps(): {\n \"aria-checked\": \"mixed\" | undefined;\n checked: boolean;\n indeterminate: boolean;\n onCheckedChange(): void;\n };\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface CombinedCheckboxGroupReturnValue<V extends string> {\n reset(): void;\n checkedValues: ReadonlySet<V>;\n setCheckedValues: UseStateSetter<ReadonlySet<V>>;\n getCheckboxProps(value: V): {\n name?: string;\n value?: V;\n checked: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n getIndeterminateProps?(): {\n \"aria-checked\": \"mixed\" | undefined;\n name?: string;\n checked: boolean;\n indeterminate: boolean;\n onChange?(): void;\n onCheckedChange?(): void;\n };\n}\n\n/**\n * @example\n * Checkbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ name: \"example\" });\n *\n * return (\n * <>\n * <Checkbox {...getCheckboxProps(\"a\")}>\n * First\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"b\")}>\n * Second\n * </Checkbox>\n * <Checkbox {...getCheckboxProps(\"c\")}>\n * Third\n * </Checkbox>\n * </>\n * );\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values?: never;\n }\n): CheckboxGroupImplementation<V>;\n/**\n * @example\n * Indeterminate Checkbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const {\n * getCheckboxProps,\n * getIndeterminateProps,\n * checkedValues\n * } = useCheckboxGroup({\n * name: \"example\",\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <Checkbox {...getIndeterminateProps()} label=\"Select all\" />\n * {VALUES.map(({ label, value }) => (\n * <Checkbox key={value} label={label} {...getCheckboxProps(value)} />\n * ))}\n * </>\n * );\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu?: false;\n name: string;\n values: readonly V[];\n }\n): IndeterminateCheckboxGroupImplementation<V>;\n/**\n * @example\n * MenuItemCheckbox Group\n * ```tsx\n * const { getCheckboxProps, checkedValues } = useCheckboxGroup({ menu: true });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getCheckboxProps(\"a\")}>\n * First\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"b\")}>\n * Second\n * </MenuItemCheckbox>\n * <MenuItemCheckbox {...getCheckboxProps(\"c\")}>\n * Third\n * </MenuItemCheckbox>\n * </>\n * );\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values?: never;\n }\n): MenuItemCheckboxGroupImplementation<V>;\n/**\n * @example\n * Indeterminate MenuItemCheckbox Group\n * ```tsx\n * const OPTIONS = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const:\n * const VALUES = OPTIONS.map(({ value }) => value) as const;\n *\n * const { getCheckboxProps, getIndeterminateProps, checkedValues } = useCheckboxGroup({\n * menu: true,\n * values: VALUES,\n * });\n *\n * return (\n * <>\n * <MenuItemCheckbox {...getIndeterminateProps()}>\n * All\n * <MenuItemCheckbox>\n * {OPTIONS.map(({ label, value }) => (\n * <MenuItemCheckbox key={value} {...getCheckboxProps(value)}>\n * {label}\n * </MenuItemCheckbox>\n * ))}\n * </>\n * );\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V> & {\n menu: true;\n name?: never;\n values: readonly V[];\n }\n): IndeterminateMenuItemCheckboxGroupImplementation<V>;\nexport function useCheckboxGroup<V extends string>(\n options: CheckboxGroupOptions<V>\n): CombinedCheckboxGroupReturnValue<V> {\n const {\n name,\n menu = false,\n values,\n defaultCheckedValues = EMPTY_LIST,\n } = options;\n const [checkedValues, setCheckedValues] = useState<ReadonlySet<V>>(() => {\n if (typeof defaultCheckedValues === \"function\") {\n return new Set(defaultCheckedValues());\n }\n\n return new Set(defaultCheckedValues);\n });\n const initial = useRef(checkedValues);\n\n let getIndeterminateProps: CombinedCheckboxGroupReturnValue<V>[\"getIndeterminateProps\"];\n if (values) {\n getIndeterminateProps = () => {\n const checked = checkedValues.size > 0;\n const indeterminate = checked && checkedValues.size < values.length;\n\n return {\n \"aria-checked\": indeterminate ? \"mixed\" : undefined,\n name,\n checked,\n indeterminate,\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues(() => {\n if (checkedValues.size === 0 || indeterminate) {\n return new Set(values);\n }\n\n return new Set();\n });\n },\n };\n };\n }\n\n return {\n reset: useCallback(() => {\n setCheckedValues(initial.current);\n }, []),\n checkedValues,\n setCheckedValues,\n getIndeterminateProps,\n getCheckboxProps(value) {\n return {\n name,\n value: menu ? undefined : value,\n checked: checkedValues.has(value),\n [menu ? \"onCheckedChange\" : \"onChange\"]() {\n setCheckedValues((prevValues) => {\n const nextValues = new Set(prevValues);\n if (prevValues.has(value)) {\n nextValues.delete(value);\n } else {\n nextValues.add(value);\n }\n\n return nextValues;\n });\n },\n };\n },\n };\n}\n"],"names":["useCallback","useRef","useState","EMPTY_LIST","useCheckboxGroup","options","name","menu","values","defaultCheckedValues","checkedValues","setCheckedValues","Set","initial","getIndeterminateProps","checked","size","indeterminate","length","undefined","reset","current","getCheckboxProps","value","has","prevValues","nextValues","delete","add"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGtD,MAAMC,aAAa,EAAE;AAoQrB,OAAO,SAASC,iBACdC,OAAgC;IAEhC,MAAM,EACJC,IAAI,EACJC,OAAO,KAAK,EACZC,MAAM,EACNC,uBAAuBN,UAAU,EAClC,GAAGE;IACJ,MAAM,CAACK,eAAeC,iBAAiB,GAAGT,SAAyB;QACjE,IAAI,OAAOO,yBAAyB,YAAY;YAC9C,OAAO,IAAIG,IAAIH;QACjB;QAEA,OAAO,IAAIG,IAAIH;IACjB;IACA,MAAMI,UAAUZ,OAAOS;IAEvB,IAAII;IACJ,IAAIN,QAAQ;QACVM,wBAAwB;YACtB,MAAMC,UAAUL,cAAcM,IAAI,GAAG;YACrC,MAAMC,gBAAgBF,WAAWL,cAAcM,IAAI,GAAGR,OAAOU,MAAM;YAEnE,OAAO;gBACL,gBAAgBD,gBAAgB,UAAUE;gBAC1Cb;gBACAS;gBACAE;gBACA,CAACV,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB;wBACf,IAAID,cAAcM,IAAI,KAAK,KAAKC,eAAe;4BAC7C,OAAO,IAAIL,IAAIJ;wBACjB;wBAEA,OAAO,IAAII;oBACb;gBACF;YACF;QACF;IACF;IAEA,OAAO;QACLQ,OAAOpB,YAAY;YACjBW,iBAAiBE,QAAQQ,OAAO;QAClC,GAAG,EAAE;QACLX;QACAC;QACAG;QACAQ,kBAAiBC,KAAK;YACpB,OAAO;gBACLjB;gBACAiB,OAAOhB,OAAOY,YAAYI;gBAC1BR,SAASL,cAAcc,GAAG,CAACD;gBAC3B,CAAChB,OAAO,oBAAoB,WAAW;oBACrCI,iBAAiB,CAACc;wBAChB,MAAMC,aAAa,IAAId,IAAIa;wBAC3B,IAAIA,WAAWD,GAAG,CAACD,QAAQ;4BACzBG,WAAWC,MAAM,CAACJ;wBACpB,OAAO;4BACLG,WAAWE,GAAG,CAACL;wBACjB;wBAEA,OAAOG;oBACT;gBACF;YACF;QACF;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useFileUpload.ts"],"sourcesContent":["\"use client\";\nimport { nanoid } from \"nanoid\";\nimport {\n useCallback,\n useEffect,\n useReducer,\n type ChangeEvent,\n type DragEvent,\n} from \"react\";\nimport {\n FileAccessError,\n getFileParser as defaultGetFileParser,\n isValidFileName as defaultIsValidFileName,\n validateFiles as defaultValidateFiles,\n type CompletedFileUploadStats,\n type FileReaderResult,\n type FileUploadHandlers,\n type FileUploadStats,\n type FileValidationError,\n type FileValidationOptions,\n type FilesValidator,\n type GetFileParser,\n type ProcessingFileUploadStats,\n} from \"./fileUtils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @remarks \\@since 2.9.0\n */\nexport interface FileUploadState<CustomError = never> {\n /**\n * All the files that have been validated and are either:\n * - pending upload\n * - uploading\n * - complete\n *\n * Each key in this object is the {@link BaseFileUploadStats.key} generated\n * once the upload starts pending.\n */\n stats: Readonly<Record<string, Readonly<FileUploadStats>>>;\n\n /**\n * A list of validation errors that have occurred before starting the upload\n * process.\n *\n * @see {@link FileAccessError}\n * @see {@link TooManyFilesError}\n * @see {@link FileValidationError}\n */\n errors: readonly FileValidationError<CustomError>[];\n}\n\n/**\n *\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @remarks \\@since 2.9.0\n * @internal\n */\nexport interface FileUploadHookState<CustomError = never>\n extends FileUploadState<CustomError> {\n /**\n * All the current readers used for uploading files to the browser.\n *\n * Note: Once an upload has completed, the reader will be removed.\n */\n readers: Readonly<Record<string, FileReader>>;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @remarks \\@since 2.9.0\n */\nexport interface FileUploadOptions<E extends HTMLElement, CustomError = never>\n extends FileUploadHandlers<E>,\n FileValidationOptions {\n /**\n * Setting this value to a number greater than `0` will update the browser\n * upload process to queue the uploads in chunks instead of all at once. This\n * can help prevent the browser from freezing if dealing with large files that\n * are being converted to data urls.\n *\n * @defaultValue `-1`\n */\n concurrency?: number;\n\n /** {@inheritDoc FilesValidator} */\n validateFiles?: FilesValidator<CustomError>;\n /** {@inheritDoc GetFileParser} */\n getFileParser?: GetFileParser;\n}\n\n/** @internal */\ntype Action<E = never> =\n | {\n type: \"queue\";\n errors: readonly FileValidationError<E>[];\n files: readonly File[];\n }\n | { type: \"reset\" }\n | { type: \"remove\"; files: readonly string[] }\n | { type: \"start\"; key: string; reader: FileReader }\n | { type: \"progress\"; key: string; progress: number }\n | { type: \"complete\"; key: string; result: FileReaderResult }\n | { type: \"clearErrors\" };\n\n/** @remarks \\@since 2.9.0 */\nexport interface FileUploadActions {\n /**\n * Reset everything related to uploads ensuring that all file readers have\n * been aborted.\n */\n reset(): void;\n\n /**\n * Removes all the errors that exist in state without cancelling any of the\n * uploads already in progress.\n */\n clearErrors(): void;\n\n /**\n * This function is used to cancel pending and uploading files or removing\n * completed files.\n *\n * @param keyOrKeys - A single or list of {@link BaseFileUploadStats.key} to\n * remove from state.\n */\n remove(keyOrKeys: string | readonly string[]): void;\n}\n\n/**\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @remarks \\@since 2.9.0\n */\nexport interface FileUploadHookReturnValue<\n E extends HTMLElement = HTMLElement,\n CustomError = never,\n> extends FileUploadActions,\n Required<FileUploadHandlers<E>> {\n /** {@inheritDoc FileUploadState.errors} */\n errors: readonly FileValidationError<CustomError>[];\n\n /**\n * A list of all the {@link FileUploadStats}.\n *\n * @see {@link getSplitFileUploads} for separating by status\n */\n stats: readonly Readonly<FileUploadStats>[];\n\n /**\n * The total number of bytes for all the files that exist in the\n * {@link stats} list.\n */\n totalBytes: number;\n\n /**\n * The total number of files in the {@link stats} list.\n */\n totalFiles: number;\n\n /**\n * An `accept` string that can be passed to the {@link FileInput} component\n * when the {@link FileValidationOptions.extensions} list has been provided to\n * limit which files the OS will _attempt_ to allow access to.\n *\n * @example\n * Simple example\n * ```ts\n * const extensions = ['pdf', 'docx', 'ppt'];\n * const { accept } = useFileUpload({ extensions, ...others });\n *\n * expect(accept).toBe(\"*.pdf,*.docx,*.ppt\")\n * ```\n *\n * @defaultValue `\"*\"`\n */\n accept: string;\n}\n\n/** @internal */\nconst EMPTY_LIST = [] as const;\n/** @internal */\nconst EMPTY_OBJECT = {} as const;\n\n/**\n * This hook is generally used to upload files **to the browser** in different\n * formats to be previewed `<img>`, `<video>`, `<embed>`, etc tags. However, it\n * can also be used to upload the files as an `ArrayBuffer` and then uploaded to\n * a server.\n *\n * Note: If using the `aws-sdk` to upload files directly to S3, **do not use\n * this hook** since it uses its own upload process.\n *\n * @typeParam E - An optional HTMLElement type that is used for the\n * {@link FileUploadHandlers}.\n * @typeParam CustomError - An optional error type that gets returned from the\n * {@link FilesValidator}.\n * @param options - All the {@link FileUploadOptions}\n * @returns the {@link FileUploadHookReturnValue}\n * @remarks \\@since 2.9.0\n */\nexport function useFileUpload<E extends HTMLElement, CustomError = never>({\n maxFiles = -1,\n extensions = EMPTY_LIST,\n minFileSize = -1,\n maxFileSize = -1,\n totalFileSize = -1,\n concurrency = -1,\n onDrop: propOnDrop = noop,\n onChange: propOnChange = noop,\n validateFiles = defaultValidateFiles,\n getFileParser = defaultGetFileParser,\n isValidFileName = defaultIsValidFileName,\n}: FileUploadOptions<E, CustomError> = {}): Readonly<\n FileUploadHookReturnValue<E, CustomError>\n> {\n const [state, dispatch] = useReducer(\n function reducer(\n state: FileUploadHookState<CustomError>,\n action: Action<CustomError>\n ): FileUploadHookState<CustomError> {\n switch (action.type) {\n case \"reset\":\n // need to reuse constants so that calling reset doesn't cause an\n // infinite loop in an effect\n return {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n };\n case \"remove\": {\n const stats: Record<string, FileUploadStats> = {};\n for (const key in state.stats) {\n if (!action.files.includes(key)) {\n stats[key] = state.stats[key];\n }\n }\n\n return {\n ...state,\n stats,\n };\n }\n case \"queue\":\n return {\n ...state,\n stats: {\n ...state.stats,\n ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(\n (files, file) => {\n const key = nanoid();\n files[key] = {\n key,\n file,\n progress: 0,\n status: \"pending\",\n };\n\n return files;\n },\n {}\n ),\n },\n errors: [...state.errors, ...action.errors],\n };\n case \"start\": {\n const { key, reader } = action;\n const fileStats: ProcessingFileUploadStats = {\n key,\n file: state.stats[key].file,\n progress: 0,\n status: \"uploading\",\n };\n\n return {\n ...state,\n readers: {\n ...state.readers,\n [key]: reader,\n },\n stats: {\n ...state.stats,\n [key]: fileStats,\n },\n };\n }\n case \"progress\": {\n const { key, progress } = action;\n return {\n ...state,\n stats: {\n ...state.stats,\n [key]: {\n ...state.stats[key],\n progress,\n },\n },\n };\n }\n case \"complete\": {\n const { key, result } = action;\n const file: CompletedFileUploadStats = {\n key,\n file: state.stats[key].file,\n status: \"complete\",\n result,\n progress: 100,\n };\n const { [key]: _reader, ...readers } = state.readers;\n\n return {\n ...state,\n readers,\n stats: {\n ...state.stats,\n [key]: file,\n },\n };\n }\n case \"clearErrors\":\n return { ...state, errors: [] };\n }\n },\n {\n stats: EMPTY_OBJECT,\n errors: EMPTY_LIST,\n readers: EMPTY_OBJECT,\n }\n );\n const { stats, errors, readers } = state;\n\n const statsList = Object.values(stats);\n const totalFiles = statsList.length;\n const totalBytes = statsList.reduce(\n (result, { file: { size } }) => result + size,\n 0\n );\n const queueFiles = useCallback(\n (files: readonly File[]) => {\n const { pending, errors } = validateFiles(files, {\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n });\n\n dispatch({ type: \"queue\", errors, files: pending });\n },\n [\n validateFiles,\n maxFiles,\n extensions,\n minFileSize,\n maxFileSize,\n totalBytes,\n totalFiles,\n totalFileSize,\n isValidFileName,\n ]\n );\n const onDrop = useCallback(\n (event: DragEvent<E>) => {\n propOnDrop(event);\n event.preventDefault();\n event.stopPropagation();\n\n try {\n const files = event.dataTransfer.files;\n if (files) {\n queueFiles(Array.from(files));\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnDrop]\n );\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n propOnChange(event);\n try {\n const files = event.currentTarget.files;\n if (files) {\n queueFiles(Array.from(files));\n } else {\n throw new Error();\n }\n } catch (e) {\n dispatch({\n type: \"queue\",\n files: [],\n errors: [\n new FileAccessError(e instanceof Error ? e.message : undefined),\n ],\n });\n }\n },\n [queueFiles, propOnChange]\n );\n\n const remove = useCallback(\n (keyOrKeys: string | readonly string[]) => {\n const files = typeof keyOrKeys === \"string\" ? [keyOrKeys] : keyOrKeys;\n files.forEach((fileKey) => {\n readers[fileKey]?.abort();\n });\n\n dispatch({ type: \"remove\", files });\n },\n [readers]\n );\n const reset = useCallback(() => {\n Object.values(readers).forEach((reader) => {\n reader.abort();\n });\n\n dispatch({ type: \"reset\" });\n }, [readers]);\n const clearErrors = useCallback(() => {\n dispatch({ type: \"clearErrors\" });\n }, []);\n const start = useCallback((key: string, reader: FileReader) => {\n dispatch({ type: \"start\", key, reader });\n }, []);\n const complete = useCallback(\n (key: string, result: FileReaderResult = null) => {\n dispatch({ type: \"complete\", key, result });\n },\n []\n );\n const createProgressEventHandler = useCallback(\n (key: string) => (event: ProgressEvent) => {\n if (event.lengthComputable) {\n const percentage = Math.round((event.loaded * 100) / event.total);\n dispatch({ type: \"progress\", key, progress: percentage });\n }\n },\n []\n );\n\n useEffect(() => {\n const pending: ProcessingFileUploadStats[] = [];\n const uploading: ProcessingFileUploadStats[] = [];\n Object.values(stats).forEach((file) => {\n if (file.status === \"pending\") {\n pending.push(file);\n } else if (file.status === \"uploading\") {\n uploading.push(file);\n }\n });\n\n const lastIndex =\n concurrency === -1\n ? pending.length\n : Math.max(0, concurrency - uploading.length);\n const queue = pending.slice(0, lastIndex);\n if (!queue.length) {\n return;\n }\n\n queue.forEach((stats) => {\n const { key, file } = stats;\n const reader = new FileReader();\n\n // using `addEventListener` instead of directly setting to\n // `reader.progress`/`reader.load` so it's easier to test\n reader.addEventListener(\"progress\", createProgressEventHandler(key));\n reader.addEventListener(\"load\", () => {\n complete(key, reader.result);\n });\n\n start(key, reader);\n const parser = getFileParser(file);\n /* istanbul ignore next */\n if (\n process.env.NODE_ENV !== \"production\" &&\n ![\n \"readAsText\",\n \"readAsDataURL\",\n \"readAsArrayBuffer\",\n \"readAsBinaryString\",\n ].includes(parser)\n ) {\n throw new Error(\"Invalid file reader parser\");\n }\n\n reader[parser](file);\n });\n }, [\n concurrency,\n stats,\n getFileParser,\n createProgressEventHandler,\n start,\n complete,\n ]);\n\n let accept = \"\";\n if (extensions.length) {\n accept = extensions.reduce((s, ext) => `${s ? `${s},` : \"\"}.${ext}`, \"\");\n }\n\n return {\n stats: statsList,\n errors,\n accept,\n totalBytes,\n totalFiles,\n onDrop,\n onChange,\n reset,\n remove,\n clearErrors,\n };\n}\n"],"names":["nanoid","useCallback","useEffect","useReducer","FileAccessError","getFileParser","defaultGetFileParser","isValidFileName","defaultIsValidFileName","validateFiles","defaultValidateFiles","noop","EMPTY_LIST","EMPTY_OBJECT","useFileUpload","maxFiles","extensions","minFileSize","maxFileSize","totalFileSize","concurrency","onDrop","propOnDrop","onChange","propOnChange","state","dispatch","reducer","action","type","stats","errors","readers","key","files","includes","reduce","file","progress","status","reader","fileStats","result","_reader","statsList","Object","values","totalFiles","length","totalBytes","size","queueFiles","pending","event","preventDefault","stopPropagation","dataTransfer","Array","from","e","Error","message","undefined","currentTarget","remove","keyOrKeys","forEach","fileKey","abort","reset","clearErrors","start","complete","createProgressEventHandler","lengthComputable","percentage","Math","round","loaded","total","uploading","push","lastIndex","max","queue","slice","FileReader","addEventListener","parser","process","env","NODE_ENV","accept","s","ext"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useListboxProvider.ts"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\n/**\n * @internal\n * \\@remarks \\@since 6.0.0\n */\nexport interface ListboxContext {\n /**\n * This ref is used to trigger the change event when an option is clicked.\n */\n inputRef: RefObject<HTMLInputElement>;\n\n /**\n * This is used within the `Option` component to determine if it is currently\n * selected or not.\n */\n currentValue: string | number | null;\n\n disableSelectedIcon: boolean;\n}\n\nconst context = createContext<ListboxContext>({\n inputRef: { current: null },\n currentValue: null,\n disableSelectedIcon: false,\n});\n\n/**\n * **Client Component**\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const { Provider: ListboxProvider } = context;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function useListboxContext(): ListboxContext {\n return useContext(context);\n}\n"],"names":["createContext","useContext","context","inputRef","current","currentValue","disableSelectedIcon","Provider","ListboxProvider","useListboxContext"],"mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAwB,QAAQ;AAqBlE,MAAMC,UAAUF,cAA8B;IAC5CG,UAAU;QAAEC,SAAS;IAAK;IAC1BC,cAAc;IACdC,qBAAqB;AACvB;AAEA;;;;;CAKC,GACD,OAAO,MAAM,EAAEC,UAAUC,eAAe,EAAE,GAAGN,QAAQ;AAErD;;;CAGC,GACD,OAAO,SAASO;IACd,OAAOR,WAAWC;AACpB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useNumberField.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { withinRange } from \"../utils/withinRange.js\";\nimport {\n useTextField,\n type ProvidedTextFieldMessageProps,\n type ProvidedTextFieldProps,\n type TextFieldHookOptions,\n type TextFieldHookState,\n type TextFieldImplementation,\n type ValidatedTextFieldImplementation,\n} from \"./useTextField.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @remarks \\@since 2.5.0 */\nexport interface NumberFieldConstraints {\n /**\n * An optional min value for the number field.\n */\n min?: number;\n\n /**\n * An optional max value for the number field.\n */\n max?: number;\n\n /**\n * An optional step amount to use.\n *\n * Note: The `min` and `max` values must be divisible by this value when any\n * are defined.\n */\n step?: number;\n}\n\n/**\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0\n * - Removed `updateOnChange` in favor of `updateValue`\n * - Renamed `fixOnBlur` to `updateValueOnBlur`\n */\nexport interface NumberFieldHookOptions\n extends Omit<\n TextFieldHookOptions<HTMLInputElement>,\n \"defaultValue\" | \"isNumber\"\n >,\n NumberFieldConstraints {\n /**\n * @defaultValue `undefined`\n */\n defaultValue?: UseStateInitializer<number>;\n\n /**\n * This controls the behavior for the `value` returned by this hook. If you\n * need access to the current value immediately as the user types to update\n * other components, keep this as the default of `\"change\"`. Otherwise, set\n * this to `\"blur\"`.\n *\n * @example\n * Deferring Updates on Blur\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * const result = useMemo(() => someExpensiveComputation(value), [value]);\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @defaultValue `\"change\"`\n */\n updateValue?: \"blur\" | \"change\";\n\n /**\n * This option is used to update the `number` value and text field value to be\n * within the `min` and `max` range or just format the text field value when\n * the input is blurred. This update will only be applied if the text field\n * contains a valid number. Using `min = 0` and `max = 10`:\n *\n * | text value | updated value |\n * | ---------- | ------------- |\n * | 000001 | 1 |\n * | -1 | 0 |\n * | 20 | 10 |\n * | -12 | 0 |\n * | --1 | --1 |\n * | fjdka | fjdka |\n *\n *\n * Set this to `false` if no changed should be applied and force the user to\n * fix any min/max errors manually and maintain weird formatting.\n *\n * @defaultValue `true`\n * @remarks \\@since 6.0.0 This was renamed from `fixOnBlur` and removed the\n * `\"min\"` and `\"max\"` behavior.\n */\n updateValueOnBlur?: boolean;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface NumberFieldHookState\n extends Omit<TextFieldHookState, \"value\"> {\n value: number | undefined;\n}\n\n/** @remarks \\@since 2.5.6 */\nexport interface ProvidedNumberFieldProps\n extends ProvidedTextFieldProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @remarks \\@since 2.5.6 */\nexport interface ProvidedNumberFieldMessageProps\n extends ProvidedTextFieldMessageProps<HTMLInputElement>,\n NumberFieldConstraints {\n type: \"number\";\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface NumberFieldImplementation\n extends Omit<\n TextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface NumberFieldWithMessageImplementation\n extends NumberFieldImplementation {\n fieldProps: ProvidedNumberFieldMessageProps;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface ValidatedNumberFieldImplementation\n extends Omit<\n ValidatedTextFieldImplementation<HTMLInputElement>,\n \"value\" | \"setState\"\n > {\n value: number | undefined;\n setState: UseStateSetter<NumberFieldHookState>;\n fieldProps: ProvidedNumberFieldProps | ProvidedNumberFieldMessageProps;\n}\n\n/**\n * @example\n * Enforce Number Value and No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * disableMessage: true,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n * ```\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n disableMessage: true;\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * @example\n * No Error Messages\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * disableMessage: true,\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & { disableMessage: true }\n): NumberFieldImplementation;\n\n/**\n * @example\n * Enforce Number Value\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * });\n *\n * // this is safe since `value` will always be a number even if there is a\n * // validation error. since the min and max options were provided as well,\n * // number will be between that range as well.\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example\n * Enforce Number Value and Deferring Updates\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * min: 0,\n * max: 100,\n * name: \"someName\",\n * defaultValue: 0,\n * updateValue: \"blur\",\n * });\n *\n * // the `value` will only be updated whenever the `TextField` is blurred.\n * // This is helpful if the `value` is used in expensive computations or\n * // updates that do not need to be updated as the user types\n * const computed = value * 10;\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions & {\n defaultValue: UseStateInitializer<number>;\n }\n): NumberFieldWithMessageImplementation & {\n value: number;\n setState: UseStateSetter<NumberFieldHookState & { value: number }>;\n};\n\n/**\n * The `useNumberField` hook is used to control the state of a `TextField` or\n * `<input type=\"number\">`\n *\n * @example\n * Default Implementation\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * });\n *\n * // `value` will be `undefined` until the user enters a valid value once\n * // there is a valid value, `value` will be a `number`. So this might cause\n * // `computed` to be `NaN | number`\n * //\n * // const computed = value * 10;\n *\n * // whenever there is an error, an error message will be displayed below the\n * // `TextField`\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @example\n * Adding Constraints\n * ```tsx\n * import { TextField, useNumberField } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldProps, value } = useNumberField({\n * name: \"someName\",\n * min: 0,\n * max: 100,\n * step: 2,\n * required: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Label\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @see {@link useTextField}\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): NumberFieldWithMessageImplementation;\n\n/**\n * @internal\n * @see {@link useTextField}\n * @see {@link useNumberField} overrides for other examples.\n */\nexport function useNumberField(\n options: NumberFieldHookOptions\n): ValidatedNumberFieldImplementation {\n const {\n min,\n max,\n step,\n onBlur = noop,\n onChange = noop,\n updateValue = \"change\",\n updateValueOnBlur = true,\n defaultValue,\n ...textOptions\n } = options;\n\n const [number, setNumber] = useState(defaultValue);\n const initial = useRef(number);\n const {\n value: _value,\n reset: resetTextField,\n fieldProps,\n setState: setTextFieldState,\n ...remaining\n } = useTextField({\n ...textOptions,\n isNumber: true,\n defaultValue: `${number ?? \"\"}`,\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n const input = event.currentTarget;\n input.setCustomValidity(\"\");\n input.checkValidity();\n if (\n !updateValueOnBlur ||\n // do nothing else since it's a weird value like: `\"--0\"` which causes\n // the value to be `\"\"` and `numberAsValue` to be `NaN`\n input.validity.badInput\n ) {\n return;\n }\n\n let value = input.valueAsNumber;\n if (input.value === \"\" && typeof initial.current === \"number\") {\n value = min ?? initial.current;\n }\n\n // can't have both rangeUnderflow and rangeOverflow at the same time, so\n // it's \"safe\" to always provide both\n value = withinRange({ min, max, value });\n if (!Number.isNaN(value)) {\n setNumber(value);\n input.value = `${value}`;\n } else if (typeof initial.current === \"undefined\") {\n setNumber(undefined);\n }\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped() || updateValue === \"blur\") {\n return;\n }\n\n const input = event.currentTarget;\n input.checkValidity();\n const value = withinRange({\n min,\n max,\n value: event.currentTarget.valueAsNumber,\n });\n if (\n !input.validity.valid &&\n !input.validity.rangeUnderflow &&\n !input.validity.rangeOverflow\n ) {\n return;\n }\n\n if (!Number.isNaN(value)) {\n setNumber(value);\n } else if (initial.current === undefined) {\n setNumber(undefined);\n }\n },\n });\n\n const reset = useCallback(() => {\n resetTextField();\n setNumber(initial.current);\n }, [resetTextField]);\n const setState = useCallback<UseStateSetter<NumberFieldHookState>>(\n (nextState) => {\n if (typeof nextState === \"function\") {\n setNumber((prevNumber) => {\n let nextNumber: number | undefined = prevNumber;\n setTextFieldState((prevState) => {\n const updated = nextState({\n ...prevState,\n value: prevNumber,\n });\n\n nextNumber = updated.value;\n\n return {\n ...updated,\n value: `${nextNumber ?? \"\"}`,\n };\n });\n\n return nextNumber;\n });\n return;\n }\n\n const { value, error, errorMessage } = nextState;\n setNumber(value);\n setTextFieldState({\n value: `${value ?? \"\"}`,\n error,\n errorMessage,\n });\n },\n [setTextFieldState]\n );\n\n return {\n ...remaining,\n reset,\n value: number,\n setState,\n fieldProps: {\n ...fieldProps,\n min,\n max,\n step,\n type: \"number\",\n },\n };\n}\n"],"names":["useCallback","useRef","useState","withinRange","useTextField","noop","useNumberField","options","min","max","step","onBlur","onChange","updateValue","updateValueOnBlur","defaultValue","textOptions","number","setNumber","initial","value","_value","reset","resetTextField","fieldProps","setState","setTextFieldState","remaining","isNumber","event","isPropagationStopped","input","currentTarget","setCustomValidity","checkValidity","validity","badInput","valueAsNumber","current","Number","isNaN","undefined","valid","rangeUnderflow","rangeOverflow","nextState","prevNumber","nextNumber","prevState","updated","error","errorMessage","type"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useRadioGroup.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n useState,\n type ChangeEventHandler,\n type FormEventHandler,\n} from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @remarks \\@since 6.0.0 */\nexport interface RadioGroupOptions<T extends string | number> {\n /**\n * A `name` to apply to all the radios within the group. This is required if\n * unless {@link menu} is set to `true`.\n */\n name?: string;\n\n /**\n * Set this to `true` if using the `MenuItemRadio` component instead of the\n * `Radio` so the correct props can be provided.\n *\n * @defaultValue `false`\n */\n menu?: boolean;\n\n /**\n * The value of a radio that should be checked by default. If you want to\n * force the user to select one of the radios, keep this as the empty string\n * or set it to a string or number that does not represent a valid radio\n * value.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: UseStateInitializer<T>;\n\n /**\n * Set this to `true` if one of the radios within the group must be checked before\n * a form can be submitted.\n *\n * This option is invalid and will be ignored if {@link menu} is `true`.\n *\n * @defaultValue `false`\n */\n required?: boolean;\n\n /**\n * If you need to prevent the default behavior in a radio group for some\n * reason, you can provide a custom `onCHange` event handler and call\n * `event.stopPropagation()`. This will be called whenever a new radio button\n * is checked.\n *\n * This option is invalid and will be ignored if {@link menu} is `true`.\n *\n * @defaultValue `() => {}`\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n\n /**\n * If the radio group has {@link required} set to `true`, the radios will gain\n * the `error` state if a form is submitted without a checked radio. If you\n * want to prevent that behavior for some reason, you can provide this\n * function and call `event.stopPropagation()`.\n *\n * This option is invalid and will be ignored if {@link menu} is `true`.\n *\n * @defaultValue `() => {}`\n */\n onInvalid?: FormEventHandler<HTMLInputElement>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface ProvidedRadioGroupProps<V extends string | number> {\n name: string;\n value: V;\n checked: boolean;\n onChange: ChangeEventHandler<HTMLInputElement>;\n error: boolean;\n required: boolean;\n onInvalid: FormEventHandler<HTMLInputElement>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport type GetRadioGroupProps<V extends string | number> = (\n value: V\n) => Readonly<ProvidedRadioGroupProps<V>>;\n\n/** @remarks \\@since 6.0.0 */\nexport interface RadioGroupImplementation<V extends string | number> {\n reset(): void;\n value: V;\n setValue: UseStateSetter<V>;\n getRadioProps: GetRadioGroupProps<V>;\n}\n\nexport type GetMenuItemRadioGroupProps<V extends string | number> = (\n value: V\n) => Readonly<{ checked: boolean; onCheckedChange(): void }>;\n\n/** @remarks \\@since 6.0.0 */\nexport interface MenuItemRadioGroupImplementation<V extends string | number> {\n reset(): void;\n value: V;\n setValue: UseStateSetter<V>;\n getRadioProps: GetMenuItemRadioGroupProps<V>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface CombinedRadioGroupReturnValue<V extends string | number> {\n reset(): void;\n value: V;\n setValue: UseStateSetter<V>;\n getRadioProps?(value: V): {\n name?: string;\n value?: V;\n checked: boolean;\n error?: boolean;\n required?: boolean;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n onCheckedChange?(): void;\n onInvalid?: FormEventHandler<HTMLInputElement>;\n };\n}\n\n// Note: These overrides are set up so that the value will default to any\n// string.\n\n/**\n * @example\n * Generic Number Example\n * ```tsx\n * const { value, getRadioProps } = useRadioGroup<number>({\n * name: \"group\",\n * defaultValue: -1\n * });\n *\n *\n * return (\n * <>\n * <Radio {...getRadioProps(0)} label=\"First\" />\n * <Radio {...getRadioProps(1)} label=\"Second\" />\n * <Radio {...getRadioProps(2)} label=\"Third\" />\n * </>\n * );\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useRadioGroup<V extends number>(\n options: RadioGroupOptions<V> & {\n menu?: false;\n name: string;\n defaultValue: UseStateInitializer<V>;\n }\n): RadioGroupImplementation<V>;\nexport function useRadioGroup<V extends number>(\n options: RadioGroupOptions<V> & {\n menu: true;\n name?: never;\n required?: never;\n onChange?: never;\n onInvalid?: never;\n defaultValue: UseStateInitializer<V>;\n }\n): MenuItemRadioGroupImplementation<V>;\n/**\n * @example\n * Generic String Example\n * ```tsx\n * const { value, getRadioProps } = useRadioGroup({ name: \"group\" });\n *\n * return (\n * <>\n * <Radio {...getRadioProps(\"a\")} label=\"First\" />\n * <Radio {...getRadioProps(\"b\")} label=\"Second\" />\n * <Radio {...getRadioProps(\"c\")} label=\"Third\" />\n * </>\n * );\n * ```\n *\n * @example\n * String Union Example\n * ```tsx\n * const values = [\n * { label: \"First\", value: \"a\" },\n * { label: \"Second\", value: \"b\" },\n * { label: \"Third\", value: \"c\" },\n * ] as const;\n *\n * type Values = typeof values[number][\"value\"];\n * // ^ \"a\" | \"b\" | \"c\"\n *\n * const { value, getRadioProps } = useRadioGroup<Values | \"\">({\n * name: \"group\",\n * defaultValue: \"\",\n * });\n *\n *\n * return (\n * <>\n * {values.map(({ label, value }) => (\n * <Radio {...getRadioProps(value)} key={value} label={label} />\n * ))}\n * </>\n * );\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useRadioGroup<V extends string>(\n options: RadioGroupOptions<V> & {\n menu?: false;\n name: string;\n defaultValue?: UseStateInitializer<V>;\n }\n): RadioGroupImplementation<V>;\nexport function useRadioGroup<V extends string>(\n options: RadioGroupOptions<V> & {\n menu: true;\n name?: never;\n required?: never;\n onChange?: never;\n onInvalid?: never;\n defaultValue?: UseStateInitializer<V>;\n }\n): MenuItemRadioGroupImplementation<V>;\n/**\n * @example\n * Strict Union Example\n * ```tsx\n * type ValidValues = 1 | 2 | 3 | 4 | \"\" | \"a\" | \"b\";\n *\n * const { value, getRadioProps } = useRadioGroup<ValidValues>({\n * name: \"group\",\n * defaultValue: \"\"\n * });\n *\n *\n * return (\n * <>\n * <Radio {...getRadioProps(1)} label=\"First\" />\n * <Radio {...getRadioProps(2)} label=\"Second\" />\n * <Radio {...getRadioProps(3)} label=\"Third\" />\n * <Radio {...getRadioProps(4)} label=\"Forth\" />\n * <Radio {...getRadioProps(\"a\")} label=\"Fifth\" />\n * <Radio {...getRadioProps(\"b\")} label=\"Sixth\" />\n * <Radio {...getRadioProps(\"c\")} label=\"Seventh\" />\n * </>\n * );\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useRadioGroup<V extends string | number>(\n options: RadioGroupOptions<V>\n): CombinedRadioGroupReturnValue<V> {\n const {\n name,\n defaultValue,\n menu = false,\n required,\n onChange = noop,\n onInvalid = noop,\n } = options;\n const [value, setValue] = useState<V>(() => {\n if (typeof defaultValue === \"function\") {\n return defaultValue();\n }\n\n return defaultValue ?? (\"\" as V);\n });\n const initial = useRef(value);\n const [error, setError] = useState(false);\n\n return {\n reset: useCallback(() => {\n setError(false);\n setValue(initial.current);\n }, []),\n value,\n setValue,\n getRadioProps(radioValue) {\n const checked = value === radioValue;\n if (menu) {\n return {\n checked,\n onCheckedChange() {\n setValue(radioValue);\n },\n };\n }\n\n return {\n name,\n value: radioValue,\n error,\n checked,\n required,\n onChange(event) {\n onChange(event);\n setError(false);\n setValue(radioValue);\n },\n onInvalid(event) {\n onInvalid(event);\n setError(true);\n },\n };\n },\n };\n}\n"],"names":["useCallback","useRef","useState","noop","useRadioGroup","options","name","defaultValue","menu","required","onChange","onInvalid","value","setValue","initial","error","setError","reset","current","getRadioProps","radioValue","checked","onCheckedChange","event"],"mappings":"AAAA;AACA,SACEA,WAAW,EACXC,MAAM,EACNC,QAAQ,QAGH,QAAQ;AAGf,MAAMC,OAAO;AACX,aAAa;AACf;AAwNA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASC,cACdC,OAA6B;IAE7B,MAAM,EACJC,IAAI,EACJC,YAAY,EACZC,OAAO,KAAK,EACZC,QAAQ,EACRC,WAAWP,IAAI,EACfQ,YAAYR,IAAI,EACjB,GAAGE;IACJ,MAAM,CAACO,OAAOC,SAAS,GAAGX,SAAY;QACpC,IAAI,OAAOK,iBAAiB,YAAY;YACtC,OAAOA;QACT;QAEA,OAAOA,gBAAiB;IAC1B;IACA,MAAMO,UAAUb,OAAOW;IACvB,MAAM,CAACG,OAAOC,SAAS,GAAGd,SAAS;IAEnC,OAAO;QACLe,OAAOjB,YAAY;YACjBgB,SAAS;YACTH,SAASC,QAAQI,OAAO;QAC1B,GAAG,EAAE;QACLN;QACAC;QACAM,eAAcC,UAAU;YACtB,MAAMC,UAAUT,UAAUQ;YAC1B,IAAIZ,MAAM;gBACR,OAAO;oBACLa;oBACAC;wBACET,SAASO;oBACX;gBACF;YACF;YAEA,OAAO;gBACLd;gBACAM,OAAOQ;gBACPL;gBACAM;gBACAZ;gBACAC,UAASa,KAAK;oBACZb,SAASa;oBACTP,SAAS;oBACTH,SAASO;gBACX;gBACAT,WAAUY,KAAK;oBACbZ,UAAUY;oBACVP,SAAS;gBACX;YACF;QACF;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useRangeSlider.ts"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { type SliderValueOptions } from \"./useSlider.js\";\n\n/**\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Updated to use labeled tuple.\n */\nexport type RangeSliderValue = readonly [minValue: number, maxValue: number];\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface RangeSliderState {\n rangeValue: RangeSliderValue;\n setRangeValue: UseStateSetter<RangeSliderValue>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface RangeSliderOptions extends SliderValueOptions {\n defaultValue?: UseStateInitializer<RangeSliderValue>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface RangeSliderImplementation\n extends Required<SliderValueOptions>,\n RangeSliderState {}\n\n/**\n * @example\n * Range Slider Example\n * ```tsx\n * import { Fieldset, Form, Legend, Slider, useRangeSlider } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useId } from \"react\";\n *\n * function Example(): ReactElement {\n * const slider = useRangeSlider({\n * // these are the defaults and can be changed\n * min: 0,\n * max: 100,\n * step: 1,\n * defaultValue: [0, 100],\n * });\n *\n * // if you need access to the current value or manually change the value\n * // yourself.\n * const { rangeValue, setRangeValue } = slider;\n * const [minPrice, maxPrice] = rangeValue;\n *\n * return (\n * <Form>\n * <Fieldset>\n * <Legend>Price Range</Legend>\n * <Slider {...slider} />\n * </Fieldset>\n * </Form>\n * );\n * }\n * ```\n *\n * @see The `Slider` component for additional examples.\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Now returns an object instead of an ordered tuple and only\n * return the `rangeValue` and `setRangeValue` instead of all the slider\n * functionality. In addition, the hook only accepts a single object argument.\n */\nexport function useRangeSlider(\n options: RangeSliderOptions = {}\n): RangeSliderImplementation {\n const { min = 0, max = 100, step = 1, defaultValue } = options;\n const [rangeValue, setRangeValue] = useState<RangeSliderValue>(\n defaultValue ?? [min, max]\n );\n\n return {\n min,\n max,\n step,\n rangeValue,\n setRangeValue,\n };\n}\n"],"names":["useState","useRangeSlider","options","min","max","step","defaultValue","rangeValue","setRangeValue"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,QAAQ;AAiCjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASC,eACdC,UAA8B,CAAC,CAAC;IAEhC,MAAM,EAAEC,MAAM,CAAC,EAAEC,MAAM,GAAG,EAAEC,OAAO,CAAC,EAAEC,YAAY,EAAE,GAAGJ;IACvD,MAAM,CAACK,YAAYC,cAAc,GAAGR,SAClCM,gBAAgB;QAACH;QAAKC;KAAI;IAG5B,OAAO;QACLD;QACAC;QACAC;QACAE;QACAC;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useResizingTextArea.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n type ChangeEventHandler,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { useResizeObserver } from \"../useResizeObserver.js\";\n\n// this is the default of 1.5rem line-height in the styles\nconst DEFAULT_LINE_HEIGHT = \"24\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * A textarea is normally resizable in browsers by default by dragging the\n * bottom right corner to the desired size which will set inline styles for\n * `height` and `width`. Since this makes creating layouts a bit more difficult,\n * this is disabled by default but can be configured using one of these values:\n *\n * - `\"auto\"` - The textarea will automatically grow in in height as the user\n * types until a max number of rows have been added. If there is additional\n * text, a scrollbar will appear in the textarea. The browser's native resize\n * behavior is disabled.\n * - `\"none\"` - The textarea's height and width will remain static\n * - `\"horizontal\"` - The textarea's width can be resized by the browser's\n * native resize behavior.\n * - `\"vertical\"` - The textarea's height can be resized by the browser's native\n * resize behavior.\n * - `\"both\"` - The browser's native resize behavior will be allowed.\n */\nexport type TextAreaResize =\n | \"none\"\n | \"auto\"\n | \"horizontal\"\n | \"vertical\"\n | \"both\";\n\n/** @internal */\nexport interface ResizingTextAreaOptions {\n resize: TextAreaResize;\n maxRows: number;\n onChange: ChangeEventHandler<HTMLTextAreaElement> | undefined;\n containerRef: RefObject<HTMLDivElement>;\n}\n\n/** @internal */\nexport interface ResizingTextAreaReturnValue {\n height: string | undefined;\n maskRef: RefCallback<HTMLTextAreaElement>;\n onChange: ChangeEventHandler<HTMLTextAreaElement>;\n scrollable: boolean;\n}\n\n/** @internal */\nexport function useResizingTextArea(\n options: ResizingTextAreaOptions\n): ResizingTextAreaReturnValue {\n const { maxRows, resize, onChange = noop, containerRef } = options;\n\n const maskRef = useRef<HTMLTextAreaElement>(null);\n const [height, setHeight] = useState<number>();\n const [scrollable, setScrollable] = useState(false);\n useEffect(() => {\n if (resize !== \"auto\") {\n setHeight(undefined);\n }\n }, [resize]);\n\n const updateHeight = useCallback(() => {\n const mask = maskRef.current;\n const container = containerRef.current;\n if (!mask || !container) {\n return;\n }\n\n const containerStyles = window.getComputedStyle(container);\n const borderHeight =\n parseFloat(containerStyles.borderTopWidth) +\n parseFloat(containerStyles.borderBottomWidth);\n let nextHeight = mask.scrollHeight + borderHeight;\n /* istanbul ignore if */\n if (maxRows > 0) {\n const lineHeight = parseFloat(\n window.getComputedStyle(mask).lineHeight || DEFAULT_LINE_HEIGHT\n );\n const maxHeight = maxRows * lineHeight;\n nextHeight = Math.min(maxHeight, nextHeight);\n\n // only want the textarea to be scrollable if there's a limit on the rows\n // since it'll flash the scrollbar on most OS during the height transition\n if (nextHeight === maxHeight && !scrollable) {\n setScrollable(true);\n } else if (nextHeight !== maxHeight && scrollable) {\n setScrollable(false);\n }\n }\n\n setHeight(nextHeight + 2);\n }, [containerRef, maxRows, scrollable]);\n\n const maskRefCallback = useResizeObserver({\n ref: maskRef,\n onUpdate: updateHeight,\n disableHeight: true,\n });\n\n return {\n height: typeof height === \"number\" ? `${height}px` : undefined,\n maskRef: maskRefCallback,\n scrollable,\n onChange(event) {\n const mask = maskRef.current;\n onChange(event);\n if (event.isPropagationStopped() || !mask || resize !== \"auto\") {\n return;\n }\n\n // to get the height transition to work, you have to set the height on:\n // - the main container element (including padding) that has the height\n // transition enabled\n // - a child div wrapper (without padding) that has the height transition\n // enabled\n // - the textarea element (without padding) and without a height transition\n //\n // if it isn't done this way, the height transition will look weird since\n // the text will be fixed to the bottom of the area and more text at the top\n // will become visible as the height transition completes. applying the\n // transition on the two parent elements work because:\n // - the height is set immediately on the text field so it expands to show all\n // the text\n // - the height is correctly applied to both parent elements, but their height\n // haven't fully been adjusted due to the animation\n // - the parent divs have overflow visible by default, so the textarea's text\n // will expand past the boundaries of the divs and not cause the upwards\n // animation weirdness.\n mask.value = event.currentTarget.value;\n updateHeight();\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","useResizeObserver","DEFAULT_LINE_HEIGHT","noop","useResizingTextArea","options","maxRows","resize","onChange","containerRef","maskRef","height","setHeight","scrollable","setScrollable","undefined","updateHeight","mask","current","container","containerStyles","window","getComputedStyle","borderHeight","parseFloat","borderTopWidth","borderBottomWidth","nextHeight","scrollHeight","lineHeight","maxHeight","Math","min","maskRefCallback","ref","onUpdate","disableHeight","event","isPropagationStopped","value","currentTarget"],"mappings":"AAAA;AACA,SACEA,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QAIH,QAAQ;AACf,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,0DAA0D;AAC1D,MAAMC,sBAAsB;AAE5B,MAAMC,OAAO;AACX,aAAa;AACf;AA0CA,cAAc,GACd,OAAO,SAASC,oBACdC,OAAgC;IAEhC,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAEC,WAAWL,IAAI,EAAEM,YAAY,EAAE,GAAGJ;IAE3D,MAAMK,UAAUX,OAA4B;IAC5C,MAAM,CAACY,QAAQC,UAAU,GAAGZ;IAC5B,MAAM,CAACa,YAAYC,cAAc,GAAGd,SAAS;IAC7CF,UAAU;QACR,IAAIS,WAAW,QAAQ;YACrBK,UAAUG;QACZ;IACF,GAAG;QAACR;KAAO;IAEX,MAAMS,eAAenB,YAAY;QAC/B,MAAMoB,OAAOP,QAAQQ,OAAO;QAC5B,MAAMC,YAAYV,aAAaS,OAAO;QACtC,IAAI,CAACD,QAAQ,CAACE,WAAW;YACvB;QACF;QAEA,MAAMC,kBAAkBC,OAAOC,gBAAgB,CAACH;QAChD,MAAMI,eACJC,WAAWJ,gBAAgBK,cAAc,IACzCD,WAAWJ,gBAAgBM,iBAAiB;QAC9C,IAAIC,aAAaV,KAAKW,YAAY,GAAGL;QACrC,sBAAsB,GACtB,IAAIjB,UAAU,GAAG;YACf,MAAMuB,aAAaL,WACjBH,OAAOC,gBAAgB,CAACL,MAAMY,UAAU,IAAI3B;YAE9C,MAAM4B,YAAYxB,UAAUuB;YAC5BF,aAAaI,KAAKC,GAAG,CAACF,WAAWH;YAEjC,yEAAyE;YACzE,0EAA0E;YAC1E,IAAIA,eAAeG,aAAa,CAACjB,YAAY;gBAC3CC,cAAc;YAChB,OAAO,IAAIa,eAAeG,aAAajB,YAAY;gBACjDC,cAAc;YAChB;QACF;QAEAF,UAAUe,aAAa;IACzB,GAAG;QAAClB;QAAcH;QAASO;KAAW;IAEtC,MAAMoB,kBAAkBhC,kBAAkB;QACxCiC,KAAKxB;QACLyB,UAAUnB;QACVoB,eAAe;IACjB;IAEA,OAAO;QACLzB,QAAQ,OAAOA,WAAW,WAAW,CAAC,EAAEA,OAAO,EAAE,CAAC,GAAGI;QACrDL,SAASuB;QACTpB;QACAL,UAAS6B,KAAK;YACZ,MAAMpB,OAAOP,QAAQQ,OAAO;YAC5BV,SAAS6B;YACT,IAAIA,MAAMC,oBAAoB,MAAM,CAACrB,QAAQV,WAAW,QAAQ;gBAC9D;YACF;YAEA,uEAAuE;YACvE,uEAAuE;YACvE,wBAAwB;YACxB,yEAAyE;YACzE,aAAa;YACb,2EAA2E;YAC3E,EAAE;YACF,yEAAyE;YACzE,4EAA4E;YAC5E,uEAAuE;YACvE,sDAAsD;YACtD,8EAA8E;YAC9E,cAAc;YACd,8EAA8E;YAC9E,sDAAsD;YACtD,6EAA6E;YAC7E,2EAA2E;YAC3E,0BAA0B;YAC1BU,KAAKsB,KAAK,GAAGF,MAAMG,aAAa,CAACD,KAAK;YACtCvB;QACF;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useSlider.ts"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { getRangeDefaultValue } from \"../utils/getRangeDefaultValue.js\";\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface SliderValueOptions {\n /**\n * The min value for the slider.\n *\n * @defaultValue `0`\n */\n min?: number;\n\n /**\n * The max value for the slider.\n *\n * @defaultValue `100`\n */\n max?: number;\n\n /**\n * A positive number representing the value to \"jump\" while incrementing or\n * decrementing the slider's value. This should normally stay as the default\n * value of `1`, but can also be decimal values if needed.\n *\n * @defaultValue `1`\n */\n step?: number;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SliderState {\n value: number;\n setValue: UseStateSetter<number>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SliderImplementation\n extends Required<SliderValueOptions>,\n SliderState {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SliderOptions extends SliderValueOptions {\n /**\n * @defaultValue `(max - min ) / 2`\n */\n defaultValue?: UseStateInitializer<number>;\n}\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import { Form, Slider, useSlider } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const slider = useSlider({\n * // these are the defaults and can be changed\n * min: 0,\n * max: 100,\n * step: 1,\n * defaultValue: 50,\n * });\n *\n * // if you need access to the current value or manually change the value\n * // yourself.\n * const { value, setValue } = slider;\n *\n * return (\n * <Form>\n * <Slider {...slider} aria-label=\"Volume\" />\n * </Form>\n * );\n * }\n * ```\n *\n * @see The `Slider` component for additional examples.\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Now returns an object instead of an ordered tuple and only\n * return the `value` and `setValue` instead of all the slider functionality. In\n * addition, the hook only accepts a single object argument.\n */\nexport function useSlider(options: SliderOptions = {}): SliderImplementation {\n const { min = 0, max = 100, step = 1, defaultValue } = options;\n const [value, setValue] = useState(\n getRangeDefaultValue({\n min,\n max,\n step,\n defaultValue,\n })\n );\n\n return {\n min,\n max,\n step,\n value,\n setValue,\n };\n}\n"],"names":["useState","getRangeDefaultValue","useSlider","options","min","max","step","defaultValue","value","setValue"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,QAAQ;AAEjC,SAASC,oBAAoB,QAAQ,mCAAmC;AAuDxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCC,GACD,OAAO,SAASC,UAAUC,UAAyB,CAAC,CAAC;IACnD,MAAM,EAAEC,MAAM,CAAC,EAAEC,MAAM,GAAG,EAAEC,OAAO,CAAC,EAAEC,YAAY,EAAE,GAAGJ;IACvD,MAAM,CAACK,OAAOC,SAAS,GAAGT,SACxBC,qBAAqB;QACnBG;QACAC;QACAC;QACAC;IACF;IAGF,OAAO;QACLH;QACAC;QACAC;QACAE;QACAC;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/useTextField.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { type TextFieldProps } from \"./TextField.js\";\nimport {\n type FormMessageInputLengthCounterProps,\n type FormMessageProps,\n} from \"./types.js\";\nimport {\n defaultGetErrorIcon,\n defaultGetErrorMessage,\n defaultIsErrored,\n type ErrorMessageOptions,\n type GetErrorIcon,\n type GetErrorMessage,\n type IsErrored,\n type TextFieldValidationOptions,\n type TextFieldValidationType,\n} from \"./validation.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Added the `onInvalid` handler\n */\nexport type TextFieldChangeHandlers<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = Pick<HTMLAttributes<E>, \"onBlur\" | \"onChange\" | \"onInvalid\">;\n\n/** @remarks \\@since 6.0.0 */\nexport interface ErrorChangeHandlerOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> {\n /**\n * A ref containing the `TextField` or `TextArea` if you need access to that\n * DOM node for error reporting.\n */\n ref: RefObject<E>;\n\n /**\n * The current name for the `TextField` or `TextArea`.\n */\n name: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * A function that reports the error state changing. A good use-case for this is\n * to keep track of all the errors within your form and keep a submit button\n * disabled until they have been resolved.\n *\n * Example:\n *\n * ```ts\n * const [errors, setErrors] = useState<Record<string, boolean | undefined>>({});\n * const onErrorChange: ErrorChangeHandler = ({ name, error }) =>\n * setErrors((prevErrors) => ({ ...prevErrors, [name]: error }));\n *\n * const invalid = Object.values(errors).some(Boolean);\n *\n * // form implementation is left as an exercise for the reader\n * <Button type=\"submit\" disabled={invalid} onClick={submitForm}>Submit</Button>\n * ```\n *\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Changed to object argument.\n */\nexport type ErrorChangeHandler<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> = (options: ErrorChangeHandlerOptions<E>) => void;\n\n/** @remarks \\@since 2.5.6 */\nexport interface TextFieldHookState {\n /**\n * The current value for the `TextField` or `TextArea`.\n */\n value: string;\n\n /**\n * This will be `true` when the `TextField`/`TextArea` has an error.\n */\n error: boolean;\n\n /**\n * The error message returned by {@link GetErrorMessage}/the browser's\n * validation message. This is normally an empty string when the {@link error}\n * state is `false`.\n */\n errorMessage: string;\n}\n\n/**\n * All the props that will be generated and return from the `useTextField` hook\n * that should be passed to a `FormMessage` component.\n *\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedFormMessageProps\n extends Pick<FormMessageProps, \"id\" | \"theme\" | \"children\">,\n Required<Pick<TextFieldProps, \"error\">>,\n Partial<Pick<FormMessageInputLengthCounterProps, \"length\" | \"maxLength\">> {}\n\n/**\n * All the props that will be generated and returned by the `useTextField` hook\n * that should be passed to a `TextField` component.\n *\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedTextFieldProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E>,\n Required<Pick<TextFieldProps, \"id\" | \"name\" | \"value\" | \"error\">>,\n Pick<TextFieldProps, \"aria-describedby\" | \"rightAddon\"> {\n /**\n * A ref that must be passed to the `TextField`/`TextArea` so that the custom\n * validity behavior can work.\n *\n * @remarks \\@since 6.0.0\n */\n ref: RefCallback<E>;\n}\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface ProvidedTextFieldMessageProps<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends ProvidedTextFieldProps<E> {\n /**\n * These props will be defined as long as the `disableMessage` prop is not\n * `true` from the `useTextField` hook.\n */\n messageProps: ProvidedFormMessageProps;\n}\n\n/** @remarks \\@since 2.5.6 */\nexport interface TextFieldHookOptions<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldValidationOptions,\n TextFieldChangeHandlers<E> {\n /**\n * An optional id to use for the `TextField` or `TextArea` that is also used\n * to create an id for the inline help/error messages.\n *\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * An optional ref that should be merged with the ref returned by this hook.\n * This should really only be used if you are making a custom component using\n * this hook and forwarding refs. If you need a ref to access the `<input>` or\n * `<textarea>` DOM node, you can use the `fieldRef` returned by this hook\n * instead.\n *\n * @example\n * Accessing TextField DOM Node\n * ```tsx\n * import { TextField, useTextField } from \"@react-md/core\";\n * import { useEffect } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { fieldRef, fieldProps } = useTextField({ name: \"example\" });\n *\n * useEffect(() => {\n * fieldRef.current;\n * // ^ HTMLInputElement | null\n * }, [fieldRef]);\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n */\n ref?: Ref<E>;\n\n /**\n * A unique name to attach to the `TextField`, `TextArea` or `Password`\n * component.\n */\n name: string;\n\n /**\n * Boolean if the `FormMessage` should also display a counter for the\n * remaining letters allowed based on the `maxLength`.\n *\n * This will still be considered false if the `maxLength` value is not\n * provided.\n *\n * @defaultValue `false`\n */\n counter?: boolean;\n\n /**\n * This is used internally for the `useNumberField` hook and probably\n * shouldn't be used otherwise. This is just passed into the\n * {@link getErrorMessage} options and is used for additional validation.\n *\n * @defaultValue `false`\n */\n isNumber?: boolean;\n\n /**\n * The default value to use for the `TextField` or `TextArea` one initial\n * render. If you want to manually change the value to something else after\n * the initial render, either change the `key` for the component containing\n * this hook, or use the `setState` function returned from this hook.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: UseStateInitializer<string>;\n\n /**\n * An optional help text to display in the `FormMessage` component when there\n * is not an error.\n */\n helpText?: ReactNode;\n\n /**\n * A function used to determine if the `TextField` or `TextArea` is an in\n * errored state.\n *\n * @see {@link defaultIsErrored}\n * @defaultValue `defaultIsErrored`\n */\n isErrored?: IsErrored;\n\n /**\n * An optional error icon used in the {@link getErrorIcon} option.\n *\n * @defaultValue `getIcon(\"error\")`\n */\n errorIcon?: ReactNode;\n\n /**\n * A function used to get the error icon to display at the right of the\n * `TextField` or `TextArea`. The default behavior will only show an icon when\n * the `error` state is `true` and an `errorIcon` option has been provided.\n *\n * @see {@link defaultGetErrorIcon}\n * @defaultValue `defaultGetErrorIcon`\n */\n getErrorIcon?: GetErrorIcon;\n\n /**\n * A function to get and display an error message based on the `TextField` or\n * `TextArea` validity.\n *\n * @see {@link defaultGetErrorMessage}\n * @defaultValue `defaultGetErrorMessage`\n */\n getErrorMessage?: GetErrorMessage;\n\n /**\n * An optional function that will be called whenever the `error` state is\n * changed. This can be used for more complex forms to `disable` the Submit\n * button or anything else if any field has an error.\n *\n * @defaultValue `() => {}`\n */\n onErrorChange?: ErrorChangeHandler<E>;\n\n /**\n * Boolean if the `TextField` or `TextArea` will **not** be rendered along\n * with a `FormMessage` component. This will prevent the `aria-describedby`\n * prop from being returned when set to `true`.\n *\n * @defaultValue `false`\n */\n disableMessage?: boolean;\n\n /**\n * Boolean if the `maxLength` prop should not be passed to the `TextField`\n * component since it will prevent any additional characters from being\n * entered in the text field which might feel like weird behavior to some\n * users. This should really only be used when the `counter` option is also\n * enabled and rendering along with a `FormMessage` component.\n *\n * @defaultValue `false`\n */\n disableMaxLength?: boolean;\n\n /**\n * @defaultValue `\"recommended\"`\n */\n validationType?: TextFieldValidationType;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldHookState {\n fieldRef: RefObject<E>;\n reset(): void;\n setState: UseStateSetter<Readonly<TextFieldHookState>>;\n fieldProps: ProvidedTextFieldProps<E>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface TextFieldWithMessageImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldMessageProps<E>;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface ValidatedTextFieldImplementation<\n E extends HTMLInputElement | HTMLTextAreaElement,\n> extends TextFieldImplementation<E> {\n fieldProps: ProvidedTextFieldProps<E> | ProvidedTextFieldMessageProps<E>;\n}\n\n/**\n * If you do not want to display the error messages below the `TextField` and\n * handle error messages separately, set the `disableMessage` option to `true`.\n *\n * @example\n * No Inline Error Messages\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * disableMessage: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * Look at the other {@link useTextField} override for additional examples.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E> & { disableMessage: true }\n): TextFieldImplementation<E>;\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Inline Counter\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * counter: true,\n * required: true,\n * maxLength: 20,\n * disableMaxLength: true,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Adding Constraints\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * pattern: \"^[A-z]+$\",\n * minLength: 4,\n * maxLength: 20,\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @example\n * Custom Validation\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useTextField } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { fieldProps } = useTextField({\n * name: \"example\",\n * required: true,\n * getErrorMessage(options) {\n * const {\n * value,\n * pattern,\n * required,\n * minLength,\n * maxLength,\n * validity,\n * validationMessage,\n * isNumber,\n * isBlurEvent,\n * validationType,\n * } = options;\n *\n * if (validity.tooLong) {\n * return `No more than ${maxLength} characters.`;\n * }\n *\n * if (validity.tooShort) {\n * return `No more than ${minLength} characters.`;\n * }\n *\n * if (validity.valueMissing) {\n * return \"This value is required!\";\n * }\n *\n * if (value === \"bad value\") {\n * return \"Value cannot be bad value\";\n * }\n *\n * return defaultGetErrorMessage(options);\n * }\n * });\n *\n * return <TextField {...fieldProps} label=\"Example\" />;\n * }\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * @remarks\n * \\@since 2.5.6\n * \\@since 6.0.0 This hook returns an object instead of an ordered list.\n */\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): TextFieldWithMessageImplementation<E>;\nexport function useTextField<E extends HTMLInputElement | HTMLTextAreaElement>(\n options: TextFieldHookOptions<E>\n): ValidatedTextFieldImplementation<E> {\n const {\n id: propId,\n ref: propRef,\n name,\n defaultValue = \"\",\n isNumber = false,\n required,\n pattern,\n minLength,\n maxLength,\n onBlur = noop,\n onChange = noop,\n onInvalid = noop,\n counter = false,\n helpText,\n validationType = \"recommended\",\n disableMessage = false,\n disableMaxLength = false,\n errorIcon: propErrorIcon,\n isErrored = defaultIsErrored,\n onErrorChange = noop,\n getErrorIcon = defaultGetErrorIcon,\n getErrorMessage = defaultGetErrorMessage,\n } = options;\n\n const id = useEnsuredId(propId, \"text-field\");\n const messageId = `${id}-message`;\n const [fieldRef, ref] = useEnsuredRef(propRef);\n const [state, setState] = useState<TextFieldHookState>(() => {\n const value =\n typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n\n return {\n value,\n error: false,\n errorMessage: \"\",\n };\n });\n const { value, error, errorMessage } = state;\n\n // using a `ref` instead of a `useCallback` makes it so the `defaultValue`\n // will always be used once reset.\n const reset = useRef(() => {\n fieldRef.current?.setCustomValidity(\"\");\n setState({ value, error: false, errorMessage: \"\" });\n }).current;\n\n const errored = useRef(error);\n const checkValidity = useCallback(\n (isBlurEvent: boolean) => {\n const field = fieldRef.current;\n if (!field) {\n throw new Error(\"Unable to check validity due to missing ref\");\n }\n\n // need to temporarily set the `maxLength` back so it can be \"verified\"\n // through the validity api\n /* istanbul ignore next */\n if (isBlurEvent && disableMaxLength && typeof maxLength === \"number\") {\n field.maxLength = maxLength;\n }\n\n const { value } = field;\n field.setCustomValidity(\"\");\n field.checkValidity();\n\n // remove the temporarily set `maxLength` attribute after checking the\n // validity\n /* istanbul ignore next */\n if (disableMaxLength && typeof maxLength === \"number\") {\n field.removeAttribute(\"maxLength\");\n }\n\n const options: ErrorMessageOptions = {\n value,\n pattern,\n required,\n minLength,\n maxLength,\n isBlurEvent,\n isNumber,\n validationType,\n validity: field.validity,\n validationMessage: field.validationMessage,\n };\n const errorMessage = getErrorMessage(options);\n const error = isErrored({ ...options, errorMessage });\n\n if (errored.current !== error) {\n errored.current = error;\n onErrorChange({\n ref: fieldRef,\n name,\n error,\n errorMessage,\n });\n }\n\n /* istanbul ignore next */\n if (errorMessage !== field.validationMessage) {\n field.setCustomValidity(errorMessage);\n }\n\n setState((prevState) => {\n if (\n prevState.value === value &&\n prevState.error === error &&\n prevState.errorMessage === errorMessage\n ) {\n return prevState;\n }\n\n return {\n value,\n error,\n errorMessage,\n };\n });\n },\n [\n disableMaxLength,\n fieldRef,\n getErrorMessage,\n isErrored,\n isNumber,\n maxLength,\n minLength,\n name,\n onErrorChange,\n pattern,\n required,\n validationType,\n ]\n );\n\n const errorIcon = getIcon(\"error\", propErrorIcon);\n const fieldProps: ProvidedTextFieldProps<E> & {\n messageProps?: ProvidedFormMessageProps;\n } = {\n id,\n ref,\n name,\n value,\n error,\n required,\n pattern,\n minLength,\n maxLength: disableMaxLength ? undefined : maxLength,\n rightAddon: getErrorIcon({\n error,\n errorIcon,\n errorMessage,\n }),\n onBlur(event) {\n onBlur(event);\n if (event.isPropagationStopped()) {\n return;\n }\n checkValidity(true);\n },\n onChange(event) {\n onChange(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n if (validationType === \"blur\") {\n setState((prevState) => ({\n ...prevState,\n value: event.currentTarget.value,\n }));\n return;\n }\n\n checkValidity(false);\n },\n onInvalid(event) {\n onInvalid(event);\n if (\n event.isPropagationStopped() ||\n event.currentTarget === document.activeElement\n ) {\n return;\n }\n\n // this makes it so that if a submit button is clicked in a form, all\n // textfields will gain the error state immediately\n // also need to extract the validationMessage immediately because of the\n // SyntheticEvent behavior in React. By the time the `setState` is called,\n // the event might've been deleted\n const { validationMessage } = event.currentTarget;\n\n setState((prevState) => {\n if (prevState.error) {\n return prevState;\n }\n\n return {\n ...prevState,\n error: true,\n errorMessage: validationMessage,\n };\n });\n },\n };\n\n if (!disableMessage) {\n fieldProps[\"aria-describedby\"] = messageId;\n fieldProps.messageProps = {\n id: messageId,\n error,\n length: counter ? value.length : undefined,\n maxLength:\n counter && typeof maxLength === \"number\" ? maxLength : undefined,\n children: errorMessage || helpText,\n };\n }\n\n return {\n ...state,\n reset,\n setState,\n fieldRef,\n fieldProps,\n };\n}\n"],"names":["useCallback","useRef","useState","getIcon","useEnsuredId","useEnsuredRef","defaultGetErrorIcon","defaultGetErrorMessage","defaultIsErrored","noop","useTextField","options","id","propId","ref","propRef","name","defaultValue","isNumber","required","pattern","minLength","maxLength","onBlur","onChange","onInvalid","counter","helpText","validationType","disableMessage","disableMaxLength","errorIcon","propErrorIcon","isErrored","onErrorChange","getErrorIcon","getErrorMessage","messageId","fieldRef","state","setState","value","error","errorMessage","reset","current","setCustomValidity","errored","checkValidity","isBlurEvent","field","Error","removeAttribute","validity","validationMessage","prevState","fieldProps","undefined","rightAddon","event","isPropagationStopped","currentTarget","document","activeElement","messageProps","length","children"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/utils.ts"],"sourcesContent":["import { type KeyboardEvent } from \"react\";\n\n/**\n * This util should be used to implement the native \"Enter\" keypress behavior\n * for \"fake\" form components to submit the form if exists.\n *\n * The way this will work will be:\n * - attempt to find a form by querying for a parent form element. if no parent\n * form element can be found, try to use the `formId` in a\n * `document.getElementById`\n * - if a form element is found, find the submit button within the form. If\n * there are no submit buttons within the form, try to find a submit button in\n * the document that is linked to this form by `form={formId}`\n * - if the submit button was found, click it to trigger the form submit\n * behavior\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n * @internal\n * @remarks\n * \\@since 2.7.0\n * \\@since 6.0.0 No longer returns a boolean, added the `formId` parameter, and\n * moved into the form package.\n * \\@since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button\n */\nexport function tryToSubmitRelatedForm<E extends HTMLElement>(\n event: KeyboardEvent<E>,\n formId: string | undefined\n): void {\n const { currentTarget } = event;\n let form: HTMLElement | null = null;\n if (formId) {\n form = document.getElementById(formId);\n } else {\n form = currentTarget.closest(\"form\");\n }\n\n if (!form || !(form instanceof HTMLFormElement)) {\n return;\n }\n\n formId = formId || form.id;\n let submit = form.querySelector<HTMLButtonElement>('[type=\"submit\"]');\n if (!submit && formId) {\n submit = document.querySelector<HTMLButtonElement>(\n `[type=\"submit\"][form=\"${formId}\"]`\n );\n }\n\n form.requestSubmit(submit);\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport type ChangeableHTMLElement =\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement;\n\n/**\n * This is used to trigger a change event for a form element.\n *\n * @internal\n * @see https://stackoverflow.com/a/46012210\n * @remarks \\@since 6.0.0\n */\nexport function triggerManualChangeEvent(\n element: ChangeableHTMLElement | null,\n value: string | number\n): void {\n if (!element) {\n return;\n }\n\n const prototype = Object.getPrototypeOf(element);\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n if (!setter) {\n return;\n }\n\n setter.call(element, value);\n const event = new Event(\"input\", { bubbles: true });\n element.dispatchEvent(event);\n}\n"],"names":["tryToSubmitRelatedForm","event","formId","currentTarget","form","document","getElementById","closest","HTMLFormElement","id","submit","querySelector","requestSubmit","triggerManualChangeEvent","element","value","prototype","Object","getPrototypeOf","setter","getOwnPropertyDescriptor","set","call","Event","bubbles","dispatchEvent"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASA,uBACdC,KAAuB,EACvBC,MAA0B;IAE1B,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,IAAIG,OAA2B;IAC/B,IAAIF,QAAQ;QACVE,OAAOC,SAASC,cAAc,CAACJ;IACjC,OAAO;QACLE,OAAOD,cAAcI,OAAO,CAAC;IAC/B;IAEA,IAAI,CAACH,QAAQ,CAAEA,CAAAA,gBAAgBI,eAAc,GAAI;QAC/C;IACF;IAEAN,SAASA,UAAUE,KAAKK,EAAE;IAC1B,IAAIC,SAASN,KAAKO,aAAa,CAAoB;IACnD,IAAI,CAACD,UAAUR,QAAQ;QACrBQ,SAASL,SAASM,aAAa,CAC7B,CAAC,sBAAsB,EAAET,OAAO,EAAE,CAAC;IAEvC;IAEAE,KAAKQ,aAAa,CAACF;AACrB;AAWA;;;;;;CAMC,GACD,OAAO,SAASG,yBACdC,OAAqC,EACrCC,KAAsB;IAEtB,IAAI,CAACD,SAAS;QACZ;IACF;IAEA,MAAME,YAAYC,OAAOC,cAAc,CAACJ;IACxC,MAAMK,SAASF,OAAOG,wBAAwB,CAACJ,WAAW,UAAUK;IACpE,IAAI,CAACF,QAAQ;QACX;IACF;IAEAA,OAAOG,IAAI,CAACR,SAASC;IACrB,MAAMd,QAAQ,IAAIsB,MAAM,SAAS;QAAEC,SAAS;IAAK;IACjDV,QAAQW,aAAa,CAACxB;AACxB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/validation.ts"],"sourcesContent":["import { type InputHTMLAttributes, type ReactNode } from \"react\";\n\n/**\n * @remarks \\@since 2.5.6\n * @remarks \\@since 6.0.0 Renamed from `TextConstraints` to\n * `TextFieldValidationOptions`\n */\nexport type TextFieldValidationOptions = Pick<\n InputHTMLAttributes<HTMLInputElement>,\n \"minLength\" | \"maxLength\" | \"required\" | \"pattern\"\n>;\n\n/**\n * Since the default validation messages can be verbose, this type is used to\n * configure when/how to display the native browser messages when the validation\n * state changes during the `change` event phase. The validation message will\n * always be shown on blur.\n *\n * When this is:\n *\n * - `true` -&gt; always show the browser message when it exists\n * - `false` -&gt; never show the browser message\n * - `\"recommended\"` -&gt; only shows the browser message if it is one of the\n * `RECOMMENDED_STATE_KEYS`/`RECOMMENDED_NUMBER_STATE_KEYS` validation errors\n * - `keyof ValidityState` -&gt; only shows the browser message if it is not the\n * specific validation error\n * - `(keyof ValidityState)[]` -&gt; only shows the browser message if it is not\n * the specific validation errors\n *\n * @see {@link RECOMMENDED_STATE_KEYS}\n * @see {@link RECOMMENDED_NUMBER_STATE_KEYS}\n * @remarks \\@since 2.5.6\n * @remarks \\@since 6.0.0 Renamed from `ChangeValidationBehavior` to\n * `TextFieldValidationType`\n */\nexport type TextFieldValidationType =\n | \"blur\"\n | \"change\"\n | \"recommended\"\n | keyof ValidityState\n | readonly (keyof ValidityState)[];\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface ErrorMessageOptions extends TextFieldValidationOptions {\n /**\n * The current input or textarea's validity state.\n */\n validity: ValidityState;\n\n /**\n * The browser defined validation message based on the validity state. This\n * will be the empty string when there are no errors.\n */\n validationMessage: string;\n\n /**\n * The current `TextField` or `TextArea` value.\n */\n value: string;\n\n /**\n * This will only be `true` if called by the `useNumberField` hook.\n */\n isNumber: boolean;\n\n /**\n * Boolean if this is triggered from a blur event instead of a change event.\n */\n isBlurEvent: boolean;\n\n /**\n * The validation type defined by the `useTextField` hook.\n */\n validationType: TextFieldValidationType;\n}\n\n/**\n * A function to get a custom error message for specific errors. This is really\n * useful when using the `pattern` attribute to give additional information or\n * changing the native \"language translated\" error message.\n *\n * @param options - An object containing metadata that can be used to create an\n * error message for your `TextField` or `TextArea`.\n * @returns An error message to display or an empty string.\n * @remarks \\@since 2.5.0\n */\nexport type GetErrorMessage = (options: ErrorMessageOptions) => string;\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nconst VALIDITY_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"customError\",\n \"patternMismatch\",\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"stepMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"typeMismatch\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nexport const RECOMMENDED_STATE_KEYS: readonly (keyof ValidityState)[] = [\n \"badInput\",\n \"tooLong\",\n \"valueMissing\",\n];\n\n/**\n * @internal\n * @remarks \\@since 2.5.0\n */\nexport const RECOMMENDED_NUMBER_STATE_KEYS: readonly (keyof ValidityState)[] = [\n ...RECOMMENDED_STATE_KEYS,\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"tooShort\",\n \"typeMismatch\",\n];\n\n/**\n * The validation message is actually kind of weird since it's possible for a\n * form element to have multiple errors at once. The validation message will be\n * the first error that appears, so need to make sure that the first error is\n * one of the recommended state keys so the message appears for only those types\n * of errors.\n *\n * @internal\n * @remarks \\@since 2.5.0\n */\nconst isRecommended = (validity: ValidityState, isNumber: boolean): boolean => {\n const errorable = isNumber\n ? RECOMMENDED_NUMBER_STATE_KEYS\n : RECOMMENDED_STATE_KEYS;\n\n return VALIDITY_STATE_KEYS.every((key) => {\n const errored = validity[key];\n return !errored || errorable.includes(key);\n });\n};\n\n/**\n * The default implementation for getting an error message for the `TextField`\n * or `TextArea` components that relies on the behavior of the\n * {@link ChangeValidationBehavior}\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultGetErrorMessage: GetErrorMessage = (options) => {\n const {\n isNumber,\n isBlurEvent,\n validity,\n validationMessage,\n validationType: validate,\n } = options;\n\n if (isBlurEvent || !validationMessage || validate === \"change\") {\n return validationMessage;\n }\n\n if (validate === \"blur\") {\n return \"\";\n }\n\n if (validate === \"recommended\") {\n return isRecommended(validity, isNumber) ? validationMessage : \"\";\n }\n\n const keys = typeof validate === \"string\" ? [validate] : validate;\n\n return keys.length &&\n VALIDITY_STATE_KEYS.some((key) => validity[key] && keys.includes(key))\n ? validationMessage\n : \"\";\n};\n\n/**\n * @remarks \\@since 2.5.0\n */\nexport interface IsErroredOptions extends ErrorMessageOptions {\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that is used to determine if a `TextField` or `TextArea` is in an\n * errored state.\n *\n * @param options - All the current options that can be used to determine the\n * error state.\n * @returns True if the component is considered to be in an errored state.\n * @remarks \\@since 2.5.0\n */\nexport type IsErrored = (options: IsErroredOptions) => boolean;\n\n/**\n * The default implementation for checking if a `TextField` or `TextArea` is\n * errored by returning `true` if the `errorMessage` string is truthy or the\n * value is not within the `minLength` and `maxLength` constraints when they\n * exist.\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultIsErrored: IsErrored = (options) => {\n const { value, errorMessage, minLength, maxLength, isBlurEvent } = options;\n\n return (\n !!errorMessage ||\n (typeof maxLength === \"number\" && value.length > maxLength) ||\n (isBlurEvent && typeof minLength === \"number\" && value.length < minLength)\n );\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface GetErrorIconOptions {\n /**\n * This will be `true` if the `TextField` or `TextArea` is in an errored state.\n */\n error: boolean;\n\n /**\n * The current error icon that was provided.\n */\n errorIcon: ReactNode;\n\n /**\n * The current error message or an empty string.\n */\n errorMessage: string;\n}\n\n/**\n * A function that can be used to dynamically get an error icon based on the\n * current visible error.\n *\n * @param options - The {@link GetErrorIconOptions}\n * @returns An icon to render or falsey to render nothing.\n * @remarks \\@since 2.5.0\n * @remarks \\@since 6.0.0 Updated to accept a single object argument\n */\nexport type GetErrorIcon = (options: GetErrorIconOptions) => ReactNode;\n\n/**\n * The default implementation for showing an error icon in `TextField` and\n * `TextArea` components that will only display when the error flag is enabled.\n *\n * @remarks \\@since 2.5.0\n */\nexport const defaultGetErrorIcon: GetErrorIcon = (options) => {\n const { error, errorIcon } = options;\n\n return error && errorIcon;\n};\n"],"names":["VALIDITY_STATE_KEYS","RECOMMENDED_STATE_KEYS","RECOMMENDED_NUMBER_STATE_KEYS","isRecommended","validity","isNumber","errorable","every","key","errored","includes","defaultGetErrorMessage","options","isBlurEvent","validationMessage","validationType","validate","keys","length","some","defaultIsErrored","value","errorMessage","minLength","maxLength","defaultGetErrorIcon","error","errorIcon"],"mappings":"AA0FA;;;CAGC,GACD,MAAMA,sBAAwD;IAC5D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;CAGC,GACD,OAAO,MAAMC,yBAA2D;IACtE;IACA;IACA;CACD,CAAC;AAEF;;;CAGC,GACD,OAAO,MAAMC,gCAAkE;OAC1ED;IACH;IACA;IACA;IACA;CACD,CAAC;AAEF;;;;;;;;;CASC,GACD,MAAME,gBAAgB,CAACC,UAAyBC;IAC9C,MAAMC,YAAYD,WACdH,gCACAD;IAEJ,OAAOD,oBAAoBO,KAAK,CAAC,CAACC;QAChC,MAAMC,UAAUL,QAAQ,CAACI,IAAI;QAC7B,OAAO,CAACC,WAAWH,UAAUI,QAAQ,CAACF;IACxC;AACF;AAEA;;;;;;CAMC,GACD,OAAO,MAAMG,yBAA0C,CAACC;IACtD,MAAM,EACJP,QAAQ,EACRQ,WAAW,EACXT,QAAQ,EACRU,iBAAiB,EACjBC,gBAAgBC,QAAQ,EACzB,GAAGJ;IAEJ,IAAIC,eAAe,CAACC,qBAAqBE,aAAa,UAAU;QAC9D,OAAOF;IACT;IAEA,IAAIE,aAAa,QAAQ;QACvB,OAAO;IACT;IAEA,IAAIA,aAAa,eAAe;QAC9B,OAAOb,cAAcC,UAAUC,YAAYS,oBAAoB;IACjE;IAEA,MAAMG,OAAO,OAAOD,aAAa,WAAW;QAACA;KAAS,GAAGA;IAEzD,OAAOC,KAAKC,MAAM,IAChBlB,oBAAoBmB,IAAI,CAAC,CAACX,MAAQJ,QAAQ,CAACI,IAAI,IAAIS,KAAKP,QAAQ,CAACF,QAC/DM,oBACA;AACN,EAAE;AAuBF;;;;;;;CAOC,GACD,OAAO,MAAMM,mBAA8B,CAACR;IAC1C,MAAM,EAAES,KAAK,EAAEC,YAAY,EAAEC,SAAS,EAAEC,SAAS,EAAEX,WAAW,EAAE,GAAGD;IAEnE,OACE,CAAC,CAACU,gBACD,OAAOE,cAAc,YAAYH,MAAMH,MAAM,GAAGM,aAChDX,eAAe,OAAOU,cAAc,YAAYF,MAAMH,MAAM,GAAGK;AAEpE,EAAE;AAiCF;;;;;CAKC,GACD,OAAO,MAAME,sBAAoC,CAACb;IAChD,MAAM,EAAEc,KAAK,EAAEC,SAAS,EAAE,GAAGf;IAE7B,OAAOc,SAASC;AAClB,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/hoverMode/useHoverMode.ts"],"sourcesContent":["\"use client\";\nimport type { MouseEvent } from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { UseStateInitializer, UseStateSetter } from \"../types.js\";\nimport type { SimpleHoverModeContext } from \"./useHoverModeProvider.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface HoverModeConfigurationOptions extends SimpleHoverModeContext {\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /**\n * This can be used to override the `HoverModeContext`'s hover time.\n */\n hoverTimeout?: number;\n\n /**\n * This can be used to override the `HoverModeContext`'s leave time.\n */\n leaveTimeout?: number;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ControlledHoverModeOptions\n extends HoverModeConfigurationOptions {\n setVisible: UseStateSetter<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ControlledHoverModeImplementation {\n startShowFlow(id?: string | MouseEvent): void;\n startHideFlow(): void;\n clearVisibilityTimeout(): void;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface UncontrolledHoverModeOptions\n extends HoverModeConfigurationOptions {\n defaultVisible?: UseStateInitializer<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface UncontrolledHoverModeImplementation\n extends ControlledHoverModeImplementation {\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface HoverModeImplementation\n extends ControlledHoverModeImplementation {\n visible?: boolean;\n setVisible?: UseStateSetter<boolean>;\n}\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 5.0.0 This hook no longer returns `handlers` or\n * `stickyHandlers` and does not hide when an element on the page is clicked.\n * \\@since 6.0.0 Requires passing the custom hover mode context to\n * work.\n */\nexport function useHoverMode(\n options: ControlledHoverModeOptions\n): ControlledHoverModeImplementation;\nexport function useHoverMode(\n options: UncontrolledHoverModeOptions\n): UncontrolledHoverModeImplementation;\nexport function useHoverMode(\n options: ControlledHoverModeOptions | UncontrolledHoverModeOptions\n): HoverModeImplementation {\n const {\n disabled,\n hoverTimeout: hoverTime,\n hoverTimeoutRef,\n leaveTimeout: leaveTime,\n leaveTimeoutRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n setVisible: propSetVisible,\n defaultVisible = false,\n } = options as ControlledHoverModeOptions & UncontrolledHoverModeOptions;\n\n const state = useState(defaultVisible);\n let visible: boolean | undefined;\n let setVisible: UseStateSetter<boolean>;\n if (typeof propSetVisible !== \"undefined\") {\n setVisible = propSetVisible;\n } else {\n [visible, setVisible] = state;\n }\n\n const visibilityTimeout = useRef<number | undefined>();\n const clearVisibilityTimeout = useCallback(() => {\n window.clearTimeout(visibilityTimeout.current);\n }, []);\n\n // if the element is near the viewport edge, the mouseleave event might not\n // trigger correctly. for these cases, just clear any timeouts to be safe.\n // do not hide the visibility so that you can still inspect things in the\n // devtools\n useEffect(() => {\n if (disabled) {\n return;\n }\n\n const handler = (): void => {\n window.clearTimeout(visibilityTimeout.current);\n\n // might need to play with this more or make it configurable. if the mouse\n // leaves the window, you're _normally_ not interacting with the app\n // anymore and state should reset.\n disableHoverMode();\n };\n\n document.addEventListener(\"mouseleave\", handler);\n return () => {\n document.removeEventListener(\"mouseleave\", handler);\n };\n }, [disableHoverMode, disabled]);\n\n useEffect(() => {\n return () => {\n window.clearTimeout(visibilityTimeout.current);\n };\n }, []);\n\n return {\n visible,\n setVisible: setVisible === propSetVisible ? undefined : setVisible,\n startShowFlow: useCallback(\n (eventOrId) => {\n const hoverTimeout = hoverTime ?? hoverTimeoutRef.current;\n if (disabled || typeof hoverTimeout === \"undefined\") {\n return;\n }\n\n let id: string;\n if (typeof eventOrId === \"string\" || typeof eventOrId === \"undefined\") {\n id = eventOrId || \"\";\n } else {\n id = eventOrId.currentTarget.id;\n }\n\n clearDisableTimer();\n clearVisibilityTimeout();\n visibilityTimeout.current = window.setTimeout(() => {\n enableHoverMode(id);\n setVisible(true);\n }, hoverTimeout);\n },\n [\n clearDisableTimer,\n clearVisibilityTimeout,\n disabled,\n enableHoverMode,\n hoverTime,\n hoverTimeoutRef,\n setVisible,\n ]\n ),\n startHideFlow: useCallback(() => {\n if (disabled) {\n return;\n }\n\n startDisableTimer();\n clearVisibilityTimeout();\n visibilityTimeout.current = window.setTimeout(() => {\n setVisible(false);\n }, leaveTime ?? leaveTimeoutRef.current);\n }, [\n clearVisibilityTimeout,\n disabled,\n leaveTime,\n leaveTimeoutRef,\n setVisible,\n startDisableTimer,\n ]),\n clearVisibilityTimeout,\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","useHoverMode","options","disabled","hoverTimeout","hoverTime","hoverTimeoutRef","leaveTimeout","leaveTime","leaveTimeoutRef","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","setVisible","propSetVisible","defaultVisible","state","visible","visibilityTimeout","clearVisibilityTimeout","window","clearTimeout","current","handler","document","addEventListener","removeEventListener","undefined","startShowFlow","eventOrId","id","currentTarget","setTimeout","startHideFlow"],"mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AA+EjE,OAAO,SAASC,aACdC,OAAkE;IAElE,MAAM,EACJC,QAAQ,EACRC,cAAcC,SAAS,EACvBC,eAAe,EACfC,cAAcC,SAAS,EACvBC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,EACjBC,YAAYC,cAAc,EAC1BC,iBAAiB,KAAK,EACvB,GAAGd;IAEJ,MAAMe,QAAQjB,SAASgB;IACvB,IAAIE;IACJ,IAAIJ;IACJ,IAAI,OAAOC,mBAAmB,aAAa;QACzCD,aAAaC;IACf,OAAO;QACL,CAACG,SAASJ,WAAW,GAAGG;IAC1B;IAEA,MAAME,oBAAoBpB;IAC1B,MAAMqB,yBAAyBvB,YAAY;QACzCwB,OAAOC,YAAY,CAACH,kBAAkBI,OAAO;IAC/C,GAAG,EAAE;IAEL,2EAA2E;IAC3E,0EAA0E;IAC1E,yEAAyE;IACzE,WAAW;IACXzB,UAAU;QACR,IAAIK,UAAU;YACZ;QACF;QAEA,MAAMqB,UAAU;YACdH,OAAOC,YAAY,CAACH,kBAAkBI,OAAO;YAE7C,0EAA0E;YAC1E,oEAAoE;YACpE,kCAAkC;YAClCZ;QACF;QAEAc,SAASC,gBAAgB,CAAC,cAAcF;QACxC,OAAO;YACLC,SAASE,mBAAmB,CAAC,cAAcH;QAC7C;IACF,GAAG;QAACb;QAAkBR;KAAS;IAE/BL,UAAU;QACR,OAAO;YACLuB,OAAOC,YAAY,CAACH,kBAAkBI,OAAO;QAC/C;IACF,GAAG,EAAE;IAEL,OAAO;QACLL;QACAJ,YAAYA,eAAeC,iBAAiBa,YAAYd;QACxDe,eAAehC,YACb,CAACiC;YACC,MAAM1B,eAAeC,aAAaC,gBAAgBiB,OAAO;YACzD,IAAIpB,YAAY,OAAOC,iBAAiB,aAAa;gBACnD;YACF;YAEA,IAAI2B;YACJ,IAAI,OAAOD,cAAc,YAAY,OAAOA,cAAc,aAAa;gBACrEC,KAAKD,aAAa;YACpB,OAAO;gBACLC,KAAKD,UAAUE,aAAa,CAACD,EAAE;YACjC;YAEAlB;YACAO;YACAD,kBAAkBI,OAAO,GAAGF,OAAOY,UAAU,CAAC;gBAC5CvB,gBAAgBqB;gBAChBjB,WAAW;YACb,GAAGV;QACL,GACA;YACES;YACAO;YACAjB;YACAO;YACAL;YACAC;YACAQ;SACD;QAEHoB,eAAerC,YAAY;YACzB,IAAIM,UAAU;gBACZ;YACF;YAEAS;YACAQ;YACAD,kBAAkBI,OAAO,GAAGF,OAAOY,UAAU,CAAC;gBAC5CnB,WAAW;YACb,GAAGN,aAAaC,gBAAgBc,OAAO;QACzC,GAAG;YACDH;YACAjB;YACAK;YACAC;YACAK;YACAF;SACD;QACDQ;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/hoverMode/useHoverModeProvider.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { NonNullMutableRef, NonNullRef } from \"../types.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @remarks \\@since 6.0.0 */\nexport interface SimpleHoverModeContext {\n /**\n * @example\n * Main Usage\n * ```ts\n * onMouseEnter(event) {\n * const hoverTimeout = hoverTimeoutRef.current;\n * if (typeof hoverTimeout !== \"number\" || mode === \"touch\") {\n * return;\n * }\n *\n * const { id } = event.currentTarget;\n * clearDisableTimer();\n * window.clearTimeout(visibilityTimeout.current);\n * visibilityTimeout.current = window.setTimeout(() => {\n * enableHoverMode(id);\n * setVisible(true);\n * }, hoverTimeout);\n * }\n * ```\n */\n hoverTimeoutRef: NonNullRef<number | undefined>;\n\n /**\n * @example\n * Main Usage\n * ```ts\n * onMouseLeave() {\n * if (mode === \"touch\") {\n * return\n * }\n *\n * startDisableTimer();\n * window.clearTimeout(visibilityTimeout.current);\n * visibilityTimeout.current = window.setTimeout(() => {\n * setVisible(false)\n * }, leaveTimeoutRef.current);\n * }\n * ```\n */\n leaveTimeoutRef: NonNullRef<number>;\n\n /**\n * When this is called, the {@link hoverTimeoutRef} will be set to `0` and the\n * {@link HoverModeContext.activeId} will be set to this `activeId` value.\n *\n * @see {@link hoverTimeoutRef} for an example.\n */\n enableHoverMode(activeId: string): void;\n\n /**\n * Disables all hover mode behavior by clearing all timeouts and resetting\n * internal state.\n */\n disableHoverMode(): void;\n\n /**\n * @see {@link leaveTimeoutRef} for an example.\n */\n startDisableTimer(): void;\n\n /**\n * @see {@link hoverTimeoutRef} for an example.\n */\n clearDisableTimer(): void;\n}\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 6.0.0 Uses refs to increase performance by preventing unneeded\n * re-renders of the entire hover mode provider's component tree. The API also\n * changed to support custom hover mode providers.\n */\nexport interface HoverModeContext extends SimpleHoverModeContext {\n /**\n * This will only be updated if {@link HoverModeConfiguration.forceRerender} is `true`\n */\n activeId: string;\n\n /**\n * This ref contains the current DOM `id` for the element that is being\n * hovered within the `HoverModeProvider`. This will be an empty string\n * when the hover mode is not active.\n */\n activeIdRef: NonNullMutableRef<string>;\n\n /**\n * This ref can be used to disable transitions for a group of components using\n * the same hover mode provider. The general flow would be:\n *\n * - set `disableTransition: animatedOnceRef.current` on hover mode components\n * - set `animatedOnceRef.current = true` when the `onEntered` transition callback fires\n * - set `animatedOnceRef.current = false` when the hover mode behavior is\n * disabled. This would normally be after a timeout for the `onExited`\n * callback\n */\n animatedOnceRef: NonNullMutableRef<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CreateHoverModeContextOptions {\n /**\n * TODO: I think this has something to do with how I implemented the MenuBar.\n *\n * @defaultValue `\"\"`\n */\n defaultActiveId?: string;\n\n /**\n * When this is `undefined`, the hover mode behavior will be disabled.\n * Otherwise, this will be the amount of time to wait on a `mouseenter` event\n * before setting the visibility to `true`.\n *\n * @defaultValue `undefined`\n */\n hoverTimeout?: number;\n\n /**\n * The amount of time to wait after a `mouseleave` event before setting the\n * visibility to `false`.\n *\n * @defaultValue `0`\n * @remarks \\@since 6.0.0 This was renamed from `exitVisibilityDelay` and the\n * default value changed from `300` to `0`.\n */\n leaveTimeout?: number;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function createHoverModeContext(\n options: CreateHoverModeContextOptions = {}\n): Readonly<HoverModeContext> {\n const { defaultActiveId = \"\", hoverTimeout, leaveTimeout = 0 } = options;\n\n return {\n activeId: defaultActiveId,\n activeIdRef: { current: defaultActiveId },\n hoverTimeoutRef: { current: hoverTimeout },\n leaveTimeoutRef: { current: leaveTimeout },\n animatedOnceRef: { current: false },\n enableHoverMode: noop,\n disableHoverMode: noop,\n startDisableTimer: noop,\n clearDisableTimer: noop,\n };\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface HoverModeConfiguration extends CreateHoverModeContextOptions {\n /**\n * The amount of time to wait before disabling the hover mode behavior if none\n * of the components are being hovered.\n *\n * If this is `undefined`, {@link HoverModeContext.startDisableTimer} will do\n * nothing. You must manually call {@link HoverModeContext.disableHoverMode}\n * to disable the hover mode instead.\n */\n disableTimeout?: number;\n\n /**\n * @defaultValue `false`\n */\n forceRerender?: boolean;\n}\n\n/**\n * @example\n * Creating a Hover Mode Group\n * ```tsx\n * import type {\n * HoverModeConfiguration,\n * HoverModeContext,\n * } from \"@react-md/core\";\n * import {\n * createHoverModeContext,\n * useHoverModeProvider,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { createContext, useContext } from \"react\";\n *\n * // extend as needed\n * type CustomHoverMode = HoverModeContext;\n *\n * // you can also add defaults if there is no parent provider.\n * const context = createContext<CustomHoverMode>(createHoverModeContext());\n * const { Provider } = context;\n *\n * interface Props extends HoverModeConfiguration {\n * children: ReactNode;\n * }\n *\n * export function CustomHoverModeProvider({\n * children,\n * // change to whatever defaults you want\n * hoverTimeout = 3000,\n * leaveTimeout = 3000,\n * defaultActiveId = \"\",\n * disableTimeout = 5000,\n * }: Props): ReactElement {\n * const context = useHoverModeProvider({\n * hoverTimeout,\n * leaveTimeout,\n * defaultActiveId,\n * disableTimeout,\n * });\n *\n * return <Provider value={context}>{children}</Provider>;\n * }\n * ```\n *\n * @see {@link CreateHoverModeContextOptions}\n * @see {@link useHoverMode}\n * @remarks \\@since 6.0.0 The `HoverModeProvider` component was replaced by this\n * hook implementation. After developing the `MenuBar`, I realized the hover\n * mode should normally be grouped by related components or types instead of a\n * top-level catch all.\n */\nexport function useHoverModeProvider(\n options: HoverModeConfiguration\n): Readonly<HoverModeContext> {\n const {\n hoverTimeout,\n leaveTimeout = 0,\n forceRerender = false,\n defaultActiveId = \"\",\n disableTimeout,\n } = options;\n\n const [activeId, setActiveId] = useState(defaultActiveId);\n const activeIdRef = useRef(defaultActiveId);\n const hoverTimeoutRef = useRef(hoverTimeout);\n const leaveTimeoutRef = useRef(leaveTimeout);\n const animatedOnceRef = useRef(!!defaultActiveId);\n const disableHoverModeTimeout = useRef<number | undefined>();\n const clearDisableTimer = useCallback(() => {\n window.clearTimeout(disableHoverModeTimeout.current);\n }, []);\n const enableHoverMode = useCallback(\n (activeId: string) => {\n clearDisableTimer();\n activeIdRef.current = activeId;\n hoverTimeoutRef.current = 0;\n\n if (forceRerender) {\n setActiveId(activeId);\n }\n },\n [clearDisableTimer, forceRerender]\n );\n const disableHoverMode = useCallback(() => {\n clearDisableTimer();\n activeIdRef.current = \"\";\n hoverTimeoutRef.current = hoverTimeout;\n animatedOnceRef.current = false;\n if (forceRerender) {\n setActiveId(\"\");\n }\n }, [clearDisableTimer, forceRerender, hoverTimeout]);\n const startDisableTimer = useCallback(() => {\n if (typeof disableTimeout !== \"number\") {\n return;\n }\n\n clearDisableTimer();\n disableHoverModeTimeout.current = window.setTimeout(() => {\n disableHoverMode();\n }, disableTimeout);\n }, [clearDisableTimer, disableHoverMode, disableTimeout]);\n\n useEffect(() => {\n hoverTimeoutRef.current = hoverTimeout;\n return () => {\n window.clearTimeout(disableHoverModeTimeout.current);\n };\n }, [hoverTimeout]);\n\n return useMemo<HoverModeContext>(\n () => ({\n activeId,\n activeIdRef,\n hoverTimeoutRef,\n leaveTimeoutRef,\n animatedOnceRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n }),\n [\n activeId,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n ]\n );\n}\n"],"names":["useCallback","useEffect","useMemo","useRef","useState","noop","createHoverModeContext","options","defaultActiveId","hoverTimeout","leaveTimeout","activeId","activeIdRef","current","hoverTimeoutRef","leaveTimeoutRef","animatedOnceRef","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","useHoverModeProvider","forceRerender","disableTimeout","setActiveId","disableHoverModeTimeout","window","clearTimeout","setTimeout"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAG1E,MAAMC,OAAO;AACX,aAAa;AACf;AAsIA;;CAEC,GACD,OAAO,SAASC,uBACdC,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,kBAAkB,EAAE,EAAEC,YAAY,EAAEC,eAAe,CAAC,EAAE,GAAGH;IAEjE,OAAO;QACLI,UAAUH;QACVI,aAAa;YAAEC,SAASL;QAAgB;QACxCM,iBAAiB;YAAED,SAASJ;QAAa;QACzCM,iBAAiB;YAAEF,SAASH;QAAa;QACzCM,iBAAiB;YAAEH,SAAS;QAAM;QAClCI,iBAAiBZ;QACjBa,kBAAkBb;QAClBc,mBAAmBd;QACnBe,mBAAmBf;IACrB;AACF;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDC,GACD,OAAO,SAASgB,qBACdd,OAA+B;IAE/B,MAAM,EACJE,YAAY,EACZC,eAAe,CAAC,EAChBY,gBAAgB,KAAK,EACrBd,kBAAkB,EAAE,EACpBe,cAAc,EACf,GAAGhB;IAEJ,MAAM,CAACI,UAAUa,YAAY,GAAGpB,SAASI;IACzC,MAAMI,cAAcT,OAAOK;IAC3B,MAAMM,kBAAkBX,OAAOM;IAC/B,MAAMM,kBAAkBZ,OAAOO;IAC/B,MAAMM,kBAAkBb,OAAO,CAAC,CAACK;IACjC,MAAMiB,0BAA0BtB;IAChC,MAAMiB,oBAAoBpB,YAAY;QACpC0B,OAAOC,YAAY,CAACF,wBAAwBZ,OAAO;IACrD,GAAG,EAAE;IACL,MAAMI,kBAAkBjB,YACtB,CAACW;QACCS;QACAR,YAAYC,OAAO,GAAGF;QACtBG,gBAAgBD,OAAO,GAAG;QAE1B,IAAIS,eAAe;YACjBE,YAAYb;QACd;IACF,GACA;QAACS;QAAmBE;KAAc;IAEpC,MAAMJ,mBAAmBlB,YAAY;QACnCoB;QACAR,YAAYC,OAAO,GAAG;QACtBC,gBAAgBD,OAAO,GAAGJ;QAC1BO,gBAAgBH,OAAO,GAAG;QAC1B,IAAIS,eAAe;YACjBE,YAAY;QACd;IACF,GAAG;QAACJ;QAAmBE;QAAeb;KAAa;IACnD,MAAMU,oBAAoBnB,YAAY;QACpC,IAAI,OAAOuB,mBAAmB,UAAU;YACtC;QACF;QAEAH;QACAK,wBAAwBZ,OAAO,GAAGa,OAAOE,UAAU,CAAC;YAClDV;QACF,GAAGK;IACL,GAAG;QAACH;QAAmBF;QAAkBK;KAAe;IAExDtB,UAAU;QACRa,gBAAgBD,OAAO,GAAGJ;QAC1B,OAAO;YACLiB,OAAOC,YAAY,CAACF,wBAAwBZ,OAAO;QACrD;IACF,GAAG;QAACJ;KAAa;IAEjB,OAAOP,QACL,IAAO,CAAA;YACLS;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACET;QACAM;QACAC;QACAC;QACAC;KACD;AAEL"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icon/FontIcon.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { icon, type FontIconClassNameOptions } from \"./styles.js\";\n\nexport interface FontIconProps\n extends HTMLAttributes<HTMLElement>,\n FontIconClassNameOptions {\n /**\n * Any children to render to create the font icon. This is required for\n * material-icons.\n */\n children?: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * The `FontIcon` component is used for rendering a font-icon library's icon.\n * The default is to use the `material-icons` library, but others can be used as\n * well.\n *\n * If you are using another font icon library that does not always create icons\n * with a perfect 1:1 scale (such as font awesome), it is recommended to use the\n * `forceSize` and `forceFontSize` props to fix the sizing issues.\n *\n * \\@remarks \\@since 6.0.0 Switched from `<i>` to `<span>` element and removed\n * the `forceSize`/`forceFontSize` props.\n */\nexport const FontIcon = forwardRef<HTMLElement, FontIconProps>(\n function FontIcon(props, ref) {\n const {\n className,\n children,\n \"aria-hidden\": ariaHidden = true,\n dense = false,\n theme,\n iconClassName = \"material-icons\",\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"font\",\n dense,\n theme,\n className,\n iconClassName,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["forwardRef","icon","FontIcon","props","ref","className","children","ariaHidden","dense","theme","iconClassName","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAASA,UAAU,QAA6C,QAAQ;AACxE,SAASC,IAAI,QAAuC,cAAc;AAYlE;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,QAAQ,EACR,eAAeC,aAAa,IAAI,EAChCC,QAAQ,KAAK,EACbC,KAAK,EACLC,gBAAgB,gBAAgB,EAChC,GAAGC,WACJ,GAAGR;IAEJ,qBACE,KAACS;QACE,GAAGD,SAAS;QACbE,eAAaN;QACbH,KAAKA;QACLC,WAAWJ,KAAK;YACda,MAAM;YACNN;YACAC;YACAJ;YACAK;QACF;kBAECJ;;AAGP,GACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icon/IconRotator.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { iconRotator, type IconRotatorClassNameOptions } from \"./styles.js\";\n\n/**\n * @remarks \\@since 6.0.0 Removed `animate` prop and added `disableTransition`\n */\nexport interface IconRotatorBaseProps\n extends HTMLAttributes<HTMLSpanElement>,\n IconRotatorClassNameOptions {\n /**\n * An optional style to apply to the surrounding span when the `forceIconWrap`\n * prop is enabled or the children is not a single react element.\n */\n style?: CSSProperties;\n\n /**\n * Boolean if the child icon should be \"forcefully\" wrapped in a `<span>`\n * element. This should be enabled if you have a custom icon that does not\n * pass the `className` prop down.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n}\n\nexport interface IconRotatorProps extends IconRotatorBaseProps {\n /**\n * The icon that should be rotated. If this is a valid React Element, the\n * class names will be cloned into that icon, otherwise the icon will be\n * wrapped in a span with the correct class names applied.\n */\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * The `IconRotator` is a simple component that is used to rotate an icon from a\n * one degrees to another.\n */\nexport const IconRotator = forwardRef<HTMLSpanElement, IconRotatorProps>(\n function IconRotator(props, ref) {\n const {\n className: propClassName,\n rotated,\n children,\n forceIconWrap = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const className = iconRotator({\n rotated,\n className: propClassName,\n disableTransition,\n });\n if (!forceIconWrap && isValidElement<{ className?: string }>(children)) {\n const child = Children.only(children);\n return cloneElement(child, {\n className: cnb(className, child.props.className),\n });\n }\n\n return (\n <span {...remaining} ref={ref} className={className}>\n {children}\n </span>\n );\n }\n);\n"],"names":["cnb","Children","cloneElement","forwardRef","isValidElement","iconRotator","IconRotator","props","ref","className","propClassName","rotated","children","forceIconWrap","disableTransition","remaining","child","only","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,cAAc,QAIT,QAAQ;AACf,SAASC,WAAW,QAA0C,cAAc;AAiC5E;;;;;CAKC,GACD,OAAO,MAAMC,4BAAcH,WACzB,SAASG,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,WAAWC,aAAa,EACxBC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,KAAK,EACrBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGR;IAEJ,MAAME,YAAYJ,YAAY;QAC5BM;QACAF,WAAWC;QACXI;IACF;IACA,IAAI,CAACD,+BAAiBT,eAAuCQ,WAAW;QACtE,MAAMI,QAAQf,SAASgB,IAAI,CAACL;QAC5B,qBAAOV,aAAac,OAAO;YACzBP,WAAWT,IAAIS,WAAWO,MAAMT,KAAK,CAACE,SAAS;QACjD;IACF;IAEA,qBACE,KAACS;QAAM,GAAGH,SAAS;QAAEP,KAAKA;QAAKC,WAAWA;kBACvCG;;AAGP,GACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icon/MaterialIcon.tsx"],"sourcesContent":["import { forwardRef, type AriaAttributes, type HTMLAttributes } from \"react\";\nimport { type MaterialIconName } from \"./material.js\";\nimport { MATERIAL_CONFIG } from \"./materialConfig.js\";\nimport { icon, type MaterialIconClassNameOptions } from \"./styles.js\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface MaterialIconProps\n extends HTMLAttributes<HTMLSpanElement>,\n Partial<MaterialIconClassNameOptions> {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n name: MaterialIconName;\n children?: never;\n}\n\n/**\n * **Server Component**\n *\n * @remarks \\@since 6.0.0\n */\nexport const MaterialIcon = forwardRef<HTMLSpanElement, MaterialIconProps>(\n function MaterialIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n name,\n family = MATERIAL_CONFIG.iconFamily,\n theme,\n dense,\n className,\n ...remaining\n } = props;\n\n return (\n <span\n ref={ref}\n aria-hidden={ariaHidden}\n {...remaining}\n className={icon({\n type: \"material\",\n family,\n theme,\n dense,\n className,\n })}\n >\n {name}\n </span>\n );\n }\n);\n"],"names":["forwardRef","MATERIAL_CONFIG","icon","MaterialIcon","props","ref","ariaHidden","name","family","iconFamily","theme","dense","className","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAASA,UAAU,QAAkD,QAAQ;AAE7E,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,IAAI,QAA2C,cAAc;AAYtE;;;;CAIC,GACD,OAAO,MAAMC,6BAAeH,WAC1B,SAASG,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,IAAI,EACJC,SAASP,gBAAgBQ,UAAU,EACnCC,KAAK,EACLC,KAAK,EACLC,SAAS,EACT,GAAGC,WACJ,GAAGT;IAEJ,qBACE,KAACU;QACCT,KAAKA;QACLU,eAAaT;QACZ,GAAGO,SAAS;QACbD,WAAWV,KAAK;YACdc,MAAM;YACNR;YACAE;YACAC;YACAC;QACF;kBAECL;;AAGP,GACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icon/MaterialSymbol.tsx"],"sourcesContent":["import { forwardRef, type AriaAttributes, type HTMLAttributes } from \"react\";\nimport { type MaterialSymbolName } from \"./material.js\";\nimport {\n getFontVariationSettings,\n type MaterialSymbolCustomization,\n type MaterialSymbolFill,\n type MaterialSymbolGrade,\n type MaterialSymbolOpticalSize,\n type MaterialSymbolWeight,\n} from \"./materialConfig.js\";\nimport { icon, type MaterialSymbolClassNameOptions } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-symbol-fill\"?: MaterialSymbolFill;\n \"--rmd-symbol-wght\"?: MaterialSymbolWeight;\n \"--rmd-symbol-grad\"?: MaterialSymbolGrade;\n \"--rmd-symbol-opsz\"?: MaterialSymbolOpticalSize;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MaterialSymbolProps\n extends HTMLAttributes<HTMLSpanElement>,\n MaterialSymbolCustomization,\n Partial<MaterialSymbolClassNameOptions> {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n name: MaterialSymbolName;\n children?: never;\n}\n\n/**\n * **Server Component**\n * This is a convenience component that provides autocomplete for all the\n * available material symbols via the `name` prop.\n *\n * Note: You might notice IDE slowdowns for files that use this component since\n * there are so many icons available. If it becomes an issue, just stop using\n * this component and define the icons inline instead.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { MaterialSymbol } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { createRoot } from \"react-dom/client\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <MaterialSymbol symbol=\"close\" />\n * <MaterialSymbol symbol=\"tune\" type=\"outline\" />\n *\n * <MaterialSymbol symbol=\"add\" type=\"round\" />\n * <MaterialSymbol symbol=\"air\" type=\"sharp\" />\n * </>\n * );\n * }\n *\n * const root = createRoot(document.getElementById(\"root\"));\n * root.render(<App />);\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const MaterialSymbol = forwardRef<HTMLSpanElement, MaterialSymbolProps>(\n function MaterialSymbol(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n className,\n name: symbol,\n style: propStyle,\n family: propFamily,\n fill,\n weight,\n grade,\n opticalSize,\n theme,\n dense,\n ...remaining\n } = props;\n const { style, family } = getFontVariationSettings({\n style: propStyle,\n fill,\n weight,\n grade,\n opticalSize,\n family: propFamily,\n });\n\n return (\n <span\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n style={style}\n className={icon({\n type: \"symbol\",\n family,\n theme,\n dense,\n className,\n })}\n >\n {symbol}\n </span>\n );\n }\n);\n"],"names":["forwardRef","getFontVariationSettings","icon","MaterialSymbol","props","ref","ariaHidden","className","name","symbol","style","propStyle","family","propFamily","fill","weight","grade","opticalSize","theme","dense","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAASA,UAAU,QAAkD,QAAQ;AAE7E,SACEC,wBAAwB,QAMnB,sBAAsB;AAC7B,SAASC,IAAI,QAA6C,cAAc;AAwBxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,+BAAiBH,WAC5B,SAASG,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,SAAS,EACTC,MAAMC,MAAM,EACZC,OAAOC,SAAS,EAChBC,QAAQC,UAAU,EAClBC,IAAI,EACJC,MAAM,EACNC,KAAK,EACLC,WAAW,EACXC,KAAK,EACLC,KAAK,EACL,GAAGC,WACJ,GAAGhB;IACJ,MAAM,EAAEM,KAAK,EAAEE,MAAM,EAAE,GAAGX,yBAAyB;QACjDS,OAAOC;QACPG;QACAC;QACAC;QACAC;QACAL,QAAQC;IACV;IAEA,qBACE,KAACQ;QACE,GAAGD,SAAS;QACbE,eAAahB;QACbD,KAAKA;QACLK,OAAOA;QACPH,WAAWL,KAAK;YACdqB,MAAM;YACNX;YACAM;YACAC;YACAZ;QACF;kBAECE;;AAGP,GACA"}
@@ -0,0 +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\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 * @remarks\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 * **Server Component**\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;AAuEjE;;;;;CAKC,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"}
@@ -0,0 +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 | 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 * @remarks \\@since 2.5.0\n * @defaultValue `false`\n */\n flexReverse?: boolean;\n}\n\n/**\n * **Server Component**\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\n * 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\n * 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icon/iconConfig.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport { FontIcon } from \"./FontIcon.js\";\n\n/**\n * @remarks \\@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 * @defaultValue `<FontIcon>close</FontIcon>`\n *\n * @remarks \\@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 * @remarks \\@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 * @remarks \\@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 * @remarks \\@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 * @remarks \\@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 * @remarks \\@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 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 * @remarks \\@since 5.0.0\n * @defaultValue `<FontIcon>file_upload</FontIcon>`\n */\n upload?: ReactNode;\n}\n\nexport type ConfiguredIcons = Required<ConfigurableIcons>;\n\n/**\n * @remarks \\@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\n * 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 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.selected = <CheckIcon />;\n * ICON_CONFIG.sort = <ArrowUpwardIcon />;\n * ICON_CONFIG.upload = <FileUploadIcon />;\n * ```\n *\n *\n * @remarks \\@since 6.0.0\n */\nexport const ICON_CONFIG: ConfiguredIcons = {\n back: <FontIcon>keyboard_arrow_left</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 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\n * Using SVG Material Icons\n * ```tsx\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 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 * selected: <CheckIcon />,\n * sort: <ArrowUpwardIcon />,\n * upload: <FileUploadIcon />,\n * });\n * ```\n *\n * @remarks \\@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 * @remarks \\@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","close","checkbox","checkboxChecked","checkboxIndeterminate","dropdown","error","expander","forward","menu","notification","password","radio","radioChecked","selected","sort","upload","configureIcons","overrides","Object","entries","forEach","name","value","process","env","NODE_ENV","Error","getIcon","override"],"mappings":";AACA,SAASA,QAAQ,QAAQ,gBAAgB;AAoJzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDC,GACD,OAAO,MAAMC,cAA+B;IAC1CC,oBAAM,KAACF;kBAAS;;IAChBG,qBAAO,KAACH;kBAAS;;IACjBI,wBAAU,KAACJ;kBAAS;;IACpBK,+BAAiB,KAACL;kBAAS;;IAC3BM,qCAAuB,KAACN;kBAAS;;IACjCO,wBAAU,KAACP;kBAAS;;IACpBQ,qBAAO,KAACR;kBAAS;;IACjBS,wBAAU,KAACT;kBAAS;;IACpBU,uBAAS,KAACV;kBAAS;;IACnBW,oBAAM,KAACX;kBAAS;;IAChBY,4BAAc,KAACZ;kBAAS;;IACxBa,wBAAU,KAACb;kBAAS;;IACpBc,qBAAO,KAACd;kBAAS;;IACjBe,4BAAc,KAACf;kBAAS;;IACxBgB,wBAAU,KAAChB;kBAAS;;IACpBiB,oBAAM,KAACjB;kBAAS;;IAChBkB,sBAAQ,KAAClB;kBAAS;;AACpB,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,OAAO,SAASmB,eAAeC,SAA0B;IACvDC,OAAOC,OAAO,CAACF,WAAWG,OAAO,CAAC,CAAC,CAACC,MAAMC,MAAM;QAC9C,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgB,CAAEJ,CAAAA,QAAQvB,WAAU,GAAI;YACnE,MAAM,IAAI4B,MAAM,CAAC,EAAEL,KAAK,kCAAkC,CAAC;QAC7D;QAEAvB,WAAW,CAACuB,KAA8B,GAAGC;IAC/C;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,QACdN,IAA0B,EAC1BO,QAAoB;IAEpB,IAAI,OAAOA,aAAa,aAAa;QACnC,OAAOA;IACT;IAEA,OAAO9B,WAAW,CAACuB,KAAK;AAC1B"}