@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
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/tree/useTreeExpansion.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { UseStateSetter } from \"../types.js\";\nimport type { TreeItemDefaultIds, TreeItemIdSet } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `TreeItemExpansion` and uses a Set\n * instead of a list to increase performance. Also renamed `onItemExpansion` to\n * `toggleTreeItemExpansion` and `onMultiItemExpansion` to\n * `expandMultipleTreeItems`.\n */\nexport interface TreeExpansion {\n expandedIds: TreeItemIdSet;\n toggleTreeItemExpansion(itemId: string): void;\n expandMultipleTreeItems: UseStateSetter<TreeItemIdSet>;\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `useTreeItemExpansion` and uses a Set\n * instead of a list to increase performance.\n */\nexport function useTreeExpansion(\n defaultExpandedIds?: TreeItemDefaultIds\n): TreeExpansion {\n const [expandedIds, setExpandedIds] = useState<TreeItemIdSet>(() => {\n const defaultIds =\n typeof defaultExpandedIds === \"function\"\n ? defaultExpandedIds()\n : defaultExpandedIds;\n\n return new Set(defaultIds);\n });\n\n const toggleTreeItemExpansion = useCallback((itemId: string) => {\n setExpandedIds((prevExpandedIds) => {\n const expandedIds = new Set(prevExpandedIds);\n if (expandedIds.has(itemId)) {\n expandedIds.delete(itemId);\n } else {\n expandedIds.add(itemId);\n }\n\n return expandedIds;\n });\n }, []);\n\n return {\n expandedIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems: setExpandedIds,\n };\n}\n"],"names":["useCallback","useState","useTreeExpansion","defaultExpandedIds","expandedIds","setExpandedIds","defaultIds","Set","toggleTreeItemExpansion","itemId","prevExpandedIds","has","delete","add","expandMultipleTreeItems"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAgB9C;;;CAGC,GACD,OAAO,SAASC,iBACdC,kBAAuC;IAEvC,MAAM,CAACC,aAAaC,eAAe,GAAGJ,SAAwB;QAC5D,MAAMK,aACJ,OAAOH,uBAAuB,aAC1BA,uBACAA;QAEN,OAAO,IAAII,IAAID;IACjB;IAEA,MAAME,0BAA0BR,YAAY,CAACS;QAC3CJ,eAAe,CAACK;YACd,MAAMN,cAAc,IAAIG,IAAIG;YAC5B,IAAIN,YAAYO,GAAG,CAACF,SAAS;gBAC3BL,YAAYQ,MAAM,CAACH;YACrB,OAAO;gBACLL,YAAYS,GAAG,CAACJ;YAClB;YAEA,OAAOL;QACT;IACF,GAAG,EAAE;IAEL,OAAO;QACLA;QACAI;QACAM,yBAAyBT;IAC3B;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/tree/useTreeItems.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport type {\n TreeItemSorter,\n TreeItemNode,\n TreeData,\n DefaultTreeItemNode,\n} from \"./types.js\";\n\n/**\n * A lookup to find all the child ids for a specific parent. This was added to\n * support the `*` keyboard behavior of opening all tree items at the current\n * level.\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type TreeItemChildIds = Map<string | null, Set<string>>;\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type RenderableTreeItemNode<\n T extends TreeItemNode = DefaultTreeItemNode,\n> = T & {\n items?: readonly RenderableTreeItemNode<T>[];\n};\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface BuildTreeOptions<T extends TreeItemNode> {\n sort: TreeItemSorter<T>;\n nodes: T[];\n parentId: string | null;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This util performantly builds a nested list of tree items from a giant flat\n * list of items by linking items together with the provided `parentId`. This\n * will also recursively build the tree and _hopefully_ all items will be added.\n *\n * @remarks \\@since 6.0.0 Updated to include the {@link TreeItemChildIds}\n */\nexport function buildTree<T extends TreeItemNode>(\n options: BuildTreeOptions<T>\n): readonly RenderableTreeItemNode<T>[] | undefined {\n const { sort, nodes, parentId, treeItemChildIds } = options;\n const childIds = treeItemChildIds.get(parentId) || new Set();\n const childItems: RenderableTreeItemNode<T>[] = [];\n\n // doing a \"reverse\" order filter/move so that the items array shrinks while\n // looping. This makes it so that the entire items array doesn't need to\n // continually be looped through as more items are added to the tree, only the\n // remaining items will have to be looped\n let i = nodes.length;\n while (i > 0) {\n i -= 1;\n if (nodes[i] && nodes[i].parentId === parentId) {\n const [item] = nodes.splice(i, 1);\n childIds.add(item.itemId);\n // shallow cloning so childItems doesn't get applied to the original data\n // set\n childItems.unshift({ ...item });\n }\n }\n\n if (!childItems.length) {\n return undefined;\n }\n\n treeItemChildIds.set(parentId, childIds);\n childItems.forEach((childItem) => {\n childItem.items = buildTree({\n sort,\n nodes,\n parentId: childItem.itemId,\n treeItemChildIds,\n });\n });\n\n return sort(childItems);\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TreeItemOptions<T extends TreeItemNode> {\n data: TreeData<T>;\n sort: TreeItemSorter<T>;\n rootId: string | null;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TreeItems<T extends TreeItemNode> {\n items: readonly RenderableTreeItemNode<T>[];\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This is mostly an internal hook, but can be used to build tree-like\n * data structures without the need of the `Tree` component.\n *\n * @remarks \\@since 6.0.0 converted to use an object argument instead of\n * multiple arguments. Also logs any orphaned items that do not have a parent\n */\nexport function useTreeItems<T extends TreeItemNode>(\n options: TreeItemOptions<T>\n): TreeItems<T> {\n const { data, sort, rootId } = options;\n\n return useMemo<TreeItems<T>>(() => {\n const values = Object.values(data);\n const treeItemChildIds = new Map<string, Set<string>>();\n const items = buildTree<T>({\n sort,\n nodes: values,\n parentId: rootId,\n treeItemChildIds,\n });\n\n if (process.env.NODE_ENV !== \"production\" && values.length) {\n /* eslint-disable no-console */\n console.warn(\"The following tree items are orphaned without a parent:\");\n console.warn(values.slice());\n }\n\n return {\n items: items || [],\n treeItemChildIds,\n };\n }, [data, rootId, sort]);\n}\n"],"names":["useMemo","buildTree","options","sort","nodes","parentId","treeItemChildIds","childIds","get","Set","childItems","i","length","item","splice","add","itemId","unshift","undefined","set","forEach","childItem","items","useTreeItems","data","rootId","values","Object","Map","process","env","NODE_ENV","console","warn","slice"],"mappings":"AAAA,SAASA,OAAO,QAAQ,QAAQ;AAuChC;;;;;;CAMC,GACD,OAAO,SAASC,UACdC,OAA4B;IAE5B,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGJ;IACpD,MAAMK,WAAWD,iBAAiBE,GAAG,CAACH,aAAa,IAAII;IACvD,MAAMC,aAA0C,EAAE;IAElD,4EAA4E;IAC5E,wEAAwE;IACxE,8EAA8E;IAC9E,yCAAyC;IACzC,IAAIC,IAAIP,MAAMQ,MAAM;IACpB,MAAOD,IAAI,EAAG;QACZA,KAAK;QACL,IAAIP,KAAK,CAACO,EAAE,IAAIP,KAAK,CAACO,EAAE,CAACN,QAAQ,KAAKA,UAAU;YAC9C,MAAM,CAACQ,KAAK,GAAGT,MAAMU,MAAM,CAACH,GAAG;YAC/BJ,SAASQ,GAAG,CAACF,KAAKG,MAAM;YACxB,yEAAyE;YACzE,MAAM;YACNN,WAAWO,OAAO,CAAC;gBAAE,GAAGJ,IAAI;YAAC;QAC/B;IACF;IAEA,IAAI,CAACH,WAAWE,MAAM,EAAE;QACtB,OAAOM;IACT;IAEAZ,iBAAiBa,GAAG,CAACd,UAAUE;IAC/BG,WAAWU,OAAO,CAAC,CAACC;QAClBA,UAAUC,KAAK,GAAGrB,UAAU;YAC1BE;YACAC;YACAC,UAAUgB,UAAUL,MAAM;YAC1BV;QACF;IACF;IAEA,OAAOH,KAAKO;AACd;AAmBA;;;;;;CAMC,GACD,OAAO,SAASa,aACdrB,OAA2B;IAE3B,MAAM,EAAEsB,IAAI,EAAErB,IAAI,EAAEsB,MAAM,EAAE,GAAGvB;IAE/B,OAAOF,QAAsB;QAC3B,MAAM0B,SAASC,OAAOD,MAAM,CAACF;QAC7B,MAAMlB,mBAAmB,IAAIsB;QAC7B,MAAMN,QAAQrB,UAAa;YACzBE;YACAC,OAAOsB;YACPrB,UAAUoB;YACVnB;QACF;QAEA,IAAIuB,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBL,OAAOd,MAAM,EAAE;YAC1D,6BAA6B,GAC7BoB,QAAQC,IAAI,CAAC;YACbD,QAAQC,IAAI,CAACP,OAAOQ,KAAK;QAC3B;QAEA,OAAO;YACLZ,OAAOA,SAAS,EAAE;YAClBhB;QACF;IACF,GAAG;QAACkB;QAAMC;QAAQtB;KAAK;AACzB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/tree/useTreeMovement.ts"],"sourcesContent":["\"use client\";\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n} from \"react\";\nimport { useRef } from \"react\";\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { getNextFocusableIndex } from \"../movement/utils.js\";\nimport type { NonNullMutableRef } from \"../types.js\";\nimport type { TreeItemMetadataLookup } from \"./TreeProvider.js\";\nimport type { TreeData, TreeItemNode } from \"./types.js\";\nimport type { TreeExpansion } from \"./useTreeExpansion.js\";\nimport type { TreeItemChildIds } from \"./useTreeItems.js\";\n\n/**\n * This helps catch the edge case where the collapse transition has occurred for\n * a tree item group, but the user uses the `ArrowDown` key before it has\n * finished. So to do this:\n *\n * - find the parent group of the tree item\n * - find the tree item that controls the group (the element before the group)\n * - check if the `aria-expanded` state is `\"false\"` meaning it is considered\n * closed\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nconst isParentItemCollapsing = (item: HTMLElement): boolean =>\n item\n .closest(\"[role='group']\")\n ?.previousElementSibling?.getAttribute(\"aria-expanded\") === \"false\";\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nconst getVisibleTreeItems = (\n container: HTMLElement\n): readonly HTMLElement[] => {\n const items = [\n ...container.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ];\n\n return items.filter(\n (item) =>\n // do not include items that have a `hidden` parent group\n item.offsetParent &&\n // do not include items that are about to become hidden\n !isParentItemCollapsing(item)\n );\n};\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ninterface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {\n data: TreeData<T>;\n onClick: MouseEventHandler<HTMLUListElement> | undefined;\n onFocus: FocusEventHandler<HTMLUListElement> | undefined;\n onKeyDown: KeyboardEventHandler<HTMLUListElement> | undefined;\n selectedIds: ReadonlySet<string>;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ninterface TreeMovement\n extends KeyboardMovementProviderImplementation<HTMLUListElement> {\n /**\n * This will be mutated by the `TreeItem` component and used to handle\n * keyboard movement.\n */\n metadataLookup: NonNullMutableRef<TreeItemMetadataLookup>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport function useTreeMovement<T extends TreeItemNode>(\n options: TreeMovementOptions<T>\n): TreeMovement {\n const {\n onClick,\n onFocus,\n onKeyDown,\n data,\n expandedIds,\n selectedIds,\n treeItemChildIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems,\n } = options;\n\n const metadataLookup = useRef<TreeItemMetadataLookup>({\n expandable: {},\n disabledItems: {},\n elementToItem: {},\n itemToElement: {},\n });\n const movement = useKeyboardMovementProvider({\n onClick,\n onFocus,\n onKeyDown,\n extendKeyDown(movementData) {\n const { event, activeDescendantId, currentFocusIndex, setFocusIndex } =\n movementData;\n const { expandable, disabledItems, elementToItem, itemToElement } =\n metadataLookup.current;\n const itemId = elementToItem[activeDescendantId];\n const item = data[itemId];\n\n /* c8 ignore start */\n if (!item) {\n return;\n }\n /* c8 ignore end */\n\n const disabled = disabledItems[itemId];\n const expanded = expandedIds.has(itemId);\n\n let flagged = false;\n switch (event.key) {\n case \"ArrowLeft\":\n if (expanded && !disabled) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else if (item.parentId) {\n // do not flag for this case since setFocusIndex already does this\n const parentId = itemToElement[item.parentId];\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = focusables.findIndex(\n (element) => element.id === parentId\n );\n setFocusIndex(index, focusables);\n }\n\n break;\n case \"ArrowRight\":\n if (expandable[itemId] && !disabled) {\n if (!expanded) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else {\n // do not flag for this case since setFocusIndex already does this\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = getNextFocusableIndex({\n loopable: false,\n increment: true,\n focusables,\n includeDisabled: true,\n currentFocusIndex: currentFocusIndex.current,\n });\n\n setFocusIndex(index, focusables);\n }\n }\n\n break;\n case \"*\": {\n flagged = true;\n const itemIds = treeItemChildIds.get(item.parentId);\n if (itemIds) {\n const expandableIds = [...itemIds].filter(\n (itemId) => expandable[itemId]\n );\n if (expandableIds.length) {\n expandMultipleTreeItems(\n (prev) => new Set([...prev, ...expandableIds])\n );\n currentFocusIndex.current = -1;\n }\n }\n break;\n }\n }\n\n if (flagged) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n searchable: true,\n tabIndexBehavior: \"virtual\",\n getFocusableElements: getVisibleTreeItems,\n getDefaultFocusedIndex(options) {\n const { focusables } = options;\n const { elementToItem } = metadataLookup.current;\n\n return focusables.findIndex((element) =>\n selectedIds.has(elementToItem[element.id])\n );\n },\n });\n\n return {\n metadataLookup,\n ...movement,\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","getNextFocusableIndex","isParentItemCollapsing","item","closest","previousElementSibling","getAttribute","getVisibleTreeItems","container","items","querySelectorAll","filter","offsetParent","useTreeMovement","options","onClick","onFocus","onKeyDown","data","expandedIds","selectedIds","treeItemChildIds","toggleTreeItemExpansion","expandMultipleTreeItems","metadataLookup","expandable","disabledItems","elementToItem","itemToElement","movement","extendKeyDown","movementData","event","activeDescendantId","currentFocusIndex","setFocusIndex","current","itemId","disabled","expanded","has","flagged","key","parentId","focusables","currentTarget","index","findIndex","element","id","loopable","increment","includeDisabled","itemIds","get","expandableIds","length","prev","Set","stopPropagation","preventDefault","searchable","tabIndexBehavior","getFocusableElements","getDefaultFocusedIndex"],"mappings":"AAAA;AAMA,SAASA,MAAM,QAAQ,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,qBAAqB,QAAQ,uBAAuB;AAO7D;;;;;;;;;;;;CAYC,GACD,MAAMC,yBAAyB,CAACC,OAC9BA,KACGC,OAAO,CAAC,mBACPC,wBAAwBC,aAAa,qBAAqB;AAEhE;;;CAGC,GACD,MAAMC,sBAAsB,CAC1BC;IAEA,MAAMC,QAAQ;WACTD,UAAUE,gBAAgB,CAAc;KAC5C;IAED,OAAOD,MAAME,MAAM,CACjB,CAACR,OACC,yDAAyD;QACzDA,KAAKS,YAAY,IACjB,uDAAuD;QACvD,CAACV,uBAAuBC;AAE9B;AA4BA;;;CAGC,GACD,OAAO,SAASU,gBACdC,OAA+B;IAE/B,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGT;IAEJ,MAAMU,iBAAiBzB,OAA+B;QACpD0B,YAAY,CAAC;QACbC,eAAe,CAAC;QAChBC,eAAe,CAAC;QAChBC,eAAe,CAAC;IAClB;IACA,MAAMC,WAAW7B,4BAA4B;QAC3Ce;QACAC;QACAC;QACAa,eAAcC,YAAY;YACxB,MAAM,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GACnEJ;YACF,MAAM,EAAEN,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAC/DJ,eAAeY,OAAO;YACxB,MAAMC,SAASV,aAAa,CAACM,mBAAmB;YAChD,MAAM9B,OAAOe,IAAI,CAACmB,OAAO;YAEzB,mBAAmB,GACnB,IAAI,CAAClC,MAAM;gBACT;YACF;YACA,iBAAiB,GAEjB,MAAMmC,WAAWZ,aAAa,CAACW,OAAO;YACtC,MAAME,WAAWpB,YAAYqB,GAAG,CAACH;YAEjC,IAAII,UAAU;YACd,OAAQT,MAAMU,GAAG;gBACf,KAAK;oBACH,IAAIH,YAAY,CAACD,UAAU;wBACzBG,UAAU;wBACVnB,wBAAwBe;oBAC1B,OAAO,IAAIlC,KAAKwC,QAAQ,EAAE;wBACxB,kEAAkE;wBAClE,MAAMA,WAAWf,aAAa,CAACzB,KAAKwC,QAAQ,CAAC;wBAC7C,MAAMC,aAAarC,oBAAoByB,MAAMa,aAAa;wBAC1D,MAAMC,QAAQF,WAAWG,SAAS,CAChC,CAACC,UAAYA,QAAQC,EAAE,KAAKN;wBAE9BR,cAAcW,OAAOF;oBACvB;oBAEA;gBACF,KAAK;oBACH,IAAInB,UAAU,CAACY,OAAO,IAAI,CAACC,UAAU;wBACnC,IAAI,CAACC,UAAU;4BACbE,UAAU;4BACVnB,wBAAwBe;wBAC1B,OAAO;4BACL,kEAAkE;4BAClE,MAAMO,aAAarC,oBAAoByB,MAAMa,aAAa;4BAC1D,MAAMC,QAAQ7C,sBAAsB;gCAClCiD,UAAU;gCACVC,WAAW;gCACXP;gCACAQ,iBAAiB;gCACjBlB,mBAAmBA,kBAAkBE,OAAO;4BAC9C;4BAEAD,cAAcW,OAAOF;wBACvB;oBACF;oBAEA;gBACF,KAAK;oBAAK;wBACRH,UAAU;wBACV,MAAMY,UAAUhC,iBAAiBiC,GAAG,CAACnD,KAAKwC,QAAQ;wBAClD,IAAIU,SAAS;4BACX,MAAME,gBAAgB;mCAAIF;6BAAQ,CAAC1C,MAAM,CACvC,CAAC0B,SAAWZ,UAAU,CAACY,OAAO;4BAEhC,IAAIkB,cAAcC,MAAM,EAAE;gCACxBjC,wBACE,CAACkC,OAAS,IAAIC,IAAI;2CAAID;2CAASF;qCAAc;gCAE/CrB,kBAAkBE,OAAO,GAAG,CAAC;4BAC/B;wBACF;wBACA;oBACF;YACF;YAEA,IAAIK,SAAS;gBACXT,MAAM2B,eAAe;gBACrB3B,MAAM4B,cAAc;YACtB;QACF;QACAC,YAAY;QACZC,kBAAkB;QAClBC,sBAAsBxD;QACtByD,wBAAuBlD,OAAO;YAC5B,MAAM,EAAE8B,UAAU,EAAE,GAAG9B;YACvB,MAAM,EAAEa,aAAa,EAAE,GAAGH,eAAeY,OAAO;YAEhD,OAAOQ,WAAWG,SAAS,CAAC,CAACC,UAC3B5B,YAAYoB,GAAG,CAACb,aAAa,CAACqB,QAAQC,EAAE,CAAC;QAE7C;IACF;IAEA,OAAO;QACLzB;QACA,GAAGK,QAAQ;IACb;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/tree/useTreeSelection.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { UseStateSetter } from \"../types.js\";\nimport type { TreeItemDefaultIds, TreeItemIdSet } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `TreeItemSelection` and uses a Set\n * instead of a list to increase performance. Also renamed `onItemSelect` to\n * `toggleTreeItemSelection` and `onMultiItemSelect` to\n * `selectMultipleTreeItems`.\n */\nexport interface TreeSelection {\n /** @defaultValue `false` */\n multiSelect?: boolean;\n selectedIds: ReadonlySet<string>;\n toggleTreeItemSelection(itemId: string): void;\n selectMultipleTreeItems: UseStateSetter<TreeItemIdSet>;\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `useTreeItemSelection` and uses a Set\n * instead of a list to increase performance.\n */\nexport function useTreeSelection(\n defaultSelectedIds?: TreeItemDefaultIds,\n multiSelect = false\n): Required<TreeSelection> {\n const [selectedIds, setSelectedIds] = useState<TreeItemIdSet>(() => {\n const defaultIds =\n typeof defaultSelectedIds === \"function\"\n ? defaultSelectedIds()\n : defaultSelectedIds;\n\n return new Set(defaultIds);\n });\n\n const toggleTreeItemSelection = useCallback(\n (itemId: string) => {\n setSelectedIds((selectedIds) => {\n if (!multiSelect) {\n return selectedIds.has(itemId) ? selectedIds : new Set([itemId]);\n }\n\n const nextSelectedIds = new Set(selectedIds);\n if (selectedIds.has(itemId)) {\n nextSelectedIds.delete(itemId);\n } else {\n nextSelectedIds.add(itemId);\n }\n\n return nextSelectedIds;\n });\n },\n [multiSelect]\n );\n\n return {\n selectedIds,\n multiSelect,\n toggleTreeItemSelection,\n selectMultipleTreeItems: setSelectedIds,\n };\n}\n"],"names":["useCallback","useState","useTreeSelection","defaultSelectedIds","multiSelect","selectedIds","setSelectedIds","defaultIds","Set","toggleTreeItemSelection","itemId","has","nextSelectedIds","delete","add","selectMultipleTreeItems"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAkB9C;;;CAGC,GACD,OAAO,SAASC,iBACdC,kBAAuC,EACvCC,cAAc,KAAK;IAEnB,MAAM,CAACC,aAAaC,eAAe,GAAGL,SAAwB;QAC5D,MAAMM,aACJ,OAAOJ,uBAAuB,aAC1BA,uBACAA;QAEN,OAAO,IAAIK,IAAID;IACjB;IAEA,MAAME,0BAA0BT,YAC9B,CAACU;QACCJ,eAAe,CAACD;YACd,IAAI,CAACD,aAAa;gBAChB,OAAOC,YAAYM,GAAG,CAACD,UAAUL,cAAc,IAAIG,IAAI;oBAACE;iBAAO;YACjE;YAEA,MAAME,kBAAkB,IAAIJ,IAAIH;YAChC,IAAIA,YAAYM,GAAG,CAACD,SAAS;gBAC3BE,gBAAgBC,MAAM,CAACH;YACzB,OAAO;gBACLE,gBAAgBE,GAAG,CAACJ;YACtB;YAEA,OAAOE;QACT;IACF,GACA;QAACR;KAAY;IAGf,OAAO;QACLC;QACAD;QACAK;QACAM,yBAAyBT;IAC3B;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/tree/utils.ts"],"sourcesContent":["import type { TreeItemNode, TreeData, DefaultTreeItemNode } from \"./types.js\";\n\n/**\n * This will get all the items from the provided itemId up to the root of the\n * tree that can be used for drag and drop behavior or building a breadcrumb\n * list.\n *\n * @param data - The flattened tree data to navigate.\n * @param itemId - The item id to start the search at.\n * @returns an ordered list of the current item followed by all the direct\n * parents of that item.\n * @remarks \\@since 6.0.0 Renamed from `getItemsFrom` to `getTreeItemsFrom`.\n */\nexport function getTreeItemsFrom<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T>,\n itemId: string | null\n): readonly T[] {\n const items: T[] = [];\n let currentId = itemId;\n while (currentId) {\n const item = data[currentId];\n currentId = item?.parentId ?? null;\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n}\n\n/**\n * Gets all the child items for a specific parent item id. If the `recursive`\n * argument is enabled, all children of the items will also be returned instead\n * of only the top level items.\n *\n * @param data - Either the flattened tree data or a list of all the tree data\n * to iterate over\n * @param parentId - The parent id to get children of\n * @param recursive - Boolean if the children's children should also be returned\n * @returns a list of all the items for a specific parent item id. Note: if the\n * recursive param is enabled, the list will be ordered so that the children of\n * a item will appear before the next item at the same level. So you either need\n * to sort by `parentId` or something else if you want a specific order.\n * @remarks \\@since 6.0.0 Renamed from `getChildItems` to `getChildTreeItems`.\n */\nexport function getChildTreeItems<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T> | readonly T[],\n parentId: string | null,\n recursive = false\n): readonly T[] {\n const items = Array.isArray(data) ? data : Object.values(data);\n\n return items.reduce<T[]>((list, item) => {\n if (parentId !== item.parentId) {\n return list;\n }\n\n return [\n ...list,\n item,\n ...(recursive ? getChildTreeItems(items, item.itemId, recursive) : []),\n ];\n }, []);\n}\n"],"names":["getTreeItemsFrom","data","itemId","items","currentId","item","parentId","push","getChildTreeItems","recursive","Array","isArray","Object","values","reduce","list"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,iBACdC,IAAiB,EACjBC,MAAqB;IAErB,MAAMC,QAAa,EAAE;IACrB,IAAIC,YAAYF;IAChB,MAAOE,UAAW;QAChB,MAAMC,OAAOJ,IAAI,CAACG,UAAU;QAC5BA,YAAYC,MAAMC,YAAY;QAC9B,IAAID,MAAM;YACRF,MAAMI,IAAI,CAACF;QACb;IACF;IAEA,OAAOF;AACT;AAEA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASK,kBACdP,IAAgC,EAChCK,QAAuB,EACvBG,YAAY,KAAK;IAEjB,MAAMN,QAAQO,MAAMC,OAAO,CAACV,QAAQA,OAAOW,OAAOC,MAAM,CAACZ;IAEzD,OAAOE,MAAMW,MAAM,CAAM,CAACC,MAAMV;QAC9B,IAAIC,aAAaD,KAAKC,QAAQ,EAAE;YAC9B,OAAOS;QACT;QAEA,OAAO;eACFA;YACHV;eACII,YAAYD,kBAAkBL,OAAOE,KAAKH,MAAM,EAAEO,aAAa,EAAE;SACtE;IACH,GAAG,EAAE;AACP"}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Dispatch, ReactElement, Ref, SetStateAction } from \"react\";\n\n/**\n * A helper type that allows an optional `ref` to also be applied with a props\n * object even though a `ref` isn't a real prop.\n */\nexport type PropsWithRef<\n Props extends {},\n Element extends HTMLElement,\n> = Props & {\n /**\n * An optional ref that can be applied.\n */\n ref?: Ref<Element>;\n};\n\n/**\n * A simple type that can be used for different components that clone a\n * `className` into a child component.\n */\nexport type ClassNameCloneableChild<T = {}> = ReactElement<\n T & { className?: string }\n>;\n\n/**\n * This type allows you to require at least one of the provided keys. This is\n * super helpful for things like `aria-label` or `aria-labelledby` when it's\n * required for a11y.\n *\n * @see https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist/49725198#49725198\n */\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport interface LabelA11y {\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\n/**\n * A small accessibility helper to ensure that either `aria-label` or\n * `aria-labelledby` have been provided to a component.\n *\n * @example\n * Simple Example\n * ```ts\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import type { LabelRequiredForA11y } from \"@react-md/core\";\n *\n * type Props = LabelRequiredForA11y<HTMLAttributes<HTMLDivElement>>;\n *\n * function Component(props: Props): ReactElement {\n * return <div {...props} />;\n * }\n *\n * const test1 = <Component />\n * // ^ type error\n * const test2 = <Component aria-label=\"Label\" />\n * const test3 = <Component aria-labelledby=\"some-other-id\" />\n * ```\n */\nexport type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<\n Props,\n keyof LabelA11y\n>;\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport interface NonNullRef<T> {\n readonly current: T;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface NonNullMutableRef<T> {\n current: T;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport type HtmlTagName = keyof JSX.IntrinsicElements;\n\n/**\n * A function to get a string from a generic item.\n *\n * @example\n * Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * const extractor: TextExtractor<Item> = (item) => item.name;\n * ```\n * @remarks \\@since 6.0.0\n */\nexport type TextExtractor<T> = (item: T) => string;\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type UseStateSetter<T> = Dispatch<SetStateAction<T>>;\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type UseStateInitializer<T> = T | (() => T);\n\n/**\n * @example\n * ```ts\n * type Visibility = UseStateObject<\"visible\", boolean>;\n * // type Visibility = {\n * // visible: boolean;\n * // setVisible: UseStateSetter<boolean>\n * // }\n *\n * type AnotherOne = UseStateObject<\"renderAsSheet\", RenderMenuAsSheet>;\n * // type AnotherOne = {\n * // renderAsSheet: RenderMenuAsSheet;\n * // setRenderAsSheet: UseStateSetter<RenderMenuAsSheet>;\n * // }\n * ```\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type UseStateObject<Name extends string, Value> = {\n [key in Name]: Value;\n} & {\n [key in `set${Capitalize<Name>}`]: UseStateSetter<Value>;\n};\n\n/**\n * @example\n * ```ts\n * interface Example {\n * value: number;\n * setValue: UseStateSetter<number>;\n * }\n *\n * type WithPrefix = RenameKeysWithPrefix<Example, \"thumb1\">;\n * // type WithPrefix = {\n * // thumb1Value: number;\n * // thumb1SetValue: UseStateSetter<number>;\n * // }\n * ```\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type RenameKeysWithPrefix<T, Prefix extends string> = {\n [Key in keyof T & string as `${Prefix}${Capitalize<Key>}`]: T[Key];\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type CssPosition = \"fixed\" | \"sticky\" | \"static\";\n\n/**\n * @remarks \\@since 6.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyFunction = (...args: any[]) => any | void;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ElementSize {\n height: number;\n width: number;\n}\n"],"names":[],"mappings":"AAiLA;;CAEC,GACD,WAGC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n Typography,\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n type TypographyProps,\n} from \"./Typography.js\";\nimport { cssUtils } from \"../cssUtils.js\";\n\nexport interface SrOnlyProps extends TypographyProps {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n return (\n <Typography\n {...remaining}\n as={as}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly: focusable ? \"focusable\" : phoneOnly ? \"phone\" : true,\n className,\n })}\n >\n {children}\n </Typography>\n );\n }\n);\n"],"names":["forwardRef","Typography","cssUtils","SrOnly","props","ref","as","className","phoneOnly","focusable","children","tabIndex","remaining","undefined","srOnly"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SACEC,UAAU,QAIL,kBAAkB;AACzB,SAASC,QAAQ,QAAQ,iBAAiB;AAuB1C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,MAAMC,uBAASH,WACpB,SAASG,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,KAAK,MAAM,EACXC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,qBACE,KAACH;QACE,GAAGW,SAAS;QACbN,IAAIA;QACJD,KAAKA;QACLM,UAAUA,YAAaF,CAAAA,YAAY,IAAII,SAAQ;QAC/CN,WAAWL,SAAS;YAClBY,QAAQL,YAAY,cAAcD,YAAY,UAAU;YACxDD;QACF;kBAECG;;AAGP,GACA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-line-length\"?: string | number;\n \"--rmd-text-container-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-text-container\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TextContainerClassNameOptions {\n /**\n * An optional className to merge with typography text container styles.\n */\n className?: string;\n}\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import { textContainer, Typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <main className={textContainer()}>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </main>\n * ):\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function textContainer(\n options: TextContainerClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(), className);\n}\n\n/**\n * @remarks \\@since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextContainerClassNameOptions {}\n\n/**\n * **Server Component**\n *\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { TextContainer, Typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @remarks \\@since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n */\nexport const TextContainer = forwardRef<HTMLDivElement, TextContainerProps>(\n function TextContainer(props, ref) {\n const { className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","textContainer","options","className","TextContainer","props","ref","children","remaining","div"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAYnB;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,SAASE,cACdC,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOL,IAAIG,UAAUG;AACvB;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,MAAMC,8BAAgBN,WAC3B,SAASM,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEH,SAAS,EAAEI,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAE9C,qBACE,KAACI;QAAK,GAAGD,SAAS;QAAEF,KAAKA;QAAKH,WAAWF,cAAc;YAAEE;QAAU;kBAChEI;;AAGP,GACA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n} from \"react\";\nimport { cssUtils, type TextCssUtilsOptions } from \"../cssUtils.js\";\n\n/**\n * A union of all the material design provided typography styles. When used with\n * the Typography component, this will generate the correct typography className\n * to apply and determine what component to be rendered as if none was provided.\n *\n * @remarks \\@since 4.0.0\n */\nexport type TypographyType =\n | \"headline-1\"\n | \"headline-2\"\n | \"headline-3\"\n | \"headline-4\"\n | \"headline-5\"\n | \"headline-6\"\n | \"subtitle-1\"\n | \"subtitle-2\"\n | \"body-1\"\n | \"body-2\"\n | \"caption\"\n | \"overline\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface TypographyClassNameOptions extends TextCssUtilsOptions {\n className?: string;\n\n /**\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport type NullableTypographyClassNameOptions = Omit<\n TypographyClassNameOptions,\n \"type\"\n> & {\n /**\n * When using the {@link typography} class name utility, the `type` can be set\n * to `null` to inherit font.\n *\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType | null;\n};\n\n/**\n * Get a typography class name based on different typography options. This is\n * only useful if you are unable to use the {@link Typography} component for\n * some reason.\n *\n * @example\n * Simple Example\n * ```ts\n * import { getTypographyClassName } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1 className={getTypographyClassName({ type: \"headline-1\" })} />\n * <h2 className={getTypographyClassName({ type: \"headline-2\" })} />\n * <h3 className={getTypographyClassName({ type: \"headline-3\" })} />\n * <h4 className={getTypographyClassName({ type: \"headline-4\" })} />\n * <h5 className={getTypographyClassName({ type: \"headline-5\" })} />\n * <h6 className={getTypographyClassName({ type: \"headline-6\" })} />\n * <h5 className={getTypographyClassName({ type: \"subtitle-1\" })} />\n * <h6 className={getTypographyClassName({ type: \"subtitle-2\" })} />\n * <p className={getTypographyClassName()} />\n * <p className={getTypographyClassName({ type \"body-1\" })} />\n * <p className={getTypographyClassName({ type \"body-1\" })} />\n * <caption className={getTypographyClassName({ type: \"caption\" })} />\n * <span className={getTypographyClassName({ type: \"overline\" })} />\n * </>\n * );\n * }\n * ```\n *\n * @example\n * Applying Additional Styles\n * ```ts\n * import { getTypography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1\n * // only maintain the default margin-bottom\n * className={getTypographyClassName({\n * type: \"headline-1\",\n * margin: \"bottom\",\n * })}\n * />\n *\n * <h2\n * // remove all default margin\n * className={getTypographyClassName({\n * type: \"headline-2\",\n * margin: \"none\",\n * })}\n * />\n *\n * <h3\n * // only maintain the default margin-top\n * className={getTypographyClassName({\n * type: \"headline-3\",\n * margin: \"top\",\n * })}\n * />\n *\n * <p\n * // center the text, set to bold, and only maintain default margin-bottom\n * className={getTypographyClassName({\n * type \"subtitle-1\",\n * align: \"center\",\n * margin: \"bottom\",\n * })}\n * />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link Typography}\n * @param options - An optional object of options used to create the typography\n * class name.\n * @returns a typography class name string\n * @remarks \\@since 6.0.0\n */\nexport function typography(\n options: NullableTypographyClassNameOptions = {}\n): string {\n const { type = \"body-1\" } = options;\n\n // using `&&` instead of `bem` since the latest version of typescript does not\n // support setting the same object key (empty string)\n return cnb(\n \"rmd-typography\",\n type && `rmd-typography--${type}`,\n cssUtils(options)\n );\n}\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @remarks \\@since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @remarks \\@since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>,\n TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * **Server Component**\n *\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example\n * All Example\n * ```tsx\n * import { Typography } from \"@react-md/core\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n */\nexport const Typography = forwardRef<TypographyHTMLElement, TypographyProps>(\n function Typography(props, ref): ReactElement {\n const {\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","cssUtils","typography","options","type","getComponent","as","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,QAIL,QAAQ;AACf,SAASC,QAAQ,QAAkC,iBAAiB;AAiDpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFC,GACD,OAAO,SAASC,WACdC,UAA8C,CAAC,CAAC;IAEhD,MAAM,EAAEC,OAAO,QAAQ,EAAE,GAAGD;IAE5B,8EAA8E;IAC9E,qDAAqD;IACrD,OAAOJ,IACL,kBACAK,QAAQ,CAAC,gBAAgB,EAAEA,KAAK,CAAC,EACjCH,SAASE;AAEb;AAuBA,cAAc,GACd,SAASE,aACPC,EAAyC,EACzCF,IAAoB;IAEpB,IAAIE,IAAI;QACN,OAAOA;IACT;IAEA,OAAQF;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GACD,OAAO,MAAMG,2BAAaP,WACxB,SAASO,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJH,EAAE,EACFF,OAAO,QAAQ,EACfM,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYhB,aAAaC,IAAIF;IACnC,qBACE,KAACiB;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWR,WAAW;YACpBE;YACAO;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP,GACA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/typography/WritingDirectionProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n Children,\n cloneElement,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ReactElement,\n} from \"react\";\nimport { type UseStateInitializer } from \"../types.js\";\n\n/**\n * Note: unlike the `dir` DOM attribute, the `\"auto\"` value is not supported.\n *\n * @remarks \\@since 6.0.0\n */\nexport type Dir = \"ltr\" | \"rtl\";\n\n/** @remarks \\@since 6.0.0 */\nexport type DefaultDir = UseStateInitializer<Dir>;\n\n/** @remarks \\@since 2.3.0 */\nexport interface WritingDirectionContext {\n /**\n * The current writing direction that is being inherited.\n */\n dir: Dir;\n\n /**\n * Toggles the current writing direction for the first parent `Dir` component.\n */\n toggleDir(): void;\n}\n\n/** @internal */\ninterface InheritableContext extends WritingDirectionContext {\n root: boolean;\n}\n\nconst context = createContext<InheritableContext>({\n root: true,\n dir: \"ltr\",\n toggleDir: () => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Tried to toggle the current writing direction without initializing the `Dir` component.\"\n );\n }\n },\n});\ncontext.displayName = \"WritingDirection\";\nconst { Provider } = context;\n\n/**\n * Gets the writing direction context which provides access to the current `dir`\n * and a `toggleDir` function.\n *\n * @example\n * Manually Changing the Writing Direction\n * ```tsx\n * import { useDir } from \"@react-md/core\";\n *\n * function Example() {\n * const { dir, toggleDir } = useDir();\n *\n * return (\n * <>\n * <p>{`The current dir is: \"${dir}\"`}</p>\n * <button type=\"button\" onClick={toggleDir}>Toggle</button>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useDir(): Readonly<WritingDirectionContext> {\n const { root: _root, ...current } = useContext(context);\n return current;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface WritingDirectionProviderProps {\n /**\n * A single ReactElement child. If the `WritingDirection` has a parent\n * `WritingDirection`, the child will have the `dir` prop cloned into this\n * element.\n */\n children: ReactElement<{ dir?: Dir }>;\n\n /**\n * The default writing direction for your app or a subtree. To change the\n * current writing direction, use the `useDir` hook to get access to the\n * current `dir` and the `toggleDir` function.\n *\n * @defaultValue `\"ltr\"`\n * @see {@link DEFAULT_WRITING_DIRECTION}\n */\n defaultDir?: DefaultDir;\n}\n\n/**\n * In the browser, this will default to the `<html>`'s `dir` value if one\n * exists. If the `dir` attribute does not exist, it will default to `\"ltr\"`.\n *\n * In node environments, this will default to `\"ltr\"`.\n *\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_WRITING_DIRECTION = (): Dir => {\n let dir: Dir = \"ltr\";\n if (typeof document !== \"undefined\") {\n const rootDir = document.documentElement.getAttribute(\"dir\");\n dir = rootDir === \"rtl\" ? \"rtl\" : \"ltr\";\n }\n\n return dir;\n};\n\n/**\n * **Client Component**\n *\n * The `WritingDirection` component is used to handle the current writing\n * direction within your app as well as conditionally updating the writing\n * direction for small sections in your app. When this component is used for the\n * first time near the root of your React component tree, the current direction\n * will be applied to the root `<html>` element. Otherwise the current dir will\n * be cloned into the child element so it can be passed as a prop.\n *\n * Note: Since the `dir` is cloned into the child element, you need to make sure\n * that the child is either a DOM element or the `dir` prop is passed from your\n * custom component.\n *\n * @example\n * Root Setup\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { WritingDirection } from \"@react-md/core\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <WritingDirection>\n * <App />\n * </WritingDirection>\n * );\n * ```\n *\n * @example\n * Supporting RTL Languages\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { WritingDirection } from \"@react-md/core\";\n * import type { Dir } from \"@react-md/core\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * // see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code\n * const SUPPORTED_RTL_LANGUAGES = [\n * \"ar\",\n * \"arc\",\n * \"ckb\",\n * \"dv\",\n * \"fa\",\n * \"ha\",\n * \"he\",\n * \"khw\",\n * \"ks\",\n * \"ps\",\n * \"sd\",\n * \"ur\",\n * \"uz_AF\",\n * \"ti\",\n * ];\n *\n * const defaultDir = (): Dir => {\n * if (SUPPORTED_RTL_LANGUAGES.includes(navigator.language)) {\n * return \"rtl\"\n * }\n *\n * return \"ltr\";\n * }\n *\n * root.render(\n * <WritingDirection defaultDir={defaultDir}>\n * <App />\n * </WritingDirection>\n * );\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function WritingDirectionProvider(\n props: WritingDirectionProviderProps\n): ReactElement {\n const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;\n const { root } = useContext(context);\n const [dir, setDir] = useState(defaultDir);\n useEffect(() => {\n if (!root || typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.setAttribute(\"dir\", dir);\n\n return () => {\n document.documentElement.removeAttribute(\"dir\");\n };\n }, [dir, root]);\n\n const toggleDir = useCallback(() => {\n setDir((prevDir) => (prevDir === \"ltr\" ? \"rtl\" : \"ltr\"));\n }, []);\n\n const value = useMemo<InheritableContext>(\n () => ({ root: false, dir, toggleDir }),\n [dir, toggleDir]\n );\n let child = Children.only(children);\n if (!root) {\n child = cloneElement(child, { dir });\n }\n\n return <Provider value={value}>{child}</Provider>;\n}\n"],"names":["Children","cloneElement","createContext","useCallback","useContext","useEffect","useMemo","useState","context","root","dir","toggleDir","process","env","NODE_ENV","Error","displayName","Provider","useDir","_root","current","DEFAULT_WRITING_DIRECTION","document","rootDir","documentElement","getAttribute","WritingDirectionProvider","props","children","defaultDir","setDir","setAttribute","removeAttribute","prevDir","value","child","only"],"mappings":"AAAA;;AACA,SACEA,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QAEH,QAAQ;AA+Bf,MAAMC,wBAAUN,cAAkC;IAChDO,MAAM;IACNC,KAAK;IACLC,WAAW;QACT,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,IAAIC,MACR;QAEJ;IACF;AACF;AACAP,QAAQQ,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGT;AAErB;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASU;IACd,MAAM,EAAET,MAAMU,KAAK,EAAE,GAAGC,SAAS,GAAGhB,WAAWI;IAC/C,OAAOY;AACT;AAsBA;;;;;;;CAOC,GACD,OAAO,MAAMC,4BAA4B;IACvC,IAAIX,MAAW;IACf,IAAI,OAAOY,aAAa,aAAa;QACnC,MAAMC,UAAUD,SAASE,eAAe,CAACC,YAAY,CAAC;QACtDf,MAAMa,YAAY,QAAQ,QAAQ;IACpC;IAEA,OAAOb;AACT,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EC,GACD,OAAO,SAASgB,yBACdC,KAAoC;IAEpC,MAAM,EAAEC,QAAQ,EAAEC,aAAaR,yBAAyB,EAAE,GAAGM;IAC7D,MAAM,EAAElB,IAAI,EAAE,GAAGL,WAAWI;IAC5B,MAAM,CAACE,KAAKoB,OAAO,GAAGvB,SAASsB;IAC/BxB,UAAU;QACR,IAAI,CAACI,QAAQ,OAAOa,aAAa,aAAa;YAC5C;QACF;QAEAA,SAASE,eAAe,CAACO,YAAY,CAAC,OAAOrB;QAE7C,OAAO;YACLY,SAASE,eAAe,CAACQ,eAAe,CAAC;QAC3C;IACF,GAAG;QAACtB;QAAKD;KAAK;IAEd,MAAME,YAAYR,YAAY;QAC5B2B,OAAO,CAACG,UAAaA,YAAY,QAAQ,QAAQ;IACnD,GAAG,EAAE;IAEL,MAAMC,QAAQ5B,QACZ,IAAO,CAAA;YAAEG,MAAM;YAAOC;YAAKC;QAAU,CAAA,GACrC;QAACD;QAAKC;KAAU;IAElB,IAAIwB,QAAQnC,SAASoC,IAAI,CAACR;IAC1B,IAAI,CAACnB,MAAM;QACT0B,sBAAQlC,aAAakC,OAAO;YAAEzB;QAAI;IACpC;IAEA,qBAAO,KAACO;QAASiB,OAAOA;kBAAQC;;AAClC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useAsyncAction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { NonNullRef, UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type AsyncActionFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type HandleAsyncAction = <Args extends unknown[]>(\n action: AsyncActionFunction<Args>\n) => AsyncActionFunction<Args>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface AsyncActionOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface AsyncActionImplementation {\n pending: boolean;\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncAction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @example\n * Simple Example (Async Button)\n * ```tsx\n * import type { ButtonProps } from \"@react-md/core\";\n * import { box, Button, CircularProgress, useAsyncAction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { MouseEvent, ReactElement } from \"react\";\n *\n * import styles from \"./AsyncButton.module.scss\";\n *\n * export interface AsyncButtonProps extends ButtonProps {\n * onClick(event: MouseEvent<HTMLButtonElement>): Promise<void>;\n * }\n *\n * export function AsyncButton(props: AsyncButtonProps): ReactElement {\n * const { onClick, children, theme, className, disabled, ...remaining } = props;\n * const { handleAsync, pending } = useAsyncAction({ disabled });\n *\n * return (\n * <Button\n * {...remaining}\n * aria-disabled={pending || undefined}\n * disabled={disabled}\n * className={cnb(pending && styles.loading, className)}\n * theme={pending ? \"disabled\" : theme}\n * onClick={handleAsync(onClick)}\n * >\n * {children}\n * {pending && (\n * <span\n * className={box({\n * align: \"center\",\n * disablePadding: true,\n * className: styles.overlay,\n * })}\n * >\n * <CircularProgress />\n * </span>\n * )}\n * </Button>\n * );\n * }\n *\n * // `AsyncButton.module.scss`\n * // hide everything in the button except for the overlay containing the circular\n * // progress\n * .loading > *:not(.overlay) {\n * opacity: 0;\n * }\n *\n * .overlay {\n * border-radius: inherit;\n * box-shadow: inherit;\n * inset: 0;\n * position: absolute;\n * z-index: 1;\n * }\n * ```\n *\n * @example\n * Confirmation Dialog with Overlay\n * ```tsx\n * import {\n * Button,\n * DialogHeader,\n * DialogContent,\n * DialogFooter,\n * Form,\n * useAsyncAction,\n * } from \"@react-md/core\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import type { ReactElement } from \"react\";\n * import { useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncAction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useAsyncAction(\n options: AsyncActionOptions = {}\n): AsyncActionImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncAction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncAction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAE9C,SAASC,YAAY,QAAQ,oBAAoB;AAkCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgIC,GACD,OAAO,SAASC,eACdC,UAA8B,CAAC,CAAC;IAEhC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,CAACE,SAASC,WAAW,GAAGN,SAAS;IACvC,MAAMO,YAAYN;IAElB,MAAMO,cAAcT,YAClB,CAACU,SACC,OAAO,GAAGC;YACR,IAAIL,WAAWD,UAAU;gBACvB;YACF;YAEAE,WAAW;YACX,IAAI;gBACF,MAAMG,UAAUC;YAClB,SAAU;gBACR,IAAI,CAACH,UAAUI,OAAO,EAAE;oBACtBL,WAAW;gBACb;YACF;QACF,GACF;QAACF;QAAUC;QAASE;KAAU;IAGhC,OAAO;QACLF;QACAE;QACAD;QACAE;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useDebouncedFunction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { AnyFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type DebouncedFunction<F extends AnyFunction> = (\n ...args: Parameters<F>\n) => void;\n\n/**\n * Creates a function that will only be called if it has not been called again\n * for X milliseconds.\n *\n * @example\n * Debounced Search API Requests\n * ```tsx\n * import { TextField, useDebouncedFunction, useUnmounted } from \"@react-md/core\";\n * import { useState } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * interface State {\n * error?: unknown\n * loading: boolean;\n * results?: {\n * // pretend some search results\n * id: string;\n * name: string;\n * }[];\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * loading: false,\n * });\n * // this is only required for async actions\n * const unmounted = useUnmounted();\n *\n * // A new search request will be fired once every 500ms as the user types.\n * // can't use the event here since React uses synthetic events\n * const search = useDebouncedFunction(async (q: string) => {\n * setState({\n * loading: true,\n * error: undefined,\n * results: undefined,\n * });\n *\n * try {\n * const response = await fetch('/search', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * },\n * body: JSON.stringify({ q }),\n * });\n * const json = await response.json();\n *\n * if (!unmounted.current) {\n * setState({\n * loading: false,\n * results: json,\n * });\n * }\n * } catch (error) {\n * if (!unmounted.current) {\n * setState({\n * error,\n * loading: false,\n * });\n * }\n * }\n * }, 500);\n *\n * return (\n * <TextField\n * type=\"search\"\n * label=\"Search\"\n * onChange={(event) => search(event.currentTarget.value)}\n * />\n * );\n * }\n * ```\n *\n * @see `useThrottledFunction` for throttle behavior instead. (Call a\n * function at most once every X milliseconds).\n * @remarks \\@since 6.0.0\n */\nexport function useDebouncedFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): DebouncedFunction<F> {\n const timeout = useRef<number | undefined>();\n const funcRef = useRef(func);\n useIsomorphicLayoutEffect(() => {\n funcRef.current = func;\n });\n\n useEffect(() => {\n return () => {\n window.clearTimeout(timeout.current);\n };\n }, []);\n\n return useCallback(\n (...args) => {\n window.clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n funcRef.current(...args);\n }, wait);\n },\n [wait]\n );\n}\n"],"names":["useCallback","useEffect","useRef","useIsomorphicLayoutEffect","useDebouncedFunction","func","wait","timeout","funcRef","current","window","clearTimeout","args","setTimeout"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAEvD,SAASC,yBAAyB,QAAQ,iCAAiC;AAS3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,UAAUL;IAChB,MAAMM,UAAUN,OAAOG;IACvBF,0BAA0B;QACxBK,QAAQC,OAAO,GAAGJ;IACpB;IAEAJ,UAAU;QACR,OAAO;YACLS,OAAOC,YAAY,CAACJ,QAAQE,OAAO;QACrC;IACF,GAAG,EAAE;IAEL,OAAOT,YACL,CAAC,GAAGY;QACFF,OAAOC,YAAY,CAACJ,QAAQE,OAAO;QACnCF,QAAQE,OAAO,GAAGC,OAAOG,UAAU,CAAC;YAClCL,QAAQC,OAAO,IAAIG;QACrB,GAAGN;IACL,GACA;QAACA;KAAK;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useDropzone.ts"],"sourcesContent":["\"use client\";\nimport type { DragEvent } from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks\n * \\@since 5.1.3\n * \\@since 6.0.0 The element type is dynamically inferred on each handler\n * instead of the `DropzoneHandlers` type.\n */\nexport interface DropzoneHandlers {\n onDrop<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragEnter?<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragOver?<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragLeave?<E extends HTMLElement>(event: DragEvent<E>): void;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface DropzoneOptions extends DropzoneHandlers {\n /**\n * Set this to `true` if you do not need to capture drag events from outside\n * the window. i.e. Dragging files into the dropzone.\n *\n * @defaultValue `false`\n * @see {@link DropzoneHookReturnValue.isDragging}\n */\n disableDragging?: boolean;\n}\n\n/**\n * @remarks\n * \\@since 2.9.0\n * \\@since 6.0.0 Returns an object instead of an ordered array of\n * `[isOver: boolean, dropzoneHandlers: DropzoneHandlers]`. Also returns a new\n * `isDragging` state.\n */\nexport interface DropzoneHookReturnValue {\n /**\n * This will be `true` when the user is dragging something over the dropzone\n * target.\n */\n isOver: boolean;\n\n /**\n * This will be `true` when the user is dragging anything within the document.\n * The main use case for this is detecting when a user is dragging a file into\n * the document so you can help highlight the dropzone area.\n *\n * This will always be `false` if {@link DropzoneOptions.disableDragging} is\n * `true`.\n */\n isDragging: boolean;\n\n /**\n * The event handlers that should be passed to the dropzone target.\n */\n dropzoneHandlers: Required<DropzoneHandlers>;\n}\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import { useDropzone, useFileUpload } from \"@react-md/core\"\n * import type { CSSProperties, ReactElement } from \"react\";\n *\n * const style: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * disableDragging: true,\n * });\n *\n * return (\n * <div {...dropzoneHandlers} style={isOver ? style : {}}>\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * Dragging Example\n * ```tsx\n * import { useDropzone, useFileUpload } from \"@react-md/core\"\n * import type { CSSProperties, ReactElement } from \"react\";\n *\n * const draggingStyle: CSSProperties = {\n * backgroundColor: \"orange\",\n * };\n * const overStyle: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, isDragging, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * });\n *\n * return (\n * <div\n * {...dropzoneHandlers}\n * style={{\n * ...(isDragging && draggingStyle),\n * ...(isOver && overStyle),\n * }}\n * >\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * \\@since 2.9.0\n * \\@since 6.0.0 Supports document-level dragging flag;\n */\nexport function useDropzone(options: DropzoneOptions): DropzoneHookReturnValue {\n const {\n onDrop,\n onDragOver = noop,\n onDragEnter = noop,\n onDragLeave = noop,\n disableDragging = false,\n } = options;\n\n const [isOver, setOver] = useState(false);\n const [isDragging, setDragging] = useState(false);\n const draggingTimeout = useRef<number | undefined>();\n\n useEffect(() => {\n if (disableDragging) {\n return;\n }\n\n const startDragging = (): void => {\n setDragging(true);\n };\n\n // Browsers sometimes don't trigger a dragleave event for the entire\n // document, so we have to work around that by using the `dragover` event\n // instead. The `dragover` event will continually fire within the window\n // until the user drops the file or moves the file outside of the window.\n //\n // So we can consider the\n const handler = (): void => {\n window.clearTimeout(draggingTimeout.current);\n draggingTimeout.current = window.setTimeout(() => {\n setDragging(false);\n }, 100);\n };\n\n window.addEventListener(\"dragenter\", startDragging);\n window.addEventListener(\"dragover\", handler);\n return () => {\n window.clearTimeout(draggingTimeout.current);\n window.removeEventListener(\"dragenter\", startDragging);\n window.removeEventListener(\"dragover\", handler);\n };\n }, [disableDragging]);\n\n return {\n isOver,\n isDragging,\n dropzoneHandlers: {\n // Note: need to call `event.stopPropagation()` and\n // `event.preventDefault())` for each of these handlers to prevent the\n // default browser behavior when dropping. Only calling within `onDrop`\n // does not work.\n //\n // i.e. dropping an image would preview that image in the current\n // window/tab instead of triggering the drop event.\n onDrop(event) {\n event.preventDefault();\n event.stopPropagation();\n\n window.clearTimeout(draggingTimeout.current);\n onDrop(event);\n setOver(false);\n setDragging(false);\n },\n onDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n\n window.clearTimeout(draggingTimeout.current);\n onDragOver(event);\n setOver(true);\n },\n onDragEnter(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragEnter(event);\n setOver(true);\n },\n onDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragLeave(event);\n setOver(false);\n },\n },\n };\n}\n"],"names":["useEffect","useRef","useState","noop","useDropzone","options","onDrop","onDragOver","onDragEnter","onDragLeave","disableDragging","isOver","setOver","isDragging","setDragging","draggingTimeout","startDragging","handler","window","clearTimeout","current","setTimeout","addEventListener","removeEventListener","dropzoneHandlers","event","preventDefault","stopPropagation"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEC,GACD,OAAO,SAASC,YAAYC,OAAwB;IAClD,MAAM,EACJC,MAAM,EACNC,aAAaJ,IAAI,EACjBK,cAAcL,IAAI,EAClBM,cAAcN,IAAI,EAClBO,kBAAkB,KAAK,EACxB,GAAGL;IAEJ,MAAM,CAACM,QAAQC,QAAQ,GAAGV,SAAS;IACnC,MAAM,CAACW,YAAYC,YAAY,GAAGZ,SAAS;IAC3C,MAAMa,kBAAkBd;IAExBD,UAAU;QACR,IAAIU,iBAAiB;YACnB;QACF;QAEA,MAAMM,gBAAgB;YACpBF,YAAY;QACd;QAEA,oEAAoE;QACpE,yEAAyE;QACzE,wEAAwE;QACxE,yEAAyE;QACzE,EAAE;QACF,yBAAyB;QACzB,MAAMG,UAAU;YACdC,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;YAC3CL,gBAAgBK,OAAO,GAAGF,OAAOG,UAAU,CAAC;gBAC1CP,YAAY;YACd,GAAG;QACL;QAEAI,OAAOI,gBAAgB,CAAC,aAAaN;QACrCE,OAAOI,gBAAgB,CAAC,YAAYL;QACpC,OAAO;YACLC,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;YAC3CF,OAAOK,mBAAmB,CAAC,aAAaP;YACxCE,OAAOK,mBAAmB,CAAC,YAAYN;QACzC;IACF,GAAG;QAACP;KAAgB;IAEpB,OAAO;QACLC;QACAE;QACAW,kBAAkB;YAChB,mDAAmD;YACnD,sEAAsE;YACtE,uEAAuE;YACvE,iBAAiB;YACjB,EAAE;YACF,iEAAiE;YACjE,mDAAmD;YACnDlB,QAAOmB,KAAK;gBACVA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC3Cd,OAAOmB;gBACPb,QAAQ;gBACRE,YAAY;YACd;YACAP,YAAWkB,KAAK;gBACdA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC3Cb,WAAWkB;gBACXb,QAAQ;YACV;YACAJ,aAAYiB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBnB,YAAYiB;gBACZb,QAAQ;YACV;YACAH,aAAYgB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBlB,YAAYgB;gBACZb,QAAQ;YACV;QACF;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useElementSize.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState, type RefCallback } from \"react\";\nimport { type ElementSize, type UseStateInitializer } from \"./types.js\";\nimport {\n useResizeObserver,\n type ResizeObserverHookOptions,\n} from \"./useResizeObserver.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ElementSizeOptions<E extends HTMLElement>\n extends Omit<ResizeObserverHookOptions<E>, \"onUpdate\"> {\n /** @defaultValue `{ height: 0, width: 0 }` */\n defaultValue?: UseStateInitializer<ElementSize>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ElementSizeImplementation<E extends HTMLElement>\n extends ElementSize {\n elementRef: RefCallback<E>;\n}\n\n/**\n * A small wrapper around the {@link useResizeObserver} hook to calculate the\n * element's size.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { useElementSize } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { height, width, elementRef } = useElementSize();\n *\n * return (\n * <div ref={elementRef}>\n * {`height: ${height}, width: ${width}`}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useElementSize<E extends HTMLElement>(\n options: ElementSizeOptions<E> = {}\n): ElementSizeImplementation<E> {\n const { defaultValue } = options;\n\n const [size, setSize] = useState<ElementSize>(() => {\n if (typeof defaultValue === \"function\") {\n return defaultValue();\n }\n\n return (\n defaultValue ?? {\n height: 0,\n width: 0,\n }\n );\n });\n\n const elementRef = useResizeObserver({\n ...options,\n onUpdate: useCallback((entry) => {\n const size = entry.borderBoxSize[0];\n\n setSize({\n height: size.blockSize,\n width: size.inlineSize,\n });\n }, []),\n });\n\n return {\n ...size,\n elementRef,\n };\n}\n"],"names":["useCallback","useState","useResizeObserver","useElementSize","options","defaultValue","size","setSize","height","width","elementRef","onUpdate","entry","borderBoxSize","blockSize","inlineSize"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAA0B,QAAQ;AAEhE,SACEC,iBAAiB,QAEZ,yBAAyB;AAmBhC;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASC,eACdC,UAAiC,CAAC,CAAC;IAEnC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IAEzB,MAAM,CAACE,MAAMC,QAAQ,GAAGN,SAAsB;QAC5C,IAAI,OAAOI,iBAAiB,YAAY;YACtC,OAAOA;QACT;QAEA,OACEA,gBAAgB;YACdG,QAAQ;YACRC,OAAO;QACT;IAEJ;IAEA,MAAMC,aAAaR,kBAAkB;QACnC,GAAGE,OAAO;QACVO,UAAUX,YAAY,CAACY;YACrB,MAAMN,OAAOM,MAAMC,aAAa,CAAC,EAAE;YAEnCN,QAAQ;gBACNC,QAAQF,KAAKQ,SAAS;gBACtBL,OAAOH,KAAKS,UAAU;YACxB;QACF,GAAG,EAAE;IACP;IAEA,OAAO;QACL,GAAGT,IAAI;QACPI;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useEnsuredId.ts"],"sourcesContent":["import { useId } from \"react\";\n\n/**\n * This hook is used to ensure that an `id` has been provided to a component\n * either through props or use the `useId` hook.\n *\n * @example\n * Simple Example\n * ```tsx\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import { useEnsuredId } from \"@react-md/core\";\n *\n * export function MaterialDesignComponent(props: HTMLAttributes<HTMLDivElement>): ReactElement {\n * const id = useEnsuredId(props.id, \"component-name\");\n *\n * return <div {...props} id={id} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport function useEnsuredId(\n propId: string | undefined,\n prefix: string\n): string {\n const id = useId();\n\n return propId ?? `${prefix}-${id}`;\n}\n"],"names":["useId","useEnsuredId","propId","prefix","id"],"mappings":"AAAA,SAASA,KAAK,QAAQ,QAAQ;AAE9B;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,aACdC,MAA0B,EAC1BC,MAAc;IAEd,MAAMC,KAAKJ;IAEX,OAAOE,UAAU,CAAC,EAAEC,OAAO,CAAC,EAAEC,GAAG,CAAC;AACpC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useEnsuredRef.ts"],"sourcesContent":["\"use client\";\nimport type { MutableRefObject, Ref, RefCallback } from \"react\";\nimport { useCallback, useRef } from \"react\";\nimport { applyRef } from \"./utils/applyRef.js\";\n\n/**\n * @remarks \\@since 2.3.0\n * @internal\n */\nexport type EnsuredRefs<E extends HTMLElement> = readonly [\n MutableRefObject<E | null>,\n RefCallback<E | null>,\n];\n\n/**\n * This is mostly an internal hook that allows for an optional ref (normally\n * from props or hook options) to be merged with a hook's required `ref`. This\n * will return a MutableRefObject used for DOM manipulation in a custom hook\n * followed by a ref callback function that should be passed to the DOM node\n * that will ensure that both the optional `propRef` and hook ref are updated.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { HTMLAttributes, forwardRef } from \"react\";\n * import { useEnsuredRef } from \"@react-md/core\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * export const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const [nodeRef, refHandler] = useEnsuredRef(ref);\n * useEffect(() => {\n * // do something with nodeRef.current\n * }, [nodeRef])\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @remarks \\@since 2.3.0\n * @internal\n */\nexport function useEnsuredRef<E extends HTMLElement>(\n propRef?: Ref<E | null>\n): EnsuredRefs<E> {\n const ref = useRef<E | null>(null);\n const refHandler = useCallback(\n (instance: E | null) => {\n applyRef(instance, propRef);\n ref.current = instance;\n },\n [propRef]\n );\n\n return [ref, refHandler];\n}\n"],"names":["useCallback","useRef","applyRef","useEnsuredRef","propRef","ref","refHandler","instance","current"],"mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AAC5C,SAASC,QAAQ,QAAQ,sBAAsB;AAW/C;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,SAASC,cACdC,OAAuB;IAEvB,MAAMC,MAAMJ,OAAiB;IAC7B,MAAMK,aAAaN,YACjB,CAACO;QACCL,SAASK,UAAUH;QACnBC,IAAIG,OAAO,GAAGD;IAChB,GACA;QAACH;KAAQ;IAGX,OAAO;QAACC;QAAKC;KAAW;AAC1B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useEnsuredState.ts"],"sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport type { Dispatch } from \"react\";\nimport { useState } from \"react\";\nimport type { UseStateInitializer, UseStateSetter } from \"./types.js\";\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface EnsuredStateOptions<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V>,\n> {\n value?: V;\n setValue?: Setter;\n defaultValue?: UseStateInitializer<V>;\n}\n\n/**\n * This is used to dynamically allow controlling hooks by providing a `value` +\n * `setValue` or defaulting to uncontrolled behavior with local state.\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function useEnsuredState<\n V,\n Setter extends Dispatch<V> | UseStateSetter<V>,\n>(\n options: EnsuredStateOptions<V, Setter>\n): readonly [value: V, setValue: Setter] {\n const { value, setValue, defaultValue } = options;\n if (typeof value !== \"undefined\" && typeof setValue !== \"undefined\") {\n return [value, setValue];\n }\n\n if (typeof value !== \"undefined\" || typeof setValue !== \"undefined\") {\n throw new Error(\n \"Both a `value` and `setValue` must be defined for controlled components.\"\n );\n }\n\n if (typeof defaultValue === \"undefined\") {\n throw new Error(\n \"A `defaultValue` must be defined for uncontrolled components.\"\n );\n }\n\n return useState(defaultValue) as [value: V, setValue: Setter];\n}\n"],"names":["useState","useEnsuredState","options","value","setValue","defaultValue","Error"],"mappings":"AAAA,6CAA6C,GAE7C,SAASA,QAAQ,QAAQ,QAAQ;AAgBjC;;;;;;CAMC,GACD,OAAO,SAASC,gBAIdC,OAAuC;IAEvC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGH;IAC1C,IAAI,OAAOC,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,OAAO;YAACD;YAAOC;SAAS;IAC1B;IAEA,IAAI,OAAOD,UAAU,eAAe,OAAOC,aAAa,aAAa;QACnE,MAAM,IAAIE,MACR;IAEJ;IAEA,IAAI,OAAOD,iBAAiB,aAAa;QACvC,MAAM,IAAIC,MACR;IAEJ;IAEA,OAAON,SAASK;AAClB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useHtmlClassName.ts"],"sourcesContent":["\"use client\";\nimport { useEffect } from \"react\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function useHtmlClassName(className: string): void {\n useEffect(() => {\n if (!className) {\n return;\n }\n\n const html = document.documentElement;\n html.classList.add(className);\n return () => {\n html.classList.remove(className);\n };\n }, [className]);\n}\n"],"names":["useEffect","useHtmlClassName","className","html","document","documentElement","classList","add","remove"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,QAAQ;AAElC;;CAEC,GACD,OAAO,SAASC,iBAAiBC,SAAiB;IAChDF,UAAU;QACR,IAAI,CAACE,WAAW;YACd;QACF;QAEA,MAAMC,OAAOC,SAASC,eAAe;QACrCF,KAAKG,SAAS,CAACC,GAAG,CAACL;QACnB,OAAO;YACLC,KAAKG,SAAS,CAACE,MAAM,CAACN;QACxB;IACF,GAAG;QAACA;KAAU;AAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useIntersectionObserver.ts"],"sourcesContent":["\"use client\";\nimport type { Ref, RefCallback, RefObject } from \"react\";\nimport { useEffect } from \"react\";\nimport { useEnsuredRef } from \"./useEnsuredRef.js\";\n\n/** @remarks \\@since 6.0.0 */\nexport type IntersectionObserverRoot = IntersectionObserverInit[\"root\"];\n/** @remarks \\@since 6.0.0 */\nexport type IntersectionObserverThreshold =\n IntersectionObserverInit[\"threshold\"];\n/** @remarks \\@since 6.0.0 */\nexport type IntersectionObserverRootMargin =\n IntersectionObserverInit[\"rootMargin\"];\n\n/**\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#intersection_observer_options}\n * @remarks \\@since 6.0.0\n */\nexport interface BaseIntersectionObserverHookOptions {\n /**\n * This is the same as the normal `root` for an IntersectionObserverInit, but\n * also supports refs.\n */\n root?: RefObject<IntersectionObserverRoot> | IntersectionObserverRoot;\n\n /**\n * Set this to `true` if the intersection observer behavior should be\n * disabled.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * **When using a list of thresholds, they must either be defined outside of\n * the component or wrapped in a `useMemo` to prevent the IntersectionObserver\n * from being re-created each render.**\n *\n * @example\n * Moving Out of Render\n * ```tsx\n * const threshold = [0, 0.25, 0.5, 0.75, 1];\n *\n * function Example() {\n * const targetRef = useIntersectionObserver({\n * threshold,\n * onUpdate: useCallback(([entry]) => {\n * // do something\n * }, []),\n * })\n * }\n * ```\n *\n * @example\n * Wrapping in useMemo\n * ```tsx\n * interface ExampleProps {\n * min: number;\n * max: number;\n * }\n *\n * function Example({ min, max }: ExampleProps): ReactElement {\n * const targetRef = useIntersectionObserver({\n * threshold: useMemo(() => [min, max], [min, max]),\n * onUpdate: useCallback(([entry]) => {\n * // do something\n * }, []),\n * });\n * }\n * ```\n *\n * @see {@link getThreshold}\n */\n threshold?: IntersectionObserverThreshold;\n\n /** @see {@link getRootMargin} */\n rootMargin?: IntersectionObserverRootMargin;\n\n /**\n * **Must be wrapped in `useCallback` to prevent re-creating the\n * IntersectionObserver each render.**\n *\n * This can be used to dynamically generate the {@link threshold} which is\n * generally useful if you need access to the DOM or do some expensive\n * computation.\n *\n * @example\n * Simple Example\n * ```tsx\n * const targetRef = useIntersectionObserver({\n * getThreshold: useCallback(() => {\n * // pretend some expensive computation\n * return [0, 0.25, 0.5, 0.75, 1];\n * }, []),\n * OnUpdate: useCallback(() => {\n * // do something\n * }, []),\n * });\n * ```\n *\n * If this option is provided, {@link threshold}'s value will be ignored.\n */\n getThreshold?(): IntersectionObserverThreshold;\n\n /**\n * **Must be wrapped in `useCallback` to prevent re-creating the\n * IntersectionObserver each render.**\n *\n * This can be used to dynamically generate the {@link rootMargin} which is\n * generally useful if you need access to the DOM.\n *\n * @example\n * Simple Example\n * ```tsx\n * const nodeRef = useRef<HTMLElement>();\n * const targetRef = useIntersectionObserver({\n * getRootMargin: useCallback(() => {\n * return `-${nodeRef.current.offsetHeight - 1}px 0px 0px`;\n * }, []),\n * onUpdate: useCallback(() => {\n * // do something\n * }, []),\n * });\n * ```\n *\n * Note: If this option is provided, {@link rootMargin} will be ignored.\n */\n getRootMargin?(): IntersectionObserverRootMargin;\n}\n\n/**\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#intersection_observer_options}\n * @remarks \\@since 6.0.0\n */\nexport interface IntersectionObserverHookOptions<E extends HTMLElement>\n extends BaseIntersectionObserverHookOptions {\n /**\n * An optional ref to merge with the ref returned by this hook.\n */\n ref?: Ref<E>;\n\n /**\n * **Must be wrapped in `useCallback` to prevent re-creating the\n * IntersectionObserver each render.**\n *\n * @example\n * Simple Example\n * ```tsx\n * const threshold = [0, 0.25, 0.5, 0.75, 1];\n *\n * function Example(): ReactElement {\n * const [intersecting, setIntersecting] = useState(false);\n * const targetRef = useIntersectionObserver({\n * threshold,\n * onUpdate: useCallback(([entry]) {\n * setIntersecting(entry.isIntersecting);\n * }, []),\n * });\n *\n * // implementation\n * }\n * ```\n */\n onUpdate(entries: readonly IntersectionObserverEntry[]): void;\n\n /**\n * **Must be wrapped in `useCallback` to prevent re-creating the\n * IntersectionObserver each render.**\n *\n * If this is defined, the {@link ref} will be ignored along with the returned\n * ref.\n *\n * @example\n * Watching Queried Elements\n * ```tsx\n * function Example(): ReactElement {\n * useIntersectionObserver({\n * onUpdate: useCallback((entries) => {\n * entries.forEach((entry) => {\n * // do stuff\n * });\n *\n * setIntersectingIds(intersecting);\n * }, []),\n * getTargets: useCallback(() => {\n * return document.querySelectorAll('h1, h2, h3, h4, h5, h6');\n * }, []),\n * }),\n *\n * return <div {...props} />;\n * }\n * ```\n */\n getTargets?(): readonly Element[];\n}\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#a_simple_example\n *\n * import { useIntersectionObserver } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * import styles from \"./Example.module.scss\";\n *\n * const numSteps = 20;\n * const thresholds = Array.from({ length: numSteps }, (_, i) => i / numSteps);\n * thresholds.push(0);\n *\n * const INCREASING = \"rgba(40, 40, 190, ratio)\";\n * const DECREASING = \"rgba(190, 40, 40, ratio)\";\n *\n * export default function Example(): ReactElement {\n * const [{ ratio, increasing }, setState] = useState({\n * ratio: 0.0,\n * increasing: true,\n * });\n *\n * const targetRef = useIntersectionObserver({\n * threshold: thresholds,\n * rootMargin: \"0px\",\n * onUpdate: useCallback(([entry]) => {\n * const { intersectionRatio } = entry;\n * setState((prevState) => {\n * return {\n * ratio: intersectionRatio,\n * increasing: intersectionRatio > prevState.ratio,\n * };\n * });\n * }, []),\n * });\n *\n * return (\n * <div\n * ref={targetRef}\n * className={styles.box}\n * style={{\n * backgroundColor: (increasing ? INCREASING : DECREASING).replace(\n * \"ratio\",\n * `${ratio}`\n * ),\n * }}\n * >\n * <div className={styles.vertical}>\n * Welcome to <strong>The Box!</strong>\n * </div>\n * </div>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n */\nexport function useIntersectionObserver<E extends HTMLElement>(\n options: IntersectionObserverHookOptions<E>\n): RefCallback<E> {\n const {\n ref,\n root,\n disabled = false,\n onUpdate,\n threshold,\n rootMargin,\n getTargets,\n getThreshold,\n getRootMargin,\n } = options;\n\n const [targetNodeRef, targetRef] = useEnsuredRef(ref);\n\n useEffect(() => {\n const element = targetNodeRef.current;\n let targets: readonly Element[] = [];\n if (getTargets) {\n targets = getTargets();\n } else if (element) {\n targets = [element];\n }\n\n if (disabled || !targets.length) {\n return;\n }\n\n let resolvedRoot: IntersectionObserverRoot;\n if (root && \"current\" in root) {\n resolvedRoot = root.current;\n } else {\n resolvedRoot = root;\n }\n\n const options: IntersectionObserverInit = {\n root: resolvedRoot,\n threshold: (getThreshold || (() => threshold))(),\n rootMargin: (getRootMargin || (() => rootMargin))(),\n };\n\n // Just like the ResizeObserver, you can see performance improvements by\n // sharing a single intersection observer but I don't think it's worth the\n // effort to implement here since I'd need to:\n // - check if there is an observer with the same options\n // - if there is, add the callback to that existing observer\n // - if there isn't, create a new observer\n // - when cleaning up, check if there are any other existing callbacks\n // - disconnect and remove the observer if there are none left\n const observer = new IntersectionObserver(onUpdate, options);\n targets.forEach((target) => {\n observer.observe(target);\n });\n\n return () => {\n observer.disconnect();\n };\n }, [\n disabled,\n getRootMargin,\n getTargets,\n getThreshold,\n onUpdate,\n root,\n rootMargin,\n targetNodeRef,\n threshold,\n ]);\n\n return targetRef;\n}\n"],"names":["useEffect","useEnsuredRef","useIntersectionObserver","options","ref","root","disabled","onUpdate","threshold","rootMargin","getTargets","getThreshold","getRootMargin","targetNodeRef","targetRef","element","current","targets","length","resolvedRoot","observer","IntersectionObserver","forEach","target","observe","disconnect"],"mappings":"AAAA;AAEA,SAASA,SAAS,QAAQ,QAAQ;AAClC,SAASC,aAAa,QAAQ,qBAAqB;AAiMnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DC,GACD,OAAO,SAASC,wBACdC,OAA2C;IAE3C,MAAM,EACJC,GAAG,EACHC,IAAI,EACJC,WAAW,KAAK,EAChBC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,aAAa,EACd,GAAGT;IAEJ,MAAM,CAACU,eAAeC,UAAU,GAAGb,cAAcG;IAEjDJ,UAAU;QACR,MAAMe,UAAUF,cAAcG,OAAO;QACrC,IAAIC,UAA8B,EAAE;QACpC,IAAIP,YAAY;YACdO,UAAUP;QACZ,OAAO,IAAIK,SAAS;YAClBE,UAAU;gBAACF;aAAQ;QACrB;QAEA,IAAIT,YAAY,CAACW,QAAQC,MAAM,EAAE;YAC/B;QACF;QAEA,IAAIC;QACJ,IAAId,QAAQ,aAAaA,MAAM;YAC7Bc,eAAed,KAAKW,OAAO;QAC7B,OAAO;YACLG,eAAed;QACjB;QAEA,MAAMF,UAAoC;YACxCE,MAAMc;YACNX,WAAW,AAACG,CAAAA,gBAAiB,CAAA,IAAMH,SAAQ,CAAC;YAC5CC,YAAY,AAACG,CAAAA,iBAAkB,CAAA,IAAMH,UAAS,CAAC;QACjD;QAEA,wEAAwE;QACxE,0EAA0E;QAC1E,8CAA8C;QAC9C,wDAAwD;QACxD,8DAA8D;QAC9D,4CAA4C;QAC5C,sEAAsE;QACtE,gEAAgE;QAChE,MAAMW,WAAW,IAAIC,qBAAqBd,UAAUJ;QACpDc,QAAQK,OAAO,CAAC,CAACC;YACfH,SAASI,OAAO,CAACD;QACnB;QAEA,OAAO;YACLH,SAASK,UAAU;QACrB;IACF,GAAG;QACDnB;QACAM;QACAF;QACAC;QACAJ;QACAF;QACAI;QACAI;QACAL;KACD;IAED,OAAOM;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useIsomorphicLayoutEffect.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\n\n/**\n * This is copy/pasted from react-redux which has some more information about\n * this and how to fix \"invalid\" warnings while running tests.\n *\n * @see {@link https://github.com/reduxjs/react-redux/blob/4c907c0870c6b9a136dd69be294c17d1dc63c8f5/src/utils/useIsomorphicLayoutEffect.js}\n */\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\"\n ? useLayoutEffect\n : useEffect;\n"],"names":["useEffect","useLayoutEffect","useIsomorphicLayoutEffect","window","document","createElement"],"mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,eAAe,QAAQ,QAAQ;AAEnD;;;;;CAKC,GACD,OAAO,MAAMC,4BACX,OAAOC,WAAW,eAClB,OAAOA,OAAOC,QAAQ,KAAK,eAC3B,OAAOD,OAAOC,QAAQ,CAACC,aAAa,KAAK,cACrCJ,kBACAD,UAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useLocalStorage.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useSsr } from \"./SsrProvider.js\";\nimport type { UseStateInitializer, UseStateSetter } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\nimport { identity } from \"./utils/identity.js\";\n\n/** @remarks \\@since 6.0.0 */\nexport type LocalStorageSerializer<T> = (value: T) => string;\n/** @remarks \\@since 6.0.0 */\nexport type LocalStorageDeserializer<T> = (item: string) => T;\n\n/** @remarks \\@since 6.0.0 */\nexport interface LocalStorageHookOptions<T> {\n /**\n * The local storage key name to use.\n *\n * This can be set to an empty string for internal usage of conditionally\n * saving items to local storage.\n */\n key: string;\n\n /**\n * The default value to use if an item does not exist in local storage.\n */\n defaultValue: UseStateInitializer<T>;\n\n /**\n * Set this to `true` if the `value` should not persist to local storage\n * immediately whenever it changes. You will manually need to call\n * {@link LocalStorageHookReturnValue.persist} instead.\n *\n * @see {@link LocalStorageHookReturnValue.persist} for an example.\n * @defaultValue `false`\n */\n manual?: boolean;\n\n /**\n * Set this to `true` to update:\n *\n * - the default {@link serializer} to be:\n * ```\n * typeof value === \"string\" ? value : `${value}`\n * ```\n * - the default {@link deserializer} to not call `JSON.parse` if the\n * {@link defaultValue} is a string.\n *\n * @defaultValue `typeof defaultValue === 'string'`\n */\n raw?: boolean;\n\n /**\n * An optional function to serialize the `value` before storing it in local\n * storage.\n *\n * @defaultValue `JSON.stringify`\n */\n serializer?: LocalStorageSerializer<T>;\n\n /**\n * An optional function to deserialize the `value` if the item existed in\n * local storage.\n *\n * @defaultValue `JSON.parse`\n */\n deserializer?: LocalStorageDeserializer<T>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const defaultLocalStorageSerializer = <T>(value: T): string =>\n typeof value === \"string\" ? value : `${value}`;\n\n/** @remarks \\@since 6.0.0 */\nexport interface GetItemFromStorageOptions<T> {\n /**\n * The storage key to use\n */\n key: string;\n\n /**\n * A value to use when the {@link key} does not exist in storage or there is\n * an error deserializing the value.\n */\n fallback: T;\n\n /** @see {@link LocalStorageHookOptions.deserializer} */\n deserializer?: LocalStorageDeserializer<T>;\n\n /** @defaultValue `localStorage` */\n storage?: Storage;\n}\n\n/**\n * You'll most likely want to use {@link useLocalStorage} instead, but this is a\n * low-level util to \"safely\" get an item from local storage.\n *\n * @example\n * ```ts\n * import { getItemFromStorage } from \"@react-md/core\";\n *\n * const values = [\"a\", \"b\", \"c\", \"d\"] as const;\n *\n * const item1 = getItemFromStorage({\n * key: \"testKey\",\n * fallback: values[0],\n * deserializer(item) {\n * if (!values.includes(item)) {\n * return values[0]\n * }\n *\n * return item;\n * },\n * });\n *\n * const item2 = getItemFromStorage({\n * key: \"anotherKey\",\n * fallback: -1,\n * });\n *\n * const item3 = getItemFromStorage({\n * key: \"anotherKey\",\n * fallback: -1,\n * storage: sessionStorage,\n * });\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const getItemFromStorage = <T>(\n options: GetItemFromStorageOptions<T>\n): T => {\n const {\n key,\n fallback,\n storage = localStorage,\n deserializer = JSON.parse,\n } = options;\n if (!key) {\n return fallback;\n }\n\n try {\n const value = storage.getItem(key);\n return !value ? fallback : deserializer(value);\n } catch (e) {\n return fallback;\n }\n};\n\n/** @remarks \\@since 6.0.0 */\nexport interface SetItemInStorageOptions<T> {\n key: string;\n value: T;\n /** @defaultValue `localStorage` */\n storage?: Storage;\n\n /** @see {@link LocalStorageHookOptions.serializer} */\n serializer?: LocalStorageSerializer<T>;\n}\n\n/**\n * You'll most likely want to use {@link useLocalStorage} instead, but this is a\n * low-level util to \"safely\" get an item from local storage.\n *\n * @example\n * ```ts\n * import { identity, getItemFromStorage } from \"@react-md/core\";\n *\n * const values = [\"a\", \"b\", \"c\", \"d\"] as const;\n *\n * setItemInStorage({\n * key: \"testKey\",\n * value: values[0],\n * // store string value as-is\n * serializer: identity,\n * });\n *\n * setItemInStorage({\n * key: \"anotherKey\",\n * value: 100,\n * });\n *\n * setItemInStorage({\n * key: \"anotherKey\",\n * value: 100,\n * storage: sessionStorage,\n * });\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const setItemInStorage = <T>(\n options: SetItemInStorageOptions<T>\n): void => {\n const {\n key,\n value,\n storage = localStorage,\n serializer = JSON.stringify,\n } = options;\n if (!key) {\n return;\n }\n\n try {\n storage.setItem(key, serializer(value));\n } catch {\n //\n }\n};\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\ninterface RemoveItemFromStorageOptions {\n key: string;\n\n /** @defaultValue `localStorage` */\n storage?: Storage;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const removeItemFromStorage = (\n options: RemoveItemFromStorageOptions\n): void => {\n const { key, storage = localStorage } = options;\n if (!key) {\n return;\n }\n\n try {\n storage.removeItem(key);\n } catch {\n // do nothing\n }\n};\n\n/** @remarks \\@since 6.0.0 */\nexport interface LocalStorageHookReturnValue<T> {\n value: T;\n\n /**\n * Updates the {@link value} in state. When the\n * {@link LocalStorageHookOptions.manual} option is `false`, the value will\n * also be updated in local storage immediately.\n */\n setValue: UseStateSetter<T>;\n\n /**\n * Remove the item from local storage.\n */\n remove(): void;\n\n /**\n * Manually persist the current {@link value} into local storage. This is only\n * useful if the {@link LocalStorageHookOptions.manual} option is `true`.\n *\n * @example\n * Manual Persisting\n * ```tsx\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { value, setValue, persist } = useLocalStorage({\n * key: \"someKey\",\n * manual: true,\n * defaultValue: \"\",\n * });\n *\n * return (\n * <>\n * <Button onClick={closeDialog}>\n * Cancel\n * </Button>\n * <Button\n * onClick={async () => {\n * await saveToDatabase(value);\n * persist();\n * closeDialog();\n * }}\n * >\n * Confirm\n * </Button>\n * </>\n * );\n * }\n * ```\n */\n persist(): void;\n}\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { TextField, useLocalStorage } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { value, setValue } = useLocalStorage({\n * key: \"savedSearch\",\n * defaultValue: \"\",\n * });\n *\n * return (\n * <TextField\n * label=\"Search\"\n * placeholder=\"Search...\"\n * type=\"search\"\n * value={value}\n * onChange={(event) => {\n * setValue(event.currentTarget.value)\n * }}\n * />\n * );\n * }\n * ```\n *\n * @example\n * Type-safe Objects\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { useLocalStorage } from \"@react-md/core\";\n *\n * interface ExpectedSchema {\n * label: string;\n * value: string;\n * // others\n * }\n *\n * function Example(): ReactElement {\n * const { value, setValue } = useLocalStorage<ExpectedSchema | null>({\n * key: \"someKey\",\n * defaultValue: null,\n *\n * // this is optional: you can create a custom deserializer to validate\n * // the stored value to prevent people manually updating local storage in\n * // the dev tools\n * deserializer(item) {\n * const parsed = JSON.parse(item):\n * const { label, value } = parsed;\n * if (typeof label !== 'string' || typeof value !== 'string') {\n * return null;\n * }\n *\n * return { label, value };\n * }\n * });\n *\n * // do something\n * // value will be `ExpectedSchema | null`\n * }\n * ```\n *\n * @example\n * Manual Persistence\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { Button, Checkbox, Form, useLocalStorage } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const { value, setValue, remove, persist } = useLocalStorage({\n * key: \"someKey\",\n * manual: true,\n * defaultValue: false,\n * });\n *\n * return (\n * <Form\n * onSubmit={() => {\n * // current value will be saved into local storage\n * persist();\n * }}\n * onReset={() => {\n * // \"someKey\" will be removed from local storage\n * remove();\n * }}\n * >\n * <Checkbox\n * label=\"Allow cookies\"\n * checked={value}\n * onChange={(event) =>\n * setValue(event.currentTarget.checked);\n * }\n * />\n * <Button type=\"reset\">Decline</Button>\n * <Button type=\"submit\">Save</Button>\n * </Form>\n * );\n * }\n * ```\n *\n * Note: Using the same local storage key in multiple parts in your app will not\n * update all instances with that value. The value will only be updated if it\n * was updated in a separate tab with the `\"storage\"` event. You must setup your\n * own context to share values or another state manager solution.\n *\n * @example\n * Shared Value\n * ```tsx\n * const context = createContext(null);\n * const { Provider } = context;\n *\n * export function useSomeValue(): string {\n * const value = useContext(context);\n * if (!value) {\n * throw new Error()\n * }\n *\n * return value;\n * }\n *\n * function Example({ children }: { children: ReactNode }) {\n * const { value, setValue, remove, persist } = useLocalStorage({\n * key: \"someKey\",\n * defaultValue: \"\",\n *\n * // optional\n * manual: true,\n * });\n *\n * return (\n * <Provider\n * value={useMemo(() => ({\n * value,\n * setValue,\n *\n * // remove and persist are optional\n * remove,\n * persist,\n * }), [value, setValue, remove, persist])}\n * >\n * {children}\n * </Provider>\n * );\n * }\n *\n * function SomeChildComponent() {\n * const { value, setValue } = useSomeValue();\n * // do stuff\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useLocalStorage<T>(\n options: LocalStorageHookOptions<T>\n): LocalStorageHookReturnValue<T> {\n const { key, defaultValue, manual = false } = options;\n\n const [initialValue] = useState(defaultValue);\n // this allows for strings to automatically be stored as-is instead of adding\n // additional quotes around then with JSON.stringify\n const raw = options.raw ?? typeof initialValue === \"string\";\n const serializer =\n options.serializer ??\n (raw ? defaultLocalStorageSerializer : JSON.stringify);\n const deserializer =\n options.deserializer ??\n (raw && typeof initialValue === \"string\" ? identity : JSON.parse);\n\n const ssr = useSsr();\n const [value, setStoredValue] = useState<T>(() => {\n if (ssr) {\n return initialValue;\n }\n\n const value = getItemFromStorage({\n key,\n fallback: initialValue,\n deserializer,\n });\n if (!manual) {\n setItemInStorage({\n key,\n value,\n serializer,\n });\n }\n\n return value;\n });\n const config = useRef({\n key,\n value,\n manual,\n serializer,\n deserializer,\n defaultValue: initialValue,\n } as const);\n useIsomorphicLayoutEffect(() => {\n config.current = {\n key,\n value,\n manual,\n serializer,\n deserializer,\n defaultValue: initialValue,\n };\n });\n\n const setValue = useCallback<UseStateSetter<T>>((valueOrDispatcher) => {\n const { key, manual, serializer } = config.current;\n setStoredValue((prevValue) => {\n const nextValue =\n valueOrDispatcher instanceof Function\n ? valueOrDispatcher(prevValue)\n : valueOrDispatcher;\n\n if (!manual) {\n setItemInStorage({\n key,\n value: nextValue,\n serializer,\n });\n }\n\n return nextValue;\n });\n }, []);\n\n const remove = useCallback(() => {\n removeItemFromStorage({\n key: config.current.key,\n });\n }, []);\n\n const persist = useCallback(() => {\n const { key, value, serializer } = config.current;\n setItemInStorage({\n key,\n value,\n serializer,\n });\n }, []);\n\n useEffect(() => {\n const { defaultValue, deserializer, manual } = config.current;\n if (manual || !ssr) {\n return;\n }\n\n setValue(\n getItemFromStorage({\n key,\n fallback: defaultValue,\n deserializer,\n })\n );\n }, [key, ssr, setValue]);\n\n // update the value if another tab changed the local storage value\n useEffect(() => {\n if (!key) {\n return;\n }\n\n const callback = (event: StorageEvent): void => {\n const { defaultValue, deserializer } = config.current;\n if (event.key === key) {\n setStoredValue(\n getItemFromStorage({\n key,\n fallback: defaultValue,\n deserializer,\n })\n );\n }\n };\n\n window.addEventListener(\"storage\", callback);\n return () => {\n window.removeEventListener(\"storage\", callback);\n };\n }, [key]);\n\n return {\n value,\n setValue,\n remove,\n persist,\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","useSsr","useIsomorphicLayoutEffect","identity","defaultLocalStorageSerializer","value","getItemFromStorage","options","key","fallback","storage","localStorage","deserializer","JSON","parse","getItem","e","setItemInStorage","serializer","stringify","setItem","removeItemFromStorage","removeItem","useLocalStorage","defaultValue","manual","initialValue","raw","ssr","setStoredValue","config","current","setValue","valueOrDispatcher","prevValue","nextValue","Function","remove","persist","callback","event","window","addEventListener","removeEventListener"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AACjE,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,QAAQ,QAAQ,sBAAsB;AA+D/C;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAAIC,QAC/C,OAAOA,UAAU,WAAWA,QAAQ,CAAC,EAAEA,MAAM,CAAC,CAAC;AAsBjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,MAAMC,qBAAqB,CAChCC;IAEA,MAAM,EACJC,GAAG,EACHC,QAAQ,EACRC,UAAUC,YAAY,EACtBC,eAAeC,KAAKC,KAAK,EAC1B,GAAGP;IACJ,IAAI,CAACC,KAAK;QACR,OAAOC;IACT;IAEA,IAAI;QACF,MAAMJ,QAAQK,QAAQK,OAAO,CAACP;QAC9B,OAAO,CAACH,QAAQI,WAAWG,aAAaP;IAC1C,EAAE,OAAOW,GAAG;QACV,OAAOP;IACT;AACF,EAAE;AAaF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMQ,mBAAmB,CAC9BV;IAEA,MAAM,EACJC,GAAG,EACHH,KAAK,EACLK,UAAUC,YAAY,EACtBO,aAAaL,KAAKM,SAAS,EAC5B,GAAGZ;IACJ,IAAI,CAACC,KAAK;QACR;IACF;IAEA,IAAI;QACFE,QAAQU,OAAO,CAACZ,KAAKU,WAAWb;IAClC,EAAE,OAAM;IACN,EAAE;IACJ;AACF,EAAE;AAaF;;;CAGC,GACD,OAAO,MAAMgB,wBAAwB,CACnCd;IAEA,MAAM,EAAEC,GAAG,EAAEE,UAAUC,YAAY,EAAE,GAAGJ;IACxC,IAAI,CAACC,KAAK;QACR;IACF;IAEA,IAAI;QACFE,QAAQY,UAAU,CAACd;IACrB,EAAE,OAAM;IACN,aAAa;IACf;AACF,EAAE;AAwDF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJC,GACD,OAAO,SAASe,gBACdhB,OAAmC;IAEnC,MAAM,EAAEC,GAAG,EAAEgB,YAAY,EAAEC,SAAS,KAAK,EAAE,GAAGlB;IAE9C,MAAM,CAACmB,aAAa,GAAG1B,SAASwB;IAChC,6EAA6E;IAC7E,oDAAoD;IACpD,MAAMG,MAAMpB,QAAQoB,GAAG,IAAI,OAAOD,iBAAiB;IACnD,MAAMR,aACJX,QAAQW,UAAU,IACjBS,CAAAA,MAAMvB,gCAAgCS,KAAKM,SAAS,AAAD;IACtD,MAAMP,eACJL,QAAQK,YAAY,IACnBe,CAAAA,OAAO,OAAOD,iBAAiB,WAAWvB,WAAWU,KAAKC,KAAK,AAAD;IAEjE,MAAMc,MAAM3B;IACZ,MAAM,CAACI,OAAOwB,eAAe,GAAG7B,SAAY;QAC1C,IAAI4B,KAAK;YACP,OAAOF;QACT;QAEA,MAAMrB,QAAQC,mBAAmB;YAC/BE;YACAC,UAAUiB;YACVd;QACF;QACA,IAAI,CAACa,QAAQ;YACXR,iBAAiB;gBACfT;gBACAH;gBACAa;YACF;QACF;QAEA,OAAOb;IACT;IACA,MAAMyB,SAAS/B,OAAO;QACpBS;QACAH;QACAoB;QACAP;QACAN;QACAY,cAAcE;IAChB;IACAxB,0BAA0B;QACxB4B,OAAOC,OAAO,GAAG;YACfvB;YACAH;YACAoB;YACAP;YACAN;YACAY,cAAcE;QAChB;IACF;IAEA,MAAMM,WAAWnC,YAA+B,CAACoC;QAC/C,MAAM,EAAEzB,GAAG,EAAEiB,MAAM,EAAEP,UAAU,EAAE,GAAGY,OAAOC,OAAO;QAClDF,eAAe,CAACK;YACd,MAAMC,YACJF,6BAA6BG,WACzBH,kBAAkBC,aAClBD;YAEN,IAAI,CAACR,QAAQ;gBACXR,iBAAiB;oBACfT;oBACAH,OAAO8B;oBACPjB;gBACF;YACF;YAEA,OAAOiB;QACT;IACF,GAAG,EAAE;IAEL,MAAME,SAASxC,YAAY;QACzBwB,sBAAsB;YACpBb,KAAKsB,OAAOC,OAAO,CAACvB,GAAG;QACzB;IACF,GAAG,EAAE;IAEL,MAAM8B,UAAUzC,YAAY;QAC1B,MAAM,EAAEW,GAAG,EAAEH,KAAK,EAAEa,UAAU,EAAE,GAAGY,OAAOC,OAAO;QACjDd,iBAAiB;YACfT;YACAH;YACAa;QACF;IACF,GAAG,EAAE;IAELpB,UAAU;QACR,MAAM,EAAE0B,YAAY,EAAEZ,YAAY,EAAEa,MAAM,EAAE,GAAGK,OAAOC,OAAO;QAC7D,IAAIN,UAAU,CAACG,KAAK;YAClB;QACF;QAEAI,SACE1B,mBAAmB;YACjBE;YACAC,UAAUe;YACVZ;QACF;IAEJ,GAAG;QAACJ;QAAKoB;QAAKI;KAAS;IAEvB,kEAAkE;IAClElC,UAAU;QACR,IAAI,CAACU,KAAK;YACR;QACF;QAEA,MAAM+B,WAAW,CAACC;YAChB,MAAM,EAAEhB,YAAY,EAAEZ,YAAY,EAAE,GAAGkB,OAAOC,OAAO;YACrD,IAAIS,MAAMhC,GAAG,KAAKA,KAAK;gBACrBqB,eACEvB,mBAAmB;oBACjBE;oBACAC,UAAUe;oBACVZ;gBACF;YAEJ;QACF;QAEA6B,OAAOC,gBAAgB,CAAC,WAAWH;QACnC,OAAO;YACLE,OAAOE,mBAAmB,CAAC,WAAWJ;QACxC;IACF,GAAG;QAAC/B;KAAI;IAER,OAAO;QACLH;QACA2B;QACAK;QACAC;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useOrientation.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useState } from \"react\";\n\n/**\n * An extremely simple \"polyfill\" for the `window.screen.orientation` just for\n * the `type` value that is required for the `useOrientation` hook.\n *\n * @see {@link https://caniuse.com/screen-orientation}\n * @returns the orientation type either from the `window.screen.orientation` or\n * by comparing the `availHeight` and `availWidth` on the `window.screen`\n * @internal\n */\nexport const getOrientationType = (): OrientationType => {\n if (typeof window === \"undefined\") {\n return \"landscape-primary\";\n }\n\n // Note: at the time of writing this, it looks like only Safari does not\n // support it from my list of browsers\n const screenOrientation = window.screen.orientation?.type;\n if (typeof screenOrientation === \"string\") {\n return screenOrientation;\n }\n\n const { availHeight, availWidth } = window.screen;\n\n return availHeight > availWidth ? \"portrait-primary\" : \"landscape-primary\";\n};\n\n/**\n * This hook uses the {@link https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation} API\n * to determine if the screen is landscape or portrait. For browsers that do not\n * support this API yet, it will polyfill that behavior using a resize handler\n * instead.\n *\n * @internal\n * @see {@link https://caniuse.com/screen-orientation}\n * @returns the current orientation type\n */\nexport function useOrientation(): OrientationType {\n const [orientation, setOrientation] = useState(getOrientationType);\n useEffect(() => {\n const handler = (): void => setOrientation(getOrientationType());\n\n const { orientation } = window.screen;\n if (orientation) {\n orientation.addEventListener(\"change\", handler);\n } else {\n window.addEventListener(\"resize\", handler);\n }\n\n return () => {\n if (orientation) {\n orientation.removeEventListener(\"change\", handler);\n } else {\n window.removeEventListener(\"resize\", handler);\n }\n };\n }, []);\n\n return orientation;\n}\n"],"names":["useEffect","useState","getOrientationType","window","screenOrientation","screen","orientation","type","availHeight","availWidth","useOrientation","setOrientation","handler","addEventListener","removeEventListener"],"mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAE5C;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAqB;IAChC,IAAI,OAAOC,WAAW,aAAa;QACjC,OAAO;IACT;IAEA,wEAAwE;IACxE,sCAAsC;IACtC,MAAMC,oBAAoBD,OAAOE,MAAM,CAACC,WAAW,EAAEC;IACrD,IAAI,OAAOH,sBAAsB,UAAU;QACzC,OAAOA;IACT;IAEA,MAAM,EAAEI,WAAW,EAAEC,UAAU,EAAE,GAAGN,OAAOE,MAAM;IAEjD,OAAOG,cAAcC,aAAa,qBAAqB;AACzD,EAAE;AAEF;;;;;;;;;CASC,GACD,OAAO,SAASC;IACd,MAAM,CAACJ,aAAaK,eAAe,GAAGV,SAASC;IAC/CF,UAAU;QACR,MAAMY,UAAU,IAAYD,eAAeT;QAE3C,MAAM,EAAEI,WAAW,EAAE,GAAGH,OAAOE,MAAM;QACrC,IAAIC,aAAa;YACfA,YAAYO,gBAAgB,CAAC,UAAUD;QACzC,OAAO;YACLT,OAAOU,gBAAgB,CAAC,UAAUD;QACpC;QAEA,OAAO;YACL,IAAIN,aAAa;gBACfA,YAAYQ,mBAAmB,CAAC,UAAUF;YAC5C,OAAO;gBACLT,OAAOW,mBAAmB,CAAC,UAAUF;YACvC;QACF;IACF,GAAG,EAAE;IAEL,OAAON;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/usePageInactive.ts"],"sourcesContent":["\"use client\";\nimport { useEffect } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * When this is set to `\"focus\"`, the change handler will be fired whenever the\n * window gains or loses focus.\n *\n * When this is set to `visibility`, the change handler will be fired when the\n * browser is no longer partially visible or becomes partially visible.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState\n * @remarks \\@since 6.0.0\n */\nexport type PageInactiveType = \"focus\" | \"visibility\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface PageInactiveOptions {\n /**\n * @see {@link PageInactiveType}\n * @defaultValue `\"focus\"`\n */\n type?: PageInactiveType;\n\n /**\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * This will be called whenever the page activity changes based on the\n * {@link PageInactiveType}.\n */\n onChange(active: boolean): void;\n\n /**\n * This will be fired whenever the {@link disabled} state is `true` which can\n * be useful for clearing pending timers or resetting state.\n *\n * Since this is passed to a `useEffect` as a dependency, you might have to\n * wrap this in a `useCallback` if unexpected re-rendering or errors occurs.\n *\n * @defaultValue `() => {}`\n */\n onDisabledCleanup?(): void;\n}\n\n/**\n * @example\n * ```ts\n * import { usePageInactive } from \"@react-md/core\";\n * import { useCallback, useEffect, useRef, useState } from \"react\";\n *\n * function Example(): null {\n * const [visible, setVisible] = useState(false);\n * const timeout = useRef<number | undefined>();\n * const startTimeout = useCallback(() => {\n * timeout.current = window.setTimeout(() => {\n * setVisible(false);\n * }, 10000);\n * }, []);\n *\n * usePageInactive({\n * onChange(active) {\n * if (!active) {\n * window.clearTimeout(timeout.current);\n * setVisible(false);\n * } else {\n * startTimeout();\n * }\n * }\n * });\n *\n * // pretend implementation\n * return null;\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function usePageInactive(options: PageInactiveOptions): void {\n const {\n type = \"focus\",\n disabled,\n onChange,\n onDisabledCleanup = noop,\n } = options;\n useEffect(() => {\n if (disabled) {\n onDisabledCleanup();\n return;\n }\n\n const callback = (event: Event): void => {\n let active = document.visibilityState === \"visible\";\n if (event.type === \"blur\") {\n active = false;\n } else if (event.type === \"focus\") {\n active = true;\n }\n\n onChange(active);\n };\n\n document.addEventListener(\"visibilitychange\", callback);\n if (type === \"focus\") {\n window.addEventListener(\"blur\", callback);\n window.addEventListener(\"focus\", callback);\n }\n\n return () => {\n document.removeEventListener(\"visibilitychange\", callback);\n window.removeEventListener(\"blur\", callback);\n window.removeEventListener(\"focus\", callback);\n };\n }, [disabled, onChange, onDisabledCleanup, type]);\n}\n"],"names":["useEffect","noop","usePageInactive","options","type","disabled","onChange","onDisabledCleanup","callback","event","active","document","visibilityState","addEventListener","window","removeEventListener"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,QAAQ;AAElC,MAAMC,OAAO;AACX,aAAa;AACf;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,SAASC,gBAAgBC,OAA4B;IAC1D,MAAM,EACJC,OAAO,OAAO,EACdC,QAAQ,EACRC,QAAQ,EACRC,oBAAoBN,IAAI,EACzB,GAAGE;IACJH,UAAU;QACR,IAAIK,UAAU;YACZE;YACA;QACF;QAEA,MAAMC,WAAW,CAACC;YAChB,IAAIC,SAASC,SAASC,eAAe,KAAK;YAC1C,IAAIH,MAAML,IAAI,KAAK,QAAQ;gBACzBM,SAAS;YACX,OAAO,IAAID,MAAML,IAAI,KAAK,SAAS;gBACjCM,SAAS;YACX;YAEAJ,SAASI;QACX;QAEAC,SAASE,gBAAgB,CAAC,oBAAoBL;QAC9C,IAAIJ,SAAS,SAAS;YACpBU,OAAOD,gBAAgB,CAAC,QAAQL;YAChCM,OAAOD,gBAAgB,CAAC,SAASL;QACnC;QAEA,OAAO;YACLG,SAASI,mBAAmB,CAAC,oBAAoBP;YACjDM,OAAOC,mBAAmB,CAAC,QAAQP;YACnCM,OAAOC,mBAAmB,CAAC,SAASP;QACtC;IACF,GAAG;QAACH;QAAUC;QAAUC;QAAmBH;KAAK;AAClD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useResizeListener.ts"],"sourcesContent":["\"use client\";\nimport { useEffect } from \"react\";\nimport { delegateEvent } from \"./delegateEvent.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { useResizeObserver } from \"./useResizeObserver.js\";\n\n/**\n * @remarks \\@since 6.0.0 Updated the API\n */\nexport interface ResizeListenerOptions extends AddEventListenerOptions {\n /**\n * Set this to `false` to disable throttling with\n * `window.requestAnimationFrame`.\n *\n * @defaultValue `true`\n */\n throttle?: boolean;\n\n /**\n * Set this to `true` to disable attaching the resize event handler.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * This function will be called whenever the resize event is fired on the\n * `window`. This should be wrapped in `useCallback`.\n */\n onUpdate(event: Event): void;\n}\n\n/**\n * This hook can be used to listen to the entire window resizing. If you need to\n * observe specific elements resizing, check out the {@link useResizeObserver}\n * hook instead.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { useResizeListener } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [size, setSize] = useState({\n * height: window.innerHeight,\n * width: window.innerWidth,\n * }):\n *\n * useResizeListener({\n * onUpdate(event) {\n * setSize({\n * height: window.innerHeight,\n * width: window.innerWidth,\n * });\n * },\n * });\n *\n * return (\n * <>\n * The current window size:\n * <pre><code>{JSON.stringify(size, null, 2)}</code></pre>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Updated the API to match the `useResizeObserver` and\n * `useIntersectionObserver` hooks by having an `onUpdate` callback and include\n * the `AddEventListenerOptions` as part of the hook options.\n */\nexport function useResizeListener(options: ResizeListenerOptions): void {\n const {\n once,\n signal,\n capture,\n passive,\n throttle = true,\n disabled = false,\n onUpdate,\n } = options;\n\n useEffect(() => {\n if (disabled) {\n return;\n }\n\n const eventHandler = delegateEvent(\"resize\", window, throttle, {\n once,\n signal,\n capture,\n passive,\n });\n eventHandler.add(onUpdate);\n\n window.dispatchEvent(new Event(\"resize\"));\n return () => {\n eventHandler.remove(onUpdate);\n };\n }, [capture, disabled, onUpdate, once, passive, signal, throttle]);\n}\n"],"names":["useEffect","delegateEvent","useResizeListener","options","once","signal","capture","passive","throttle","disabled","onUpdate","eventHandler","window","add","dispatchEvent","Event","remove"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,QAAQ;AAClC,SAASC,aAAa,QAAQ,qBAAqB;AA8BnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASC,kBAAkBC,OAA8B;IAC9D,MAAM,EACJC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,OAAO,EACPC,WAAW,IAAI,EACfC,WAAW,KAAK,EAChBC,QAAQ,EACT,GAAGP;IAEJH,UAAU;QACR,IAAIS,UAAU;YACZ;QACF;QAEA,MAAME,eAAeV,cAAc,UAAUW,QAAQJ,UAAU;YAC7DJ;YACAC;YACAC;YACAC;QACF;QACAI,aAAaE,GAAG,CAACH;QAEjBE,OAAOE,aAAa,CAAC,IAAIC,MAAM;QAC/B,OAAO;YACLJ,aAAaK,MAAM,CAACN;QACtB;IACF,GAAG;QAACJ;QAASG;QAAUC;QAAUN;QAAMG;QAASF;QAAQG;KAAS;AACnE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useResizeObserver.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, type Ref, type RefCallback } from \"react\";\nimport { useEnsuredRef } from \"./useEnsuredRef.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type useElementSize } from \"./useElementSize.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ResizeObserverEntryCallback = (entry: ResizeObserverEntry) => void;\n\n/** @internal */\ntype Unsubscribe = () => void;\n\n/** @internal */\ninterface TargetSize {\n height: number;\n width: number;\n scrollHeight: number;\n scrollWidth: number;\n}\n\n/** @internal */\ninterface TargetSubscription {\n readonly onUpdate: ResizeObserverEntryCallback;\n readonly disableHeight: boolean;\n readonly disableWidth: boolean;\n\n size?: TargetSize;\n}\n\n/** @internal */\ninterface SubscribeOptions {\n element: Element;\n onUpdate: ResizeObserverEntryCallback;\n disableHeight: boolean;\n disableWidth: boolean;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0 This was added to help with testing. The\n * `subscriptions` and `sharedObserver` used to be module-level variables but\n * moving to a class makes it easier to mock. Checkout the\n * `src/tests-utils/ResizeObserver.ts`\n */\nexport class ResizeObserverManager {\n frame: number;\n subscriptions: Map<Element, Set<TargetSubscription>>;\n\n /**\n * Why is there a single shared observer instead of multiple and a\n * \"subscription\" model?\n *\n * Note: Probably a bit of a premature optimization right now...\n *\n * @see https://github.com/WICG/resize-observer/issues/59\n * @internal\n */\n sharedObserver: ResizeObserver | undefined;\n\n constructor() {\n this.frame = 0;\n this.subscriptions = new Map();\n }\n\n subscribe = (options: SubscribeOptions): Unsubscribe => {\n const { element, onUpdate, disableHeight, disableWidth } = options;\n\n // lazy initialize the observer\n const observer =\n this.sharedObserver ||\n new ResizeObserver((entries) => {\n // this prevents the `ResizeObserver loop limit exceeded`\n window.cancelAnimationFrame(this.frame);\n this.frame = window.requestAnimationFrame(() => {\n this.handleResizeEntries(entries);\n });\n });\n this.sharedObserver = observer;\n\n const updates = this.subscriptions.get(element) || new Set();\n const subscription: TargetSubscription = {\n onUpdate,\n disableHeight,\n disableWidth,\n };\n updates.add(subscription);\n if (!this.subscriptions.has(element)) {\n this.subscriptions.set(element, updates);\n }\n\n observer.observe(element);\n\n return () => {\n observer.unobserve(element);\n updates.delete(subscription);\n };\n };\n\n handleResizeEntries = (entries: ResizeObserverEntry[]): void => {\n for (const entry of entries) {\n const targetSubscriptions = this.subscriptions.get(entry.target);\n // shouldn't really happen\n /* c8 ignore start */\n if (!targetSubscriptions) {\n continue;\n }\n /* c8 ignore end */\n\n const entries = targetSubscriptions.values();\n for (const subscription of entries) {\n const { height, width } = entry.contentRect;\n const { scrollHeight, scrollWidth } = entry.target;\n const { onUpdate, size, disableHeight, disableWidth } = subscription;\n const isHeightChange =\n !disableHeight &&\n (!size ||\n size.height !== height ||\n size.scrollHeight !== scrollHeight);\n const isWidthChange =\n !disableWidth &&\n (!size || size.width !== width || size.scrollWidth !== scrollWidth);\n\n subscription.size = {\n height,\n width,\n scrollHeight,\n scrollWidth,\n };\n if (isHeightChange || isWidthChange) {\n onUpdate(entry);\n }\n }\n }\n };\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const resizeObserverManager = new ResizeObserverManager();\n\n/**\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 Renamed from `UseResizeObserverOptions` and added\n * `onUpdate`/`disabled` options.\n */\nexport interface ResizeObserverHookOptions<E extends HTMLElement> {\n /**\n * An optional ref to merge with the ref returned by this hook.\n */\n ref?: Ref<E>;\n\n /**\n * **Must be wrapped in `useCallback` to prevent re-creating the\n * ResizeObserver each render.**\n *\n * This function will be called whenever the target element resizes.\n *\n * @see {@link useResizeObserver} for an example.\n */\n onUpdate: ResizeObserverEntryCallback;\n\n /**\n * Set this to `true` to prevent observing the element's size changes. THis is\n * equivalent to not attaching the returned ref to any element.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to `true` if the {@link onUpdate} should not be fired for height\n * changes.\n *\n * @defaultValue `false`\n */\n disableHeight?: boolean;\n\n /**\n * Set this to `true` if the {@link onUpdate} should not be fired for width\n * changes.\n *\n * @defaultValue `false`\n */\n disableWidth?: boolean;\n}\n\n/**\n * The resize observer is used to track the size changes of a specific element.\n * For most cases you can use the {@link useElementSize} instead, but this hook\n * can be used for more complex behavior with the {@link ResizeObserverEntry}.\n *\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 The API was updated to match the `useIntersectionObserver`\n * implementation -- accepts only a single object parameter and returns a\n * {@link RefCallback} instead of `[nodeRef, refCallback]`\n */\nexport function useResizeObserver<E extends HTMLElement>(\n options: ResizeObserverHookOptions<E>\n): RefCallback<E> {\n const {\n ref,\n onUpdate,\n disabled,\n disableHeight = false,\n disableWidth = false,\n } = options;\n\n const [targetNodeRef, refCallback] = useEnsuredRef(ref);\n useEffect(() => {\n const element = targetNodeRef.current;\n if (disabled || (disableHeight && disableWidth) || !element) {\n return;\n }\n\n const unsubscribe = resizeObserverManager.subscribe({\n element,\n onUpdate,\n disableHeight,\n disableWidth,\n });\n\n return () => {\n unsubscribe();\n };\n }, [disableHeight, disableWidth, disabled, onUpdate, targetNodeRef]);\n\n return refCallback;\n}\n"],"names":["useEffect","useEnsuredRef","ResizeObserverManager","constructor","frame","subscriptions","sharedObserver","subscribe","options","element","onUpdate","disableHeight","disableWidth","observer","ResizeObserver","entries","window","cancelAnimationFrame","requestAnimationFrame","handleResizeEntries","updates","get","Set","subscription","add","has","set","observe","unobserve","delete","entry","targetSubscriptions","target","values","height","width","contentRect","scrollHeight","scrollWidth","size","isHeightChange","isWidthChange","Map","resizeObserverManager","useResizeObserver","ref","disabled","targetNodeRef","refCallback","current","unsubscribe"],"mappings":"AAAA;;;;;;;;;;;;;;AACA,SAASA,SAAS,QAAoC,QAAQ;AAC9D,SAASC,aAAa,QAAQ,qBAAqB;AAsCnD;;;;;;CAMC,GACD,OAAO,MAAMC;IAeXC,aAAc;QAddC,uBAAAA,SAAAA,KAAAA;QACAC,uBAAAA,iBAAAA,KAAAA;QAEA;;;;;;;;GAQC,GACDC,uBAAAA,kBAAAA,KAAAA;QAOAC,uBAAAA,aAAY,CAACC;YACX,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,YAAY,EAAE,GAAGJ;YAE3D,+BAA+B;YAC/B,MAAMK,WACJ,IAAI,CAACP,cAAc,IACnB,IAAIQ,eAAe,CAACC;gBAClB,yDAAyD;gBACzDC,OAAOC,oBAAoB,CAAC,IAAI,CAACb,KAAK;gBACtC,IAAI,CAACA,KAAK,GAAGY,OAAOE,qBAAqB,CAAC;oBACxC,IAAI,CAACC,mBAAmB,CAACJ;gBAC3B;YACF;YACF,IAAI,CAACT,cAAc,GAAGO;YAEtB,MAAMO,UAAU,IAAI,CAACf,aAAa,CAACgB,GAAG,CAACZ,YAAY,IAAIa;YACvD,MAAMC,eAAmC;gBACvCb;gBACAC;gBACAC;YACF;YACAQ,QAAQI,GAAG,CAACD;YACZ,IAAI,CAAC,IAAI,CAAClB,aAAa,CAACoB,GAAG,CAAChB,UAAU;gBACpC,IAAI,CAACJ,aAAa,CAACqB,GAAG,CAACjB,SAASW;YAClC;YAEAP,SAASc,OAAO,CAAClB;YAEjB,OAAO;gBACLI,SAASe,SAAS,CAACnB;gBACnBW,QAAQS,MAAM,CAACN;YACjB;QACF;QAEAJ,uBAAAA,uBAAsB,CAACJ;YACrB,KAAK,MAAMe,SAASf,QAAS;gBAC3B,MAAMgB,sBAAsB,IAAI,CAAC1B,aAAa,CAACgB,GAAG,CAACS,MAAME,MAAM;gBAC/D,0BAA0B;gBAC1B,mBAAmB,GACnB,IAAI,CAACD,qBAAqB;oBACxB;gBACF;gBACA,iBAAiB,GAEjB,MAAMhB,UAAUgB,oBAAoBE,MAAM;gBAC1C,KAAK,MAAMV,gBAAgBR,QAAS;oBAClC,MAAM,EAAEmB,MAAM,EAAEC,KAAK,EAAE,GAAGL,MAAMM,WAAW;oBAC3C,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAE,GAAGR,MAAME,MAAM;oBAClD,MAAM,EAAEtB,QAAQ,EAAE6B,IAAI,EAAE5B,aAAa,EAAEC,YAAY,EAAE,GAAGW;oBACxD,MAAMiB,iBACJ,CAAC7B,iBACA,CAAA,CAAC4B,QACAA,KAAKL,MAAM,KAAKA,UAChBK,KAAKF,YAAY,KAAKA,YAAW;oBACrC,MAAMI,gBACJ,CAAC7B,gBACA,CAAA,CAAC2B,QAAQA,KAAKJ,KAAK,KAAKA,SAASI,KAAKD,WAAW,KAAKA,WAAU;oBAEnEf,aAAagB,IAAI,GAAG;wBAClBL;wBACAC;wBACAE;wBACAC;oBACF;oBACA,IAAIE,kBAAkBC,eAAe;wBACnC/B,SAASoB;oBACX;gBACF;YACF;QACF;QAzEE,IAAI,CAAC1B,KAAK,GAAG;QACb,IAAI,CAACC,aAAa,GAAG,IAAIqC;IAC3B;AAwEF;AAEA;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,IAAIzC,wBAAwB;AAiDjE;;;;;;;;;;CAUC,GACD,OAAO,SAAS0C,kBACdpC,OAAqC;IAErC,MAAM,EACJqC,GAAG,EACHnC,QAAQ,EACRoC,QAAQ,EACRnC,gBAAgB,KAAK,EACrBC,eAAe,KAAK,EACrB,GAAGJ;IAEJ,MAAM,CAACuC,eAAeC,YAAY,GAAG/C,cAAc4C;IACnD7C,UAAU;QACR,MAAMS,UAAUsC,cAAcE,OAAO;QACrC,IAAIH,YAAanC,iBAAiBC,gBAAiB,CAACH,SAAS;YAC3D;QACF;QAEA,MAAMyC,cAAcP,sBAAsBpC,SAAS,CAAC;YAClDE;YACAC;YACAC;YACAC;QACF;QAEA,OAAO;YACLsC;QACF;IACF,GAAG;QAACvC;QAAeC;QAAckC;QAAUpC;QAAUqC;KAAc;IAEnE,OAAOC;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useThrottledFunction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { AnyFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ThrottledFunction<F extends AnyFunction> = (\n ...args: Parameters<F>\n) => ReturnType<F>;\n\n/**\n * Creates a function that will only be called once every X milliseconds.\n *\n * @example\n * Throttling Search API Requests\n * ```tsx\n * import { TextField, useThrottledFunction, useUnmounted } from \"@react-md/core\";\n * import { useState } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * interface State {\n * error?: unknown\n * loading: boolean;\n * results?: {\n * // pretend some search results\n * id: string;\n * name: string;\n * }[];\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * loading: false,\n * });\n * // this is only required for async actions\n * const unmounted = useUnmounted();\n *\n * // A new search request will be fired once every 500ms as the user types.\n * // can't use the event here since React uses synthetic events\n * const search = useThrottledFunction(async (q: string) => {\n * setState({\n * loading: true,\n * error: undefined,\n * results: undefined,\n * });\n *\n * try {\n * const response = await fetch('/search', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * },\n * body: JSON.stringify({ q }),\n * });\n * const json = await response.json();\n *\n * if (!unmounted.current) {\n * setState({\n * loading: false,\n * results: json,\n * });\n * }\n * } catch (error) {\n * if (!unmounted.current) {\n * setState({\n * error,\n * loading: false,\n * });\n * }\n * }\n * }, 500);\n *\n * return (\n * <TextField\n * type=\"search\"\n * label=\"Search\"\n * onChange={(event) => search(event.currentTarget.value)}\n * />\n * );\n * }\n * ```\n *\n * @see `useDebouncedFunction` for debounce behavior instead. (Call a\n * function only if it has not been called again for X milliseconds).\n * @remarks \\@since 6.0.0\n */\nexport function useThrottledFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): ThrottledFunction<F> {\n const args = useRef<Parameters<F>>();\n const result = useRef<ReturnType<F>>();\n const timeout = useRef<number | undefined>();\n const funcRef = useRef(func);\n const lastCalledTime = useRef(0);\n\n useIsomorphicLayoutEffect(() => {\n funcRef.current = func;\n });\n\n useEffect(() => {\n return () => {\n window.clearTimeout(timeout.current);\n };\n }, []);\n\n return useCallback(\n (...nextArgs) => {\n args.current = nextArgs;\n\n const now = Date.now();\n const remaining = wait - (now - lastCalledTime.current);\n if (remaining <= 0 || remaining > wait) {\n lastCalledTime.current = now;\n result.current = funcRef.current(...args.current);\n } else if (!timeout.current) {\n timeout.current = window.setTimeout(() => {\n lastCalledTime.current = Date.now();\n timeout.current = undefined;\n // should exist by this time\n result.current = funcRef.current(...(args.current as Parameters<F>));\n }, remaining);\n }\n\n return result.current as ReturnType<F>;\n },\n [wait]\n );\n}\n"],"names":["useCallback","useEffect","useRef","useIsomorphicLayoutEffect","useThrottledFunction","func","wait","args","result","timeout","funcRef","lastCalledTime","current","window","clearTimeout","nextArgs","now","Date","remaining","setTimeout","undefined"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAEvD,SAASC,yBAAyB,QAAQ,iCAAiC;AAS3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,OAAOL;IACb,MAAMM,SAASN;IACf,MAAMO,UAAUP;IAChB,MAAMQ,UAAUR,OAAOG;IACvB,MAAMM,iBAAiBT,OAAO;IAE9BC,0BAA0B;QACxBO,QAAQE,OAAO,GAAGP;IACpB;IAEAJ,UAAU;QACR,OAAO;YACLY,OAAOC,YAAY,CAACL,QAAQG,OAAO;QACrC;IACF,GAAG,EAAE;IAEL,OAAOZ,YACL,CAAC,GAAGe;QACFR,KAAKK,OAAO,GAAGG;QAEf,MAAMC,MAAMC,KAAKD,GAAG;QACpB,MAAME,YAAYZ,OAAQU,CAAAA,MAAML,eAAeC,OAAO,AAAD;QACrD,IAAIM,aAAa,KAAKA,YAAYZ,MAAM;YACtCK,eAAeC,OAAO,GAAGI;YACzBR,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAIL,KAAKK,OAAO;QAClD,OAAO,IAAI,CAACH,QAAQG,OAAO,EAAE;YAC3BH,QAAQG,OAAO,GAAGC,OAAOM,UAAU,CAAC;gBAClCR,eAAeC,OAAO,GAAGK,KAAKD,GAAG;gBACjCP,QAAQG,OAAO,GAAGQ;gBAClB,4BAA4B;gBAC5BZ,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAKL,KAAKK,OAAO;YACnD,GAAGM;QACL;QAEA,OAAOV,OAAOI,OAAO;IACvB,GACA;QAACN;KAAK;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useToggle.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { UseStateInitializer, UseStateSetter } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToggleHookReturnValue {\n toggled: boolean;\n setToggled: UseStateSetter<boolean>;\n toggle(): void;\n enable(): void;\n disable(): void;\n}\n\n/**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Button, useToggle } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggled, toggle } = useToggle();\n *\n * return (\n * <>\n * <Button onClick=[toggle]>Toggle</Button>\n * {`Toggled: ${toggled}`}\n * </>\n * );\n * }\n * ```\n *\n * @param defaultValue - `false`\n */\nexport function useToggle(\n defaultValue: UseStateInitializer<boolean> = false\n): Readonly<ToggleHookReturnValue> {\n const [toggled, setToggled] = useState(defaultValue);\n\n return {\n toggled,\n setToggled,\n toggle: useCallback(() => {\n setToggled((prevToggled) => !prevToggled);\n }, []),\n enable: useCallback(() => {\n setToggled(true);\n }, []),\n disable: useCallback(() => {\n setToggled(false);\n }, []),\n };\n}\n"],"names":["useCallback","useState","useToggle","defaultValue","toggled","setToggled","toggle","prevToggled","enable","disable"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAc9C;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASC,UACdC,eAA6C,KAAK;IAElD,MAAM,CAACC,SAASC,WAAW,GAAGJ,SAASE;IAEvC,OAAO;QACLC;QACAC;QACAC,QAAQN,YAAY;YAClBK,WAAW,CAACE,cAAgB,CAACA;QAC/B,GAAG,EAAE;QACLC,QAAQR,YAAY;YAClBK,WAAW;QACb,GAAG,EAAE;QACLI,SAAST,YAAY;YACnBK,WAAW;QACb,GAAG,EAAE;IACP;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useUnmounted.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport type { NonNullRef } from \"./types.js\";\n\n/**\n * @example\n * Simple Example\n * ```tsx\n * import { useUnmounted } from \"@react-md/core\";\n * import { useEffect, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState({ loading: false });\n * const unmounted = useUnmounted();\n *\n * useEffect(() => {\n * async function load(): void {\n * const result = await fetch('/some-api');\n * const json = await response.json();\n * if (!unmounted.current) {\n * setState({ loading: false, result: json });\n * }\n * }\n *\n * setState({ loading: true });\n * load();\n * }, [unmounted]);\n *\n * return null;\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useUnmounted(): NonNullRef<boolean> {\n const unmounted = useRef(false);\n useEffect(() => {\n unmounted.current = false;\n return () => {\n unmounted.current = true;\n };\n }, []);\n\n return unmounted;\n}\n"],"names":["useEffect","useRef","useUnmounted","unmounted","current"],"mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC;IACd,MAAMC,YAAYF,OAAO;IACzBD,UAAU;QACRG,UAAUC,OAAO,GAAG;QACpB,OAAO;YACLD,UAAUC,OAAO,GAAG;QACtB;IACF,GAAG,EAAE;IAEL,OAAOD;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/useWindowSize.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport { useSsr } from \"./SsrProvider.js\";\nimport { type ElementSize } from \"./types.js\";\nimport {\n useResizeListener,\n type ResizeListenerOptions,\n} from \"./useResizeListener.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface WindowSizeOptions\n extends Omit<ResizeListenerOptions, \"disabled\" | \"onUpdate\"> {\n /**\n * The default value to use in SSR environments for the window's height.\n *\n * @defaultValue `0`\n */\n ssrHeight?: number;\n\n /**\n * The default value to use in SSR environments for the window's width.\n *\n * @defaultValue `0`\n */\n ssrWidth?: number;\n\n /**\n * Set this to `true` to ignore resize events that only updated the height.\n * The hook can be disabled by setting this and {@link disableWidth} to\n * `true`.\n *\n * @defaultValue `false`\n */\n disableHeight?: boolean;\n\n /**\n * Set this to `true` to ignore resize events that only updated the width.\n * The hook can be disabled by setting this and {@link disableHeight} to\n * `true`.\n *\n * @defaultValue `false`\n */\n disableWidth?: boolean;\n}\n\n/**\n * This is just a convenience wrapper around the {@link useResizeListener}.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { useWindowSize } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const { height, width } = useWindowSize();\n *\n * return (\n * <>\n * The current window size:\n * <pre><code>{JSON.stringify(size, null, 2)}</code></pre>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useWindowSize(options: WindowSizeOptions = {}): ElementSize {\n const {\n once,\n signal,\n capture,\n passive,\n throttle,\n ssrHeight = 0,\n ssrWidth = 0,\n disableWidth,\n disableHeight,\n } = options;\n\n const ssr = useSsr();\n const [size, setSize] = useState(() => {\n if (typeof window === \"undefined\" || ssr) {\n return {\n height: ssrHeight,\n width: ssrWidth,\n };\n }\n\n return {\n height: window.innerHeight,\n width: window.innerWidth,\n };\n });\n\n useResizeListener({\n once,\n signal,\n capture,\n passive,\n throttle,\n disabled: disableHeight && disableWidth,\n onUpdate: useCallback(() => {\n setSize((prevSize) => {\n const nextSize: ElementSize = {\n height: window.innerHeight,\n width: window.innerWidth,\n };\n\n const isHeightChange =\n !disableHeight && prevSize.height !== nextSize.height;\n const isWidthChange =\n !disableWidth && prevSize.width !== nextSize.width;\n\n return isHeightChange || isWidthChange ? nextSize : prevSize;\n });\n }, [disableHeight, disableWidth]),\n });\n\n return size;\n}\n"],"names":["useCallback","useState","useSsr","useResizeListener","useWindowSize","options","once","signal","capture","passive","throttle","ssrHeight","ssrWidth","disableWidth","disableHeight","ssr","size","setSize","window","height","width","innerHeight","innerWidth","disabled","onUpdate","prevSize","nextSize","isHeightChange","isWidthChange"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC9C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SACEC,iBAAiB,QAEZ,yBAAyB;AAwChC;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,SAASC,cAAcC,UAA6B,CAAC,CAAC;IAC3D,MAAM,EACJC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,YAAY,CAAC,EACbC,WAAW,CAAC,EACZC,YAAY,EACZC,aAAa,EACd,GAAGT;IAEJ,MAAMU,MAAMb;IACZ,MAAM,CAACc,MAAMC,QAAQ,GAAGhB,SAAS;QAC/B,IAAI,OAAOiB,WAAW,eAAeH,KAAK;YACxC,OAAO;gBACLI,QAAQR;gBACRS,OAAOR;YACT;QACF;QAEA,OAAO;YACLO,QAAQD,OAAOG,WAAW;YAC1BD,OAAOF,OAAOI,UAAU;QAC1B;IACF;IAEAnB,kBAAkB;QAChBG;QACAC;QACAC;QACAC;QACAC;QACAa,UAAUT,iBAAiBD;QAC3BW,UAAUxB,YAAY;YACpBiB,QAAQ,CAACQ;gBACP,MAAMC,WAAwB;oBAC5BP,QAAQD,OAAOG,WAAW;oBAC1BD,OAAOF,OAAOI,UAAU;gBAC1B;gBAEA,MAAMK,iBACJ,CAACb,iBAAiBW,SAASN,MAAM,KAAKO,SAASP,MAAM;gBACvD,MAAMS,gBACJ,CAACf,gBAAgBY,SAASL,KAAK,KAAKM,SAASN,KAAK;gBAEpD,OAAOO,kBAAkBC,gBAAgBF,WAAWD;YACtD;QACF,GAAG;YAACX;YAAeD;SAAa;IAClC;IAEA,OAAOG;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/RenderRecursively.tsx"],"sourcesContent":["// TODO: Figure out how to strictly enforce the data\nimport { type ComponentType, type ReactElement, type ReactNode } from \"react\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type RecursiveItem<T = Record<string, unknown>> = T & {\n items?: readonly RecursiveItem<T>[];\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface RenderRecursiveItemsProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n\n /**\n * The current item to render.\n */\n item: RecursiveItem<Item>;\n\n /**\n * The list of parent items which can be used to determine the depth or \"share\n * props\" if the items contained props.\n */\n parents: readonly RecursiveItem<Item>[];\n\n /**\n * This will be provided if the {@link item} had child items and will be the\n * rendered content.\n */\n children?: ReactNode;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface RenderRecursivelyProps<\n Item = Record<string, unknown>,\n Data = unknown,\n> {\n data?: Data;\n items: readonly RecursiveItem<Item>[];\n\n /**\n * The renderer for each item.\n */\n render: ComponentType<RenderRecursiveItemsProps<Item, Data>>;\n\n /**\n * This should not be used for external users. This is used to build the\n * {@link RenderRecursiveItemsProps.parents} list.\n *\n * @internal\n * @defaultValue `[]`\n */\n parents?: readonly RecursiveItem<Item>[];\n\n /**\n * Gets a React `key` for a specific item. This should be provided if the\n * items can be moved around to improve performance.\n *\n * @example\n * ```ts\n * getItemKey={(item) => item.id}\n * ```\n *\n * @defaultValue `() => ${parents.length}-${index}`.\n */\n getItemKey?(item: RecursiveItem<Item>): string;\n}\n\n/**\n * Helper component for recursively rendering specific data structures (mostly\n * trees). The main use-case is for rendering site navigation and the `Tree`\n * component.\n *\n * @example\n * ```tsx\n * import {\n * buildTree,\n * List,\n * ListItem,\n * ListItemLink,\n * RenderRecursively,\n * TreeData,\n * type DefaultTreeItemNode,\n * type RenderRecursiveItemsProps,\n * } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * const navItems = {\n * \"/\": {\n * href: \"/\",\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Collapsible\",\n * },\n * \"/nested-route-1\": {\n * itemId: \"/nested-route-1\",\n * parentId: \"/route-1\",\n * children: \"Child 1\",\n * },\n * \"/nested-route-2\": {\n * itemId: \"/nested-route-2\",\n * parentId: \"/route-2\",\n * children: \"Child 2\",\n * },\n * \"/divider-1\": {\n * itemId: \"/divider-1\",\n * parentId: null\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\"\n * parentId: null,\n * children: \"Route 2\",\n * },\n * } satisfies TreeData;\n *\n * function NestedNavigation(props: RenderRecursiveItemsProps<DefaultTreeItemNode>): ReactElement {\n * const { item, parents, children } = props;\n * const { toggle, toggled: collapsed } = useToggle(false);\n * const { elementProps } = useCollapseTransition({\n * transitionIn: !collapsed,\n * });\n *\n * return (\n * <li>\n * <Button onClick={toggle}>{item.children}</Button>\n * <List {...elementProps}>{children}</List>\n * </li>\n * ):\n * }\n *\n *\n * function Render(props: RenderRecursiveItemsProps<DefaultTreeItemNode>): ReactElement {\n * const { item, parents } = props;\n * if (item.itemId.includes(\"divider\")) {\n * return <Divider />;\n * }\n *\n * if (item.items) {\n * return <NestedNavigation {...props} />\n * }\n *\n * const prefix = parents.map((parent) => parent.itemId).join(\"/\");\n * return (\n * <Link href={`${prefix}${item.itemId}`}>\n * {item.children}\n * </Link>\n * );\n * }\n * ```\n *\n *\n * @remarks \\@since 6.0.0\n */\nexport function RenderRecursively<Item, Data>(\n props: RenderRecursivelyProps<Item, Data>\n): ReactElement {\n const { data, items, render: Render, getItemKey, parents = [] } = props;\n\n return (\n <>\n {items.map((item, index) => {\n let children: ReactNode;\n const depth = parents.length;\n if (item.items?.length) {\n children = (\n <RenderRecursively\n data={data}\n items={item.items}\n render={Render}\n getItemKey={getItemKey}\n parents={[...parents, item]}\n />\n );\n }\n\n return (\n <Render\n key={getItemKey ? getItemKey(item) : `${depth}-${index}`}\n // typecast since it should be undefined in renderer as well?\n data={data}\n item={item}\n parents={parents}\n >\n {children}\n </Render>\n );\n })}\n </>\n );\n}\n"],"names":["RenderRecursively","props","data","items","render","Render","getItemKey","parents","map","item","index","children","depth","length"],"mappings":"AAAA,oDAAoD;;AA2EpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFC,GACD,OAAO,SAASA,kBACdC,KAAyC;IAEzC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQC,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAE,EAAE,GAAGN;IAElE,qBACE;kBACGE,MAAMK,GAAG,CAAC,CAACC,MAAMC;YAChB,IAAIC;YACJ,MAAMC,QAAQL,QAAQM,MAAM;YAC5B,IAAIJ,KAAKN,KAAK,EAAEU,QAAQ;gBACtBF,yBACE,KAACX;oBACCE,MAAMA;oBACNC,OAAOM,KAAKN,KAAK;oBACjBC,QAAQC;oBACRC,YAAYA;oBACZC,SAAS;2BAAIA;wBAASE;qBAAK;;YAGjC;YAEA,qBACE,KAACJ;gBAEC,6DAA6D;gBAC7DH,MAAMA;gBACNO,MAAMA;gBACNF,SAASA;0BAERI;eANIL,aAAaA,WAAWG,QAAQ,CAAC,EAAEG,MAAM,CAAC,EAAEF,MAAM,CAAC;QAS9D;;AAGN"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/alphaNumericSort.ts"],"sourcesContent":["import type { TextExtractor } from \"../types.js\";\n\nconst identity = <T>(item: T): string => {\n if (typeof item === \"string\") {\n return item;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"A `TextExtractor` must be provided to `alphaNumericSort` for lists that do not contain strings\"\n );\n }\n\n return \"\";\n};\n\n/**\n * The default `Intl.Collator` that should be used for sorting large lists.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare#performance\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_COLLATOR = new Intl.Collator(\"en-US\", {\n numeric: true,\n caseFirst: \"upper\",\n});\n\n/** @remarks \\@since 6.0.0 */\nexport interface AlphaNumericSortOptions<T> {\n /**\n * The extractor is only required when the list of items are not strings.\n *\n * @example\n * Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * `alphaNumericSort(items, {\n * extractor: item => item.name,\n * })`\n * ```\n *\n * @remarks\n * For javascript developers, this will throw an error in dev mode if an\n * extractor is not provided for non-string lists.\n *\n * @defaultValue `typeof item === \"string\" ? item : \"\"`\n */\n extractor?: TextExtractor<T>;\n\n /**\n * A custom compare function for sorting the list. This should really only be\n * provided if the language for your app is not `\"en-US\"` or you'd like to\n * provide some custom sorting options.\n *\n * @example\n * Custom Compare using Intl.Collator\n * ```ts\n * const collator = new Intl.Collator(\"en-US\", {\n * numeric: false,\n * caseFirst: \"lower\",\n * usage: \"search\",\n * });\n *\n * alphaNumericSort(items, {\n * compare: collator.compare,\n * })\n * ```\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator\n * @defaultValue `new Intl.Collator(\"en-US\", { numeric: true, caseFirst: \"upper\" }).compare`\n */\n compare?(a: string, b: string): number;\n\n /**\n * Setting this to `true` will return the list in descending order instead of\n * ascending.\n *\n * @defaultValue `false`\n */\n descending?: boolean;\n}\n\n/**\n * @example\n * Simple Example\n * ```ts\n * const items = [\"World\", \"Hello\"];\n *\n * const sorted = alphaNumericSort(items);\n * // sorted == [\"Hello\", \"World\"]\n * ```\n *\n * @param list - The list of strings to sort\n * @returns a new sorted list\n */\nexport function alphaNumericSort<T extends string>(\n list: readonly T[],\n options?: Omit<AlphaNumericSortOptions<T>, \"extractor\">\n): readonly T[];\n/**\n * @example\n * Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: \"World\" }, { name: \"Hello\" }];\n *\n * const sorted = alphaNumericSort(items, {\n * extractor: item => item.name,\n * });\n * // sorted == [{ name: \"Hello\" }, { name: \"World\" }]\n * ```\n *\n * @param list - The list of items to sort\n * @returns a new sorted list\n */\nexport function alphaNumericSort<T>(\n list: readonly T[],\n options: AlphaNumericSortOptions<T> & { extractor: TextExtractor<T> }\n): readonly T[];\nexport function alphaNumericSort<T>(\n list: readonly T[],\n options: AlphaNumericSortOptions<T> = {}\n): readonly T[] {\n const {\n compare = DEFAULT_COLLATOR.compare,\n extractor = identity,\n descending = false,\n } = options;\n\n const sorted = list.slice();\n sorted.sort((a, b) => {\n const aValue = extractor(a);\n const bValue = extractor(b);\n\n const value1 = descending ? bValue : aValue;\n const value2 = descending ? aValue : bValue;\n\n return compare(value1, value2);\n });\n\n return sorted;\n}\n"],"names":["identity","item","process","env","NODE_ENV","Error","DEFAULT_COLLATOR","Intl","Collator","numeric","caseFirst","alphaNumericSort","list","options","compare","extractor","descending","sorted","slice","sort","a","b","aValue","bValue","value1","value2"],"mappings":"AAEA,MAAMA,WAAW,CAAIC;IACnB,IAAI,OAAOA,SAAS,UAAU;QAC5B,OAAOA;IACT;IAEA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,MAAM,IAAIC,MACR;IAEJ;IAEA,OAAO;AACT;AAEA;;;;;CAKC,GACD,OAAO,MAAMC,mBAAmB,IAAIC,KAAKC,QAAQ,CAAC,SAAS;IACzDC,SAAS;IACTC,WAAW;AACb,GAAG;AAsGH,OAAO,SAASC,iBACdC,IAAkB,EAClBC,UAAsC,CAAC,CAAC;IAExC,MAAM,EACJC,UAAUR,iBAAiBQ,OAAO,EAClCC,YAAYf,QAAQ,EACpBgB,aAAa,KAAK,EACnB,GAAGH;IAEJ,MAAMI,SAASL,KAAKM,KAAK;IACzBD,OAAOE,IAAI,CAAC,CAACC,GAAGC;QACd,MAAMC,SAASP,UAAUK;QACzB,MAAMG,SAASR,UAAUM;QAEzB,MAAMG,SAASR,aAAaO,SAASD;QACrC,MAAMG,SAAST,aAAaM,SAASC;QAErC,OAAOT,QAAQU,QAAQC;IACzB;IAEA,OAAOR;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/applyRef.ts"],"sourcesContent":["import type { MutableRefObject, Ref } from \"react\";\n\n/**\n * A small utility function that allows me to apply a passed in ref along with\n * my own custom ref logic.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { HTMLAttributes, forwardRef } from \"react\";\n * import { applyRef } from \"@react-md/core\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const refHandler = useCallback((instance: HTMLDivElement | null) => {\n * applyRef(instance, ref);\n * if (!instance) {\n * return;\n * }\n *\n * // do something with instance\n * });\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @param instance - The DOM Node instance\n * @param ref - The prop ref\n * @internal\n */\nexport function applyRef<E>(instance: E | null, ref: Ref<E> | undefined): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (typeof ref === \"object\") {\n (ref as MutableRefObject<E | null>).current = instance;\n }\n}\n"],"names":["applyRef","instance","ref","current"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,SAASA,SAAYC,QAAkB,EAAEC,GAAuB;IACrE,IAAI,CAACA,KAAK;QACR;IACF;IAEA,IAAI,OAAOA,QAAQ,YAAY;QAC7BA,IAAID;IACN,OAAO,IAAI,OAAOC,QAAQ,UAAU;QACjCA,IAAmCC,OAAO,GAAGF;IAChD;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/bem.ts"],"sourcesContent":["export type Block = string;\nexport type Element = string;\nexport type Modifier = Record<string, unknown>;\n\nfunction modify(base: string, modifier?: Modifier): string {\n if (!modifier) {\n return base;\n }\n\n const hasOwn = Object.prototype.hasOwnProperty;\n return Object.keys(modifier).reduce((s, mod) => {\n if (hasOwn.call(modifier, mod) && modifier[mod]) {\n s = `${s} ${base}--${mod}`;\n }\n\n return s;\n }, base);\n}\n\nexport type BEMResult = (\n elementOrModifier?: Element | Modifier,\n modifier?: Modifier\n) => string;\n\n/**\n * Applies the BEM styled class name to an element.\n *\n * @example\n * Simple Example\n * ```jsx\n * import { Bem } from \"@react-md/core\":\n *\n * const styles = bem(\"my-component\"):\n *\n * export function MyComponent(props) {\n * const className = styles({\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * }):\n * const childClassName = styles('child', {\n * always: true,\n * never: false,\n * \"some-condition\": props.something,\n * });\n *\n * // With a false-like `props.something`\n * // className === \"my-component__child my-component__child--always\"\n * // childClassName === \"my-component my-component--always\"\n * // With a truthy `props.something`\n * // className === \"my-component my-component--always my-component--some-condition\"\n * // childClassName === \"my-component__child my-component__child--always my-component__child--some-condition\"\n *\n * return (\n * <div className={className}>\n * <div className={childClassName} />\n * </div>\n * ):\n * }\n * ```\n *\n * @see https://en.bem.info/methodology/css/\n * @param base - The base class to use\n * @returns a function to call that generates the full class name\n */\nexport function bem(base: Block): BEMResult {\n if (process.env.NODE_ENV !== \"production\") {\n if (!base) {\n throw new Error(\n \"bem requires a base block class but none were provided.\"\n );\n }\n }\n\n /**\n * Creates the full class name from the base block name. This can be called\n * without any arguments which will just return the base block name (kind of\n * worthless), or you can provide a child element name and modifiers.\n *\n * @param elementOrModifier - This is either the child element name or an\n * object of modifiers to apply. This **must** be a string if the second\n * argument is provided.\n * @param modifier - Any optional modifiers to apply to the block and optional\n * element.\n * @returns the full class name\n */\n return function block(\n elementOrModifier?: Element | Modifier,\n modifier?: Modifier\n ): string {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof elementOrModifier !== \"string\" && modifier) {\n throw new TypeError(\n \"bem does not support having two modifier arguments.\"\n );\n }\n }\n\n if (!elementOrModifier) {\n return base;\n }\n\n if (typeof elementOrModifier !== \"string\") {\n return modify(base, elementOrModifier);\n }\n\n return modify(`${base}__${elementOrModifier}`, modifier);\n };\n}\n"],"names":["modify","base","modifier","hasOwn","Object","prototype","hasOwnProperty","keys","reduce","s","mod","call","bem","process","env","NODE_ENV","Error","block","elementOrModifier","TypeError"],"mappings":"AAIA,SAASA,OAAOC,IAAY,EAAEC,QAAmB;IAC/C,IAAI,CAACA,UAAU;QACb,OAAOD;IACT;IAEA,MAAME,SAASC,OAAOC,SAAS,CAACC,cAAc;IAC9C,OAAOF,OAAOG,IAAI,CAACL,UAAUM,MAAM,CAAC,CAACC,GAAGC;QACtC,IAAIP,OAAOQ,IAAI,CAACT,UAAUQ,QAAQR,QAAQ,CAACQ,IAAI,EAAE;YAC/CD,IAAI,CAAC,EAAEA,EAAE,CAAC,EAAER,KAAK,EAAE,EAAES,IAAI,CAAC;QAC5B;QAEA,OAAOD;IACT,GAAGR;AACL;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCC,GACD,OAAO,SAASW,IAAIX,IAAW;IAC7B,IAAIY,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACd,MAAM;YACT,MAAM,IAAIe,MACR;QAEJ;IACF;IAEA;;;;;;;;;;;GAWC,GACD,OAAO,SAASC,MACdC,iBAAsC,EACtChB,QAAmB;QAEnB,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,IAAI,OAAOG,sBAAsB,YAAYhB,UAAU;gBACrD,MAAM,IAAIiB,UACR;YAEJ;QACF;QAEA,IAAI,CAACD,mBAAmB;YACtB,OAAOjB;QACT;QAEA,IAAI,OAAOiB,sBAAsB,UAAU;YACzC,OAAOlB,OAAOC,MAAMiB;QACtB;QAEA,OAAOlB,OAAO,CAAC,EAAEC,KAAK,EAAE,EAAEiB,kBAAkB,CAAC,EAAEhB;IACjD;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/filters.ts"],"sourcesContent":["import type { TextExtractor } from \"../types.js\";\n\n/** @internal */\nconst identity =\n <T>(name: string) =>\n (item: T): string => {\n if (typeof item === \"string\") {\n return item;\n }\n\n throw new Error(\n `A \\`TextExtractor\\` must be provided to \\`${name}\\` for lists that do not contain strings`\n );\n };\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface BaseFilterOptions<T> {\n list: readonly T[];\n\n /**\n * The current query string. i.e. `\"SeArch\"`\n */\n query: string;\n\n /**\n * This is required if the list includes anything other than strings.\n * @see {@link TextExtractor}\n */\n extractor?: TextExtractor<T>;\n\n /**\n * @defaultValue `\"keep\"`\n */\n whitespace?: \"ignore\" | \"trim\" | \"keep\";\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface FilterOptions<T> extends BaseFilterOptions<T> {\n filter(query: string, value: string): boolean;\n extractor: TextExtractor<T>;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nconst toSearchString = (\n s: string,\n whitespace: \"trim\" | \"ignore\" | \"keep\"\n): string => {\n let q = s.toLowerCase();\n if (whitespace === \"ignore\") {\n q = q.replace(/\\s/g, \"\");\n } else if (whitespace === \"trim\") {\n q = q.trim();\n }\n\n return q;\n};\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nfunction filter<T>(options: FilterOptions<T>): readonly T[] {\n const { list, query, filter, extractor, whitespace = \"keep\" } = options;\n if (!list.length) {\n return list;\n }\n\n const q = toSearchString(query, whitespace);\n if (!q) {\n return list;\n }\n\n return list.filter((item) =>\n filter(q, toSearchString(extractor(item), whitespace))\n );\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CaseInsensitiveOptions<T> extends BaseFilterOptions<T> {\n /**\n * Set this to `true` if the item in the list must start with the query\n * instead of only including it.\n *\n * @example\n * ```ts\n * const fruits = [\"Apple\", \"Banana\", \"Grape\", \"Orange\"];\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \"ap\",\n * });\n * // [\"Apple\", \"Grape\"]\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \"ap\",\n * startsWith: true,\n * });\n * // [\"Apple\"]\n * ```\n *\n * @defaultValue `false`\n */\n startsWith?: boolean;\n}\n\n/**\n * @example\n * String list\n * ```ts\n * const fruits = [\"Apple\", \"Banana\", \"Grape\", \"Orange\"];\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \"ap\",\n * });\n * // [\"Apple\", \"Grape\"]\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \"ap\",\n * startsWith: true,\n * });\n * // [\"Apple\"]\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \" a p\",\n * });\n * // []\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \" a p\",\n * whitespace: \"ignore\",\n * });\n * // [\"Apple\", \"Grape\"]\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \" ap \",\n * whitespace: \"trim\",\n * });\n * // [\"Apple\", \"Grape\"]\n * ```\n *\n * @example\n * Objects\n * ```ts\n * const fruits = [\n * { name: \"Apple\", value: 0 },\n * { name: \"Banana\", value: 1 },\n * { name: \"Grape\", value: 2 },\n * { name: \"Orange\", value: 3 },\n * ];\n *\n * caseInsensitiveFilter({\n * list: fruits,\n * query: \"ap\",\n * extractor: (item) => item.name,\n * });\n * // [{ name: \"Apple\", value: 0 }, { name: \"Grape\", value: 2 }]\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function caseInsensitiveFilter<T extends string>(\n options: Omit<CaseInsensitiveOptions<T>, \"extractor\">\n): readonly T[];\nexport function caseInsensitiveFilter<T>(\n options: CaseInsensitiveOptions<T> & { extractor: TextExtractor<T> }\n): readonly T[];\nexport function caseInsensitiveFilter<T>(\n options: CaseInsensitiveOptions<T>\n): readonly T[] {\n const {\n list,\n query,\n extractor = identity(\"caseInsensitiveFilter\"),\n startsWith,\n whitespace,\n } = options;\n\n return filter({\n list,\n query,\n extractor,\n whitespace,\n filter(q, value) {\n const matchIndex = value.indexOf(q);\n if (startsWith) {\n return matchIndex === 0;\n }\n\n return matchIndex !== -1;\n },\n });\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type FuzzyFilterOptions<T> = BaseFilterOptions<T>;\n\n/**\n * Filters a list by making sure that all the letters appear in order ignoring\n * case, punctuation, whitespace, and special characters. This is kind of the\n * same filtering that appears in text editors.\n *\n * @example\n * Simple Example\n * ```ts\n * const list = [\n * \"at\",\n * \"charAt\",\n * \"charCodeAt\",\n * \"codePointAt\",\n * \"concat\",\n * \"constructor\",\n * \"endsWith\",\n * \"includes\",\n * \"indexOf\",\n * \"lastIndexOf\",\n * \"length\",\n * \"localeCompare\",\n * \"match\",\n * \"matchAll\",\n * \"normalize\",\n * \"padEnd\",\n * \"padStart\",\n * \"repeat\",\n * \"replace\",\n * \"replaceAll\",\n * \"search\",\n * \"slice\",\n * \"split\",\n * \"startsWith\",\n * \"substring\",\n * \"toLocaleLowerCase\",\n * \"toLocaleUpperCase\",\n * \"toLowerCase\",\n * \"toString\",\n * \"toUpperCase\",\n * \"trim\",\n * \"trimEnd\",\n * \"trimStart\",\n * \"valueOf\",\n * ];\n *\n * fuzzyFilter({ list: list, query: \"la\" });\n * // [\n * // \"lastIndexOf\",\n * // ^^\n * // \"localeCompare\",\n * // ^ ^\n * // \"replace\",\n * // ^^\n * // \"replaceAll\",\n * // ^^\n * // \"toLocaleLowerCase\",\n * // ^ ^\n * // \"toLocaleUpperCase\",\n * // ^ ^\n * // \"toLowerCase\",\n * // ^ ^\n * // ]\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function fuzzyFilter<T extends string>(\n options: Omit<FuzzyFilterOptions<T>, \"extractor\">\n): readonly T[];\nexport function fuzzyFilter<T>(\n option: FuzzyFilterOptions<T> & { extractor: TextExtractor<T> }\n): readonly T[];\nexport function fuzzyFilter<T>(options: FuzzyFilterOptions<T>): readonly T[] {\n const {\n list,\n query,\n extractor = identity(\"fuzzyFilter\"),\n whitespace,\n } = options;\n\n let regexp: RegExp;\n return filter({\n list,\n query,\n extractor,\n whitespace,\n filter(query, value) {\n if (!regexp) {\n regexp = new RegExp(\n `${query}`\n .split(\"\")\n .join(\"\\\\w*\")\n .replace(\n /(\\(|\\||\\)|\\\\(?!w\\*)|\\[|\\|-|\\.|\\^|\\+|\\$|\\?|^(?!w)\\*)/g,\n \"\\\\$1\"\n )\n // Couldn't get the matching of two '*' working, so replace them here..\n .replace(/\\*\\*/g, \"*\\\\*\"),\n \"i\"\n );\n }\n\n return value.length > 0 && regexp.test(value);\n },\n });\n}\n"],"names":["identity","name","item","Error","toSearchString","s","whitespace","q","toLowerCase","replace","trim","filter","options","list","query","extractor","length","caseInsensitiveFilter","startsWith","value","matchIndex","indexOf","fuzzyFilter","regexp","RegExp","split","join","test"],"mappings":"AAEA,cAAc,GACd,MAAMA,WACJ,CAAIC,OACJ,CAACC;QACC,IAAI,OAAOA,SAAS,UAAU;YAC5B,OAAOA;QACT;QAEA,MAAM,IAAIC,MACR,CAAC,0CAA0C,EAAEF,KAAK,wCAAwC,CAAC;IAE/F;AAkCF;;;CAGC,GACD,MAAMG,iBAAiB,CACrBC,GACAC;IAEA,IAAIC,IAAIF,EAAEG,WAAW;IACrB,IAAIF,eAAe,UAAU;QAC3BC,IAAIA,EAAEE,OAAO,CAAC,OAAO;IACvB,OAAO,IAAIH,eAAe,QAAQ;QAChCC,IAAIA,EAAEG,IAAI;IACZ;IAEA,OAAOH;AACT;AAEA;;;CAGC,GACD,SAASI,OAAUC,OAAyB;IAC1C,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEH,MAAM,EAAEI,SAAS,EAAET,aAAa,MAAM,EAAE,GAAGM;IAChE,IAAI,CAACC,KAAKG,MAAM,EAAE;QAChB,OAAOH;IACT;IAEA,MAAMN,IAAIH,eAAeU,OAAOR;IAChC,IAAI,CAACC,GAAG;QACN,OAAOM;IACT;IAEA,OAAOA,KAAKF,MAAM,CAAC,CAACT,OAClBS,OAAOJ,GAAGH,eAAeW,UAAUb,OAAOI;AAE9C;AAmGA,OAAO,SAASW,sBACdL,OAAkC;IAElC,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,YAAYf,SAAS,wBAAwB,EAC7CkB,UAAU,EACVZ,UAAU,EACX,GAAGM;IAEJ,OAAOD,OAAO;QACZE;QACAC;QACAC;QACAT;QACAK,QAAOJ,CAAC,EAAEY,KAAK;YACb,MAAMC,aAAaD,MAAME,OAAO,CAACd;YACjC,IAAIW,YAAY;gBACd,OAAOE,eAAe;YACxB;YAEA,OAAOA,eAAe,CAAC;QACzB;IACF;AACF;AA+EA,OAAO,SAASE,YAAeV,OAA8B;IAC3D,MAAM,EACJC,IAAI,EACJC,KAAK,EACLC,YAAYf,SAAS,cAAc,EACnCM,UAAU,EACX,GAAGM;IAEJ,IAAIW;IACJ,OAAOZ,OAAO;QACZE;QACAC;QACAC;QACAT;QACAK,QAAOG,KAAK,EAAEK,KAAK;YACjB,IAAI,CAACI,QAAQ;gBACXA,SAAS,IAAIC,OACX,CAAC,EAAEV,MAAM,CAAC,CACPW,KAAK,CAAC,IACNC,IAAI,CAAC,QACLjB,OAAO,CACN,wDACA,OAEF,uEAAuE;iBACtEA,OAAO,CAAC,SAAS,SACpB;YAEJ;YAEA,OAAOU,MAAMH,MAAM,GAAG,KAAKO,OAAOI,IAAI,CAACR;QACzC;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/getClientPosition.ts"],"sourcesContent":["/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface ClientPositionMouseEvent {\n clientX: number;\n clientY: number;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface ClientPositionTouchEvent {\n changedTouches: {\n [index: number]: ClientPositionMouseEvent;\n };\n}\n\nexport type ClientPositionEvent =\n | ClientPositionMouseEvent\n | ClientPositionTouchEvent;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface ClientPositionOptions {\n event: ClientPositionEvent;\n vertical: boolean;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const getClientPosition = (options: ClientPositionOptions): number => {\n const { event, vertical } = options;\n\n const key = vertical ? \"clientY\" : \"clientX\";\n if (\"clientX\" in event) {\n return event[key];\n }\n\n // this should pretty much always be defined\n return event.changedTouches[0]?.[key] || 0;\n};\n"],"names":["getClientPosition","options","event","vertical","key","changedTouches"],"mappings":"AAAA;;;CAGC,GA6BD;;;CAGC,GACD,OAAO,MAAMA,oBAAoB,CAACC;IAChC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAE5B,MAAMG,MAAMD,WAAW,YAAY;IACnC,IAAI,aAAaD,OAAO;QACtB,OAAOA,KAAK,CAACE,IAAI;IACnB;IAEA,4CAA4C;IAC5C,OAAOF,MAAMG,cAAc,CAAC,EAAE,EAAE,CAACD,IAAI,IAAI;AAC3C,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/getMiddleOfRange.ts"],"sourcesContent":["import { getRangeSteps } from \"./getRangeSteps.js\";\nimport { nearest } from \"./nearest.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface GetMiddleOfRangeOptions {\n min: number;\n max: number;\n step: number;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function getMiddleOfRange(options: GetMiddleOfRangeOptions): number {\n const { min, max, step } = options;\n\n return nearest({\n min,\n max,\n steps: getRangeSteps({ min, max, step }),\n value: (max - min) / 2 + min,\n });\n}\n"],"names":["getRangeSteps","nearest","getMiddleOfRange","options","min","max","step","steps","value"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,OAAO,QAAQ,eAAe;AAWvC;;;CAGC,GACD,OAAO,SAASC,iBAAiBC,OAAgC;IAC/D,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAE,GAAGH;IAE3B,OAAOF,QAAQ;QACbG;QACAC;QACAE,OAAOP,cAAc;YAAEI;YAAKC;YAAKC;QAAK;QACtCE,OAAO,AAACH,CAAAA,MAAMD,GAAE,IAAK,IAAIA;IAC3B;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/getPercentage.ts"],"sourcesContent":["/** @remarks \\@since 4.0.1 */\nexport interface GetPercentageOptions {\n /**\n * The min value allowed.\n */\n min: number;\n\n /**\n * The max value allowed.\n */\n max: number;\n\n /**\n * The current value\n */\n value: number;\n\n /**\n * Boolean if the min, max, and value options should be validated to make sure\n * they are within the correct range relative to each other.\n *\n * @defaultValue `false`\n */\n validate?: boolean;\n}\n\n/**\n * Gets the current percentage based on the min, max, and current value.\n *\n * @returns the percentage that the `value` is between the `min` and `max`\n * values.\n *\n * @remarks\n * \\@since 4.0.1 uses an object for options instead of multiple arguments.\n * \\@since 6.0.0 Updated to be included in the public API and `validate`\n * defaults to `false` instead of `true`.\n */\nexport function getPercentage(options: GetPercentageOptions): number {\n const { min, max, value, validate = false } = options;\n if (validate) {\n if (min >= max) {\n throw new RangeError(\n \"A range must have the min value less than the max value\"\n );\n }\n\n if (value > max || value < min) {\n throw new RangeError(\"A value must be between the min and max values\");\n }\n }\n\n const range = max - min;\n const start = value - min;\n const percentage = start / range;\n return Math.max(0, Math.min(Math.abs(percentage), 1));\n}\n"],"names":["getPercentage","options","min","max","value","validate","RangeError","range","start","percentage","Math","abs"],"mappings":"AAAA,2BAA2B,GA0B3B;;;;;;;;;;CAUC,GACD,OAAO,SAASA,cAAcC,OAA6B;IACzD,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAEC,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGJ;IAC9C,IAAII,UAAU;QACZ,IAAIH,OAAOC,KAAK;YACd,MAAM,IAAIG,WACR;QAEJ;QAEA,IAAIF,QAAQD,OAAOC,QAAQF,KAAK;YAC9B,MAAM,IAAII,WAAW;QACvB;IACF;IAEA,MAAMC,QAAQJ,MAAMD;IACpB,MAAMM,QAAQJ,QAAQF;IACtB,MAAMO,aAAaD,QAAQD;IAC3B,OAAOG,KAAKP,GAAG,CAAC,GAAGO,KAAKR,GAAG,CAACQ,KAAKC,GAAG,CAACF,aAAa;AACpD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/getRangeDefaultValue.ts"],"sourcesContent":["import { type UseStateInitializer } from \"../types.js\";\nimport {\n getMiddleOfRange,\n type GetMiddleOfRangeOptions,\n} from \"./getMiddleOfRange.js\";\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface RangeDefaultValueOptions extends GetMiddleOfRangeOptions {\n defaultValue?: UseStateInitializer<number>;\n}\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function getRangeDefaultValue(\n options: RangeDefaultValueOptions\n): UseStateInitializer<number> {\n const { defaultValue } = options;\n if (typeof defaultValue !== \"undefined\") {\n return defaultValue;\n }\n\n return () => getMiddleOfRange(options);\n}\n"],"names":["getMiddleOfRange","getRangeDefaultValue","options","defaultValue"],"mappings":"AACA,SACEA,gBAAgB,QAEX,wBAAwB;AAU/B;;;CAGC,GACD,OAAO,SAASC,qBACdC,OAAiC;IAEjC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,IAAI,OAAOC,iBAAiB,aAAa;QACvC,OAAOA;IACT;IAEA,OAAO,IAAMH,iBAAiBE;AAChC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/getRangeSteps.ts"],"sourcesContent":["/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface RangeStepsOptions {\n min: number;\n max: number;\n step: number;\n}\n\n/**\n * Gets the number of steps in the allowed range of values.\n *\n * @internal\n * @remarks\n * \\@since 2.5.0\n * \\@since 6.0.0 Converted to using an object instead of multiple arguments and\n * renamed from `getSteps` to `getRangeSteps`.\n */\nexport function getRangeSteps(options: RangeStepsOptions): number {\n const { min, max, step } = options;\n\n return Math.abs(max - min) / step;\n}\n"],"names":["getRangeSteps","options","min","max","step","Math","abs"],"mappings":"AAAA;;;CAGC,GAOD;;;;;;;;CAQC,GACD,OAAO,SAASA,cAAcC,OAA0B;IACtD,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAE,GAAGH;IAE3B,OAAOI,KAAKC,GAAG,CAACH,MAAMD,OAAOE;AAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/identity.ts"],"sourcesContent":["/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const identity = <T>(thing: T): T => thing;\n"],"names":["identity","thing"],"mappings":"AAAA;;;CAGC,GACD,OAAO,MAAMA,WAAW,CAAIC,QAAgBA,MAAM"}