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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1134) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +3 -3
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/CHANGELOG.md +6 -0
  5. package/coverage/clover.xml +529 -437
  6. package/coverage/coverage-final.json +3 -3
  7. package/coverage/lcov-report/ListItem.tsx.html +2 -2
  8. package/coverage/lcov-report/ListItemLink.tsx.html +616 -0
  9. package/coverage/lcov-report/getListItemHeight.ts.html +298 -0
  10. package/coverage/lcov-report/index.html +38 -23
  11. package/coverage/lcov.info +423 -317
  12. package/dist/_core.scss +1 -1
  13. package/dist/form/_form.scss +1 -1
  14. package/dist/list/getListItemHeight.d.ts +0 -1
  15. package/dist/list/types.d.ts +1 -1
  16. package/dist/menu/_menu.scss +0 -2
  17. package/dist/src/CoreProviders.js.map +1 -0
  18. package/dist/src/NoSsr.js.map +1 -0
  19. package/dist/src/SsrProvider.js.map +1 -0
  20. package/dist/src/app-bar/AppBar.js.map +1 -0
  21. package/dist/src/app-bar/AppBarTitle.js.map +1 -0
  22. package/dist/src/avatar/Avatar.js.map +1 -0
  23. package/dist/src/avatar/styles.js.map +1 -0
  24. package/dist/src/badge/Badge.js.map +1 -0
  25. package/dist/src/box/Box.js.map +1 -0
  26. package/dist/src/box/styles.js.map +1 -0
  27. package/dist/src/button/AsyncButton.js.map +1 -0
  28. package/dist/src/button/Button.js.map +1 -0
  29. package/dist/src/button/ButtonUnstyled.js.map +1 -0
  30. package/dist/src/button/FloatingActionButton.js.map +1 -0
  31. package/dist/src/button/TooltippedButton.js.map +1 -0
  32. package/dist/src/button/buttonStyles.js.map +1 -0
  33. package/dist/src/button/buttonUnstyledStyles.js.map +1 -0
  34. package/dist/src/card/Card.js.map +1 -0
  35. package/dist/src/card/CardContent.js.map +1 -0
  36. package/dist/src/card/CardFooter.js.map +1 -0
  37. package/dist/src/card/CardHeader.js.map +1 -0
  38. package/dist/src/card/CardSubtitle.js.map +1 -0
  39. package/dist/src/card/CardTitle.js.map +1 -0
  40. package/dist/src/card/ClickableCard.js.map +1 -0
  41. package/dist/src/card/styles.js.map +1 -0
  42. package/dist/src/chip/Chip.js.map +1 -0
  43. package/dist/src/chip/styles.js.map +1 -0
  44. package/dist/src/cssUtils.js.map +1 -0
  45. package/dist/src/delegateEvent.js.map +1 -0
  46. package/dist/src/dialog/Dialog.js.map +1 -0
  47. package/dist/src/dialog/DialogContainer.js.map +1 -0
  48. package/dist/src/dialog/DialogContent.js.map +1 -0
  49. package/dist/src/dialog/DialogFooter.js.map +1 -0
  50. package/dist/src/dialog/DialogHeader.js.map +1 -0
  51. package/dist/src/dialog/DialogTitle.js.map +1 -0
  52. package/dist/src/dialog/FixedDialog.js.map +1 -0
  53. package/dist/src/dialog/NestedDialogProvider.js.map +1 -0
  54. package/dist/src/dialog/styles.js.map +1 -0
  55. package/dist/src/divider/Divider.js.map +1 -0
  56. package/dist/src/divider/styles.js.map +1 -0
  57. package/dist/src/draggable/useDraggable.js.map +1 -0
  58. package/dist/src/draggable/utils.js.map +1 -0
  59. package/dist/src/expansion-panel/ExpansionList.js.map +1 -0
  60. package/dist/src/expansion-panel/ExpansionPanel.js.map +1 -0
  61. package/dist/src/expansion-panel/ExpansionPanelHeader.js.map +1 -0
  62. package/dist/src/expansion-panel/useExpansionList.js.map +1 -0
  63. package/dist/src/expansion-panel/useExpansionPanels.js.map +1 -0
  64. package/dist/src/focus/useFocusContainer.js.map +1 -0
  65. package/dist/src/focus/utils.js.map +1 -0
  66. package/dist/src/form/Checkbox.js.map +1 -0
  67. package/dist/src/form/Fieldset.js.map +1 -0
  68. package/dist/src/form/FileInput.js.map +1 -0
  69. package/dist/src/form/Form.js.map +1 -0
  70. package/dist/src/form/FormMessage.js.map +1 -0
  71. package/dist/src/form/FormMessageContainer.js.map +1 -0
  72. package/dist/src/form/FormMessageCounter.js.map +1 -0
  73. package/dist/src/form/InputToggle.js.map +1 -0
  74. package/dist/src/form/InputToggleIcon.js.map +1 -0
  75. package/dist/src/form/Label.js.map +1 -0
  76. package/dist/src/form/Legend.js.map +1 -0
  77. package/dist/src/form/MenuItemCheckbox.js.map +1 -0
  78. package/dist/src/form/MenuItemFileInput.js.map +1 -0
  79. package/dist/src/form/MenuItemInputToggle.js.map +1 -0
  80. package/dist/src/form/MenuItemRadio.js.map +1 -0
  81. package/dist/src/form/MenuItemSwitch.js.map +1 -0
  82. package/dist/src/form/MenuItemTextField.js.map +1 -0
  83. package/dist/src/form/NativeSelect.js.map +1 -0
  84. package/dist/src/form/OptGroup.js.map +1 -0
  85. package/dist/src/form/Option.js.map +1 -0
  86. package/dist/src/form/Password.js.map +1 -0
  87. package/dist/src/form/Radio.js.map +1 -0
  88. package/dist/src/form/Select.js.map +1 -0
  89. package/dist/src/form/SelectValue.js.map +1 -0
  90. package/dist/src/form/Slider.js.map +1 -0
  91. package/dist/src/form/SliderContainer.js.map +1 -0
  92. package/dist/src/form/SliderMark.js.map +1 -0
  93. package/dist/src/form/SliderMarkLabel.js.map +1 -0
  94. package/dist/src/form/SliderThumb.js.map +1 -0
  95. package/dist/src/form/SliderTrack.js.map +1 -0
  96. package/dist/src/form/SliderValueMarks.js.map +1 -0
  97. package/dist/src/form/SliderValueTooltip.js.map +1 -0
  98. package/dist/src/form/Switch.js.map +1 -0
  99. package/dist/src/form/SwitchTrack.js.map +1 -0
  100. package/dist/src/form/TextArea.js.map +1 -0
  101. package/dist/src/form/TextField.js.map +1 -0
  102. package/dist/src/form/TextFieldAddon.js.map +1 -0
  103. package/dist/src/form/TextFieldContainer.js.map +1 -0
  104. package/dist/src/form/TextFieldContainerStyles.js.map +1 -0
  105. package/dist/src/form/fileUtils.js.map +1 -0
  106. package/dist/src/form/formConfig.js.map +1 -0
  107. package/dist/src/form/formMessageStyles.js.map +1 -0
  108. package/dist/src/form/inputToggleStyles.js.map +1 -0
  109. package/dist/src/form/nativeSelectStyles.js.map +1 -0
  110. package/dist/src/form/optionStyles.js.map +1 -0
  111. package/dist/src/form/passwordStyles.js.map +1 -0
  112. package/dist/src/form/selectStyles.js.map +1 -0
  113. package/dist/src/form/selectUtils.js.map +1 -0
  114. package/dist/src/form/sliderUtils.js.map +1 -0
  115. package/dist/src/form/switchStyles.js.map +1 -0
  116. package/dist/src/form/textAreaStyles.js.map +1 -0
  117. package/dist/src/form/textFieldStyles.js.map +1 -0
  118. package/dist/src/form/types.js.map +1 -0
  119. package/dist/src/form/useCheckboxGroup.js.map +1 -0
  120. package/dist/src/form/useFileUpload.js.map +1 -0
  121. package/dist/src/form/useListboxProvider.js.map +1 -0
  122. package/dist/src/form/useNumberField.js.map +1 -0
  123. package/dist/src/form/useRadioGroup.js.map +1 -0
  124. package/dist/src/form/useRangeSlider.js.map +1 -0
  125. package/dist/src/form/useResizingTextArea.js.map +1 -0
  126. package/dist/src/form/useSlider.js.map +1 -0
  127. package/dist/src/form/useTextField.js.map +1 -0
  128. package/dist/src/form/utils.js.map +1 -0
  129. package/dist/src/form/validation.js.map +1 -0
  130. package/dist/src/hoverMode/useHoverMode.js.map +1 -0
  131. package/dist/src/hoverMode/useHoverModeProvider.js.map +1 -0
  132. package/dist/src/icon/FontIcon.js.map +1 -0
  133. package/dist/src/icon/IconRotator.js.map +1 -0
  134. package/dist/src/icon/MaterialIcon.js.map +1 -0
  135. package/dist/src/icon/MaterialSymbol.js.map +1 -0
  136. package/dist/src/icon/SVGIcon.js.map +1 -0
  137. package/dist/src/icon/TextIconSpacing.js.map +1 -0
  138. package/dist/src/icon/iconConfig.js.map +1 -0
  139. package/dist/src/icon/material.js.map +1 -0
  140. package/dist/src/icon/materialConfig.js.map +1 -0
  141. package/dist/src/icon/styles.js.map +1 -0
  142. package/dist/src/index.js.map +1 -0
  143. package/dist/src/interaction/Ripple.js.map +1 -0
  144. package/dist/src/interaction/RippleContainer.js.map +1 -0
  145. package/dist/src/interaction/UserInteractionModeProvider.js.map +1 -0
  146. package/dist/src/interaction/config.js.map +1 -0
  147. package/dist/src/interaction/types.js.map +1 -0
  148. package/dist/src/interaction/useElementInteraction.js.map +1 -0
  149. package/dist/src/interaction/useHigherContrastChildren.js.map +1 -0
  150. package/dist/src/interaction/utils.js.map +1 -0
  151. package/dist/src/layout/LayoutAppBar.js.map +1 -0
  152. package/dist/src/layout/LayoutNav.js.map +1 -0
  153. package/dist/src/layout/LayoutWindowSplitter.js.map +1 -0
  154. package/dist/src/layout/Main.js.map +1 -0
  155. package/dist/src/layout/layoutNavStyles.js.map +1 -0
  156. package/dist/src/layout/layoutWindowSplitterStyles.js.map +1 -0
  157. package/dist/src/layout/mainStyles.js.map +1 -0
  158. package/dist/src/layout/useExpandableLayout.js.map +1 -0
  159. package/dist/src/layout/useHorizontalLayoutTransition.js.map +1 -0
  160. package/dist/src/layout/useLayoutAppBarHeight.js.map +1 -0
  161. package/dist/src/layout/useLayoutTree.js.map +1 -0
  162. package/dist/src/layout/useLayoutWindowSplitter.js.map +1 -0
  163. package/dist/src/layout/useMainTabIndex.js.map +1 -0
  164. package/dist/src/layout/useResizableLayout.js.map +1 -0
  165. package/dist/src/layout/useTemporaryLayout.js.map +1 -0
  166. package/dist/src/link/Link.js.map +1 -0
  167. package/dist/src/link/SkipToMainContent.js.map +1 -0
  168. package/dist/src/link/styles.js.map +1 -0
  169. package/dist/src/list/List.js.map +1 -0
  170. package/dist/src/list/ListItem.js +148 -0
  171. package/dist/src/list/ListItem.js.map +1 -0
  172. package/dist/src/list/ListItemAddon.js.map +1 -0
  173. package/dist/src/list/ListItemChildren.js.map +1 -0
  174. package/dist/src/list/ListItemLink.js +89 -0
  175. package/dist/src/list/ListItemLink.js.map +1 -0
  176. package/dist/src/list/ListItemText.js.map +1 -0
  177. package/dist/src/list/ListSubheader.js.map +1 -0
  178. package/dist/src/list/getListItemHeight.js +28 -0
  179. package/dist/src/list/getListItemHeight.js.map +1 -0
  180. package/dist/src/list/listItemStyles.js.map +1 -0
  181. package/dist/src/list/types.js.map +1 -0
  182. package/dist/src/media-queries/AppSizeProvider.js.map +1 -0
  183. package/dist/src/media-queries/appSize.js.map +1 -0
  184. package/dist/src/media-queries/useMediaQuery.js.map +1 -0
  185. package/dist/src/menu/DropdownMenu.js.map +1 -0
  186. package/dist/src/menu/Menu.js.map +1 -0
  187. package/dist/src/menu/MenuBar.js.map +1 -0
  188. package/dist/src/menu/MenuButton.js.map +1 -0
  189. package/dist/src/menu/MenuConfigurationProvider.js.map +1 -0
  190. package/dist/src/menu/MenuItem.js.map +1 -0
  191. package/dist/src/menu/MenuItemButton.js.map +1 -0
  192. package/dist/src/menu/MenuItemGroup.js.map +1 -0
  193. package/dist/src/menu/MenuItemSeparator.js.map +1 -0
  194. package/dist/src/menu/MenuSheet.js.map +1 -0
  195. package/dist/src/menu/MenuVisibilityProvider.js.map +1 -0
  196. package/dist/src/menu/MenuWidget.js.map +1 -0
  197. package/dist/src/menu/MenuWidgetKeyboardProvider.js.map +1 -0
  198. package/dist/src/menu/useContextMenu.js.map +1 -0
  199. package/dist/src/menu/useMenuBarProvider.js.map +1 -0
  200. package/dist/src/menu/utils.js.map +1 -0
  201. package/dist/src/movement/constants.js.map +1 -0
  202. package/dist/src/movement/findMatchIndex.js.map +1 -0
  203. package/dist/src/movement/types.js.map +1 -0
  204. package/dist/src/movement/useKeyboardMovementProvider.js.map +1 -0
  205. package/dist/src/movement/utils.js.map +1 -0
  206. package/dist/src/overlay/Overlay.js.map +1 -0
  207. package/dist/src/overlay/overlayStyles.js.map +1 -0
  208. package/dist/src/portal/Portal.js.map +1 -0
  209. package/dist/src/portal/PortalContainerProvider.js.map +1 -0
  210. package/dist/src/positioning/constants.js.map +1 -0
  211. package/dist/src/positioning/createHorizontalPosition.js.map +1 -0
  212. package/dist/src/positioning/createVerticalPosition.js.map +1 -0
  213. package/dist/src/positioning/getFixedPosition.js.map +1 -0
  214. package/dist/src/positioning/types.js.map +1 -0
  215. package/dist/src/positioning/useFixedPositioning.js.map +1 -0
  216. package/dist/src/positioning/utils.js.map +1 -0
  217. package/dist/src/progress/CircularProgress.js.map +1 -0
  218. package/dist/src/progress/LinearProgress.js.map +1 -0
  219. package/dist/src/progress/getProgressA11y.js.map +1 -0
  220. package/dist/src/progress/types.js.map +1 -0
  221. package/dist/src/responsive-item/ResponsiveItemContainer.js.map +1 -0
  222. package/dist/src/responsive-item/ResponsiveItemOverlay.js.map +1 -0
  223. package/dist/src/responsive-item/styles.js.map +1 -0
  224. package/dist/src/scroll/ScrollLock.js.map +1 -0
  225. package/dist/src/scroll/getScrollbarWidth.js.map +1 -0
  226. package/dist/src/scroll/useScrollLock.js.map +1 -0
  227. package/dist/src/segmented-button/SegmentedButton.js.map +1 -0
  228. package/dist/src/segmented-button/SegmentedButtonContainer.js.map +1 -0
  229. package/dist/src/segmented-button/segmentedButtonContainerStyles.js.map +1 -0
  230. package/dist/src/segmented-button/segmentedButtonStyles.js.map +1 -0
  231. package/dist/src/sheet/Sheet.js.map +1 -0
  232. package/dist/src/sheet/styles.js.map +1 -0
  233. package/dist/src/snackbar/DefaultToastRenderer.js.map +1 -0
  234. package/dist/src/snackbar/Snackbar.js.map +1 -0
  235. package/dist/src/snackbar/Toast.js.map +1 -0
  236. package/dist/src/snackbar/ToastActionButton.js.map +1 -0
  237. package/dist/src/snackbar/ToastCloseButton.js.map +1 -0
  238. package/dist/src/snackbar/ToastContent.js.map +1 -0
  239. package/dist/src/snackbar/ToastManager.js.map +1 -0
  240. package/dist/src/snackbar/ToastManagerProvider.js.map +1 -0
  241. package/dist/src/snackbar/snackbarStyles.js.map +1 -0
  242. package/dist/src/snackbar/toastContentStyles.js.map +1 -0
  243. package/dist/src/snackbar/toastStyles.js.map +1 -0
  244. package/dist/src/snackbar/useCurrentToastActions.js.map +1 -0
  245. package/dist/src/suspense/CircularProgressSuspense.js.map +1 -0
  246. package/dist/src/suspense/NullSuspense.js.map +1 -0
  247. package/dist/src/table/Table.js.map +1 -0
  248. package/dist/src/table/TableBody.js.map +1 -0
  249. package/dist/src/table/TableCell.js.map +1 -0
  250. package/dist/src/table/TableCellContent.js.map +1 -0
  251. package/dist/src/table/TableCheckbox.js.map +1 -0
  252. package/dist/src/table/TableConfigurationProvider.js.map +1 -0
  253. package/dist/src/table/TableContainer.js.map +1 -0
  254. package/dist/src/table/TableContainerProvider.js.map +1 -0
  255. package/dist/src/table/TableFooter.js.map +1 -0
  256. package/dist/src/table/TableHeader.js.map +1 -0
  257. package/dist/src/table/TableRadio.js.map +1 -0
  258. package/dist/src/table/TableRow.js.map +1 -0
  259. package/dist/src/table/tableCellStyles.js.map +1 -0
  260. package/dist/src/table/tableContainerStyles.js.map +1 -0
  261. package/dist/src/table/tableFooterStyles.js.map +1 -0
  262. package/dist/src/table/tableHeaderStyles.js.map +1 -0
  263. package/dist/src/table/tableRowStyles.js.map +1 -0
  264. package/dist/src/table/tableStyles.js.map +1 -0
  265. package/dist/src/table/types.js.map +1 -0
  266. package/dist/src/tabs/Tab.js.map +1 -0
  267. package/dist/src/tabs/TabList.js.map +1 -0
  268. package/dist/src/tabs/TabListScrollButton.js.map +1 -0
  269. package/dist/src/tabs/tabIndicatorStyles.js.map +1 -0
  270. package/dist/src/tabs/tabListScrollButtonStyles.js.map +1 -0
  271. package/dist/src/tabs/tabListStyles.js.map +1 -0
  272. package/dist/src/tabs/tabStyles.js.map +1 -0
  273. package/dist/src/tabs/useTabList.js.map +1 -0
  274. package/dist/src/tabs/useTabs.js.map +1 -0
  275. package/dist/src/tabs/utils.js.map +1 -0
  276. package/dist/src/test-utils/IntersectionObserver.js.map +1 -0
  277. package/dist/src/test-utils/ResizeObserver.js.map +1 -0
  278. package/dist/src/test-utils/data-testid.js.map +1 -0
  279. package/dist/src/test-utils/index.js.map +1 -0
  280. package/dist/src/test-utils/jest-setup.js.map +1 -0
  281. package/dist/src/test-utils/matchMedia.js.map +1 -0
  282. package/dist/src/test-utils/polyfills/IntersectionObserver.js.map +1 -0
  283. package/dist/src/test-utils/polyfills/ResizeObserver.js.map +1 -0
  284. package/dist/src/test-utils/polyfills/index.js.map +1 -0
  285. package/dist/src/test-utils/polyfills/matchMedia.js.map +1 -0
  286. package/dist/src/test-utils/polyfills/offsetParent.js.map +1 -0
  287. package/dist/src/test-utils/polyfills/scrollIntoView.js.map +1 -0
  288. package/dist/src/test-utils/render.js.map +1 -0
  289. package/dist/src/test-utils/timers.js.map +1 -0
  290. package/dist/src/theme/LocalStorageColorSchemeProvider.js.map +1 -0
  291. package/dist/src/theme/ThemeProvider.js.map +1 -0
  292. package/dist/src/theme/colors.js.map +1 -0
  293. package/dist/src/theme/cssVars.js.map +1 -0
  294. package/dist/src/theme/types.js.map +1 -0
  295. package/dist/src/theme/useCSSVariables.js.map +1 -0
  296. package/dist/src/theme/useColorScheme.js.map +1 -0
  297. package/dist/src/theme/useColorSchemeMetaTag.js.map +1 -0
  298. package/dist/src/theme/useColorSchemeProvider.js.map +1 -0
  299. package/dist/src/theme/usePrefersColorScheme.js.map +1 -0
  300. package/dist/src/theme/utils.js.map +1 -0
  301. package/dist/src/tooltip/Tooltip.js.map +1 -0
  302. package/dist/src/tooltip/TooltipHoverModeProvider.js.map +1 -0
  303. package/dist/src/tooltip/constants.js.map +1 -0
  304. package/dist/src/tooltip/tooltipStyles.js.map +1 -0
  305. package/dist/src/tooltip/useTooltip.js.map +1 -0
  306. package/dist/src/tooltip/useTooltipPosition.js.map +1 -0
  307. package/dist/src/tooltip/utils.js.map +1 -0
  308. package/dist/src/transition/CSSTransition.js.map +1 -0
  309. package/dist/src/transition/Collapse.js.map +1 -0
  310. package/dist/src/transition/CrossFade.js.map +1 -0
  311. package/dist/src/transition/ScaleTransition.js.map +1 -0
  312. package/dist/src/transition/SkeletonPlaceholder.js.map +1 -0
  313. package/dist/src/transition/Slide.js.map +1 -0
  314. package/dist/src/transition/SlideContainer.js.map +1 -0
  315. package/dist/src/transition/collapseStyles.js.map +1 -0
  316. package/dist/src/transition/config.js.map +1 -0
  317. package/dist/src/transition/maxWidthTransition.js.map +1 -0
  318. package/dist/src/transition/skeletonPlaceholderUtils.js.map +1 -0
  319. package/dist/src/transition/types.js.map +1 -0
  320. package/dist/src/transition/useCSSTransition.js.map +1 -0
  321. package/dist/src/transition/useCarousel.js.map +1 -0
  322. package/dist/src/transition/useCollapseTransition.js.map +1 -0
  323. package/dist/src/transition/useCrossFadeTransition.js.map +1 -0
  324. package/dist/src/transition/useMaxWidthTransition.js.map +1 -0
  325. package/dist/src/transition/useScaleTransition.js.map +1 -0
  326. package/dist/src/transition/useSkeletonPlaceholder.js.map +1 -0
  327. package/dist/src/transition/useSlideTransition.js.map +1 -0
  328. package/dist/src/transition/useTransition.js.map +1 -0
  329. package/dist/src/transition/utils.js.map +1 -0
  330. package/dist/src/tree/DefaultTreeItemRenderer.js.map +1 -0
  331. package/dist/src/tree/Tree.js.map +1 -0
  332. package/dist/src/tree/TreeGroup.js.map +1 -0
  333. package/dist/src/tree/TreeItem.js.map +1 -0
  334. package/dist/src/tree/TreeItemExpander.js.map +1 -0
  335. package/dist/src/tree/TreeProvider.js.map +1 -0
  336. package/dist/src/tree/styles.js.map +1 -0
  337. package/dist/src/tree/types.js.map +1 -0
  338. package/dist/src/tree/useTree.js.map +1 -0
  339. package/dist/src/tree/useTreeExpansion.js.map +1 -0
  340. package/dist/src/tree/useTreeItems.js.map +1 -0
  341. package/dist/src/tree/useTreeMovement.js.map +1 -0
  342. package/dist/src/tree/useTreeSelection.js.map +1 -0
  343. package/dist/src/tree/utils.js.map +1 -0
  344. package/dist/src/types.js.map +1 -0
  345. package/dist/src/typography/SrOnly.js.map +1 -0
  346. package/dist/src/typography/TextContainer.js.map +1 -0
  347. package/dist/src/typography/Typography.js.map +1 -0
  348. package/dist/src/typography/WritingDirectionProvider.js.map +1 -0
  349. package/dist/src/useAsyncAction.js.map +1 -0
  350. package/dist/src/useDebouncedFunction.js.map +1 -0
  351. package/dist/src/useDropzone.js.map +1 -0
  352. package/dist/src/useElementSize.js.map +1 -0
  353. package/dist/src/useEnsuredId.js.map +1 -0
  354. package/dist/src/useEnsuredRef.js.map +1 -0
  355. package/dist/src/useEnsuredState.js.map +1 -0
  356. package/dist/src/useHtmlClassName.js.map +1 -0
  357. package/dist/src/useIntersectionObserver.js.map +1 -0
  358. package/dist/src/useIsomorphicLayoutEffect.js.map +1 -0
  359. package/dist/src/useLocalStorage.js.map +1 -0
  360. package/dist/src/useOrientation.js.map +1 -0
  361. package/dist/src/usePageInactive.js.map +1 -0
  362. package/dist/src/useResizeListener.js.map +1 -0
  363. package/dist/src/useResizeObserver.js.map +1 -0
  364. package/dist/src/useThrottledFunction.js.map +1 -0
  365. package/dist/src/useToggle.js.map +1 -0
  366. package/dist/src/useUnmounted.js.map +1 -0
  367. package/dist/src/useWindowSize.js.map +1 -0
  368. package/dist/src/utils/RenderRecursively.js.map +1 -0
  369. package/dist/src/utils/alphaNumericSort.js.map +1 -0
  370. package/dist/src/utils/applyRef.js.map +1 -0
  371. package/dist/src/utils/bem.js.map +1 -0
  372. package/dist/src/utils/filters.js.map +1 -0
  373. package/dist/src/utils/getClientPosition.js.map +1 -0
  374. package/dist/src/utils/getMiddleOfRange.js.map +1 -0
  375. package/dist/src/utils/getPercentage.js.map +1 -0
  376. package/dist/src/utils/getRangeDefaultValue.js.map +1 -0
  377. package/dist/src/utils/getRangeSteps.js.map +1 -0
  378. package/dist/src/utils/identity.js.map +1 -0
  379. package/dist/src/utils/isElementVisible.js.map +1 -0
  380. package/dist/src/utils/loop.js.map +1 -0
  381. package/dist/src/utils/nearest.js.map +1 -0
  382. package/dist/src/utils/parseCssLengthUnit.js.map +1 -0
  383. package/dist/src/utils/randomInt.js.map +1 -0
  384. package/dist/src/utils/wait.js.map +1 -0
  385. package/dist/src/utils/withinRange.js.map +1 -0
  386. package/dist/src/window-splitter/WindowSplitter.js.map +1 -0
  387. package/dist/src/window-splitter/useWindowSplitter.js.map +1 -0
  388. package/dist/theme/_theme.scss +20 -10
  389. package/package.json +8 -8
  390. package/src/_core.scss +1 -1
  391. package/src/form/_form.scss +1 -1
  392. package/src/list/ListItem.tsx +1 -1
  393. package/src/list/ListItemLink.tsx +1 -1
  394. package/src/list/__tests__/getListItemHeight.ts +2 -2
  395. package/src/list/getListItemHeight.ts +2 -3
  396. package/src/list/types.ts +1 -1
  397. package/src/menu/_menu.scss +0 -2
  398. package/src/theme/_theme.scss +20 -10
  399. package/dist/CoreProviders.js.map +0 -1
  400. package/dist/NoSsr.js.map +0 -1
  401. package/dist/SsrProvider.js.map +0 -1
  402. package/dist/app-bar/AppBar.js.map +0 -1
  403. package/dist/app-bar/AppBarTitle.js.map +0 -1
  404. package/dist/avatar/Avatar.js.map +0 -1
  405. package/dist/avatar/styles.js.map +0 -1
  406. package/dist/badge/Badge.js.map +0 -1
  407. package/dist/box/Box.js.map +0 -1
  408. package/dist/box/styles.js.map +0 -1
  409. package/dist/button/AsyncButton.js.map +0 -1
  410. package/dist/button/Button.js.map +0 -1
  411. package/dist/button/ButtonUnstyled.js.map +0 -1
  412. package/dist/button/FloatingActionButton.js.map +0 -1
  413. package/dist/button/TooltippedButton.js.map +0 -1
  414. package/dist/button/buttonStyles.js.map +0 -1
  415. package/dist/button/buttonUnstyledStyles.js.map +0 -1
  416. package/dist/card/Card.js.map +0 -1
  417. package/dist/card/CardContent.js.map +0 -1
  418. package/dist/card/CardFooter.js.map +0 -1
  419. package/dist/card/CardHeader.js.map +0 -1
  420. package/dist/card/CardSubtitle.js.map +0 -1
  421. package/dist/card/CardTitle.js.map +0 -1
  422. package/dist/card/ClickableCard.js.map +0 -1
  423. package/dist/card/styles.js.map +0 -1
  424. package/dist/chip/Chip.js.map +0 -1
  425. package/dist/chip/styles.js.map +0 -1
  426. package/dist/cssUtils.js.map +0 -1
  427. package/dist/delegateEvent.js.map +0 -1
  428. package/dist/dialog/Dialog.js.map +0 -1
  429. package/dist/dialog/DialogContainer.js.map +0 -1
  430. package/dist/dialog/DialogContent.js.map +0 -1
  431. package/dist/dialog/DialogFooter.js.map +0 -1
  432. package/dist/dialog/DialogHeader.js.map +0 -1
  433. package/dist/dialog/DialogTitle.js.map +0 -1
  434. package/dist/dialog/FixedDialog.js.map +0 -1
  435. package/dist/dialog/NestedDialogProvider.js.map +0 -1
  436. package/dist/dialog/styles.js.map +0 -1
  437. package/dist/divider/Divider.js.map +0 -1
  438. package/dist/divider/styles.js.map +0 -1
  439. package/dist/draggable/useDraggable.js.map +0 -1
  440. package/dist/draggable/utils.js.map +0 -1
  441. package/dist/expansion-panel/ExpansionList.js.map +0 -1
  442. package/dist/expansion-panel/ExpansionPanel.js.map +0 -1
  443. package/dist/expansion-panel/ExpansionPanelHeader.js.map +0 -1
  444. package/dist/expansion-panel/useExpansionList.js.map +0 -1
  445. package/dist/expansion-panel/useExpansionPanels.js.map +0 -1
  446. package/dist/focus/useFocusContainer.js.map +0 -1
  447. package/dist/focus/utils.js.map +0 -1
  448. package/dist/form/Checkbox.js.map +0 -1
  449. package/dist/form/Fieldset.js.map +0 -1
  450. package/dist/form/FileInput.js.map +0 -1
  451. package/dist/form/Form.js.map +0 -1
  452. package/dist/form/FormMessage.js.map +0 -1
  453. package/dist/form/FormMessageContainer.js.map +0 -1
  454. package/dist/form/FormMessageCounter.js.map +0 -1
  455. package/dist/form/InputToggle.js.map +0 -1
  456. package/dist/form/InputToggleIcon.js.map +0 -1
  457. package/dist/form/Label.js.map +0 -1
  458. package/dist/form/Legend.js.map +0 -1
  459. package/dist/form/MenuItemCheckbox.js.map +0 -1
  460. package/dist/form/MenuItemFileInput.js.map +0 -1
  461. package/dist/form/MenuItemInputToggle.js.map +0 -1
  462. package/dist/form/MenuItemRadio.js.map +0 -1
  463. package/dist/form/MenuItemSwitch.js.map +0 -1
  464. package/dist/form/MenuItemTextField.js.map +0 -1
  465. package/dist/form/NativeSelect.js.map +0 -1
  466. package/dist/form/OptGroup.js.map +0 -1
  467. package/dist/form/Option.js.map +0 -1
  468. package/dist/form/Password.js.map +0 -1
  469. package/dist/form/Radio.js.map +0 -1
  470. package/dist/form/Select.js.map +0 -1
  471. package/dist/form/SelectValue.js.map +0 -1
  472. package/dist/form/Slider.js.map +0 -1
  473. package/dist/form/SliderContainer.js.map +0 -1
  474. package/dist/form/SliderMark.js.map +0 -1
  475. package/dist/form/SliderMarkLabel.js.map +0 -1
  476. package/dist/form/SliderThumb.js.map +0 -1
  477. package/dist/form/SliderTrack.js.map +0 -1
  478. package/dist/form/SliderValueMarks.js.map +0 -1
  479. package/dist/form/SliderValueTooltip.js.map +0 -1
  480. package/dist/form/Switch.js.map +0 -1
  481. package/dist/form/SwitchTrack.js.map +0 -1
  482. package/dist/form/TextArea.js.map +0 -1
  483. package/dist/form/TextField.js.map +0 -1
  484. package/dist/form/TextFieldAddon.js.map +0 -1
  485. package/dist/form/TextFieldContainer.js.map +0 -1
  486. package/dist/form/TextFieldContainerStyles.js.map +0 -1
  487. package/dist/form/fileUtils.js.map +0 -1
  488. package/dist/form/formConfig.js.map +0 -1
  489. package/dist/form/formMessageStyles.js.map +0 -1
  490. package/dist/form/inputToggleStyles.js.map +0 -1
  491. package/dist/form/nativeSelectStyles.js.map +0 -1
  492. package/dist/form/optionStyles.js.map +0 -1
  493. package/dist/form/passwordStyles.js.map +0 -1
  494. package/dist/form/selectStyles.js.map +0 -1
  495. package/dist/form/selectUtils.js.map +0 -1
  496. package/dist/form/sliderUtils.js.map +0 -1
  497. package/dist/form/switchStyles.js.map +0 -1
  498. package/dist/form/textAreaStyles.js.map +0 -1
  499. package/dist/form/textFieldStyles.js.map +0 -1
  500. package/dist/form/types.js.map +0 -1
  501. package/dist/form/useCheckboxGroup.js.map +0 -1
  502. package/dist/form/useFileUpload.js.map +0 -1
  503. package/dist/form/useListboxProvider.js.map +0 -1
  504. package/dist/form/useNumberField.js.map +0 -1
  505. package/dist/form/useRadioGroup.js.map +0 -1
  506. package/dist/form/useRangeSlider.js.map +0 -1
  507. package/dist/form/useResizingTextArea.js.map +0 -1
  508. package/dist/form/useSlider.js.map +0 -1
  509. package/dist/form/useTextField.js.map +0 -1
  510. package/dist/form/utils.js.map +0 -1
  511. package/dist/form/validation.js.map +0 -1
  512. package/dist/hoverMode/useHoverMode.js.map +0 -1
  513. package/dist/hoverMode/useHoverModeProvider.js.map +0 -1
  514. package/dist/icon/FontIcon.js.map +0 -1
  515. package/dist/icon/IconRotator.js.map +0 -1
  516. package/dist/icon/MaterialIcon.js.map +0 -1
  517. package/dist/icon/MaterialSymbol.js.map +0 -1
  518. package/dist/icon/SVGIcon.js.map +0 -1
  519. package/dist/icon/TextIconSpacing.js.map +0 -1
  520. package/dist/icon/iconConfig.js.map +0 -1
  521. package/dist/icon/material.js.map +0 -1
  522. package/dist/icon/materialConfig.js.map +0 -1
  523. package/dist/icon/styles.js.map +0 -1
  524. package/dist/index.js.map +0 -1
  525. package/dist/interaction/Ripple.js.map +0 -1
  526. package/dist/interaction/RippleContainer.js.map +0 -1
  527. package/dist/interaction/UserInteractionModeProvider.js.map +0 -1
  528. package/dist/interaction/config.js.map +0 -1
  529. package/dist/interaction/types.js.map +0 -1
  530. package/dist/interaction/useElementInteraction.js.map +0 -1
  531. package/dist/interaction/useHigherContrastChildren.js.map +0 -1
  532. package/dist/interaction/utils.js.map +0 -1
  533. package/dist/layout/LayoutAppBar.js.map +0 -1
  534. package/dist/layout/LayoutNav.js.map +0 -1
  535. package/dist/layout/LayoutWindowSplitter.js.map +0 -1
  536. package/dist/layout/Main.js.map +0 -1
  537. package/dist/layout/layoutNavStyles.js.map +0 -1
  538. package/dist/layout/layoutWindowSplitterStyles.js.map +0 -1
  539. package/dist/layout/mainStyles.js.map +0 -1
  540. package/dist/layout/useExpandableLayout.js.map +0 -1
  541. package/dist/layout/useHorizontalLayoutTransition.js.map +0 -1
  542. package/dist/layout/useLayoutAppBarHeight.js.map +0 -1
  543. package/dist/layout/useLayoutTree.js.map +0 -1
  544. package/dist/layout/useLayoutWindowSplitter.js.map +0 -1
  545. package/dist/layout/useMainTabIndex.js.map +0 -1
  546. package/dist/layout/useResizableLayout.js.map +0 -1
  547. package/dist/layout/useTemporaryLayout.js.map +0 -1
  548. package/dist/link/Link.js.map +0 -1
  549. package/dist/link/SkipToMainContent.js.map +0 -1
  550. package/dist/link/styles.js.map +0 -1
  551. package/dist/list/List.js.map +0 -1
  552. package/dist/list/ListItem.js +0 -148
  553. package/dist/list/ListItem.js.map +0 -1
  554. package/dist/list/ListItemAddon.js.map +0 -1
  555. package/dist/list/ListItemChildren.js.map +0 -1
  556. package/dist/list/ListItemLink.js +0 -89
  557. package/dist/list/ListItemLink.js.map +0 -1
  558. package/dist/list/ListItemText.js.map +0 -1
  559. package/dist/list/ListSubheader.js.map +0 -1
  560. package/dist/list/getListItemHeight.js +0 -28
  561. package/dist/list/getListItemHeight.js.map +0 -1
  562. package/dist/list/listItemStyles.js.map +0 -1
  563. package/dist/list/types.js.map +0 -1
  564. package/dist/media-queries/AppSizeProvider.js.map +0 -1
  565. package/dist/media-queries/appSize.js.map +0 -1
  566. package/dist/media-queries/useMediaQuery.js.map +0 -1
  567. package/dist/menu/DropdownMenu.js.map +0 -1
  568. package/dist/menu/Menu.js.map +0 -1
  569. package/dist/menu/MenuBar.js.map +0 -1
  570. package/dist/menu/MenuButton.js.map +0 -1
  571. package/dist/menu/MenuConfigurationProvider.js.map +0 -1
  572. package/dist/menu/MenuItem.js.map +0 -1
  573. package/dist/menu/MenuItemButton.js.map +0 -1
  574. package/dist/menu/MenuItemGroup.js.map +0 -1
  575. package/dist/menu/MenuItemSeparator.js.map +0 -1
  576. package/dist/menu/MenuSheet.js.map +0 -1
  577. package/dist/menu/MenuVisibilityProvider.js.map +0 -1
  578. package/dist/menu/MenuWidget.js.map +0 -1
  579. package/dist/menu/MenuWidgetKeyboardProvider.js.map +0 -1
  580. package/dist/menu/useContextMenu.js.map +0 -1
  581. package/dist/menu/useMenuBarProvider.js.map +0 -1
  582. package/dist/menu/utils.js.map +0 -1
  583. package/dist/movement/constants.js.map +0 -1
  584. package/dist/movement/findMatchIndex.js.map +0 -1
  585. package/dist/movement/types.js.map +0 -1
  586. package/dist/movement/useKeyboardMovementProvider.js.map +0 -1
  587. package/dist/movement/utils.js.map +0 -1
  588. package/dist/overlay/Overlay.js.map +0 -1
  589. package/dist/overlay/overlayStyles.js.map +0 -1
  590. package/dist/portal/Portal.js.map +0 -1
  591. package/dist/portal/PortalContainerProvider.js.map +0 -1
  592. package/dist/positioning/constants.js.map +0 -1
  593. package/dist/positioning/createHorizontalPosition.js.map +0 -1
  594. package/dist/positioning/createVerticalPosition.js.map +0 -1
  595. package/dist/positioning/getFixedPosition.js.map +0 -1
  596. package/dist/positioning/types.js.map +0 -1
  597. package/dist/positioning/useFixedPositioning.js.map +0 -1
  598. package/dist/positioning/utils.js.map +0 -1
  599. package/dist/progress/CircularProgress.js.map +0 -1
  600. package/dist/progress/LinearProgress.js.map +0 -1
  601. package/dist/progress/getProgressA11y.js.map +0 -1
  602. package/dist/progress/types.js.map +0 -1
  603. package/dist/responsive-item/ResponsiveItemContainer.js.map +0 -1
  604. package/dist/responsive-item/ResponsiveItemOverlay.js.map +0 -1
  605. package/dist/responsive-item/styles.js.map +0 -1
  606. package/dist/scroll/ScrollLock.js.map +0 -1
  607. package/dist/scroll/getScrollbarWidth.js.map +0 -1
  608. package/dist/scroll/useScrollLock.js.map +0 -1
  609. package/dist/segmented-button/SegmentedButton.js.map +0 -1
  610. package/dist/segmented-button/SegmentedButtonContainer.js.map +0 -1
  611. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +0 -1
  612. package/dist/segmented-button/segmentedButtonStyles.js.map +0 -1
  613. package/dist/sheet/Sheet.js.map +0 -1
  614. package/dist/sheet/styles.js.map +0 -1
  615. package/dist/snackbar/DefaultToastRenderer.js.map +0 -1
  616. package/dist/snackbar/Snackbar.js.map +0 -1
  617. package/dist/snackbar/Toast.js.map +0 -1
  618. package/dist/snackbar/ToastActionButton.js.map +0 -1
  619. package/dist/snackbar/ToastCloseButton.js.map +0 -1
  620. package/dist/snackbar/ToastContent.js.map +0 -1
  621. package/dist/snackbar/ToastManager.js.map +0 -1
  622. package/dist/snackbar/ToastManagerProvider.js.map +0 -1
  623. package/dist/snackbar/snackbarStyles.js.map +0 -1
  624. package/dist/snackbar/toastContentStyles.js.map +0 -1
  625. package/dist/snackbar/toastStyles.js.map +0 -1
  626. package/dist/snackbar/useCurrentToastActions.js.map +0 -1
  627. package/dist/suspense/CircularProgressSuspense.js.map +0 -1
  628. package/dist/suspense/NullSuspense.js.map +0 -1
  629. package/dist/table/Table.js.map +0 -1
  630. package/dist/table/TableBody.js.map +0 -1
  631. package/dist/table/TableCell.js.map +0 -1
  632. package/dist/table/TableCellContent.js.map +0 -1
  633. package/dist/table/TableCheckbox.js.map +0 -1
  634. package/dist/table/TableConfigurationProvider.js.map +0 -1
  635. package/dist/table/TableContainer.js.map +0 -1
  636. package/dist/table/TableContainerProvider.js.map +0 -1
  637. package/dist/table/TableFooter.js.map +0 -1
  638. package/dist/table/TableHeader.js.map +0 -1
  639. package/dist/table/TableRadio.js.map +0 -1
  640. package/dist/table/TableRow.js.map +0 -1
  641. package/dist/table/tableCellStyles.js.map +0 -1
  642. package/dist/table/tableContainerStyles.js.map +0 -1
  643. package/dist/table/tableFooterStyles.js.map +0 -1
  644. package/dist/table/tableHeaderStyles.js.map +0 -1
  645. package/dist/table/tableRowStyles.js.map +0 -1
  646. package/dist/table/tableStyles.js.map +0 -1
  647. package/dist/table/types.js.map +0 -1
  648. package/dist/tabs/Tab.js.map +0 -1
  649. package/dist/tabs/TabList.js.map +0 -1
  650. package/dist/tabs/TabListScrollButton.js.map +0 -1
  651. package/dist/tabs/tabIndicatorStyles.js.map +0 -1
  652. package/dist/tabs/tabListScrollButtonStyles.js.map +0 -1
  653. package/dist/tabs/tabListStyles.js.map +0 -1
  654. package/dist/tabs/tabStyles.js.map +0 -1
  655. package/dist/tabs/useTabList.js.map +0 -1
  656. package/dist/tabs/useTabs.js.map +0 -1
  657. package/dist/tabs/utils.js.map +0 -1
  658. package/dist/test-utils/IntersectionObserver.js.map +0 -1
  659. package/dist/test-utils/ResizeObserver.js.map +0 -1
  660. package/dist/test-utils/data-testid.js.map +0 -1
  661. package/dist/test-utils/index.js.map +0 -1
  662. package/dist/test-utils/jest-setup.js.map +0 -1
  663. package/dist/test-utils/matchMedia.js.map +0 -1
  664. package/dist/test-utils/polyfills/IntersectionObserver.js.map +0 -1
  665. package/dist/test-utils/polyfills/ResizeObserver.js.map +0 -1
  666. package/dist/test-utils/polyfills/index.js.map +0 -1
  667. package/dist/test-utils/polyfills/matchMedia.js.map +0 -1
  668. package/dist/test-utils/polyfills/offsetParent.js.map +0 -1
  669. package/dist/test-utils/polyfills/scrollIntoView.js.map +0 -1
  670. package/dist/test-utils/render.js.map +0 -1
  671. package/dist/test-utils/timers.js.map +0 -1
  672. package/dist/theme/LocalStorageColorSchemeProvider.js.map +0 -1
  673. package/dist/theme/ThemeProvider.js.map +0 -1
  674. package/dist/theme/colors.js.map +0 -1
  675. package/dist/theme/cssVars.js.map +0 -1
  676. package/dist/theme/types.js.map +0 -1
  677. package/dist/theme/useCSSVariables.js.map +0 -1
  678. package/dist/theme/useColorScheme.js.map +0 -1
  679. package/dist/theme/useColorSchemeMetaTag.js.map +0 -1
  680. package/dist/theme/useColorSchemeProvider.js.map +0 -1
  681. package/dist/theme/usePrefersColorScheme.js.map +0 -1
  682. package/dist/theme/utils.js.map +0 -1
  683. package/dist/tooltip/Tooltip.js.map +0 -1
  684. package/dist/tooltip/TooltipHoverModeProvider.js.map +0 -1
  685. package/dist/tooltip/constants.js.map +0 -1
  686. package/dist/tooltip/tooltipStyles.js.map +0 -1
  687. package/dist/tooltip/useTooltip.js.map +0 -1
  688. package/dist/tooltip/useTooltipPosition.js.map +0 -1
  689. package/dist/tooltip/utils.js.map +0 -1
  690. package/dist/transition/CSSTransition.js.map +0 -1
  691. package/dist/transition/Collapse.js.map +0 -1
  692. package/dist/transition/CrossFade.js.map +0 -1
  693. package/dist/transition/ScaleTransition.js.map +0 -1
  694. package/dist/transition/SkeletonPlaceholder.js.map +0 -1
  695. package/dist/transition/Slide.js.map +0 -1
  696. package/dist/transition/SlideContainer.js.map +0 -1
  697. package/dist/transition/collapseStyles.js.map +0 -1
  698. package/dist/transition/config.js.map +0 -1
  699. package/dist/transition/maxWidthTransition.js.map +0 -1
  700. package/dist/transition/skeletonPlaceholderUtils.js.map +0 -1
  701. package/dist/transition/types.js.map +0 -1
  702. package/dist/transition/useCSSTransition.js.map +0 -1
  703. package/dist/transition/useCarousel.js.map +0 -1
  704. package/dist/transition/useCollapseTransition.js.map +0 -1
  705. package/dist/transition/useCrossFadeTransition.js.map +0 -1
  706. package/dist/transition/useMaxWidthTransition.js.map +0 -1
  707. package/dist/transition/useScaleTransition.js.map +0 -1
  708. package/dist/transition/useSkeletonPlaceholder.js.map +0 -1
  709. package/dist/transition/useSlideTransition.js.map +0 -1
  710. package/dist/transition/useTransition.js.map +0 -1
  711. package/dist/transition/utils.js.map +0 -1
  712. package/dist/tree/DefaultTreeItemRenderer.js.map +0 -1
  713. package/dist/tree/Tree.js.map +0 -1
  714. package/dist/tree/TreeGroup.js.map +0 -1
  715. package/dist/tree/TreeItem.js.map +0 -1
  716. package/dist/tree/TreeItemExpander.js.map +0 -1
  717. package/dist/tree/TreeProvider.js.map +0 -1
  718. package/dist/tree/styles.js.map +0 -1
  719. package/dist/tree/types.js.map +0 -1
  720. package/dist/tree/useTree.js.map +0 -1
  721. package/dist/tree/useTreeExpansion.js.map +0 -1
  722. package/dist/tree/useTreeItems.js.map +0 -1
  723. package/dist/tree/useTreeMovement.js.map +0 -1
  724. package/dist/tree/useTreeSelection.js.map +0 -1
  725. package/dist/tree/utils.js.map +0 -1
  726. package/dist/types.js.map +0 -1
  727. package/dist/typography/SrOnly.js.map +0 -1
  728. package/dist/typography/TextContainer.js.map +0 -1
  729. package/dist/typography/Typography.js.map +0 -1
  730. package/dist/typography/WritingDirectionProvider.js.map +0 -1
  731. package/dist/useAsyncAction.js.map +0 -1
  732. package/dist/useDebouncedFunction.js.map +0 -1
  733. package/dist/useDropzone.js.map +0 -1
  734. package/dist/useElementSize.js.map +0 -1
  735. package/dist/useEnsuredId.js.map +0 -1
  736. package/dist/useEnsuredRef.js.map +0 -1
  737. package/dist/useEnsuredState.js.map +0 -1
  738. package/dist/useHtmlClassName.js.map +0 -1
  739. package/dist/useIntersectionObserver.js.map +0 -1
  740. package/dist/useIsomorphicLayoutEffect.js.map +0 -1
  741. package/dist/useLocalStorage.js.map +0 -1
  742. package/dist/useOrientation.js.map +0 -1
  743. package/dist/usePageInactive.js.map +0 -1
  744. package/dist/useResizeListener.js.map +0 -1
  745. package/dist/useResizeObserver.js.map +0 -1
  746. package/dist/useThrottledFunction.js.map +0 -1
  747. package/dist/useToggle.js.map +0 -1
  748. package/dist/useUnmounted.js.map +0 -1
  749. package/dist/useWindowSize.js.map +0 -1
  750. package/dist/utils/RenderRecursively.js.map +0 -1
  751. package/dist/utils/alphaNumericSort.js.map +0 -1
  752. package/dist/utils/applyRef.js.map +0 -1
  753. package/dist/utils/bem.js.map +0 -1
  754. package/dist/utils/filters.js.map +0 -1
  755. package/dist/utils/getClientPosition.js.map +0 -1
  756. package/dist/utils/getMiddleOfRange.js.map +0 -1
  757. package/dist/utils/getPercentage.js.map +0 -1
  758. package/dist/utils/getRangeDefaultValue.js.map +0 -1
  759. package/dist/utils/getRangeSteps.js.map +0 -1
  760. package/dist/utils/identity.js.map +0 -1
  761. package/dist/utils/isElementVisible.js.map +0 -1
  762. package/dist/utils/loop.js.map +0 -1
  763. package/dist/utils/nearest.js.map +0 -1
  764. package/dist/utils/parseCssLengthUnit.js.map +0 -1
  765. package/dist/utils/randomInt.js.map +0 -1
  766. package/dist/utils/wait.js.map +0 -1
  767. package/dist/utils/withinRange.js.map +0 -1
  768. package/dist/window-splitter/WindowSplitter.js.map +0 -1
  769. package/dist/window-splitter/useWindowSplitter.js.map +0 -1
  770. /package/dist/{CoreProviders.js → src/CoreProviders.js} +0 -0
  771. /package/dist/{NoSsr.js → src/NoSsr.js} +0 -0
  772. /package/dist/{SsrProvider.js → src/SsrProvider.js} +0 -0
  773. /package/dist/{app-bar → src/app-bar}/AppBar.js +0 -0
  774. /package/dist/{app-bar → src/app-bar}/AppBarTitle.js +0 -0
  775. /package/dist/{avatar → src/avatar}/Avatar.js +0 -0
  776. /package/dist/{avatar → src/avatar}/styles.js +0 -0
  777. /package/dist/{badge → src/badge}/Badge.js +0 -0
  778. /package/dist/{box → src/box}/Box.js +0 -0
  779. /package/dist/{box → src/box}/styles.js +0 -0
  780. /package/dist/{button → src/button}/AsyncButton.js +0 -0
  781. /package/dist/{button → src/button}/Button.js +0 -0
  782. /package/dist/{button → src/button}/ButtonUnstyled.js +0 -0
  783. /package/dist/{button → src/button}/FloatingActionButton.js +0 -0
  784. /package/dist/{button → src/button}/TooltippedButton.js +0 -0
  785. /package/dist/{button → src/button}/buttonStyles.js +0 -0
  786. /package/dist/{button → src/button}/buttonUnstyledStyles.js +0 -0
  787. /package/dist/{card → src/card}/Card.js +0 -0
  788. /package/dist/{card → src/card}/CardContent.js +0 -0
  789. /package/dist/{card → src/card}/CardFooter.js +0 -0
  790. /package/dist/{card → src/card}/CardHeader.js +0 -0
  791. /package/dist/{card → src/card}/CardSubtitle.js +0 -0
  792. /package/dist/{card → src/card}/CardTitle.js +0 -0
  793. /package/dist/{card → src/card}/ClickableCard.js +0 -0
  794. /package/dist/{card → src/card}/styles.js +0 -0
  795. /package/dist/{chip → src/chip}/Chip.js +0 -0
  796. /package/dist/{chip → src/chip}/styles.js +0 -0
  797. /package/dist/{cssUtils.js → src/cssUtils.js} +0 -0
  798. /package/dist/{delegateEvent.js → src/delegateEvent.js} +0 -0
  799. /package/dist/{dialog → src/dialog}/Dialog.js +0 -0
  800. /package/dist/{dialog → src/dialog}/DialogContainer.js +0 -0
  801. /package/dist/{dialog → src/dialog}/DialogContent.js +0 -0
  802. /package/dist/{dialog → src/dialog}/DialogFooter.js +0 -0
  803. /package/dist/{dialog → src/dialog}/DialogHeader.js +0 -0
  804. /package/dist/{dialog → src/dialog}/DialogTitle.js +0 -0
  805. /package/dist/{dialog → src/dialog}/FixedDialog.js +0 -0
  806. /package/dist/{dialog → src/dialog}/NestedDialogProvider.js +0 -0
  807. /package/dist/{dialog → src/dialog}/styles.js +0 -0
  808. /package/dist/{divider → src/divider}/Divider.js +0 -0
  809. /package/dist/{divider → src/divider}/styles.js +0 -0
  810. /package/dist/{draggable → src/draggable}/useDraggable.js +0 -0
  811. /package/dist/{draggable → src/draggable}/utils.js +0 -0
  812. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionList.js +0 -0
  813. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionPanel.js +0 -0
  814. /package/dist/{expansion-panel → src/expansion-panel}/ExpansionPanelHeader.js +0 -0
  815. /package/dist/{expansion-panel → src/expansion-panel}/useExpansionList.js +0 -0
  816. /package/dist/{expansion-panel → src/expansion-panel}/useExpansionPanels.js +0 -0
  817. /package/dist/{focus → src/focus}/useFocusContainer.js +0 -0
  818. /package/dist/{focus → src/focus}/utils.js +0 -0
  819. /package/dist/{form → src/form}/Checkbox.js +0 -0
  820. /package/dist/{form → src/form}/Fieldset.js +0 -0
  821. /package/dist/{form → src/form}/FileInput.js +0 -0
  822. /package/dist/{form → src/form}/Form.js +0 -0
  823. /package/dist/{form → src/form}/FormMessage.js +0 -0
  824. /package/dist/{form → src/form}/FormMessageContainer.js +0 -0
  825. /package/dist/{form → src/form}/FormMessageCounter.js +0 -0
  826. /package/dist/{form → src/form}/InputToggle.js +0 -0
  827. /package/dist/{form → src/form}/InputToggleIcon.js +0 -0
  828. /package/dist/{form → src/form}/Label.js +0 -0
  829. /package/dist/{form → src/form}/Legend.js +0 -0
  830. /package/dist/{form → src/form}/MenuItemCheckbox.js +0 -0
  831. /package/dist/{form → src/form}/MenuItemFileInput.js +0 -0
  832. /package/dist/{form → src/form}/MenuItemInputToggle.js +0 -0
  833. /package/dist/{form → src/form}/MenuItemRadio.js +0 -0
  834. /package/dist/{form → src/form}/MenuItemSwitch.js +0 -0
  835. /package/dist/{form → src/form}/MenuItemTextField.js +0 -0
  836. /package/dist/{form → src/form}/NativeSelect.js +0 -0
  837. /package/dist/{form → src/form}/OptGroup.js +0 -0
  838. /package/dist/{form → src/form}/Option.js +0 -0
  839. /package/dist/{form → src/form}/Password.js +0 -0
  840. /package/dist/{form → src/form}/Radio.js +0 -0
  841. /package/dist/{form → src/form}/Select.js +0 -0
  842. /package/dist/{form → src/form}/SelectValue.js +0 -0
  843. /package/dist/{form → src/form}/Slider.js +0 -0
  844. /package/dist/{form → src/form}/SliderContainer.js +0 -0
  845. /package/dist/{form → src/form}/SliderMark.js +0 -0
  846. /package/dist/{form → src/form}/SliderMarkLabel.js +0 -0
  847. /package/dist/{form → src/form}/SliderThumb.js +0 -0
  848. /package/dist/{form → src/form}/SliderTrack.js +0 -0
  849. /package/dist/{form → src/form}/SliderValueMarks.js +0 -0
  850. /package/dist/{form → src/form}/SliderValueTooltip.js +0 -0
  851. /package/dist/{form → src/form}/Switch.js +0 -0
  852. /package/dist/{form → src/form}/SwitchTrack.js +0 -0
  853. /package/dist/{form → src/form}/TextArea.js +0 -0
  854. /package/dist/{form → src/form}/TextField.js +0 -0
  855. /package/dist/{form → src/form}/TextFieldAddon.js +0 -0
  856. /package/dist/{form → src/form}/TextFieldContainer.js +0 -0
  857. /package/dist/{form → src/form}/TextFieldContainerStyles.js +0 -0
  858. /package/dist/{form → src/form}/fileUtils.js +0 -0
  859. /package/dist/{form → src/form}/formConfig.js +0 -0
  860. /package/dist/{form → src/form}/formMessageStyles.js +0 -0
  861. /package/dist/{form → src/form}/inputToggleStyles.js +0 -0
  862. /package/dist/{form → src/form}/nativeSelectStyles.js +0 -0
  863. /package/dist/{form → src/form}/optionStyles.js +0 -0
  864. /package/dist/{form → src/form}/passwordStyles.js +0 -0
  865. /package/dist/{form → src/form}/selectStyles.js +0 -0
  866. /package/dist/{form → src/form}/selectUtils.js +0 -0
  867. /package/dist/{form → src/form}/sliderUtils.js +0 -0
  868. /package/dist/{form → src/form}/switchStyles.js +0 -0
  869. /package/dist/{form → src/form}/textAreaStyles.js +0 -0
  870. /package/dist/{form → src/form}/textFieldStyles.js +0 -0
  871. /package/dist/{form → src/form}/types.js +0 -0
  872. /package/dist/{form → src/form}/useCheckboxGroup.js +0 -0
  873. /package/dist/{form → src/form}/useFileUpload.js +0 -0
  874. /package/dist/{form → src/form}/useListboxProvider.js +0 -0
  875. /package/dist/{form → src/form}/useNumberField.js +0 -0
  876. /package/dist/{form → src/form}/useRadioGroup.js +0 -0
  877. /package/dist/{form → src/form}/useRangeSlider.js +0 -0
  878. /package/dist/{form → src/form}/useResizingTextArea.js +0 -0
  879. /package/dist/{form → src/form}/useSlider.js +0 -0
  880. /package/dist/{form → src/form}/useTextField.js +0 -0
  881. /package/dist/{form → src/form}/utils.js +0 -0
  882. /package/dist/{form → src/form}/validation.js +0 -0
  883. /package/dist/{hoverMode → src/hoverMode}/useHoverMode.js +0 -0
  884. /package/dist/{hoverMode → src/hoverMode}/useHoverModeProvider.js +0 -0
  885. /package/dist/{icon → src/icon}/FontIcon.js +0 -0
  886. /package/dist/{icon → src/icon}/IconRotator.js +0 -0
  887. /package/dist/{icon → src/icon}/MaterialIcon.js +0 -0
  888. /package/dist/{icon → src/icon}/MaterialSymbol.js +0 -0
  889. /package/dist/{icon → src/icon}/SVGIcon.js +0 -0
  890. /package/dist/{icon → src/icon}/TextIconSpacing.js +0 -0
  891. /package/dist/{icon → src/icon}/iconConfig.js +0 -0
  892. /package/dist/{icon → src/icon}/material.js +0 -0
  893. /package/dist/{icon → src/icon}/materialConfig.js +0 -0
  894. /package/dist/{icon → src/icon}/styles.js +0 -0
  895. /package/dist/{index.js → src/index.js} +0 -0
  896. /package/dist/{interaction → src/interaction}/Ripple.js +0 -0
  897. /package/dist/{interaction → src/interaction}/RippleContainer.js +0 -0
  898. /package/dist/{interaction → src/interaction}/UserInteractionModeProvider.js +0 -0
  899. /package/dist/{interaction → src/interaction}/config.js +0 -0
  900. /package/dist/{interaction → src/interaction}/types.js +0 -0
  901. /package/dist/{interaction → src/interaction}/useElementInteraction.js +0 -0
  902. /package/dist/{interaction → src/interaction}/useHigherContrastChildren.js +0 -0
  903. /package/dist/{interaction → src/interaction}/utils.js +0 -0
  904. /package/dist/{layout → src/layout}/LayoutAppBar.js +0 -0
  905. /package/dist/{layout → src/layout}/LayoutNav.js +0 -0
  906. /package/dist/{layout → src/layout}/LayoutWindowSplitter.js +0 -0
  907. /package/dist/{layout → src/layout}/Main.js +0 -0
  908. /package/dist/{layout → src/layout}/layoutNavStyles.js +0 -0
  909. /package/dist/{layout → src/layout}/layoutWindowSplitterStyles.js +0 -0
  910. /package/dist/{layout → src/layout}/mainStyles.js +0 -0
  911. /package/dist/{layout → src/layout}/useExpandableLayout.js +0 -0
  912. /package/dist/{layout → src/layout}/useHorizontalLayoutTransition.js +0 -0
  913. /package/dist/{layout → src/layout}/useLayoutAppBarHeight.js +0 -0
  914. /package/dist/{layout → src/layout}/useLayoutTree.js +0 -0
  915. /package/dist/{layout → src/layout}/useLayoutWindowSplitter.js +0 -0
  916. /package/dist/{layout → src/layout}/useMainTabIndex.js +0 -0
  917. /package/dist/{layout → src/layout}/useResizableLayout.js +0 -0
  918. /package/dist/{layout → src/layout}/useTemporaryLayout.js +0 -0
  919. /package/dist/{link → src/link}/Link.js +0 -0
  920. /package/dist/{link → src/link}/SkipToMainContent.js +0 -0
  921. /package/dist/{link → src/link}/styles.js +0 -0
  922. /package/dist/{list → src/list}/List.js +0 -0
  923. /package/dist/{list → src/list}/ListItemAddon.js +0 -0
  924. /package/dist/{list → src/list}/ListItemChildren.js +0 -0
  925. /package/dist/{list → src/list}/ListItemText.js +0 -0
  926. /package/dist/{list → src/list}/ListSubheader.js +0 -0
  927. /package/dist/{list → src/list}/listItemStyles.js +0 -0
  928. /package/dist/{list → src/list}/types.js +0 -0
  929. /package/dist/{media-queries → src/media-queries}/AppSizeProvider.js +0 -0
  930. /package/dist/{media-queries → src/media-queries}/appSize.js +0 -0
  931. /package/dist/{media-queries → src/media-queries}/useMediaQuery.js +0 -0
  932. /package/dist/{menu → src/menu}/DropdownMenu.js +0 -0
  933. /package/dist/{menu → src/menu}/Menu.js +0 -0
  934. /package/dist/{menu → src/menu}/MenuBar.js +0 -0
  935. /package/dist/{menu → src/menu}/MenuButton.js +0 -0
  936. /package/dist/{menu → src/menu}/MenuConfigurationProvider.js +0 -0
  937. /package/dist/{menu → src/menu}/MenuItem.js +0 -0
  938. /package/dist/{menu → src/menu}/MenuItemButton.js +0 -0
  939. /package/dist/{menu → src/menu}/MenuItemGroup.js +0 -0
  940. /package/dist/{menu → src/menu}/MenuItemSeparator.js +0 -0
  941. /package/dist/{menu → src/menu}/MenuSheet.js +0 -0
  942. /package/dist/{menu → src/menu}/MenuVisibilityProvider.js +0 -0
  943. /package/dist/{menu → src/menu}/MenuWidget.js +0 -0
  944. /package/dist/{menu → src/menu}/MenuWidgetKeyboardProvider.js +0 -0
  945. /package/dist/{menu → src/menu}/useContextMenu.js +0 -0
  946. /package/dist/{menu → src/menu}/useMenuBarProvider.js +0 -0
  947. /package/dist/{menu → src/menu}/utils.js +0 -0
  948. /package/dist/{movement → src/movement}/constants.js +0 -0
  949. /package/dist/{movement → src/movement}/findMatchIndex.js +0 -0
  950. /package/dist/{movement → src/movement}/types.js +0 -0
  951. /package/dist/{movement → src/movement}/useKeyboardMovementProvider.js +0 -0
  952. /package/dist/{movement → src/movement}/utils.js +0 -0
  953. /package/dist/{overlay → src/overlay}/Overlay.js +0 -0
  954. /package/dist/{overlay → src/overlay}/overlayStyles.js +0 -0
  955. /package/dist/{portal → src/portal}/Portal.js +0 -0
  956. /package/dist/{portal → src/portal}/PortalContainerProvider.js +0 -0
  957. /package/dist/{positioning → src/positioning}/constants.js +0 -0
  958. /package/dist/{positioning → src/positioning}/createHorizontalPosition.js +0 -0
  959. /package/dist/{positioning → src/positioning}/createVerticalPosition.js +0 -0
  960. /package/dist/{positioning → src/positioning}/getFixedPosition.js +0 -0
  961. /package/dist/{positioning → src/positioning}/types.js +0 -0
  962. /package/dist/{positioning → src/positioning}/useFixedPositioning.js +0 -0
  963. /package/dist/{positioning → src/positioning}/utils.js +0 -0
  964. /package/dist/{progress → src/progress}/CircularProgress.js +0 -0
  965. /package/dist/{progress → src/progress}/LinearProgress.js +0 -0
  966. /package/dist/{progress → src/progress}/getProgressA11y.js +0 -0
  967. /package/dist/{progress → src/progress}/types.js +0 -0
  968. /package/dist/{responsive-item → src/responsive-item}/ResponsiveItemContainer.js +0 -0
  969. /package/dist/{responsive-item → src/responsive-item}/ResponsiveItemOverlay.js +0 -0
  970. /package/dist/{responsive-item → src/responsive-item}/styles.js +0 -0
  971. /package/dist/{scroll → src/scroll}/ScrollLock.js +0 -0
  972. /package/dist/{scroll → src/scroll}/getScrollbarWidth.js +0 -0
  973. /package/dist/{scroll → src/scroll}/useScrollLock.js +0 -0
  974. /package/dist/{segmented-button → src/segmented-button}/SegmentedButton.js +0 -0
  975. /package/dist/{segmented-button → src/segmented-button}/SegmentedButtonContainer.js +0 -0
  976. /package/dist/{segmented-button → src/segmented-button}/segmentedButtonContainerStyles.js +0 -0
  977. /package/dist/{segmented-button → src/segmented-button}/segmentedButtonStyles.js +0 -0
  978. /package/dist/{sheet → src/sheet}/Sheet.js +0 -0
  979. /package/dist/{sheet → src/sheet}/styles.js +0 -0
  980. /package/dist/{snackbar → src/snackbar}/DefaultToastRenderer.js +0 -0
  981. /package/dist/{snackbar → src/snackbar}/Snackbar.js +0 -0
  982. /package/dist/{snackbar → src/snackbar}/Toast.js +0 -0
  983. /package/dist/{snackbar → src/snackbar}/ToastActionButton.js +0 -0
  984. /package/dist/{snackbar → src/snackbar}/ToastCloseButton.js +0 -0
  985. /package/dist/{snackbar → src/snackbar}/ToastContent.js +0 -0
  986. /package/dist/{snackbar → src/snackbar}/ToastManager.js +0 -0
  987. /package/dist/{snackbar → src/snackbar}/ToastManagerProvider.js +0 -0
  988. /package/dist/{snackbar → src/snackbar}/snackbarStyles.js +0 -0
  989. /package/dist/{snackbar → src/snackbar}/toastContentStyles.js +0 -0
  990. /package/dist/{snackbar → src/snackbar}/toastStyles.js +0 -0
  991. /package/dist/{snackbar → src/snackbar}/useCurrentToastActions.js +0 -0
  992. /package/dist/{suspense → src/suspense}/CircularProgressSuspense.js +0 -0
  993. /package/dist/{suspense → src/suspense}/NullSuspense.js +0 -0
  994. /package/dist/{table → src/table}/Table.js +0 -0
  995. /package/dist/{table → src/table}/TableBody.js +0 -0
  996. /package/dist/{table → src/table}/TableCell.js +0 -0
  997. /package/dist/{table → src/table}/TableCellContent.js +0 -0
  998. /package/dist/{table → src/table}/TableCheckbox.js +0 -0
  999. /package/dist/{table → src/table}/TableConfigurationProvider.js +0 -0
  1000. /package/dist/{table → src/table}/TableContainer.js +0 -0
  1001. /package/dist/{table → src/table}/TableContainerProvider.js +0 -0
  1002. /package/dist/{table → src/table}/TableFooter.js +0 -0
  1003. /package/dist/{table → src/table}/TableHeader.js +0 -0
  1004. /package/dist/{table → src/table}/TableRadio.js +0 -0
  1005. /package/dist/{table → src/table}/TableRow.js +0 -0
  1006. /package/dist/{table → src/table}/tableCellStyles.js +0 -0
  1007. /package/dist/{table → src/table}/tableContainerStyles.js +0 -0
  1008. /package/dist/{table → src/table}/tableFooterStyles.js +0 -0
  1009. /package/dist/{table → src/table}/tableHeaderStyles.js +0 -0
  1010. /package/dist/{table → src/table}/tableRowStyles.js +0 -0
  1011. /package/dist/{table → src/table}/tableStyles.js +0 -0
  1012. /package/dist/{table → src/table}/types.js +0 -0
  1013. /package/dist/{tabs → src/tabs}/Tab.js +0 -0
  1014. /package/dist/{tabs → src/tabs}/TabList.js +0 -0
  1015. /package/dist/{tabs → src/tabs}/TabListScrollButton.js +0 -0
  1016. /package/dist/{tabs → src/tabs}/tabIndicatorStyles.js +0 -0
  1017. /package/dist/{tabs → src/tabs}/tabListScrollButtonStyles.js +0 -0
  1018. /package/dist/{tabs → src/tabs}/tabListStyles.js +0 -0
  1019. /package/dist/{tabs → src/tabs}/tabStyles.js +0 -0
  1020. /package/dist/{tabs → src/tabs}/useTabList.js +0 -0
  1021. /package/dist/{tabs → src/tabs}/useTabs.js +0 -0
  1022. /package/dist/{tabs → src/tabs}/utils.js +0 -0
  1023. /package/dist/{test-utils → src/test-utils}/IntersectionObserver.js +0 -0
  1024. /package/dist/{test-utils → src/test-utils}/ResizeObserver.js +0 -0
  1025. /package/dist/{test-utils → src/test-utils}/data-testid.js +0 -0
  1026. /package/dist/{test-utils → src/test-utils}/index.js +0 -0
  1027. /package/dist/{test-utils → src/test-utils}/jest-setup.js +0 -0
  1028. /package/dist/{test-utils → src/test-utils}/matchMedia.js +0 -0
  1029. /package/dist/{test-utils → src/test-utils}/polyfills/IntersectionObserver.js +0 -0
  1030. /package/dist/{test-utils → src/test-utils}/polyfills/ResizeObserver.js +0 -0
  1031. /package/dist/{test-utils → src/test-utils}/polyfills/index.js +0 -0
  1032. /package/dist/{test-utils → src/test-utils}/polyfills/matchMedia.js +0 -0
  1033. /package/dist/{test-utils → src/test-utils}/polyfills/offsetParent.js +0 -0
  1034. /package/dist/{test-utils → src/test-utils}/polyfills/scrollIntoView.js +0 -0
  1035. /package/dist/{test-utils → src/test-utils}/render.js +0 -0
  1036. /package/dist/{test-utils → src/test-utils}/timers.js +0 -0
  1037. /package/dist/{theme → src/theme}/LocalStorageColorSchemeProvider.js +0 -0
  1038. /package/dist/{theme → src/theme}/ThemeProvider.js +0 -0
  1039. /package/dist/{theme → src/theme}/colors.js +0 -0
  1040. /package/dist/{theme → src/theme}/cssVars.js +0 -0
  1041. /package/dist/{theme → src/theme}/types.js +0 -0
  1042. /package/dist/{theme → src/theme}/useCSSVariables.js +0 -0
  1043. /package/dist/{theme → src/theme}/useColorScheme.js +0 -0
  1044. /package/dist/{theme → src/theme}/useColorSchemeMetaTag.js +0 -0
  1045. /package/dist/{theme → src/theme}/useColorSchemeProvider.js +0 -0
  1046. /package/dist/{theme → src/theme}/usePrefersColorScheme.js +0 -0
  1047. /package/dist/{theme → src/theme}/utils.js +0 -0
  1048. /package/dist/{tooltip → src/tooltip}/Tooltip.js +0 -0
  1049. /package/dist/{tooltip → src/tooltip}/TooltipHoverModeProvider.js +0 -0
  1050. /package/dist/{tooltip → src/tooltip}/constants.js +0 -0
  1051. /package/dist/{tooltip → src/tooltip}/tooltipStyles.js +0 -0
  1052. /package/dist/{tooltip → src/tooltip}/useTooltip.js +0 -0
  1053. /package/dist/{tooltip → src/tooltip}/useTooltipPosition.js +0 -0
  1054. /package/dist/{tooltip → src/tooltip}/utils.js +0 -0
  1055. /package/dist/{transition → src/transition}/CSSTransition.js +0 -0
  1056. /package/dist/{transition → src/transition}/Collapse.js +0 -0
  1057. /package/dist/{transition → src/transition}/CrossFade.js +0 -0
  1058. /package/dist/{transition → src/transition}/ScaleTransition.js +0 -0
  1059. /package/dist/{transition → src/transition}/SkeletonPlaceholder.js +0 -0
  1060. /package/dist/{transition → src/transition}/Slide.js +0 -0
  1061. /package/dist/{transition → src/transition}/SlideContainer.js +0 -0
  1062. /package/dist/{transition → src/transition}/collapseStyles.js +0 -0
  1063. /package/dist/{transition → src/transition}/config.js +0 -0
  1064. /package/dist/{transition → src/transition}/maxWidthTransition.js +0 -0
  1065. /package/dist/{transition → src/transition}/skeletonPlaceholderUtils.js +0 -0
  1066. /package/dist/{transition → src/transition}/types.js +0 -0
  1067. /package/dist/{transition → src/transition}/useCSSTransition.js +0 -0
  1068. /package/dist/{transition → src/transition}/useCarousel.js +0 -0
  1069. /package/dist/{transition → src/transition}/useCollapseTransition.js +0 -0
  1070. /package/dist/{transition → src/transition}/useCrossFadeTransition.js +0 -0
  1071. /package/dist/{transition → src/transition}/useMaxWidthTransition.js +0 -0
  1072. /package/dist/{transition → src/transition}/useScaleTransition.js +0 -0
  1073. /package/dist/{transition → src/transition}/useSkeletonPlaceholder.js +0 -0
  1074. /package/dist/{transition → src/transition}/useSlideTransition.js +0 -0
  1075. /package/dist/{transition → src/transition}/useTransition.js +0 -0
  1076. /package/dist/{transition → src/transition}/utils.js +0 -0
  1077. /package/dist/{tree → src/tree}/DefaultTreeItemRenderer.js +0 -0
  1078. /package/dist/{tree → src/tree}/Tree.js +0 -0
  1079. /package/dist/{tree → src/tree}/TreeGroup.js +0 -0
  1080. /package/dist/{tree → src/tree}/TreeItem.js +0 -0
  1081. /package/dist/{tree → src/tree}/TreeItemExpander.js +0 -0
  1082. /package/dist/{tree → src/tree}/TreeProvider.js +0 -0
  1083. /package/dist/{tree → src/tree}/styles.js +0 -0
  1084. /package/dist/{tree → src/tree}/types.js +0 -0
  1085. /package/dist/{tree → src/tree}/useTree.js +0 -0
  1086. /package/dist/{tree → src/tree}/useTreeExpansion.js +0 -0
  1087. /package/dist/{tree → src/tree}/useTreeItems.js +0 -0
  1088. /package/dist/{tree → src/tree}/useTreeMovement.js +0 -0
  1089. /package/dist/{tree → src/tree}/useTreeSelection.js +0 -0
  1090. /package/dist/{tree → src/tree}/utils.js +0 -0
  1091. /package/dist/{types.js → src/types.js} +0 -0
  1092. /package/dist/{typography → src/typography}/SrOnly.js +0 -0
  1093. /package/dist/{typography → src/typography}/TextContainer.js +0 -0
  1094. /package/dist/{typography → src/typography}/Typography.js +0 -0
  1095. /package/dist/{typography → src/typography}/WritingDirectionProvider.js +0 -0
  1096. /package/dist/{useAsyncAction.js → src/useAsyncAction.js} +0 -0
  1097. /package/dist/{useDebouncedFunction.js → src/useDebouncedFunction.js} +0 -0
  1098. /package/dist/{useDropzone.js → src/useDropzone.js} +0 -0
  1099. /package/dist/{useElementSize.js → src/useElementSize.js} +0 -0
  1100. /package/dist/{useEnsuredId.js → src/useEnsuredId.js} +0 -0
  1101. /package/dist/{useEnsuredRef.js → src/useEnsuredRef.js} +0 -0
  1102. /package/dist/{useEnsuredState.js → src/useEnsuredState.js} +0 -0
  1103. /package/dist/{useHtmlClassName.js → src/useHtmlClassName.js} +0 -0
  1104. /package/dist/{useIntersectionObserver.js → src/useIntersectionObserver.js} +0 -0
  1105. /package/dist/{useIsomorphicLayoutEffect.js → src/useIsomorphicLayoutEffect.js} +0 -0
  1106. /package/dist/{useLocalStorage.js → src/useLocalStorage.js} +0 -0
  1107. /package/dist/{useOrientation.js → src/useOrientation.js} +0 -0
  1108. /package/dist/{usePageInactive.js → src/usePageInactive.js} +0 -0
  1109. /package/dist/{useResizeListener.js → src/useResizeListener.js} +0 -0
  1110. /package/dist/{useResizeObserver.js → src/useResizeObserver.js} +0 -0
  1111. /package/dist/{useThrottledFunction.js → src/useThrottledFunction.js} +0 -0
  1112. /package/dist/{useToggle.js → src/useToggle.js} +0 -0
  1113. /package/dist/{useUnmounted.js → src/useUnmounted.js} +0 -0
  1114. /package/dist/{useWindowSize.js → src/useWindowSize.js} +0 -0
  1115. /package/dist/{utils → src/utils}/RenderRecursively.js +0 -0
  1116. /package/dist/{utils → src/utils}/alphaNumericSort.js +0 -0
  1117. /package/dist/{utils → src/utils}/applyRef.js +0 -0
  1118. /package/dist/{utils → src/utils}/bem.js +0 -0
  1119. /package/dist/{utils → src/utils}/filters.js +0 -0
  1120. /package/dist/{utils → src/utils}/getClientPosition.js +0 -0
  1121. /package/dist/{utils → src/utils}/getMiddleOfRange.js +0 -0
  1122. /package/dist/{utils → src/utils}/getPercentage.js +0 -0
  1123. /package/dist/{utils → src/utils}/getRangeDefaultValue.js +0 -0
  1124. /package/dist/{utils → src/utils}/getRangeSteps.js +0 -0
  1125. /package/dist/{utils → src/utils}/identity.js +0 -0
  1126. /package/dist/{utils → src/utils}/isElementVisible.js +0 -0
  1127. /package/dist/{utils → src/utils}/loop.js +0 -0
  1128. /package/dist/{utils → src/utils}/nearest.js +0 -0
  1129. /package/dist/{utils → src/utils}/parseCssLengthUnit.js +0 -0
  1130. /package/dist/{utils → src/utils}/randomInt.js +0 -0
  1131. /package/dist/{utils → src/utils}/wait.js +0 -0
  1132. /package/dist/{utils → src/utils}/withinRange.js +0 -0
  1133. /package/dist/{window-splitter → src/window-splitter}/WindowSplitter.js +0 -0
  1134. /package/dist/{window-splitter → src/window-splitter}/useWindowSplitter.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/movement/types.ts"],"sourcesContent":["import type {\n FocusEvent,\n FocusEventHandler,\n KeyboardEvent,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n} from \"react\";\nimport type {\n NonNullMutableRef,\n NonNullRef,\n UseStateSetter,\n} from \"../types.js\";\n\n/**\n * Set this to `\"roving\"` when:\n * - there are a group of focusable elements that have a `tabIndex={-1}`\n * - the container element defaults to having a `tabIndex={0}`\n * - if the container is focused, it should no longer be included in the normal\n * tab flow. Instead, the current focused element should be included instead\n * by changing its `tabIndex` from `-1` to `0`\n *\n * Set this to `\"virtual\"` when:\n * - the container element should never lose focus\n * - the \"focused\" element only gains focus styles instead of being focused\n * - the container element specifies an `aria-activedescendant` pointing to one\n * of the ids for the child \"focusable\" elements\n *\n * @remarks \\@since 6.0.0\n */\nexport type TabIndexBehavior = \"roving\" | \"virtual\";\n\n/**\n * @remarks \\@since 5.0.0\n */\nexport interface KeyboardMovementConfiguration {\n /**\n * A list of keys that will attempt to increment the focus index by 1.\n *\n * @defaultValue `[\"ArrowDown\"]`\n */\n incrementKeys?: readonly string[];\n\n /**\n * A list of keys that will attempt to decrement the focus index by 1.\n *\n * @defaultValue `[\"ArrowUp\"]`\n */\n decrementKeys?: readonly string[];\n\n /**\n * A list of keys that will set the focus index to `0`.\n *\n * @defaultValue `[\"Home\"]`\n */\n jumpToFirstKeys?: readonly string[];\n\n /**\n * A list of keys that will set the focus index to the last focusable index.\n *\n * @defaultValue `[\"End\"]`\n */\n jumpToLastKeys?: readonly string[];\n}\n\n/**\n * The defined {@link KeyboardMovementConfiguration} that should be used for\n * custom keyboard focus behavior.\n *\n * @remarks \\@since 5.0.0\n */\nexport type KeyboardMovementConfig = Required<KeyboardMovementConfiguration>;\n\n/**\n * @remarks \\@since 5.0.0\n */\nexport interface KeyboardMovementBehavior {\n /**\n * Boolean if pressing a letter will focus the next item in the\n * {@link KeyboardMovementProvider} that starts with the same letter.\n *\n * @defaultValue `false`\n */\n searchable?: boolean;\n\n /**\n * Boolean if the {@link KeyboardMovementProvider} should allow the focus behavior\n * to loop from the first to last or last to first item instead of preventing\n * any new focus behavior. In other words... if the last item is focused and\n * the user presses a key that should advance the focus to the next focusable\n * element, should the focus stay on the current element or loop back and\n * focus the first focusable item.\n *\n * @defaultValue `false`\n */\n loopable?: boolean;\n\n /**\n * Boolean if elements that are `aria-disabled` or `disabled` should still be\n * able to gain focus.\n *\n * @defaultValue `false`\n */\n includeDisabled?: boolean;\n\n /**\n * Boolean if the keyboard movement is horizontal instead of vertical. This\n * updates the default keyboard config to use `ArrowRight` and `ArrowLeft`\n * instead of `ArrowDown` and `ArrowUp`,\n *\n * @remarks \\@since 5.1.2\n * @defaultValue `false`\n */\n horizontal?: boolean;\n}\n\n/**\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Removed `attach`, `detach` and `watching`\n * @internal\n */\nexport interface KeyboardMovementContext\n extends Required<KeyboardMovementBehavior> {\n /** {@inheritDoc KeyboardMovementConfig} */\n config: NonNullRef<KeyboardMovementConfig>;\n\n /** @see {@link TabIndexBehavior} */\n tabIndexBehavior: TabIndexBehavior | undefined;\n\n /**\n * Note: This will only update if the {@link KeyboardMovementProviderOptions.tabIndexBehavior}\n * has been set to `\"roving\"` or `\"virtual\"`.\n */\n activeDescendantId: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface FocusableIndexOptions {\n focusables: readonly HTMLElement[];\n includeDisabled: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type GetDefaultFocusedIndex = (options: FocusableIndexOptions) => number;\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface FocusChangeEvent {\n index: number;\n element: HTMLElement;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport type KeyboardMovementFocusChangeEvent = (\n event: FocusChangeEvent\n) => void;\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface KeyboardMovementExtensionData<E extends HTMLElement>\n extends KeyboardMovementContext {\n event: KeyboardEvent<E>;\n currentFocusIndex: NonNullMutableRef<number>;\n setFocusIndex(index: number, focusables: readonly HTMLElement[]): void;\n setActiveDescendantId(id: string): void;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface KeyboardMovementProviderOptions<E extends HTMLElement>\n extends KeyboardMovementBehavior,\n KeyboardMovementConfiguration {\n /** @see {@link TabIndexBehavior} */\n tabIndexBehavior?: TabIndexBehavior;\n\n onClick?(event: MouseEvent<E>): void;\n onFocus?(event: FocusEvent<E>): void;\n onKeyDown?(event: KeyboardEvent<E>): void;\n\n /**\n * This is used to implement custom keyboard movement for the `keydown` event.\n */\n extendKeyDown?(movementData: KeyboardMovementExtensionData<E>): void;\n\n /**\n * Triggered whenever the focus changes.\n */\n onFocusChange?: KeyboardMovementFocusChangeEvent;\n\n /**\n * From what I've understood so far, programmatically focusable elements\n * should only be included when disabled elements via `aria-disabled` are\n * allowed.\n *\n * @defaultValue `includeDisabled`\n */\n programmatic?: boolean;\n\n /**\n * This should be used for specific widgets that should not include all\n * focusable elements and instead only specific elements.\n *\n * @example\n * ```ts\n * const getExpansionPanelsOnly = (container: HTMLElement): readonly HTMLElement[] =>\n * container.querySelectorAll(\".rmd-expansion-panel__button\");\n *\n * const getTreeItemsOnly = (container: HTMLElement): readonly HTMLElement[] =>\n * container.querySelectorAll(\"[role='treeitem']\");\n * ```\n *\n * @defaultValue `getFocusableElements`\n * @see the default `getFocusableElements` function.\n */\n getFocusableElements?(\n container: HTMLElement,\n programmatic: boolean\n ): readonly HTMLElement[];\n\n /**\n * This can be used to set the initial focus index whenever the container\n * element is first focused or the focus index is `-1` on other focus events.\n */\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface KeyboardMovementProps<E extends HTMLElement> {\n /**\n * This will only be provided if the {@link KeyboardMovementContext.tabIndexBehavior}\n * is set to `\"virtual\"`.\n */\n \"aria-activedescendant\"?: string;\n\n /**\n * This will not be provided if the {@link KeyboardMovementContext.tabIndexBehavior}\n * is `undefined`. Otherwise:\n * - `0` when `\"virtual\"`\n * - `0` when `\"roving\"` and the container element has not been focused at\n * least once\n * - `-1` when `\"roving\"` and the container has been focused at least once\n * - a child element **should** have a `tabIndex={0}` instead\n */\n tabIndex?: number;\n onClick: MouseEventHandler<E>;\n onFocus: FocusEventHandler<E>;\n onKeyDown: KeyboardEventHandler<E>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface KeyboardMovementProviderImplementation<E extends HTMLElement> {\n movementProps: Readonly<KeyboardMovementProps<E>>;\n movementContext: Readonly<KeyboardMovementContext>;\n currentFocusIndex: NonNullMutableRef<number>;\n setActiveDescendantId: UseStateSetter<string>;\n}\n"],"names":[],"mappings":"AA4QA;;;CAGC,GACD,WAKC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/movement/useKeyboardMovementProvider.ts"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { getFocusableElements as defaultGetFocusableElements } from \"../focus/utils.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { useDir } from \"../typography/WritingDirectionProvider.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport {\n DEFAULT_KEYBOARD_MOVEMENT,\n DEFAULT_LTR_KEYBOARD_MOVEMENT,\n DEFAULT_RTL_KEYBOARD_MOVEMENT,\n} from \"./constants.js\";\nimport { findMatchIndex } from \"./findMatchIndex.js\";\nimport type {\n KeyboardMovementConfig,\n KeyboardMovementConfiguration,\n KeyboardMovementContext,\n KeyboardMovementProviderImplementation,\n KeyboardMovementProviderOptions,\n} from \"./types.js\";\nimport {\n getFirstFocusableIndex,\n getLastFocusableIndex,\n getNextFocusableIndex,\n getSearchText,\n getVirtualFocusDefaultIndex,\n isElementDisabled,\n isNotFocusable,\n isSearchableEvent,\n recalculateFocusIndex,\n} from \"./utils.js\";\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nconst context = createContext<KeyboardMovementContext>({\n config: { current: DEFAULT_KEYBOARD_MOVEMENT },\n loopable: false,\n searchable: false,\n horizontal: false,\n includeDisabled: false,\n tabIndexBehavior: undefined,\n activeDescendantId: \"\",\n});\ncontext.displayName = \"KeyboardMovement\";\nexport const { Provider: KeyboardMovementProvider } = context;\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport function useKeyboardMovementContext(): Readonly<KeyboardMovementContext> {\n return useContext(context);\n}\n\nconst noop = (): void => {\n // do nothing\n};\n\nconst returnNegative1 = (): number => -1;\n\n/**\n * Implements the custom keyboard movement behavior throughout react-md. Using\n * the \"Find References\" will be the best way to see example usage.\n *\n * @example\n * Default Keyboard Movement for any Focusable Element\n * ```tsx\n * import {\n * KeyboardMovementProvider,\n * useKeyboardMovementProvider,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * function Example({ children }: { children: ReactNode }): ReactElement {\n * const { movementContext, movementProps } = useKeyboardMovementProvider();\n *\n * // any focusable element child can be focused with the arrow , home, and\n * // end keys\n * return (\n * <KeyboardMovementProvider value={movementContext}>\n * <div {...movementProps}>\n * {children}\n * </div>\n * </KeyboardMovementProvider>\n * );\n * }\n * ```\n *\n * @example\n * Active Descendant Movement\n * ```tsx\n * import {\n * KeyboardMovementProvider,\n * useKeyboardMovementContext,\n * useKeyboardMovementProvider,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n * import { useId } from \"react\";\n *\n * function Child(): ReactElement {\n * const id = useId()\n * const { activeDescendantId } = useKeyboardMovementContext();\n *\n * return (\n * <div\n * {...props}\n * id={id}\n * className={cnb(id === activeDescendantId && \"focused-class-name\")}\n * >\n * Some Content\n * </div>\n * );\n * }\n *\n * function Example({ children }: { children: ReactNode }): ReactElement {\n * const { movementContext, movementProps } = useKeyboardMovementProvider({\n * loopable: true,\n * searchable: true,\n * tabIndexBehavior: \"virtual\",\n * });\n *\n * // any focusable element child can be focused with the arrow , home, and\n * // end keys\n * return (\n * <KeyboardMovementProvider value={movementContext}>\n * <div {...movementProps}>\n * <Child />\n * <Child />\n * <Child />\n * </div>\n * </KeyboardMovementProvider>\n * );\n * }\n * ```\n *\n * @example\n * Roving Tab Index\n * ```tsx\n * import {\n * KeyboardMovementProvider,\n * useKeyboardMovementContext,\n * useKeyboardMovementProvider,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n * import { useId } from \"react\";\n *\n * function Child(): ReactElement {\n * const id = useId()\n * const { activeDescendantId } = useKeyboardMovementContext();\n *\n * return (\n * <div\n * {...props}\n * id={id}\n * tabIndex={id === activeDescendantId ? 0 : -1}\n * >\n * Some Content\n * </div>\n * );\n * }\n *\n * function Example({ children }: { children: ReactNode }): ReactElement {\n * const { movementContext, movementProps } = useKeyboardMovementProvider({\n * loopable: true,\n * searchable: true,\n * tabIndexBehavior: \"roving\",\n * });\n *\n * // any focusable element child can be focused with the arrow , home, and\n * // end keys\n * return (\n * <KeyboardMovementProvider value={movementContext}>\n * <div {...movementProps}>\n * <Child />\n * <Child />\n * <Child />\n * </div>\n * </KeyboardMovementProvider>\n * );\n * }\n * ```\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport function useKeyboardMovementProvider<E extends HTMLElement>(\n options: KeyboardMovementProviderOptions<E> = {}\n): KeyboardMovementProviderImplementation<E> {\n const {\n onClick = noop,\n onFocus = noop,\n onKeyDown = noop,\n loopable = false,\n searchable = false,\n horizontal = false,\n includeDisabled = false,\n tabIndexBehavior,\n extendKeyDown = noop,\n onFocusChange = noop,\n programmatic = includeDisabled,\n incrementKeys: propIncrementKeys,\n decrementKeys: propDecrementKeys,\n jumpToFirstKeys: propJumpToFirstKeys,\n jumpToLastKeys: propJumpToLastKeys,\n getFocusableElements = defaultGetFocusableElements,\n getDefaultFocusedIndex = returnNegative1,\n } = options;\n\n const isRTL = useDir().dir === \"rtl\";\n let defaults: Readonly<Required<KeyboardMovementConfiguration>>;\n if (horizontal) {\n defaults = isRTL\n ? DEFAULT_RTL_KEYBOARD_MOVEMENT\n : DEFAULT_LTR_KEYBOARD_MOVEMENT;\n } else {\n defaults = DEFAULT_KEYBOARD_MOVEMENT;\n }\n\n const incrementKeys = propIncrementKeys || defaults.incrementKeys;\n const decrementKeys = propDecrementKeys || defaults.decrementKeys;\n const jumpToFirstKeys = propJumpToFirstKeys || defaults.jumpToFirstKeys;\n const jumpToLastKeys = propJumpToLastKeys || defaults.jumpToLastKeys;\n\n const configuration: KeyboardMovementConfig = {\n incrementKeys,\n decrementKeys,\n jumpToFirstKeys,\n jumpToLastKeys,\n };\n const config = useRef(configuration);\n useIsomorphicLayoutEffect(() => {\n config.current = configuration;\n });\n\n const [activeDescendantId, setActiveDescendantId] = useState(\"\");\n const movementContext = useMemo<KeyboardMovementContext>(\n () => ({\n config,\n loopable,\n searchable,\n horizontal,\n includeDisabled,\n tabIndexBehavior,\n activeDescendantId,\n }),\n [\n activeDescendantId,\n horizontal,\n includeDisabled,\n loopable,\n searchable,\n tabIndexBehavior,\n ]\n );\n const currentFocusIndex = useRef(-1);\n const mode = useUserInteractionMode();\n const refocus = useRef(false);\n\n if (process.env.NODE_ENV !== \"production\") {\n // this fixes issues during hot reloading and using the `useId()` hook\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n return () => {\n setActiveDescendantId(\"\");\n };\n }, []);\n }\n\n return {\n movementProps: {\n \"aria-activedescendant\":\n tabIndexBehavior === \"virtual\" ? activeDescendantId : undefined,\n tabIndex:\n tabIndexBehavior === \"roving\"\n ? activeDescendantId\n ? -1\n : 0\n : undefined,\n\n // Note: This used to be on the `onFocus` event, but this causes issues in\n // Chromium browsers for drag and drop behavior\n onClick(event) {\n onClick(event);\n\n // This makes it so you can click an element with a mouse and then\n // keyboard navigate from that element instead of the last keyboard focus\n // element\n const { currentTarget, target } = event;\n if (target === currentTarget || !(target instanceof HTMLElement)) {\n return;\n }\n\n const focusables = getFocusableElements(currentTarget, programmatic);\n const focusedIndex = focusables.findIndex(\n (element) => element === target || element.contains(target)\n );\n if (focusedIndex === -1 || !focusables.length) {\n return;\n }\n\n currentFocusIndex.current = focusedIndex;\n const focused = focusables[focusedIndex];\n if (tabIndexBehavior) {\n setActiveDescendantId(focused.id);\n }\n\n // need to force focus back to the container element when using\n // aria activedescendant\n if (tabIndexBehavior === \"virtual\") {\n refocus.current = true;\n currentTarget.focus();\n }\n\n onFocusChange({\n index: focusedIndex,\n element: focused,\n });\n },\n onFocus(event) {\n onFocus(event);\n if (event.isPropagationStopped() || refocus.current) {\n refocus.current = false;\n return;\n }\n\n if (\n (mode !== \"keyboard\" && tabIndexBehavior !== \"virtual\") ||\n event.target !== event.currentTarget\n ) {\n return;\n }\n\n const focusables = getFocusableElements(\n event.currentTarget,\n programmatic\n );\n if (!focusables.length) {\n return;\n }\n\n let defaultFocusIndex = getDefaultFocusedIndex({\n focusables,\n includeDisabled,\n });\n\n // This allows my custom `getDefaultFocusedIndex` implementations to\n // have a nice fallback without having to re-implement the \"focus\n // first\" behavior\n if (defaultFocusIndex === -1) {\n if (tabIndexBehavior === \"virtual\") {\n // virtual keyboard navigation **must** always focus at least one element\n defaultFocusIndex = getVirtualFocusDefaultIndex({\n focusables,\n includeDisabled,\n activeDescendantId,\n });\n } else {\n defaultFocusIndex = getFirstFocusableIndex({\n focusables,\n includeDisabled,\n });\n }\n }\n\n if (defaultFocusIndex === -1) {\n return;\n }\n\n currentFocusIndex.current = defaultFocusIndex;\n const focused = focusables[defaultFocusIndex];\n if (tabIndexBehavior) {\n setActiveDescendantId(focused.id);\n }\n\n if (tabIndexBehavior !== \"virtual\") {\n focused.focus();\n } else {\n focused.scrollIntoView({ block: \"nearest\" });\n }\n\n onFocusChange({\n index: defaultFocusIndex,\n element: focused,\n });\n },\n onKeyDown(event) {\n onKeyDown(event);\n const { currentTarget } = event;\n\n const setFocusIndex = (\n index: number,\n focusables: readonly HTMLElement[]\n ): void => {\n event.preventDefault();\n event.stopPropagation();\n if (currentFocusIndex.current === index || index === -1) {\n return;\n }\n\n currentFocusIndex.current = index;\n const focused = focusables[index];\n if (tabIndexBehavior) {\n focused.scrollIntoView({\n block: \"nearest\",\n inline: \"nearest\",\n });\n setActiveDescendantId(focused.id);\n }\n\n if (tabIndexBehavior !== \"virtual\") {\n focused.focus();\n }\n\n onFocusChange({\n index,\n element: focused,\n });\n };\n\n extendKeyDown({\n event,\n setFocusIndex,\n currentFocusIndex,\n setActiveDescendantId,\n ...movementContext,\n });\n\n if (event.isPropagationStopped()) {\n return;\n }\n\n // TODO: Figure this part out. This is currently required for the tree\n // movement when the asterisk key is pressed. There might be other cases\n // as well.\n if (currentFocusIndex.current === -1) {\n currentFocusIndex.current = recalculateFocusIndex({\n focusables: getFocusableElements(currentTarget, programmatic),\n includeDisabled,\n tabIndexBehavior,\n activeDescendantId,\n });\n }\n\n const { key, shiftKey } = event;\n if (\n tabIndexBehavior === \"virtual\" &&\n activeDescendantId &&\n (key === \" \" || key === \"Enter\")\n ) {\n if (key === \" \") {\n event.preventDefault();\n }\n\n const focusables = getFocusableElements(currentTarget, programmatic);\n const activeElement = focusables[currentFocusIndex.current];\n if (!activeElement || isElementDisabled(activeElement)) {\n return;\n }\n\n activeElement.click();\n return;\n }\n\n const {\n incrementKeys,\n decrementKeys,\n jumpToFirstKeys,\n jumpToLastKeys,\n } = config.current;\n\n if (searchable && isSearchableEvent(event)) {\n const focusables = getFocusableElements(currentTarget, programmatic);\n const index = findMatchIndex({\n value: key,\n values: focusables.map((element) =>\n getSearchText(element, !isNotFocusable(element, includeDisabled))\n ),\n startIndex: shiftKey ? -1 : currentFocusIndex.current,\n });\n setFocusIndex(index, focusables);\n return;\n }\n\n const jumpToFirst = jumpToFirstKeys.includes(key);\n const jumpToLast = !jumpToFirst && jumpToLastKeys.includes(key);\n const increment =\n !jumpToFirst && !jumpToLast && incrementKeys.includes(key);\n const decrement =\n !jumpToFirst &&\n !jumpToLast &&\n !increment &&\n decrementKeys.includes(key);\n\n if (!jumpToFirst && !jumpToLast && !increment && !decrement) {\n return;\n }\n const focusables = getFocusableElements(currentTarget, programmatic);\n\n let index: number;\n if (jumpToFirst) {\n index = getFirstFocusableIndex({\n focusables,\n includeDisabled,\n });\n } else if (jumpToLast) {\n index = getLastFocusableIndex({\n focusables,\n includeDisabled,\n });\n } else {\n index = getNextFocusableIndex({\n loopable,\n increment,\n focusables,\n includeDisabled,\n currentFocusIndex: currentFocusIndex.current,\n });\n }\n\n setFocusIndex(index, focusables);\n },\n },\n movementContext,\n currentFocusIndex,\n setActiveDescendantId,\n };\n}\n"],"names":["createContext","useContext","useEffect","useMemo","useRef","useState","getFocusableElements","defaultGetFocusableElements","useUserInteractionMode","useDir","useIsomorphicLayoutEffect","DEFAULT_KEYBOARD_MOVEMENT","DEFAULT_LTR_KEYBOARD_MOVEMENT","DEFAULT_RTL_KEYBOARD_MOVEMENT","findMatchIndex","getFirstFocusableIndex","getLastFocusableIndex","getNextFocusableIndex","getSearchText","getVirtualFocusDefaultIndex","isElementDisabled","isNotFocusable","isSearchableEvent","recalculateFocusIndex","context","config","current","loopable","searchable","horizontal","includeDisabled","tabIndexBehavior","undefined","activeDescendantId","displayName","Provider","KeyboardMovementProvider","useKeyboardMovementContext","noop","returnNegative1","useKeyboardMovementProvider","options","onClick","onFocus","onKeyDown","extendKeyDown","onFocusChange","programmatic","incrementKeys","propIncrementKeys","decrementKeys","propDecrementKeys","jumpToFirstKeys","propJumpToFirstKeys","jumpToLastKeys","propJumpToLastKeys","getDefaultFocusedIndex","isRTL","dir","defaults","configuration","setActiveDescendantId","movementContext","currentFocusIndex","mode","refocus","process","env","NODE_ENV","movementProps","tabIndex","event","currentTarget","target","HTMLElement","focusables","focusedIndex","findIndex","element","contains","length","focused","id","focus","index","isPropagationStopped","defaultFocusIndex","scrollIntoView","block","setFocusIndex","preventDefault","stopPropagation","inline","key","shiftKey","activeElement","click","value","values","map","startIndex","jumpToFirst","includes","jumpToLast","increment","decrement"],"mappings":"AAAA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AACf,SAASC,wBAAwBC,2BAA2B,QAAQ,oBAAoB;AACxF,SAASC,sBAAsB,QAAQ,gDAAgD;AACvF,SAASC,MAAM,QAAQ,4CAA4C;AACnE,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SACEC,yBAAyB,EACzBC,6BAA6B,EAC7BC,6BAA6B,QACxB,iBAAiB;AACxB,SAASC,cAAc,QAAQ,sBAAsB;AAQrD,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,qBAAqB,EACrBC,aAAa,EACbC,2BAA2B,EAC3BC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBC,qBAAqB,QAChB,aAAa;AAEpB;;;CAGC,GACD,MAAMC,UAAUxB,cAAuC;IACrDyB,QAAQ;QAAEC,SAASf;IAA0B;IAC7CgB,UAAU;IACVC,YAAY;IACZC,YAAY;IACZC,iBAAiB;IACjBC,kBAAkBC;IAClBC,oBAAoB;AACtB;AACAT,QAAQU,WAAW,GAAG;AACtB,OAAO,MAAM,EAAEC,UAAUC,wBAAwB,EAAE,GAAGZ,QAAQ;AAE9D;;;CAGC,GACD,OAAO,SAASa;IACd,OAAOpC,WAAWuB;AACpB;AAEA,MAAMc,OAAO;AACX,aAAa;AACf;AAEA,MAAMC,kBAAkB,IAAc,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,IAAI/B,kBAAkBrC,OAAO;oBACvD;oBACA+D,cAAcL,OAAOT;oBACrB;gBACF;gBAEA,MAAM0B,cAAcjD,gBAAgBkD,QAAQ,CAACT;gBAC7C,MAAMU,aAAa,CAACF,eAAe/C,eAAegD,QAAQ,CAACT;gBAC3D,MAAMW,YACJ,CAACH,eAAe,CAACE,cAAcvD,cAAcsD,QAAQ,CAACT;gBACxD,MAAMY,YACJ,CAACJ,eACD,CAACE,cACD,CAACC,aACDtD,cAAcoD,QAAQ,CAACT;gBAEzB,IAAI,CAACQ,eAAe,CAACE,cAAc,CAACC,aAAa,CAACC,WAAW;oBAC3D;gBACF;gBACA,MAAM9B,aAAarE,qBAAqBkE,eAAezB;gBAEvD,IAAIqC;gBACJ,IAAIiB,aAAa;oBACfjB,QAAQrE,uBAAuB;wBAC7B4D;wBACA7C;oBACF;gBACF,OAAO,IAAIyE,YAAY;oBACrBnB,QAAQpE,sBAAsB;wBAC5B2D;wBACA7C;oBACF;gBACF,OAAO;oBACLsD,QAAQnE,sBAAsB;wBAC5BU;wBACA6E;wBACA7B;wBACA7C;wBACAiC,mBAAmBA,kBAAkBrC,OAAO;oBAC9C;gBACF;gBAEA+D,cAAcL,OAAOT;YACvB;QACF;QACAb;QACAC;QACAF;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/movement/utils.ts"],"sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport { loop } from \"../utils/loop.js\";\nimport type { FocusableIndexOptions, TabIndexBehavior } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const isElementDisabled = (element: HTMLElement): boolean =>\n element.getAttribute(\"disabled\") !== null ||\n element.getAttribute(\"aria-disabled\") === \"true\";\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport const isNotFocusable = (\n element: HTMLElement | undefined,\n includeDisabled: boolean\n): boolean => {\n if (!element) {\n return true;\n }\n\n if (includeDisabled) {\n return false;\n }\n\n return isElementDisabled(element);\n};\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface VirtualFocusableIndexOptions {\n focusables: readonly HTMLElement[];\n includeDisabled: boolean;\n activeDescendantId: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const getVirtualFocusDefaultIndex = (\n options: VirtualFocusableIndexOptions\n): number => {\n const { focusables, includeDisabled, activeDescendantId } = options;\n if (!focusables.length || (!activeDescendantId && includeDisabled)) {\n return 0;\n }\n\n const activeIndex = focusables.findIndex((element) => {\n if (activeDescendantId) {\n return element.id === activeDescendantId;\n }\n\n return !isElementDisabled(element);\n });\n return Math.max(0, activeIndex);\n};\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport const getFirstFocusableIndex = (\n options: FocusableIndexOptions\n): number => {\n const { focusables, includeDisabled } = options;\n\n if (!focusables.length) {\n return -1;\n }\n\n let firstIndex = 0;\n while (\n firstIndex < focusables.length - 1 &&\n isNotFocusable(focusables[firstIndex], includeDisabled)\n ) {\n firstIndex += 1;\n }\n\n if (isNotFocusable(focusables[firstIndex], includeDisabled)) {\n return -1;\n }\n\n return firstIndex;\n};\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport const getLastFocusableIndex = (\n options: FocusableIndexOptions\n): number => {\n const { focusables, includeDisabled } = options;\n\n if (!focusables.length) {\n return -1;\n }\n\n let lastIndex = focusables.length - 1;\n while (\n lastIndex > 0 &&\n isNotFocusable(focusables[lastIndex], includeDisabled)\n ) {\n lastIndex -= 1;\n }\n\n if (isNotFocusable(focusables[lastIndex], includeDisabled)) {\n return -1;\n }\n\n return lastIndex;\n};\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\ninterface NextFocusableIndexOptions extends FocusableIndexOptions {\n loopable: boolean;\n increment: boolean;\n currentFocusIndex: number;\n}\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport const getNextFocusableIndex = (\n options: NextFocusableIndexOptions\n): number => {\n const {\n loopable,\n increment,\n focusables,\n includeDisabled,\n currentFocusIndex,\n } = options;\n if (!focusables.length) {\n return currentFocusIndex;\n }\n\n const min = getFirstFocusableIndex({ focusables, includeDisabled });\n const max = getLastFocusableIndex({ focusables, includeDisabled });\n let nextIndex = loop({\n min,\n max,\n value: currentFocusIndex,\n minmax: !loopable,\n increment,\n });\n while (\n isNotFocusable(focusables[nextIndex], includeDisabled) &&\n (loopable || nextIndex !== (increment ? max : min))\n ) {\n nextIndex = loop({\n min,\n max,\n value: nextIndex,\n minmax: !loopable,\n increment,\n });\n }\n\n // Since the `min` and `max` values are \"safely\" set, I don't need to verify\n // the nextIndex is still focusable\n return nextIndex;\n};\n\n/**\n * @remarks \\@since 5.0.0\n * @internal\n */\nexport function getSearchText(\n element: HTMLElement,\n searchable: boolean\n): string {\n if (!searchable) {\n return \"\";\n }\n\n const cloned = element.cloneNode(true) as HTMLElement;\n cloned\n .querySelectorAll(\n // Note: do not include DISPLAY_NONE_CLASS since it is presentational only\n \".rmd-icon--font,[aria-hidden=true],[hidden],[role=presentation]\"\n )\n .forEach((element) => {\n element.parentNode?.removeChild(element);\n });\n\n // Note: It would be good to use `cloned.innerText` (maybe?) at some point,\n // but it returns `undefined` in jsdom. It also does cause a reflow, so maybe\n // this is fine?\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#differences_from_innertext\n return (cloned.textContent || \"\")[0].toUpperCase();\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface RecalculateOptions {\n focusables: readonly HTMLElement[];\n includeDisabled: boolean;\n tabIndexBehavior: TabIndexBehavior | undefined;\n activeDescendantId: string;\n}\n\n/**\n * This was added to help with specific widgets that cause focus index to change\n * between renders (i.e. expanding all tree items on the same level with `*`).\n * There might be a better way to handle this in the future.\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport function recalculateFocusIndex(options: RecalculateOptions): number {\n const { focusables, includeDisabled, tabIndexBehavior, activeDescendantId } =\n options;\n if (tabIndexBehavior === \"virtual\") {\n return getVirtualFocusDefaultIndex({\n focusables,\n includeDisabled,\n activeDescendantId,\n });\n }\n\n const { activeElement } = document;\n return focusables.findIndex((element) => element === activeElement);\n}\n\n/**\n * Checks if a keyboard event can trigger a search through focusable elements\n * by:\n *\n * - checking if the key is a single letter that is not the space key\n * - checking that the alt, ctrl, and meta keys are not being held\n *\n * The shift key **is allowed** because holding shift means \"search from the\n * beginning\" instead of \"search from current location\".\n *\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport function isSearchableEvent(event: KeyboardEvent): boolean {\n const { key, altKey, ctrlKey, metaKey } = event;\n\n return (\n key.length === 1 &&\n // can't search with space since it is generally a click event\n key !== \" \" &&\n !altKey &&\n !ctrlKey &&\n !metaKey\n );\n}\n"],"names":["loop","isElementDisabled","element","getAttribute","isNotFocusable","includeDisabled","getVirtualFocusDefaultIndex","options","focusables","activeDescendantId","length","activeIndex","findIndex","id","Math","max","getFirstFocusableIndex","firstIndex","getLastFocusableIndex","lastIndex","getNextFocusableIndex","loopable","increment","currentFocusIndex","min","nextIndex","value","minmax","getSearchText","searchable","cloned","cloneNode","querySelectorAll","forEach","parentNode","removeChild","textContent","toUpperCase","recalculateFocusIndex","tabIndexBehavior","activeElement","document","isSearchableEvent","event","key","altKey","ctrlKey","metaKey"],"mappings":"AACA,SAASA,IAAI,QAAQ,mBAAmB;AAGxC;;;CAGC,GACD,OAAO,MAAMC,oBAAoB,CAACC,UAChCA,QAAQC,YAAY,CAAC,gBAAgB,QACrCD,QAAQC,YAAY,CAAC,qBAAqB,OAAO;AAEnD;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,CAC5BF,SACAG;IAEA,IAAI,CAACH,SAAS;QACZ,OAAO;IACT;IAEA,IAAIG,iBAAiB;QACnB,OAAO;IACT;IAEA,OAAOJ,kBAAkBC;AAC3B,EAAE;AAYF;;;CAGC,GACD,OAAO,MAAMI,8BAA8B,CACzCC;IAEA,MAAM,EAAEC,UAAU,EAAEH,eAAe,EAAEI,kBAAk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ASE,kBAAkBC,KAAoB;IACpD,MAAM,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGJ;IAE1C,OACEC,IAAIlC,MAAM,KAAK,KACf,8DAA8D;IAC9DkC,QAAQ,OACR,CAACC,UACD,CAACC,WACD,CAACC;AAEL"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/overlay/Overlay.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type BoxAlignItems, type BoxJustifyContent } from \"../box/styles.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { useSsr } from \"../SsrProvider.js\";\nimport {\n type CSSTransitionComponentProps,\n type TransitionActions,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport {\n DEFAULT_OVERLAY_CLASSNAMES,\n DEFAULT_OVERLAY_TIMEOUT,\n overlay,\n} from \"./overlayStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added `align` and `justify` props.\n */\nexport interface OverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n CSSTransitionComponentProps,\n TransitionActions {\n /**\n * @defaultValue `\"center\"`\n * @remarks \\@since 6.0.0\n */\n align?: BoxAlignItems;\n\n /**\n * @defaultValue `\"center\"`\n * @remarks \\@since 6.0.0\n */\n justify?: BoxJustifyContent;\n\n /**\n * Set this to `true` for when the overlay should be visible. Toggling this\n * value will trigger the enter/exit animation.\n */\n visible: boolean;\n\n /**\n * Set this to `true` if the overlay should be rendered with an `opacity: 0`\n * and disabling the animation. This is useful if you'd like a \"close on\n * outside click\" behavior.\n *\n * @defaultValue `false`\n */\n noOpacity?: boolean;\n\n /**\n * @see {@link OverlayClassNameOptions.clickable}\n * @defaultValue `!noOpacity`\n */\n clickable?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Button, Overlay, useToggle } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggle, disable, toggled: visible } = useToggle(false);\n *\n * return (\n * <>\n * <Button onClick={toggle}>Toggle</Button>\n * <Overlay visible={visible} onClick={disable} />\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Removed the `onRequestClose` prop in favor of using\n * the `onClick` prop instead.\n */\nexport const Overlay = forwardRef<HTMLSpanElement, OverlayProps>(\n function Overlay(props, nodeRef) {\n const {\n children,\n className,\n visible,\n noOpacity = false,\n clickable = !noOpacity,\n temporary = true,\n timeout = DEFAULT_OVERLAY_TIMEOUT,\n classNames = DEFAULT_OVERLAY_CLASSNAMES,\n disableTransition = false,\n align = \"center\",\n justify = \"center\",\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n exitedHidden = true,\n disablePortal: propDisablePortal = false,\n ...remaining\n } = props;\n\n const ssr = useSsr();\n const { elementProps, rendered, disablePortal } = useCSSTransition({\n nodeRef,\n transitionIn: visible,\n timeout: noOpacity ? 0 : timeout,\n classNames: noOpacity ? \"\" : classNames,\n className: overlay({\n visible,\n clickable,\n align,\n justify,\n className,\n }),\n appear: appear && !disableTransition && !ssr,\n enter: enter && !disableTransition,\n exit: exit && !disableTransition,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n temporary,\n exitedHidden,\n disablePortal: propDisablePortal,\n });\n\n return (\n <Portal disabled={disablePortal}>\n {rendered && (\n <span {...remaining} {...elementProps}>\n {children}\n </span>\n )}\n </Portal>\n );\n }\n);\n"],"names":["forwardRef","Portal","useSsr","useCSSTransition","DEFAULT_OVERLAY_CLASSNAMES","DEFAULT_OVERLAY_TIMEOUT","overlay","Overlay","props","nodeRef","children","className","visible","noOpacity","clickable","temporary","timeout","classNames","disableTransition","align","justify","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","exitedHidden","disablePortal","propDisablePortal","remaining","ssr","elementProps","rendered","transitionIn","disabled","span"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AAExD,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,MAAM,QAAQ,oBAAoB;AAK3C,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SACEC,0BAA0B,EAC1BC,uBAAuB,EACvBC,OAAO,QACF,qBAAqB;AAqD5B;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,MAAMC,wBAAUP,WACrB,SAASO,QAAQC,KAAK,EAAEC,OAAO;IAC7B,MAAM,EACJC,QAAQ,EACRC,SAAS,EACTC,OAAO,EACPC,YAAY,KAAK,EACjBC,YAAY,CAACD,SAAS,EACtBE,YAAY,IAAI,EAChBC,UAAUX,uBAAuB,EACjCY,aAAab,0BAA0B,EACvCc,oBAAoB,KAAK,EACzBC,QAAQ,QAAQ,EAChBC,UAAU,QAAQ,EAClBC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,eAAe,IAAI,EACnBC,eAAeC,oBAAoB,KAAK,EACxC,GAAGC,WACJ,GAAGzB;IAEJ,MAAM0B,MAAMhC;IACZ,MAAM,EAAEiC,YAAY,EAAEC,QAAQ,EAAEL,aAAa,EAAE,GAAG5B,iBAAiB;QACjEM;QACA4B,cAAczB;QACdI,SAASH,YAAY,IAAIG;QACzBC,YAAYJ,YAAY,KAAKI;QAC7BN,WAAWL,QAAQ;YACjBM;YACAE;YACAK;YACAC;YACAT;QACF;QACAU,QAAQA,UAAU,CAACH,qBAAqB,CAACgB;QACzCZ,OAAOA,SAAS,CAACJ;QACjBK,MAAMA,QAAQ,CAACL;QACfM;QACAC;QACAC;QACAC;QACAC;QACAC;QACAd;QACAe;QACAC,eAAeC;IACjB;IAEA,qBACE,KAAC/B;QAAOqC,UAAUP;kBACfK,0BACC,KAACG;YAAM,GAAGN,SAAS;YAAG,GAAGE,YAAY;sBAClCzB;;;AAKX,GACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/overlay/overlayStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n box,\n type BoxAlignItems,\n type BoxJustifyContent,\n} from \"../box/styles.js\";\nimport {\n type CSSTransitionClassNamesObject,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-overlay-background-color\"?: string;\n \"--rmd-overlay-z-index\"?: number;\n }\n}\n\nconst styles = bem(\"rmd-overlay\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface OverlayClassNameOptions {\n className?: string;\n\n visible: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n clickable?: boolean;\n\n /** @defaultValue `false` */\n absolute?: boolean;\n /** @defaultValue `\"center\"` */\n align?: BoxAlignItems;\n\n /** @defaultValue `\"center\"` */\n justify?: BoxJustifyContent;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function overlay(\n options: OverlayClassNameOptions & { active?: boolean }\n): string {\n const {\n visible,\n active,\n absolute = false,\n clickable = false,\n align = \"center\",\n justify = \"center\",\n className,\n } = options;\n\n return cnb(\n styles({\n active,\n visible,\n clickable,\n absolute,\n }),\n box({\n align,\n justify,\n disablePadding: true,\n }),\n className\n );\n}\n\n/** @remarks \\@since 2.4.0 */\nexport const DEFAULT_OVERLAY_TIMEOUT: TransitionTimeout = 150;\n\n/** @remarks \\@since 2.4.0 */\nexport const DEFAULT_OVERLAY_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> =\n {\n appearActive: \"rmd-overlay--active\",\n appearDone: \"rmd-overlay--active\",\n enterActive: \"rmd-overlay--active\",\n enterDone: \"rmd-overlay--active\",\n };\n"],"names":["cnb","box","bem","styles","overlay","options","visible","active","absolute","clickable","align","justify","className","disablePadding","DEFAULT_OVERLAY_TIMEOUT","DEFAULT_OVERLAY_CLASSNAMES","appearActive","appearDone","enterActive","enterDone"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,GAAG,QAGE,mBAAmB;AAK1B,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAuBnB;;CAEC,GACD,OAAO,SAASE,QACdC,OAAuD;IAEvD,MAAM,EACJC,OAAO,EACPC,MAAM,EACNC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,QAAQ,QAAQ,EAChBC,UAAU,QAAQ,EAClBC,SAAS,EACV,GAAGP;IAEJ,OAAOL,IACLG,OAAO;QACLI;QACAD;QACAG;QACAD;IACF,IACAP,IAAI;QACFS;QACAC;QACAE,gBAAgB;IAClB,IACAD;AAEJ;AAEA,2BAA2B,GAC3B,OAAO,MAAME,0BAA6C,IAAI;AAE9D,2BAA2B,GAC3B,OAAO,MAAMC,6BACX;IACEC,cAAc;IACdC,YAAY;IACZC,aAAa;IACbC,WAAW;AACb,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/portal/Portal.tsx"],"sourcesContent":["\"use client\";\nimport { type ReactElement, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { usePortalContainer } from \"./PortalContainerProvider.js\";\n\nexport interface PortalProps {\n children: ReactNode;\n /**\n * Setting this to `true` will disable the portal behavior and just render\n * the `children` in the normal DOM tree.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * Portals are a great way to render temporary elements like dialogs, tooltips,\n * and menus at a different port of the DOM. This implementation will render\n * the `children` in the current {@link PortalContainer} element.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Portal } from \"@react-md/portal\";\n *\n * function Example() {\n * return <Portal><div>Some Content</div></Portal>;\n * }\n * ```\n *\n * @see {@link PortalContainerProvider}\n * @see {@link usePortalContainer}\n */\nexport function Portal(props: PortalProps): ReactElement {\n const { children, disabled = false } = props;\n const container = usePortalContainer();\n if (!container || disabled) {\n return <>{disabled && children}</>;\n }\n\n return createPortal(children, container);\n}\n"],"names":["createPortal","usePortalContainer","Portal","props","children","disabled","container"],"mappings":"AAAA;;AAEA,SAASA,YAAY,QAAQ,YAAY;AAEzC,SAASC,kBAAkB,QAAQ,+BAA+B;AAalE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,KAAK,EAAE,GAAGF;IACvC,MAAMG,YAAYL;IAClB,IAAI,CAACK,aAAaD,UAAU;QAC1B,qBAAO;sBAAGA,YAAYD;;IACxB;IAEA,qBAAOJ,aAAaI,UAAUE;AAChC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/portal/PortalContainerProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useEffect,\n useState,\n type ReactElement,\n type ReactNode,\n type RefObject,\n} from \"react\";\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport type PortalContainer = Element | DocumentFragment | null;\n\nexport const PORTAL_CONTAINER_ID = \"rmd-portal-container\";\n\nlet portalContainer: PortalContainer = null;\n\nconst getPortalContainer = (): PortalContainer =>\n typeof window === \"undefined\" ? null : document.body;\n\nconst context = createContext<PortalContainer>(getPortalContainer());\ncontext.displayName = \"PortalContainer\";\nconst { Provider } = context;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function usePortalContainer(): PortalContainer {\n return useContext(context);\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface PortalContainerProviderProps {\n /**\n * An optional container element to use. When this is `undefined`, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n */\n container?: PortalContainer | RefObject<PortalContainer>;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component allows for all child `Portal` components to render within the\n * same container element. If a custom `container` element is not provided, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n *\n * @see {@link Portal}\n * @remarks \\@since 6.0.0\n */\nexport function PortalContainerProvider(\n props: PortalContainerProviderProps\n): ReactElement {\n const { container, children } = props;\n const [value, setValue] = useState<PortalContainer>(portalContainer);\n useEffect(() => {\n if (container && \"current\" in container) {\n setValue(container.current);\n return;\n }\n\n if (typeof container !== \"undefined\") {\n return;\n }\n\n if (!portalContainer) {\n portalContainer = document.createElement(\"div\");\n portalContainer.id = PORTAL_CONTAINER_ID;\n }\n if (!document.body.contains(portalContainer)) {\n document.body.appendChild(portalContainer);\n }\n\n setValue(portalContainer);\n\n return () => {\n if (portalContainer && document.body.contains(portalContainer)) {\n document.body.removeChild(portalContainer);\n }\n };\n }, [container]);\n\n const containerValue =\n (container && \"current\" in container) || !container ? value : container;\n return <Provider value={containerValue}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useState","PORTAL_CONTAINER_ID","portalContainer","getPortalContainer","window","document","body","context","displayName","Provider","usePortalContainer","PortalContainerProvider","props","container","children","value","setValue","current","createElement","id","contains","appendChild","removeChild","containerValue"],"mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QAIH,QAAQ;AAQf,OAAO,MAAMC,sBAAsB,uBAAuB;AAE1D,IAAIC,kBAAmC;AAEvC,MAAMC,qBAAqB,IACzB,OAAOC,WAAW,cAAc,OAAOC,SAASC,IAAI;AAEtD,MAAMC,wBAAUV,cAA+BM;AAC/CI,QAAQC,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;CAGC,GACD,OAAO,SAASG;IACd,OAAOZ,WAAWS;AACpB;AAaA;;;;;;;;;;CAUC,GACD,OAAO,SAASI,wBACdC,KAAmC;IAEnC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGF;IAChC,MAAM,CAACG,OAAOC,SAAS,GAAGhB,SAA0BE;IACpDH,UAAU;QACR,IAAIc,aAAa,aAAaA,WAAW;YACvCG,SAASH,UAAUI,OAAO;YAC1B;QACF;QAEA,IAAI,OAAOJ,cAAc,aAAa;YACpC;QACF;QAEA,IAAI,CAACX,iBAAiB;YACpBA,kBAAkBG,SAASa,aAAa,CAAC;YACzChB,gBAAgBiB,EAAE,GAAGlB;QACvB;QACA,IAAI,CAACI,SAASC,IAAI,CAACc,QAAQ,CAAClB,kBAAkB;YAC5CG,SAASC,IAAI,CAACe,WAAW,CAACnB;QAC5B;QAEAc,SAASd;QAET,OAAO;YACL,IAAIA,mBAAmBG,SAASC,IAAI,CAACc,QAAQ,CAAClB,kBAAkB;gBAC9DG,SAASC,IAAI,CAACgB,WAAW,CAACpB;YAC5B;QACF;IACF,GAAG;QAACW;KAAU;IAEd,MAAMU,iBACJ,AAACV,aAAa,aAAaA,aAAc,CAACA,YAAYE,QAAQF;IAChE,qBAAO,KAACJ;QAASM,OAAOQ;kBAAiBT;;AAC3C"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/constants.ts"],"sourcesContent":["import type { PositionAnchor } from \"./types.js\";\n\nexport const ABOVE_LEFT_ANCHOR: PositionAnchor = {\n x: \"left\",\n y: \"above\",\n};\n\nexport const ABOVE_INNER_LEFT_ANCHOR: PositionAnchor = {\n x: \"inner-left\",\n y: \"above\",\n};\n\nexport const ABOVE_CENTER_ANCHOR: PositionAnchor = {\n x: \"center\",\n y: \"above\",\n};\n\nexport const ABOVE_INNER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"inner-right\",\n y: \"above\",\n};\n\nexport const ABOVE_RIGHT_ANCHOR: PositionAnchor = {\n x: \"right\",\n y: \"above\",\n};\n\nexport const TOP_LEFT_ANCHOR: PositionAnchor = {\n x: \"left\",\n y: \"top\",\n};\n\nexport const TOP_INNER_LEFT_ANCHOR: PositionAnchor = {\n x: \"inner-left\",\n y: \"top\",\n};\n\nexport const TOP_CENTER_ANCHOR: PositionAnchor = {\n x: \"center\",\n y: \"top\",\n};\n\nexport const TOP_INNER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"inner-right\",\n y: \"top\",\n};\n\nexport const TOP_RIGHT_ANCHOR: PositionAnchor = {\n x: \"right\",\n y: \"top\",\n};\n\nexport const CENTER_LEFT_ANCHOR: PositionAnchor = {\n x: \"left\",\n y: \"center\",\n};\n\nexport const CENTER_INNER_LEFT_ANCHOR: PositionAnchor = {\n x: \"inner-left\",\n y: \"center\",\n};\n\nexport const CENTER_CENTER_ANCHOR: PositionAnchor = {\n x: \"center\",\n y: \"center\",\n};\n\nexport const CENTER_INNER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"inner-right\",\n y: \"center\",\n};\n\nexport const CENTER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"right\",\n y: \"center\",\n};\n\nexport const BOTTOM_LEFT_ANCHOR: PositionAnchor = {\n x: \"left\",\n y: \"bottom\",\n};\n\nexport const BOTTOM_INNER_LEFT_ANCHOR: PositionAnchor = {\n x: \"inner-left\",\n y: \"bottom\",\n};\n\nexport const BOTTOM_CENTER_ANCHOR: PositionAnchor = {\n x: \"center\",\n y: \"bottom\",\n};\n\nexport const BOTTOM_INNER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"inner-right\",\n y: \"bottom\",\n};\n\nexport const BOTTOM_RIGHT_ANCHOR: PositionAnchor = {\n x: \"right\",\n y: \"bottom\",\n};\n\nexport const BELOW_LEFT_ANCHOR: PositionAnchor = {\n x: \"left\",\n y: \"below\",\n};\n\nexport const BELOW_INNER_LEFT_ANCHOR: PositionAnchor = {\n x: \"inner-left\",\n y: \"below\",\n};\n\nexport const BELOW_CENTER_ANCHOR: PositionAnchor = {\n x: \"center\",\n y: \"below\",\n};\n\nexport const BELOW_INNER_RIGHT_ANCHOR: PositionAnchor = {\n x: \"inner-right\",\n y: \"below\",\n};\n\nexport const BELOW_RIGHT_ANCHOR: PositionAnchor = {\n x: \"right\",\n y: \"below\",\n};\n"],"names":["ABOVE_LEFT_ANCHOR","x","y","ABOVE_INNER_LEFT_ANCHOR","ABOVE_CENTER_ANCHOR","ABOVE_INNER_RIGHT_ANCHOR","ABOVE_RIGHT_ANCHOR","TOP_LEFT_ANCHOR","TOP_INNER_LEFT_ANCHOR","TOP_CENTER_ANCHOR","TOP_INNER_RIGHT_ANCHOR","TOP_RIGHT_ANCHOR","CENTER_LEFT_ANCHOR","CENTER_INNER_LEFT_ANCHOR","CENTER_CENTER_ANCHOR","CENTER_INNER_RIGHT_ANCHOR","CENTER_RIGHT_ANCHOR","BOTTOM_LEFT_ANCHOR","BOTTOM_INNER_LEFT_ANCHOR","BOTTOM_CENTER_ANCHOR","BOTTOM_INNER_RIGHT_ANCHOR","BOTTOM_RIGHT_ANCHOR","BELOW_LEFT_ANCHOR","BELOW_INNER_LEFT_ANCHOR","BELOW_CENTER_ANCHOR","BELOW_INNER_RIGHT_ANCHOR","BELOW_RIGHT_ANCHOR"],"mappings":"AAEA,OAAO,MAAMA,oBAAoC;IAC/CC,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMC,0BAA0C;IACrDF,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAME,sBAAsC;IACjDH,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMG,2BAA2C;IACtDJ,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMI,qBAAqC;IAChDL,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMK,kBAAkC;IAC7CN,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMM,wBAAwC;IACnDP,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMO,oBAAoC;IAC/CR,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMQ,yBAAyC;IACpDT,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMS,mBAAmC;IAC9CV,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMU,qBAAqC;IAChDX,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMW,2BAA2C;IACtDZ,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMY,uBAAuC;IAClDb,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMa,4BAA4C;IACvDd,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMc,sBAAsC;IACjDf,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMe,qBAAqC;IAChDhB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMgB,2BAA2C;IACtDjB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMiB,uBAAuC;IAClDlB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMkB,4BAA4C;IACvDnB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMmB,sBAAsC;IACjDpB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMoB,oBAAoC;IAC/CrB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMqB,0BAA0C;IACrDtB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMsB,sBAAsC;IACjDvB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMuB,2BAA2C;IACtDxB,GAAG;IACHC,GAAG;AACL,EAAE;AAEF,OAAO,MAAMwB,qBAAqC;IAChDzB,GAAG;IACHC,GAAG;AACL,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/createHorizontalPosition.ts"],"sourcesContent":["import type { XCoordConfig } from \"./utils.js\";\nimport {\n getCenterXCoord,\n getInnerLeftCoord,\n getInnerRightCoord,\n getLeftCoord,\n getRightCoord,\n} from \"./utils.js\";\nimport type { FixedPositionOptions, HorizontalPosition } from \"./types.js\";\n\n/**\n * @internal\n */\ninterface XPosition {\n left: number;\n right?: number;\n width?: number;\n minWidth?: number;\n actualX: HorizontalPosition;\n}\n\n/**\n * @internal\n */\nexport interface FixConfig extends XCoordConfig {\n vwMargin: number;\n screenRight: number;\n disableSwapping: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CreateHorizontalPositionOptions\n extends Required<\n Pick<\n FixedPositionOptions,\n \"vwMargin\" | \"xMargin\" | \"width\" | \"disableSwapping\"\n >\n > {\n x: HorizontalPosition;\n vw: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the left of\n * the container element but also within the viewport boundaries. When swapping\n * is enabled, it will attempt to swap to the right position if it can't fit\n * within the viewport to the left. If it can't fit in the viewport even after\n * being swapped to the right or swapping is disabled, it will be positioned to\n * the viewport left boundary.\n *\n * @internal\n */\nexport function createAnchoredLeft(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth, disableSwapping } = config;\n\n let left = getLeftCoord(config);\n let actualX: HorizontalPosition = \"left\";\n if (left >= vwMargin) {\n return { actualX, left };\n }\n\n const swappedLeft = getRightCoord(config);\n if (disableSwapping || swappedLeft + elWidth > screenRight) {\n left = vwMargin;\n } else {\n left = swappedLeft;\n actualX = \"right\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the\n * inner-left of the container element but also within the viewport boundaries.\n * When swapping is enabled, it will attempt to swap to the right position if it\n * can't fit within the viewport to the left. If it can't fit in the viewport\n * even after being swapped to the right or swapping is disabled, it will be\n * positioned to the viewport left boundary.\n *\n * @internal\n */\nexport function createAnchoredInnerLeft(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth, disableSwapping } = config;\n\n let left = getInnerLeftCoord(config);\n let actualX: HorizontalPosition = \"inner-left\";\n if (left + elWidth <= screenRight && left >= vwMargin) {\n return { actualX, left };\n }\n\n if (disableSwapping) {\n if (left + elWidth > screenRight) {\n left = screenRight - elWidth;\n } else {\n left = vwMargin;\n }\n\n return { actualX, left };\n }\n\n const swappedLeft = getInnerRightCoord(config);\n if (swappedLeft < vwMargin) {\n left = vwMargin;\n } else if (swappedLeft + elWidth > screenRight) {\n left = screenRight - elWidth;\n actualX = \"inner-right\";\n } else {\n left = swappedLeft;\n actualX = \"inner-right\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear at the center\n * of the container element but also within the viewport boundaries. If the\n * centered element can't fit within the viewport, it will use the vwMargin\n * value if it overflowed to the left, it'll position to the screen right\n * boundary.\n *\n * @internal\n */\nexport function createAnchoredCenter(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth } = config;\n let left = getCenterXCoord(config);\n if (left < vwMargin) {\n left = vwMargin;\n } else if (left + elWidth > screenRight || left < vwMargin) {\n left = screenRight - elWidth;\n }\n\n return { actualX: \"center\", left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the\n * inner-right of the container element but also within the viewport boundaries.\n * When swapping is enabled, it will attempt to swap to the inner-left position\n * if it can't fit within the viewport to the right. If it can't fit in the\n * viewport even after being swapped to the left or swapping is disabled, it\n * will be positioned to the viewport right boundary.\n *\n * @internal\n */\nexport function createAnchoredInnerRight(config: FixConfig): XPosition {\n const { screenRight, vwMargin, elWidth, disableSwapping } = config;\n\n let left = getInnerRightCoord(config);\n let actualX: HorizontalPosition = \"inner-right\";\n if (left >= vwMargin) {\n return { actualX, left: Math.min(left, screenRight - elWidth) };\n }\n\n const swappedLeft = getInnerLeftCoord(config);\n if (disableSwapping || swappedLeft + elWidth > screenRight) {\n left = vwMargin;\n } else {\n left = Math.max(swappedLeft, vwMargin);\n actualX = \"inner-left\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the right of\n * the container element but also within the viewport boundaries. When swapping\n * is enabled, it will attempt to swap to the left position if it can't fit\n * within the viewport to the right. If it can't fit in the viewport even after\n * being swapped to the left or swapping is disabled, it will be positioned to\n * the viewport right boundary.\n *\n * @internal\n */\nexport function createAnchoredRight(config: FixConfig): XPosition {\n const { screenRight, vwMargin, elWidth, disableSwapping } = config;\n\n let left = getRightCoord(config);\n let actualX: HorizontalPosition = \"right\";\n if (left + elWidth <= screenRight) {\n return { actualX, left };\n }\n\n const swappedLeft = getLeftCoord(config);\n if (disableSwapping || swappedLeft < vwMargin) {\n left = screenRight - elWidth;\n } else {\n left = swappedLeft;\n actualX = \"left\";\n }\n\n return { actualX, left };\n}\n\nexport interface EqualWidthOptions\n extends Pick<\n CreateHorizontalPositionOptions,\n \"x\" | \"elWidth\" | \"xMargin\" | \"vwMargin\" | \"containerRect\" | \"initialX\"\n > {\n screenRight: number;\n isMinWidth: boolean;\n}\n\n/**\n * @internal\n */\nexport function createEqualWidth(options: EqualWidthOptions): XPosition {\n const {\n x,\n elWidth,\n xMargin,\n vwMargin,\n initialX,\n containerRect,\n screenRight,\n isMinWidth,\n } = options;\n\n let left = initialX ?? containerRect.left + xMargin;\n\n let width: number | undefined = containerRect.width - xMargin * 2;\n let minWidth: number | undefined;\n let right: number | undefined;\n if (isMinWidth) {\n minWidth = width;\n // if the fixed element has a width greater than the element it is fixed to,\n // update the width to be the fixed element's width. since the \"min-width\"\n // option is only possible for horizontally centered elements, need to then\n // update the `left` position again.\n if (elWidth > width) {\n left -= (elWidth - width) / 2;\n minWidth = elWidth;\n }\n\n width = undefined;\n const elRight = left + elWidth;\n if (elRight > screenRight) {\n left -= elRight - screenRight;\n right = vwMargin;\n }\n\n left = Math.max(vwMargin, left);\n }\n\n // going to assume that the container element is visible in the DOM and just\n // make the fixed element have the same left and right corners\n return {\n left,\n right,\n width,\n minWidth,\n actualX: x,\n };\n}\n\n/**\n * Creates the horizontal position for a fixed element with the provided\n * options.\n * @internal\n */\nexport function createHorizontalPosition(\n options: CreateHorizontalPositionOptions\n): XPosition {\n const {\n x,\n vw,\n vwMargin,\n xMargin,\n width,\n elWidth,\n initialX,\n containerRect,\n disableSwapping,\n } = options;\n\n const screenRight = vw - vwMargin;\n if (width === \"min\" || width === \"equal\") {\n return createEqualWidth({\n x,\n vwMargin,\n xMargin,\n elWidth,\n initialX,\n containerRect,\n screenRight,\n isMinWidth: width === \"min\",\n });\n }\n\n if (elWidth > vw - vwMargin * 2) {\n // if the element's width is greater than the viewport's width minus the\n // margin on both sides, just make the element span the entire viewport with\n // the margin\n return {\n left: vwMargin,\n right: vwMargin,\n actualX: x,\n };\n }\n\n const config: FixConfig = {\n vwMargin,\n xMargin,\n elWidth,\n initialX,\n screenRight,\n containerRect,\n disableSwapping,\n };\n\n switch (x) {\n case \"left\":\n return createAnchoredLeft(config);\n case \"inner-left\":\n return createAnchoredInnerLeft(config);\n case \"center\":\n return createAnchoredCenter(config);\n case \"inner-right\":\n return createAnchoredInnerRight(config);\n case \"right\":\n return createAnchoredRight(config);\n }\n}\n"],"names":["getCenterXCoord","getInnerLeftCoord","getInnerRightCoord","getLeftCoord","getRightCoord","createAnchoredLeft","config","vwMargin","screenRight","elWidth","disableSwapping","left","actualX","swappedLeft","createAnchoredInnerLeft","createAnchoredCenter","createAnchoredInnerRight","Math","min","max","createAnchoredRight","createEqualWidth","options","x","xMargin","initialX","containerRect","isMinWidth","width","minWidth","right","undefined","elRight","createHorizontalPosition","vw"],"mappings":"AACA,SACEA,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,YAAY,EACZC,aAAa,QACR,aAAa;AAwCpB;;;;;;;;;CASC,GACD,OAAO,SAASC,mBAAmBC,MAAiB;IAClD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,EAAEC,eAAe,EAAE,GAAGJ;IAE5D,IAAIK,OAAOR,aAAaG;IACxB,IAAIM,UAA8B;IAClC,IAAID,QAAQJ,UAAU;QACpB,OAAO;YAAEK;YAASD;QAAK;IACzB;IAEA,MAAME,cAAcT,cAAcE;IAClC,IAAII,mBAAmBG,cAAcJ,UAAUD,aAAa;QAC1DG,OAAO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;QACR,MAAMC,UAAUrB,OAAOF;QACvB,IAAIuB,UAAUxB,aAAa;YACzBG,QAAQqB,UAAUxB;YAClBsB,QAAQvB;QACV;QAEAI,OAAOM,KAAKE,GAAG,CAACZ,UAAUI;IAC5B;IAEA,4EAA4E;IAC5E,8DAA8D;IAC9D,OAAO;QACLA;QACAmB;QACAF;QACAC;QACAjB,SAASW;IACX;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASU,yBACdX,OAAwC;IAExC,MAAM,EACJC,CAAC,EACDW,EAAE,EACF3B,QAAQ,EACRiB,OAAO,EACPI,KAAK,EACLnB,OAAO,EACPgB,QAAQ,EACRC,aAAa,EACbhB,eAAe,EAChB,GAAGY;IAEJ,MAAMd,cAAc0B,KAAK3B;IACzB,IAAIqB,UAAU,SAASA,UAAU,SAAS;QACxC,OAAOP,iBAAiB;YACtBE;YACAhB;YACAiB;YACAf;YACAgB;YACAC;YACAlB;YACAmB,YAAYC,UAAU;QACxB;IACF;IAEA,IAAInB,UAAUyB,KAAK3B,WAAW,GAAG;QAC/B,wEAAwE;QACxE,4EAA4E;QAC5E,aAAa;QACb,OAAO;YACLI,MAAMJ;YACNuB,OAAOvB;YACPK,SAASW;QACX;IACF;IAEA,MAAMjB,SAAoB;QACxBC;QACAiB;QACAf;QACAgB;QACAjB;QACAkB;QACAhB;IACF;IAEA,OAAQa;QACN,KAAK;YACH,OAAOlB,mBAAmBC;QAC5B,KAAK;YACH,OAAOQ,wBAAwBR;QACjC,KAAK;YACH,OAAOS,qBAAqBT;QAC9B,KAAK;YACH,OAAOU,yBAAyBV;QAClC,KAAK;YACH,OAAOc,oBAAoBd;IAC/B;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/createVerticalPosition.ts"],"sourcesContent":["import type { YCoordConfig } from \"./utils.js\";\nimport {\n getAboveCoord,\n getBelowCoord,\n getBottomCoord,\n getCenterYCoord,\n getTopCoord,\n} from \"./utils.js\";\nimport type { FixedPositionOptions, VerticalPosition } from \"./types.js\";\n\n/** @internal */\ninterface YPosition {\n top: number;\n bottom?: number;\n actualY: VerticalPosition;\n /** @remarks \\@since 6.0.0 */\n transformOriginY?: number;\n}\n\n/** @internal */\nexport interface FixConfig extends YCoordConfig {\n vhMargin: number;\n screenBottom: number;\n preventOverlap: boolean;\n disableSwapping: boolean;\n disableVHBounds: boolean;\n}\n\n/** @internal */\nexport interface CreateVerticalPositionOptions\n extends Required<\n Pick<\n FixedPositionOptions,\n | \"yMargin\"\n | \"vhMargin\"\n | \"preventOverlap\"\n | \"disableSwapping\"\n | \"disableVHBounds\"\n >\n > {\n y: VerticalPosition;\n vh: number;\n initialY?: number;\n elHeight: number;\n containerRect: DOMRect;\n}\n\n/**\n * Attempts to position the fixed element so that it will appear completely\n * above the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the below position if it\n * can't fit within the viewport above the container element. If it can't fit in\n * the viewport even after being swapped below or swapping is disabled, it will\n * be positioned to the top viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredAbove(config: FixConfig): YPosition {\n const {\n yMargin,\n vhMargin,\n screenBottom,\n elHeight,\n containerRect,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n } = config;\n let top = getAboveCoord(config);\n let actualY: VerticalPosition = \"above\";\n\n if (disableVHBounds) {\n // can't actually allow a top value as a negative number since browsers\n // won't scroll upwards past the normal page top\n return { actualY, top: Math.max(0, top) };\n }\n\n if (top > vhMargin) {\n // don't need to do anything else since the top is still in the viewport and\n // since it's positioned above, we already know it can't overlap the\n // container element\n return { actualY, top };\n }\n\n const swappedTop = getBelowCoord(config);\n if (disableSwapping || swappedTop + elHeight > screenBottom) {\n top = Math.min(top, vhMargin);\n } else {\n actualY = \"below\";\n top = swappedTop;\n }\n\n let bottom: number | undefined;\n if (\n preventOverlap &&\n // can't overlap if it's positioned below\n actualY === \"above\" &&\n top + elHeight > containerRect.top\n ) {\n bottom = screenBottom - containerRect.top + yMargin;\n }\n\n return { actualY, top, bottom };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear fixed to the\n * top of the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the bottom position if it\n * can't fit within the viewport. If it can't fit in the viewport even after\n * being swapped to the bottom position or swapping is disabled, it will be\n * positioned to the top viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredTop(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableSwapping, disableVHBounds } =\n config;\n let top = getTopCoord(config);\n let actualY: VerticalPosition = \"top\";\n\n if (disableVHBounds || top + elHeight <= screenBottom) {\n return { actualY, top };\n }\n\n const swappedTop = getBottomCoord(config);\n if (disableSwapping || swappedTop < vhMargin) {\n top = Math.max(top, vhMargin);\n } else {\n actualY = \"bottom\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear at the center\n * of the container element but also within the viewport boundaries. If the\n * entered element can't fit within the viewport, it'll update the top value\n * to either be the vhMargin or position to the screen bottom boundary\n *\n * @internal\n */\nexport function createAnchoredCenter(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableVHBounds } = config;\n let top = getCenterYCoord(config);\n const actualY: VerticalPosition = \"center\";\n if (disableVHBounds) {\n return { actualY, top: Math.max(0, top) };\n }\n\n top = Math.max(vhMargin, top);\n if (top + elHeight > screenBottom) {\n top = screenBottom - elHeight;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear fixed to the\n * bottom of the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the top position if it can't\n * fit within the viewport. If it can't fit in the viewport even after being\n * swapped to the top position or swapping is disabled, it will be positioned to\n * the bottom viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredBottom(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableSwapping, disableVHBounds } =\n config;\n let top = getBottomCoord(config);\n let actualY: VerticalPosition = \"bottom\";\n if (disableVHBounds || top > vhMargin) {\n return { actualY, top };\n }\n\n const swappedTop = getTopCoord(config);\n if (disableSwapping || swappedTop + elHeight > screenBottom) {\n top = Math.min(top, screenBottom - elHeight);\n } else {\n actualY = \"top\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear completely\n * below the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the above position if it\n * can't fit within the viewport below the container element. If it can't fit in\n * the viewport even after being swapped above or swapping is disabled, it will\n * be positioned to the bottom viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredBelow(config: FixConfig): YPosition {\n const {\n yMargin,\n vhMargin,\n elHeight,\n screenBottom,\n containerRect,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n } = config;\n let top = getBelowCoord(config);\n let actualY: VerticalPosition = \"below\";\n if (disableVHBounds || top + elHeight <= screenBottom) {\n return { actualY, top };\n }\n\n if (preventOverlap) {\n const availableTop = containerRect.top - yMargin;\n if (disableSwapping || availableTop < screenBottom - top) {\n return {\n actualY,\n top,\n bottom: vhMargin,\n };\n }\n\n return {\n actualY: \"above\",\n top: Math.max(vhMargin, availableTop - elHeight),\n // this makes it so that the bottom of the fixed element is the top of the container\n // element. this ensures that it won't ever overlap the container element\n bottom: window.innerHeight - availableTop,\n };\n }\n\n const swappedTop = getAboveCoord(config);\n if (disableSwapping || swappedTop < vhMargin) {\n top = Math.min(top, screenBottom - elHeight);\n } else {\n actualY = \"above\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Creates the vertical position for a fixed element with the provided options.\n *\n * @internal\n */\nexport function createVerticalPosition(\n options: CreateVerticalPositionOptions\n): YPosition {\n const {\n y,\n vh,\n vhMargin,\n yMargin,\n elHeight,\n initialY,\n containerRect,\n disableSwapping,\n preventOverlap,\n disableVHBounds,\n } = options;\n\n if (!disableVHBounds && !preventOverlap && elHeight > vh - vhMargin * 2) {\n // the element is too big to be displayed in the viewport, so just span the\n // full viewport excluding margins\n return {\n top: vhMargin,\n bottom: vhMargin,\n actualY: \"center\",\n transformOriginY: containerRect.top,\n };\n }\n\n const config: FixConfig = {\n vhMargin,\n yMargin,\n elHeight,\n initialY,\n containerRect,\n screenBottom: vh - vhMargin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n };\n\n switch (y) {\n case \"above\":\n return createAnchoredAbove(config);\n case \"top\":\n return createAnchoredTop(config);\n case \"center\":\n return createAnchoredCenter(config);\n case \"bottom\":\n return createAnchoredBottom(config);\n case \"below\":\n return createAnchoredBelow(config);\n }\n}\n"],"names":["getAboveCoord","getBelowCoord","getBottomCoord","getCenterYCoord","getTopCoord","createAnchoredAbove","config","yMargin","vhMargin","screenBottom","elHeight","containerRect","preventOverlap","disableSwapping","disableVHBounds","top","actualY","Math","max","swappedTop","min","bottom","createAnchoredTop","createAnchoredCenter","createAnchoredBottom","createAnchoredBelow","availableTop","window","innerHeight","createVerticalPosition","options","y","vh","initialY","transformOriginY"],"mappings":"AACA,SACEA,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,WAAW,QACN,aAAa;AAwCpB;;;;;;;;;CASC,GACD,OAAO,SAASC,oBAAoBC,MAAiB;IACnD,MAAM,EACJC,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,eAAe,EAChB,GAAGR;IACJ,IAAIS,MAAMf,cAAcM;IACxB,IAAIU,UAA4B;IAEhC,IAAIF,iBAAiB;QACnB,uEAAuE;QACvE,gDAAgD;QAChD,OAAO;YAAEE;YAASD,KAAKE,KAAKC,GAAG,CAAC,GAAGH;QAAK;IAC1C;IAEA,IAAIA,MAAMP,UAAU;QAClB,4EAA4E;QAC5E,oEAAoE;QACpE,oBAAoB;QACpB,OAAO;YAAEQ;YAASD;QAAI;IACxB;IAEA,MAAMI,aAAalB,cAAcK;IACjC,IAAIO,mBAAmBM,aAAaT,WAAWD,cAAc;QAC3DM,MAAME,KAAKG,GAAG,CAACL,KAAKP;IACtB,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FxB,QAAQ,EACRD,OAAO,EACPG,QAAQ,EACRuB,QAAQ,EACRtB,aAAa,EACbE,eAAe,EACfD,cAAc,EACdE,eAAe,EAChB,GAAGgB;IAEJ,IAAI,CAAChB,mBAAmB,CAACF,kBAAkBF,WAAWsB,KAAKxB,WAAW,GAAG;QACvE,2EAA2E;QAC3E,kCAAkC;QAClC,OAAO;YACLO,KAAKP;YACLa,QAAQb;YACRQ,SAAS;YACTkB,kBAAkBvB,cAAcI,GAAG;QACrC;IACF;IAEA,MAAMT,SAAoB;QACxBE;QACAD;QACAG;QACAuB;QACAtB;QACAF,cAAcuB,KAAKxB;QACnBI;QACAC;QACAC;IACF;IAEA,OAAQiB;QACN,KAAK;YACH,OAAO1B,oBAAoBC;QAC7B,KAAK;YACH,OAAOgB,kBAAkBhB;QAC3B,KAAK;YACH,OAAOiB,qBAAqBjB;QAC9B,KAAK;YACH,OAAOkB,qBAAqBlB;QAC9B,KAAK;YACH,OAAOmB,oBAAoBnB;IAC/B;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/getFixedPosition.ts"],"sourcesContent":["import { getScrollbarWidth } from \"../scroll/getScrollbarWidth.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { createHorizontalPosition } from \"./createHorizontalPosition.js\";\nimport { createVerticalPosition } from \"./createVerticalPosition.js\";\nimport type { FixedPosition, FixedPositionOptions } from \"./types.js\";\nimport {\n findSizingContainer,\n getElementRect,\n getTransformOrigin,\n} from \"./utils.js\";\n\n/**\n * This is used when there is no `container` element so that some styles can\n * still be created. The main use-case for this is context menus and when the\n * `initialX` and `initialY` options have been provided.\n *\n * @internal\n * @remarks \\@since 5.0.0\n */\nconst FALLBACK_DOM_RECT: DOMRect = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n toJSON() {\n // do nothing\n },\n};\n\n/**\n * One of the most complicated functions in this project that will attempt to\n * position an element relative to another container element while still being\n * visible within the viewport. Below is the logical flow for attempting to fix\n * the element to the container:\n *\n * No Container: If there is no container element, return the provided x and y\n * positions and no styles since there's nothing we can use to calculate the\n * position.\n *\n * No Element: If the container was provided but the element to position does\n * not exist, return an style object containing the `left` and `top` values for\n * the container and apply as many of the positioning options as possible so\n * that the styles are \"as close as possible\" before the fixed element is added\n * to the DOM. This will also return the provided x and y positions since\n * nothing could be swapped around yet.\n *\n * Container and Element: If both the container and fixed element were provided,\n * apply all the positioning options to the `left` and `top` values of the\n * container based on the sizes of both elements.\n *\n * Now that the `left` and `top` values were applied, check to see if the\n * element is fully visible within the viewport with the provided positioning\n * options. If it is fully visible, do nothing else. If it isn't... follow the\n * next flow:\n *\n * First, check the horizontal sizes and make sure that the element is still\n * within the viewport with the provided view width margin. If it isn't, first\n * try to swap only to a `right` style instead of left to see if that fixes it,\n * otherwise keep both the `left` and `right` styles.\n */\nexport function getFixedPosition(options: FixedPositionOptions): FixedPosition {\n const {\n element,\n anchor = BELOW_CENTER_ANCHOR,\n initialX,\n vwMargin = 16,\n vhMargin = 16,\n xMargin = 0,\n yMargin = 0,\n width: widthType = \"auto\",\n preventOverlap = false,\n transformOrigin = false,\n disableSwapping = false,\n disableVHBounds = false,\n } = options;\n let { initialY } = options;\n const container = findSizingContainer(options.container);\n\n if (process.env.NODE_ENV !== \"production\") {\n if (preventOverlap && anchor.y !== \"above\" && anchor.y !== \"below\") {\n throw new Error(\n 'Unable to prevent overlap when the vertical anchor is not `\"above\"` or `\"below\"`'\n );\n }\n }\n\n if (!element) {\n return {\n actualX: anchor.x,\n actualY: anchor.y,\n style: {\n left: initialX,\n top: initialY,\n position: disableVHBounds ? \"absolute\" : \"fixed\",\n transformOrigin: transformOrigin\n ? getTransformOrigin({ x: anchor.x, y: anchor.y })\n : undefined,\n },\n };\n }\n\n const containerRect = container?.getBoundingClientRect() ?? FALLBACK_DOM_RECT;\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n\n const { minWidth: elMinWidth } = element.style;\n // Note: This makes it \"min-content\" or \"min-container-width\"\n if (widthType === \"min\") {\n element.style.overflow = \"visible\";\n element.style.minWidth = \"\";\n }\n const elementRect = getElementRect(element);\n const { height } = elementRect;\n let elWidth = elementRect.width;\n if (widthType === \"min\") {\n elWidth += getScrollbarWidth();\n element.style.overflow = \"\";\n element.style.minWidth = elMinWidth;\n }\n if (disableVHBounds) {\n const dialog = element.closest(\"[role='dialog']\");\n if (!dialog) {\n initialY = (initialY ?? 0) + window.scrollY;\n }\n }\n\n const { left, right, width, minWidth, actualX } = createHorizontalPosition({\n x: anchor.x,\n vw,\n vwMargin,\n xMargin,\n width: widthType,\n elWidth,\n initialX,\n containerRect,\n disableSwapping,\n });\n const { top, bottom, actualY, transformOriginY } = createVerticalPosition({\n y: anchor.y,\n vh,\n vhMargin,\n yMargin,\n initialY,\n elHeight: height,\n containerRect,\n disableSwapping,\n preventOverlap,\n disableVHBounds,\n });\n\n return {\n actualX,\n actualY,\n style: {\n left,\n top,\n right,\n bottom,\n width,\n minWidth,\n position: disableVHBounds ? \"absolute\" : \"fixed\",\n transformOrigin: transformOrigin\n ? getTransformOrigin({\n x: actualX,\n y: actualY,\n transformOriginY,\n })\n : undefined,\n },\n };\n}\n"],"names":["getScrollbarWidth","BELOW_CENTER_ANCHOR","createHorizontalPosition","createVerticalPosition","findSizingContainer","getElementRect","getTransformOrigin","FALLBACK_DOM_RECT","x","y","height","width","left","right","top","bottom","toJSON","getFixedPosition","options","element","anchor","initialX","vwMargin","vhMargin","xMargin","yMargin","widthType","preventOverlap","transformOrigin","disableSwapping","disableVHBounds","initialY","container","process","env","NODE_ENV","Error","actualX","actualY","style","position","undefined","containerRect","getBoundingClientRect","vh","window","innerHeight","vw","innerWidth","minWidth","elMinWidth","overflow","elementRect","elWidth","dialog","closest","scrollY","transformOriginY","elHeight"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SAASC,wBA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;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/types.ts"],"sourcesContent":["/**\n * Above:\n * - the container top is in-line with the bottom of the element.\n *\n * Below:\n * - the container bottom is in-line with the top of the element\n *\n * Center:\n * - the container center is in-line with the top of the element\n *\n * Top:\n * - the container top is in-line with the top of the element\n *\n * Bottom:\n * - the container bottom is in-line with the bottom of the element\n */\nexport type VerticalPosition = \"above\" | \"below\" | \"center\" | \"top\" | \"bottom\";\n\n/**\n * Left:\n * - the container left is in-line with the right of the element\n *\n * Right:\n * - the container right is in-line with the left of the element\n *\n * Center:\n * - the container's horizontal center point will be aligned with the element's\n * horizontal center point\n *\n * Inner Left:\n * - the container's left is in-line with the left of the element\n *\n * Inner Right:\n * - the container's right is in-line with the right of the element\n */\nexport type HorizontalPosition =\n | \"left\"\n | \"right\"\n | \"center\"\n | \"inner-left\"\n | \"inner-right\";\n\n/**\n * An object containing the x and y positions to anchor a fixed element to\n * another container element.\n */\nexport interface PositionAnchor {\n x: HorizontalPosition;\n y: VerticalPosition;\n}\n\n/**\n * A \"simple\" version of all the positioning options. These are generally used\n * across all of react-md as it'll use the \"center\" version of the opposite type\n * when creating a fixed position.\n */\nexport type SimplePosition = \"above\" | \"below\" | \"left\" | \"right\";\n\n/**\n * An optional configuration for calculating and setting the width of the\n * element relative to the width of the container. When this value is set to\n * `\"auto\"` (default), the width will be based on content width but still\n * ensuring it can fit within the viewport. Setting this to `\"equal\"` will just\n * apply the container's width to the fixed element. Finally, setting this to\n * `\"min\"` will set the container's width as the `minWidth` for the fixed\n * element so that it is at least the same width as the container.\n *\n * If this is set to `\"equal\"` or `\"min\"` and the horizontal anchor is not set\n * to `\"center\"`, an error will be thrown.\n *\n * @defaultValue `\"auto\"`\n */\nexport type PositionWidth = \"auto\" | \"equal\" | \"min\";\n\nexport interface InitialCoords {\n /**\n * The initial x value to use when calculating the position instead of\n * finding the container element to determine the the correct position. All\n * the other positioning logic will still be in effect to ensure the element\n * will be visible within the viewport.\n */\n initialX?: number;\n\n /**\n * The initial y value to use when calculating the position instead of\n * finding the container element to determine the the correct position. All\n * the other positioning logic will still be in effect to ensure the element\n * will be visible within the viewport.\n */\n initialY?: number;\n}\n\n/** @remarks \\@since 4.0.0 */\nexport interface CalculateFixedPositionOptions extends InitialCoords {\n /**\n * The configuration to anchor the fixed element to the container element.\n *\n * @defaultValue `BELOW_CENTER_ANCHOR`\n */\n anchor?: PositionAnchor;\n\n /**\n * The viewwidth margin to apply so that the element doesn't need to be\n * directly on the screen edge.\n *\n * @defaultValue `16`\n */\n vwMargin?: number;\n\n /**\n * The viewwidth margin to apply so that the element doesn't need to be\n * directly on the screen edge.\n *\n * @defaultValue `16`\n */\n vhMargin?: number;\n\n /**\n * The container width margin to apply so that the element doesn't need to be\n * directly on the container's edge.\n *\n * @defaultValue `0`\n */\n xMargin?: number;\n\n /**\n * The container height margin to apply so that the element doesn't need to be\n * directly on the container's edge\n *\n * @defaultValue `0`\n */\n yMargin?: number;\n\n /** {@inheritDoc PositionWidth} */\n width?: PositionWidth;\n\n /**\n * Boolean if the style object should include the `transformOrigin` value\n * based on the x and y positions.\n *\n * @defaultValue `false`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the fixed element should no longer be able to overlap the\n * container element. This is useful for autocomplete menus or other\n * components that retain focus on the container element while the fixed\n * element becomes visible.\n *\n * @defaultValue `false`\n */\n preventOverlap?: boolean;\n\n /**\n * Boolean if the auto-swapping behavior should be disabled. It's normally\n * recommended to not disable this since it'll allow elements to appear off\n * screen.\n *\n * @defaultValue `false`\n * @remarks \\@since 5.0.0 This will always be `true` if the\n * {@link FixedPositionOptions.container} is `null`.\n * \\@remarks \\@since 6.0.0 Allow this to be `false` while the `container` is\n * null. I can't figure out why I prevented that.\n */\n disableSwapping?: boolean;\n\n /**\n * Boolean if the fixed positioning should no longer prevent the fixed element\n * to be positioned within the viewport. This is nice if you want to allow for\n * full page scrolling instead and manually set a max-height on your element.\n *\n * @defaultValue `false`\n */\n disableVHBounds?: boolean;\n}\n\nexport interface FixedPositionOptions extends CalculateFixedPositionOptions {\n /**\n * The container element that the `element` should be fixed to.\n */\n container: HTMLElement | null;\n\n /**\n * The element that is fixed to a `container` element.\n */\n element: HTMLElement | null;\n}\n\n/**\n * This is more of a private interface that is used to help show how fixed\n * elements are placed within the viewport. Most of the time the `top` and\n * `left` values will be provided, but there are a few flows where the `right`\n * and `bottom` could be added or the `top` and `left` are removed.\n *\n * The `width` values will only be used when the `equalWidth` or `minEqualWidth`\n * options are enabled.\n *\n * @internal\n */\nexport interface Coords {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n width?: number;\n minWidth?: number;\n}\n\n/**\n * The style object that should be applied to the fixed element so it will be\n * fixed to the container element. This will be `undefined` if the container\n * element doesn't exist within the DOM.\n *\n * Note: The fixed element styles **will not** contain styles for `z-index` or\n * `background-color` so you'll need to add that manually.\n *\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositionStyle extends Coords {\n /**\n * This will be `\"fixed\"` unless\n * {@link CalculateFixedPositionOptions.disableVHBounds} is set to `true`.\n */\n position: \"fixed\" | \"absolute\";\n\n /**\n * This will be `undefined` unless\n * {@link CalculateFixedPositionOptions.transformOrigin} is set to `true`\n */\n transformOrigin?: string;\n}\n\n/**\n * Since the position can be \"swapped\" to help fit the fixed element within the\n * viewport, this interface is used to contain the calculated positions as well\n * as an optional style object to apply.\n */\nexport interface FixedPosition {\n /**\n * The calculated horizontal position that can be used to compare to the\n * provided horizontal position anchor if additional manual updates should be\n * applied.\n */\n actualX: HorizontalPosition;\n\n /**\n * The calculated vertical position that can be used to compare to the\n * provided horizontal position anchor if additional manual updates should be\n * applied.\n */\n actualY: VerticalPosition;\n /** {@inheritDoc FixedPositionStyle} */\n style?: FixedPositionStyle;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GA0ND;;;;CAIC,GACD,WAgBC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\nimport type { CSSProperties, Ref, RefCallback, RefObject } from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport type { TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport type { CalculateFixedPositionOptions } from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @remarks \\@since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningHookReturnValue<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * @see {@link FixedPositionStyle}\n */\n style: CSSProperties;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle(): void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useCSSTransition, useFixedPositioning } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button\n * ref={fixedTo}\n * onClick={() => setTransitionIn(!transitionIn)}\n * >\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningHookReturnValue<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX and initialY should cause the useEffect below\n // to trigger, which is why everything else is set in a ref.\n }, [initialX, initialY]);\n\n useEffect(() => {\n if (!active) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n useEffect(() => {\n if (!ref.current || !ref.current.hidden) {\n updateStyle();\n }\n }, [ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,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DE,SAAS;QACX;QACAH,cAAcI,GAAG,CAACV;QAClBQ,cAAcE,GAAG,CAACR;QAClB,OAAO;YACLI,cAAcK,MAAM,CAACX;YACrBQ,cAAcG,MAAM,CAACT;QACvB;IACF,GAAG;QAACb;QAAQpB;QAASmB;QAAUD;QAAUI;QAAKO;KAAY;IAE1D7C,UAAU;QACR,IAAI,CAACsC,IAAIG,OAAO,IAAI,CAACH,IAAIG,OAAO,CAACK,MAAM,EAAE;YACvCD;QACF;IACF,GAAG;QAACP;QAAKO;KAAY;IAErB,MAAMc,YAA2D;QAC/D1C,SAAQ2C,SAAS;YACf3C,QAAQ2C;YACRf;QACF;QACA3B,YAAW0C,SAAS;YAClB1C,WAAW0C;YACXf;QACF;QACA1B,WAAUyC,SAAS;YACjBzC,UAAUyC;YACVf;QACF;QACAzB;YACEA;YACAiB,UAAU;QACZ;IACF;IAEA,OAAO;QACLC,KAAKC;QACL1B,OAAO;YAAE,GAAGA,KAAK;YAAE,GAAGC,SAAS;QAAC;QAChC6C;QACAd;QACAgB,mBAAmB;YACjB,GAAGF,SAAS;YACZ5C,SAASwB;QACX;IACF;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/positioning/utils.ts"],"sourcesContent":["import type { PositionAnchor } from \"./types.js\";\n\n/** @internal */\nexport interface XCoordConfig {\n xMargin: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/** @internal */\nexport interface YCoordConfig {\n yMargin: number;\n elHeight: number;\n initialY?: number;\n containerRect: DOMRect;\n}\n\ntype Left = number;\ntype Top = number;\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) left of the container element. So the right bounds of the fixed\n * element will be equal to the left bounds of the container element (before the\n * xMargin is applied).\n *\n * @internal\n */\nexport function getLeftCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) - elWidth - xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-left of the container element. So the left bounds of both the container\n * and fixed elements will overlap (before the xMargin is applied)\n *\n * @internal\n */\nexport function getInnerLeftCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) + xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * center of the container element. So the center point of the fixed element\n * should be the center point of the container element.\n *\n * Note: Unlike all the other horizontal positioning logic, the center position\n * does not use the xMargin.\n *\n * @internal\n */\nexport function getCenterXCoord({\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n const containerCenter = containerRect.width / 2;\n const elementCenter = elWidth / 2;\n return (initialX ?? containerRect.left + containerCenter) - elementCenter;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-right of the container element. So the right bounds for both the\n * container and fixed elements will overlap (before the xMargin is applied).\n *\n * @internal\n */\nexport function getInnerRightCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (\n (initialX ?? containerRect.left + containerRect.width) - elWidth - xMargin\n );\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) right of the container element. So the left bounds of the fixed\n * element will overlap with the right bounds of the container element (before\n * the xMargin is applied).\n *\n * @internal\n */\nexport function getRightCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left + containerRect.width) + xMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed above the\n * container element. So the bottom bounds of the fixed element will overlap\n * with the top bounds of the container element (before the yMargin is applied).\n *\n * @internal\n */\nexport function getAboveCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) - elHeight - yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the top\n * of the container element. So the top bounds for both the container and fixed\n * elements will overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getTopCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) + yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed vertically\n * centered relative to the container element. So the vertical center point for\n * the fixed element should overlap the vertical center point of the container\n * element.\n *\n * Note: Unlike all the other vertical positioning logic, the center position\n * does not use the yMargin.\n *\n * @internal\n */\nexport function getCenterYCoord({\n yMargin,\n elHeight,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n const containerCenter = containerRect.height / 2;\n const elementCenter = elHeight / 2;\n return (\n (initialY ?? containerRect.top + containerCenter + yMargin) - elementCenter\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the top bounds of the fixed element\n * should overlap the bottom bounds of the container element (before the yMargin\n * is applied).\n *\n * @internal\n */\nexport function getBottomCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (\n (initialY ?? containerRect.top + containerRect.height) - elHeight - yMargin\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the bottom bounds of both the container\n * and fixed elements should overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getBelowCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top + containerRect.height) + yMargin;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface TransformOriginOptions extends PositionAnchor {\n transformOriginY?: number;\n}\n\n/**\n * This is a simple util that'll generate a css `transform-origin` string so\n * that the fixed element can animate from the correct point based on the\n * provided anchor.\n *\n * @param options - The anchor that should be used to create the transform origin\n * for.\n * @returns the transform origin string\n * @internal\n */\nexport function getTransformOrigin(options: TransformOriginOptions): string {\n const { transformOriginY: yPosition } = options;\n\n let x = \"0\";\n switch (options.x) {\n case \"right\":\n case \"inner-left\":\n x = \"0\";\n break;\n case \"center\":\n x = \"50%\";\n break;\n case \"left\":\n case \"inner-right\":\n x = \"100%\";\n break;\n default:\n x = \"0\";\n }\n\n let y = \"0\";\n if (typeof yPosition === \"number\") {\n y = `${yPosition}px`;\n } else {\n switch (options.y) {\n case \"above\":\n case \"bottom\":\n y = \"100%\";\n break;\n case \"center\":\n y = \"50%\";\n break;\n case \"below\":\n case \"top\":\n y = \"0\";\n break;\n default:\n y = \"0\";\n }\n }\n\n return `${x} ${y}`;\n}\n\n/**\n * Attempts to find a sizing container based on the provided HTMLElement. By\n * default, the sizing element will just be the provided element unless:\n * - the item has a known role within react-md that can target known classes\n * - the item has a `data-sizing-selector` attribute that is a valid query\n * selector for the nested item.\n *\n * NOTE: The `data-sizing-selector` will be run from the current element instead\n * of the `document`.\n *\n * @param el - The element to find a sizing container for.\n * @returns the sizing container relative to the provided element, or `null` if\n * none could be found.\n * @throws This error will be thrown if using the `data-query-selector` and the\n * query selector does not return an element on the page.\n * @internal\n */\nexport function findSizingContainer(\n el: HTMLElement | null\n): HTMLElement | null {\n if (!el) {\n return null;\n }\n\n if (/(tree|list)item/.test(el.getAttribute(\"role\") || \"\")) {\n const content = el.querySelector(\n \".rmd-tree-item__content, .rmd-item-text\"\n ) as HTMLElement;\n if (content) {\n return content;\n }\n } else if (el.getAttribute(\"type\") === \"file\") {\n const label = document.querySelector<HTMLLabelElement>(`[for=\"${el.id}\"]`);\n if (label) {\n return label;\n }\n }\n\n const data = el.getAttribute(\"data-sizing-selector\");\n if (data) {\n const content = el.querySelector(data) as HTMLElement;\n if (content) {\n return content;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Unable to find a child element using the `data-sizing-selector`\"\n );\n }\n }\n\n return el;\n}\n\n/**\n * This util is used to get the \"true\" `element.getBoundingClientRect()` that\n * ensures that transitions using transforms don't mess up the sizing so that\n * position calculations are easier to do.\n *\n * @param element - The element to get a rect for.\n * @returns either a DOMRect for the element\n * @internal\n */\nexport function getElementRect(element: HTMLElement): DOMRect {\n const cloned = element.cloneNode(true) as HTMLElement;\n // remove the id so there won't be two elements with the same id on the page\n cloned.removeAttribute(\"id\");\n\n // remove the role just in case the role would alert screen readers once added\n // to the dom\n cloned.removeAttribute(\"role\");\n\n // ensure the cloned node won't shift the page or be visible\n cloned.style.position = \"fixed\";\n cloned.style.visibility = \"hidden\";\n\n // reset positioning to get a \"pure\" calculation. otherwise this will mess up\n // the height and width if the element is able to line wrap.\n cloned.style.left = \"\";\n cloned.style.top = \"\";\n cloned.style.right = \"\";\n cloned.style.bottom = \"\";\n\n // reset transforms so that custom animations don't mess with the sizing\n cloned.style.transform = \"none\";\n\n const parent = element.parentElement || document.body;\n parent.appendChild(cloned);\n\n const rect = cloned.getBoundingClientRect();\n parent.removeChild(cloned);\n\n return rect;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\ninterface IsWithinViewportOptions {\n fixedElement: HTMLElement;\n fixedToElement: HTMLElement;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function isWithinViewport(options: IsWithinViewportOptions): boolean {\n const { fixedElement, fixedToElement } = options;\n const fixedElementRect = fixedElement.getBoundingClientRect();\n const fixedToElementRect = fixedToElement.getBoundingClientRect();\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n const top = Math.min(fixedElementRect.top, fixedToElementRect.top);\n const right = Math.max(fixedElementRect.right, fixedToElementRect.right);\n const bottom = Math.max(fixedElementRect.bottom, fixedToElementRect.bottom);\n const left = Math.min(fixedElementRect.left, fixedToElementRect.left);\n\n return bottom >= 0 && top <= vh && right >= 0 && left <= vw;\n}\n"],"names":["getLeftCoord","xMargin","elWidth","initialX","containerRect","left","getInnerLeftCoord","getCenterXCoord","containerCenter","width","elementCenter","getInnerRightCoord","getRightCoord","getAboveCoord","yMargin","initialY","elHeight","top","getTopCoord","getCenterYCoord","height","getBottomCoord","getBelowCoord","getTransformOrigin","options","transformOriginY","yPosition","x","y","findSizingContainer","el","test","getAttribute","content","querySelector","label","document","id","data","process","env","NODE_ENV","Error","getElementRect","element","cloned","cloneNode","removeAttribute","style","position","visibility","right","bottom","transform","parent","parentElement","body","appendChild","rect","getBoundingClientRect","removeChild","isWithinViewport","fixedElement","fixedToElement","fixedElementRect","fixedToElementRect","vh","window","innerHeight","vw","innerWidth","Math","min","max"],"mappings":"AAqBA;;;;;;;CAOC,GACD,OAAO,SAASA,aAAa,EAC3BC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,AAAD,IAAKH,UAAUD;AACtD;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,kBAAkB,EAChCL,OAAO,EACPE,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,AAAD,IAAKJ;AAC5C;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASM,gBAAgB,EAC9BL,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,MAAMI,kBAAkBJ,cAAcK,KAAK,GAAG;IAC9C,MAAMC,gBAAgBR,UAAU;IAChC,OAAO,AAACC,CAAAA,YAAYC,cAAcC,IAAI,GAAGG,eAAc,IAAKE;AAC9D;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,mBAAmB,EACjCV,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,OACE,AAACD,CAAAA,YAAYC,cAAcC,IAAI,GAAGD,cAAcK,KAAK,AAAD,IAAKP,UAAUD;AAEvE;AAEA;;;;;;;CAOC,GACD,OAAO,SAASW,cAAc,EAC5BX,OAAO,EACPE,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,GAAGD,cAAcK,KAAK,AAAD,IAAKR;AAClE;AAEA;;;;;;CAMC,GACD,OAAO,SAASY,cAAc,EAC5BC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRZ,aAAa,EACA;IACb,OAAO,AAACW,CAAAA,YAAYX,cAAca,GAAG,AAAD,IAAKD,WAAWF;AACtD;AAEA;;;;;;CAMC,GACD,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GAAG;IACrBN,OAAOG,KAAK,CAACI,MAAM,GAAG;IAEtB,wEAAwE;IACxEP,OAAOG,KAAK,CAACK,SAAS,GAAG;IAEzB,MAAMC,SAASV,QAAQW,aAAa,IAAInB,SAASoB,IAAI;IACrDF,OAAOG,WAAW,CAACZ;IAEnB,MAAMa,OAAOb,OAAOc,qBAAqB;IACzCL,OAAOM,WAAW,CAACf;IAEnB,OAAOa;AACT;AAWA;;;CAGC,GACD,OAAO,SAASG,iBAAiBrC,OAAgC;IAC/D,MAAM,EAAEsC,YAAY,EAAEC,cAAc,EAAE,GAAGvC;IACzC,MAAMwC,mBAAmBF,aAAaH,qBAAqB;IAC3D,MAAMM,qBAAqBF,eAAeJ,qBAAqB;IAC/D,MAAMO,KAAKC,OAAOC,WAAW;IAC7B,MAAMC,KAAKF,OAAOG,UAAU;IAC5B,MAAMrD,MAAMsD,KAAKC,GAAG,CAACR,iBAAiB/C,GAAG,EAAEgD,mBAAmBhD,GAAG;IACjE,MAAMkC,QAAQoB,KAAKE,GAAG,CAACT,iBAAiBb,KAAK,EAAEc,mBAAmBd,KAAK;IACvE,MAAMC,SAASmB,KAAKE,GAAG,CAACT,iBAAiBZ,MAAM,EAAEa,mBAAmBb,MAAM;IAC1E,MAAM/C,OAAOkE,KAAKC,GAAG,CAACR,iBAAiB3D,IAAI,EAAE4D,mBAAmB5D,IAAI;IAEpE,OAAO+C,UAAU,KAAKnC,OAAOiD,MAAMf,SAAS,KAAK9C,QAAQgE;AAC3D"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * Removed the `determinateRotateDegrees` prop since the determinate state no\n * longer rotates while increasing value.\n * Added the `disableShrink` prop.\n * Renamed the `small` prop to `dense` to match other components.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Updated the determinate circular progress to no longer\n * rotate while increasing the value and require a label for accessibility.\n */\nexport const CircularProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<CircularProgressProps>\n>(function CircularProgress(props, ref) {\n const {\n id: propId,\n className,\n svgStyle,\n svgClassName,\n circleStyle: propCircleStyle,\n circleClassName,\n value,\n min = 0,\n max = 100,\n radius = 30,\n center = 33,\n viewBox = \"0 0 66 66\",\n theme = \"primary\",\n dense = false,\n dashoffset = 187,\n disableShrink = false,\n disableCentered = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"circular-progress\");\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n\n const circleStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propCircleStyle;\n }\n\n return {\n ...propCircleStyle,\n strokeDashoffset: dashoffset - dashoffset * progress,\n };\n }, [progress, propCircleStyle, dashoffset]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({ dense, centered: !disableCentered }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <svg\n style={svgStyle}\n className={cnb(\n styles(\"svg\", {\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n svgClassName\n )}\n viewBox={viewBox}\n >\n <circle\n style={circleStyle}\n className={cnb(\n styles(\"circle\", {\n animate: !disableTransition && determinate,\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n circleClassName\n )}\n r={radius}\n cx={center}\n cy={center}\n />\n </svg>\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","CircularProgress","props","ref","id","propId","className","svgStyle","svgClassName","circleStyle","propCircleStyle","circleClassName","value","min","max","radius","center","viewBox","theme","dense","dashoffset","disableShrink","disableCentered","disableTransition","remaining","progress","validate","strokeDashoffset","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","centered","textColor","svg","style","circle","animate","r","cx","cy"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAuG1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,iCAAmBP,WAG9B,SAASO,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,aAAaC,eAAe,EAC5BC,eAAe,EACfC,KAAK,EACLC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,SAAS,EA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;AAKd,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/progress/LinearProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\" | \"children\">,\n ProgressProps {\n /**\n * An optional style to apply to the progress bar. This will be merged with\n * the current width or height tracking the progress when a `value` is also\n * provided.\n */\n barStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the progress bar.\n */\n barClassName?: string;\n\n /**\n * Boolean if the progress should be reversed. This will change the progress\n * direction from `left-to-right` to be `right-to-left`. If the current\n * language is a rtl language and this prop is enabled, the direction will\n * still be `left-to-right`.\n *\n * @defaultValue `false`\n */\n reverse?: boolean;\n\n /**\n * Boolean if the progress should be vertical instead of horizontal. When\n * this prop is set, you should also set the `verticalHeight` prop to a height\n * value you want for your progress bar.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * Since there isn't really a good way to have \"auto height\", you'll need to\n * manually set the progress bar's height with this prop to some pixel value.\n * If you'd prefer to set the height in Sass/css, set this value to `null`\n * instead since this value would be passed down as a `height` inline style.\n *\n * @defaultValue `240`\n */\n verticalHeight?: number | null;\n}\n\nconst styles = bem(\"rmd-linear-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <LinearProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <LinearProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Supports rendering as any of the theme colors and\n * requires a label for accessibility.\n */\nexport const LinearProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<LinearProgressProps>\n>(function LinearProgress(props, ref) {\n const {\n id: propId,\n style: propStyle,\n className,\n barStyle: propBarStyle,\n barClassName,\n min = 0,\n max = 100,\n value,\n reverse = false,\n theme = \"primary\",\n disableTransition = false,\n vertical = false,\n verticalHeight = 240,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"linear-progress\");\n const style = useMemo(() => {\n if (!vertical || verticalHeight === null) {\n return propStyle;\n }\n\n return {\n ...propStyle,\n height: verticalHeight,\n };\n }, [propStyle, vertical, verticalHeight]);\n\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n const barStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propBarStyle;\n }\n\n const key = vertical ? \"height\" : \"width\";\n return {\n ...propBarStyle,\n [key]: `${progress * 100}%`,\n };\n }, [progress, propBarStyle, vertical]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n style={style}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({\n vertical,\n horizontal: !vertical,\n determinate,\n indeterminate,\n }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <span\n style={barStyle}\n className={cnb(\n styles(\"bar\", {\n vertical,\n \"vertical-reverse\": vertical && reverse,\n horizontal: !vertical,\n \"horizontal-reverse\": !vertical && reverse,\n animate: !disableTransition && determinate,\n determinate,\n indeterminate,\n \"determinate-reverse\": determinate && reverse && !vertical,\n \"determinate-vertical-reverse\": determinate && reverse && vertical,\n \"indeterminate-reverse\": indeterminate && reverse && !vertical,\n \"indeterminate-vertical\": indeterminate && vertical,\n \"indeterminate-vertical-reverse\":\n indeterminate && reverse && vertical,\n }),\n barClassName\n )}\n />\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","LinearProgress","props","ref","id","propId","style","propStyle","className","barStyle","propBarStyle","barClassName","min","max","value","reverse","theme","disableTransition","vertical","verticalHeight","remaining","height","progress","validate","key","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","horizontal","textColor","animate"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAmD1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAOC,SAAS,EAChBC,SAAS,EACTC,UAAUC,YAAY,EACtBC,YAAY,EACZC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,KAAK,EACLC,UAAU,KAAK,EACfC,QAAQ,SAAS,EACjBC,oBAAoB,KAAK,EACzBC,WAAW,KAAK,EAChBC,iBAAiB,GAAG,EACpB,GAAGC,WACJ,GAAGlB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMC,QAAQX,QAAQ;QACpB,IAAI,CAACuB,YAAYC,mBAAmB,MAAM;YACxC,OAAOZ;QACT;QAEA,OAAO;YACL,GAAGA,SAAS;YACZc,QAAQF;QACV;IACF,GAAG;QAACZ;QAAWW;QAAUC;KAAe;IAExC,IAAIG;IACJ,IAAI,OAAOR,UAAU,UAAU;QAC7BQ,WAAWvB,cAAc;YAAEa;YAAKC;YAAKC;YAAOS,UAAU;QAAK;IAC7D;IACA,MAAMd,WAAWd,QAAQ;QACvB,IAAI,OAAO2B,aAAa,UAAU;YAChC,OAAOZ;QACT;QAEA,MAAMc,MAAMN,WAAW,WAAW;QAClC,OAAO;YACL,GAAGR,YAAY;YACf,CAACc,IAAI,EAAE,CAAC,EAAEF,WAAW,IAAI,CAAC,CAAC;QAC7B;IACF,GAAG;QAACA;QAAUZ;QAAcQ;KAAS;IAErC,MAAMO,cAAc,OAAOH,aAAa;IACxC,MAAMI,gBAAgB,CAACD;IACvB,qBACE,KAACE;QACE,GAAGP,SAAS;QACbhB,IAAIA;QACJD,KAAKA;QACLG,OAAOA;QACPsB,MAAK;QACLC,iBAAejB;QACfkB,iBAAejB;QACfkB,iBAAejB;QACfN,WAAWf,IACTO,OAAO;YACLkB;YACAc,YAAY,CAACd;YACbO;YACAC;QACF,IACAV,UAAU,mBAAmBpB,SAAS;YAAEqC,WAAWjB;QAAM,IACzDR;kBAGF,cAAA,KAACmB;YACCrB,OAAOG;YACPD,WAAWf,IACTO,OAAO,OAAO;gBACZkB;gBACA,oBAAoBA,YAAYH;gBAChCiB,YAAY,CAACd;gBACb,sBAAsB,CAACA,YAAYH;gBACnCmB,SAAS,CAACjB,qBAAqBQ;gBAC/BA;gBACAC;gBACA,uBAAuBD,eAAeV,WAAW,CAACG;gBAClD,gCAAgCO,eAAeV,WAAWG;gBAC1D,yBAAyBQ,iBAAiBX,WAAW,CAACG;gBACtD,0BAA0BQ,iBAAiBR;gBAC3C,kCACEQ,iBAAiBX,WAAWG;YAChC,IACAP;;;AAKV,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/progress/getProgressA11y.ts"],"sourcesContent":["export interface ProgressA11y {\n \"aria-busy\": true;\n \"aria-describedby\": string;\n}\n\n/**\n * An extremely simple util that can be used to get the required a11y props for\n * another component that relies on a progress component.\n *\n * @param progressId - The id for the progress bar\n * @param progressing - Boolean if the progress bar is visible and progressing\n */\nexport function getProgressA11y(\n progressId: string,\n progressing: boolean\n): ProgressA11y | undefined {\n if (!progressing) {\n return undefined;\n }\n\n return {\n \"aria-busy\": true,\n \"aria-describedby\": progressId,\n };\n}\n"],"names":["getProgressA11y","progressId","progressing","undefined"],"mappings":"AAKA;;;;;;CAMC,GACD,OAAO,SAASA,gBACdC,UAAkB,EAClBC,WAAoB;IAEpB,IAAI,CAACA,aAAa;QAChB,OAAOC;IACT;IAEA,OAAO;QACL,aAAa;QACb,oBAAoBF;IACtB;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/progress/types.ts"],"sourcesContent":["import { type ThemeColor } from \"../cssUtils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-progress-background-color\"?: string;\n \"--rmd-progress-color\"?: string;\n \"--rmd-progress-circular-size\"?: string | number;\n \"--rmd-progress-circular-stroke-width\"?: number;\n \"--rmd-progress-linear-size\"?: string | number;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProgressTheme = ThemeColor | \"current-color\";\n\n/**\n * The base progress props for both the linear and circular progress components.\n *\n * @remarks \\@since 6.0.0 Added the `theme` prop.\n */\nexport interface ProgressProps {\n /**\n * The id for the progress component. This is required for accessibility since\n * the progress will 99% of the time be describing the progress of something\n * else within the page. The element that is loading or tracking progress\n * should also be updated to have `aria-busy=\"true\"` and\n * `aria-describedby=\"THIS_ID\"`.\n *\n * @defaultValue `\"circular-progress-\" useId() || \"linear-progress-\" + useId()`\n * @remarks \\@since 6.0.0 This prop is now optional.\n */\n id?: string;\n\n /**\n * The min value for the progress component. This is used to determine the\n * current progress percentage for screen readers and styles.\n *\n * @defaultValue `0`\n */\n min?: number;\n\n /**\n * The max value for the progress component. This is used to determine the\n * current progress percentage for screen readers and styles.\n *\n * @defaultValue `100`\n */\n max?: number;\n\n /**\n * The current value for the progress component. If this prop is omitted, the\n * progress component will be put in an \"indeterminate\" state which will just\n * infinitely loop an animation until it is unmounted.\n *\n * This value will be passed down as a percentage based on the `min` and `max`\n * props so that screen readers can be notified of changes.\n */\n value?: number;\n\n /**\n * Boolean if the determinate progress versions should animate when the value\n * changes. This should really only be enabled if you aren't getting quick\n * progress updates or the updates happen in chunks.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0 This was renamed from `animate` to\n * `disableTransition`.\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `\"primary\"`\n * @remarks \\@since 6.0.0\n */\n theme?: ProgressTheme;\n}\n"],"names":[],"mappings":"AAiBA;;;;CAIC,GACD,WAuDC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/responsive-item/ResponsiveItemContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item-container\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemContainerClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the container should gain the following styles:\n *\n * ```scss\n * display: block;\n * width: 100%;\n * ```\n *\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n\n /**\n * Set this to a custom aspect ratio to use.\n *\n * @example\n * Valid Aspect Ratios\n * ```tsx\n * aspectRatio=\"16-9\"\n * aspectRatio=\"9-16\"\n * aspectRatio=\"3-4\"\n * aspectRatio=\"4-3\"\n * aspectRatio=\"1-1\"\n * ```\n *\n * These values are based on the `core.$responsive-item-aspect-ratios` map.\n *\n * @defaultValue `\"\"`\n */\n aspectRatio?: `${number}-${number}`;\n\n /**\n * Set this to `\"manual\"` if you want to manually specify which elements are\n * responsive items using custom class names. You probably don't really want\n * to use this.\n *\n * Set this to `\"auto\"` to automatically update all visual media that appear\n * as a child in this component to a responsive item.\n *\n * Set this to `\"container\"` to automatically update all visual media that\n * appear as a child in this component to be a responsive item that scales to\n * the container's dimensions.\n *\n * Note: The `\"auto\"` and `\"container\"` values use the\n * `core.$responsive-item-selectors` value for their behavior.\n *\n * @defaultValue `\"auto\"`\n */\n responsive?: \"auto\" | \"manual\" | \"container\";\n}\n\n/** @remarks \\@since 6.0.0 */\nexport function responsiveItemContainer(\n options: ResponsiveItemContainerClassNameOptions = {}\n): string {\n const {\n className,\n fullWidth = false,\n aspectRatio = \"\",\n responsive = \"auto\",\n } = options;\n\n return cnb(\n styles({\n auto: responsive !== \"manual\",\n \"auto-scale\": responsive === \"container\",\n \"aspect-ratio\": aspectRatio,\n [aspectRatio]: aspectRatio,\n \"full-width\": fullWidth,\n }),\n className\n );\n}\n\n/**\n * @remarks\n * \\@since 6.0.0 Renamed from `MediaContainerProps` to\n * `ResponsiveItemContainerProps`\n * \\@since 6.0.0 The `height` and `width` props were removed in favor of the\n * `aspectRatio` props since the latest typescript string interpolation supports\n * enforcing the correct format.\n * \\@since 6.0.0 The `auto` prop was removed in favor of the new\n * {@link ResponsiveItemContainerProps.responsive} prop.\n */\nexport interface ResponsiveItemContainerProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemContainerClassNameOptions {}\n\n/**\n * **Server Component**\n *\n * @example\n * Image Example\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @example\n * Iframe Example\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <iframe\n * src=\"https://youtube.com/some-video-url\"\n * title=\"Some YouTube video\"\n * allowFullScreen\n * />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @example\n * Forced Aspect Ratio\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer aspectRatio=\"16-9\">\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaContainer` to\n * `ResponsiveItemContainer` and renders a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItemContainer = forwardRef<\n HTMLSpanElement,\n ResponsiveItemContainerProps\n>(function ResponsiveItemContainer(props, ref) {\n const {\n className,\n fullWidth = false,\n aspectRatio,\n responsive = \"auto\",\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItemContainer({\n className,\n fullWidth,\n aspectRatio,\n responsive,\n })}\n >\n {children}\n </span>\n );\n});\n"],"names":["cnb","forwardRef","bem","styles","responsiveItemContainer","options","className","fullWidth","aspectRatio","responsive","auto","ResponsiveItemContainer","props","ref","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAyDnB,2BAA2B,GAC3B,OAAO,SAASE,wBACdC,UAAmD,CAAC,CAAC;IAErD,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,cAAc,EAAE,EAChBC,aAAa,MAAM,EACpB,GAAGJ;IAEJ,OAAOL,IACLG,OAAO;QACLO,MAAMD,eAAe;QACrB,cAAcA,eAAe;QAC7B,gBAAgBD;QAChB,CAACA,YAAY,EAAEA;QACf,cAAcD;IAChB,IACAD;AAEJ;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDC,GACD,OAAO,MAAMK,wCAA0BV,WAGrC,SAASU,wBAAwBC,KAAK,EAAEC,GAAG;IAC3C,MAAM,EACJP,SAAS,EACTC,YAAY,KAAK,EACjBC,WAAW,EACXC,aAAa,MAAM,EACnBK,QAAQ,EACR,GAAGC,WACJ,GAAGH;IAEJ,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLP,WAAWF,wBAAwB;YACjCE;YACAC;YACAC;YACAC;QACF;kBAECK;;AAGP,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/responsive-item/ResponsiveItemOverlay.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item-overlay\");\n\n/**\n * The overlay positions relative to the `MediaContainer` component. Most of\n * the sizes are self-explanatory, but the `middle` position will be centered\n * vertically while `center` will be centered `horizontally`.\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlayPosition` to\n * `ResponsiveItemOverlayProps`.\n */\nexport type ResponsiveItemOverlayPosition =\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"middle\"\n | \"center\"\n | \"absolute-center\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemOverlayClassNameOptions {\n className?: string;\n /** @defaultValue `\"bottom\"` */\n position?: ResponsiveItemOverlayPosition;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function responsiveItemOverlay(\n options: ResponsiveItemOverlayClassNameOptions = {}\n): string {\n const { className, position = \"bottom\" } = options;\n\n return cnb(\n styles({\n [position]: true,\n horizontal:\n position !== \"top\" && position !== \"bottom\" && position !== \"middle\",\n }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlayProps` to\n * `ResponsiveItemOverlayProps`.\n */\nexport interface ResponsiveItemOverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemOverlayClassNameOptions {}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ResponsiveItemContainer, ResponsiveItemOverlay } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <img alt=\"\" src=\"/some-image.png\" />\n * <ResponsiveItemOverlay>\n * <Typography type=\"headline-5\" margin=\"none\">\n * This appears at the bottom by default.\n * </Typography>\n * </ResponsiveItemOverlay>\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @see {@link ResponsiveItemOverlayPosition}\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlay` to `ResponsiveItemOverlay`\n * and renders as a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItemOverlay = forwardRef<\n HTMLSpanElement,\n ResponsiveItemOverlayProps\n>(function ResponsiveItemOverlay(props, ref) {\n const { className, children, position = \"bottom\", ...remaining } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItemOverlay({ className, position })}\n >\n {children}\n </span>\n );\n});\n"],"names":["cnb","forwardRef","bem","styles","responsiveItemOverlay","options","className","position","horizontal","ResponsiveItemOverlay","props","ref","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA0BnB;;CAEC,GACD,OAAO,SAASE,sBACdC,UAAiD,CAAC,CAAC;IAEnD,MAAM,EAAEC,SAAS,EAAEC,WAAW,QAAQ,EAAE,GAAGF;IAE3C,OAAOL,IACLG,OAAO;QACL,CAACI,SAAS,EAAE;QACZC,YACED,aAAa,SAASA,aAAa,YAAYA,aAAa;IAChE,IACAD;AAEJ;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,MAAMG,sCAAwBR,WAGnC,SAASQ,sBAAsBC,KAAK,EAAEC,GAAG;IACzC,MAAM,EAAEL,SAAS,EAAEM,QAAQ,EAAEL,WAAW,QAAQ,EAAE,GAAGM,WAAW,GAAGH;IAEnE,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLL,WAAWF,sBAAsB;YAAEE;YAAWC;QAAS;kBAEtDK;;AAGP,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/responsive-item/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply the following styles:\n * ```scss\n * max-height: 100%;\n * max-width: 100%;\n * object-fit: contain;\n * ```\n *\n * This is useful for displaying images in a full page dialog so that scroll\n * bars do not appear while maintaining the correct aspect ratio for the item.\n *\n * @defaultValue `false`\n */\n scaleToContainer?: boolean;\n\n /**\n * Set this to `true` to force a specific aspect ratio.\n *\n * Note: This will only work if the parent element has applied the correct\n * {@link ResponsiveItemContainerStyles} as well.\n *\n * @defaultValue `false`\n */\n forcedAspectRatio?: boolean;\n}\n\n/**\n * Applies the visual media responsive styles manually if you cannot use the\n * `ResponsiveItemContainer` component.\n *\n * @remarks \\@since 6.0.0\n */\nexport function responsiveItem(\n options: ResponsiveItemClassNameOptions = {}\n): string {\n const {\n className,\n scaleToContainer = false,\n forcedAspectRatio = false,\n } = options;\n\n return cnb(\n styles({\n scale: scaleToContainer,\n \"aspect-ratio\": forcedAspectRatio,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","responsiveItem","options","className","scaleToContainer","forcedAspectRatio","scale"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgCnB;;;;;CAKC,GACD,OAAO,SAASE,eACdC,UAA0C,CAAC,CAAC;IAE5C,MAAM,EACJC,SAAS,EACTC,mBAAmB,KAAK,EACxBC,oBAAoB,KAAK,EAC1B,GAAGH;IAEJ,OAAOJ,IACLE,OAAO;QACLM,OAAOF;QACP,gBAAgBC;IAClB,IACAF;AAEJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/scroll/ScrollLock.tsx"],"sourcesContent":["\"use client\";\nimport { useScrollLock } from \"./useScrollLock.js\";\n\n/**\n * **Client Component**\n *\n * This is a convenience component that can be used within transitionable\n * components to ensure the scroll lock is active only while the element is\n * rendered.\n *\n * @remarks \\@since 6.0.0\n */\nexport function ScrollLock(): null {\n useScrollLock(true);\n return null;\n}\n"],"names":["useScrollLock","ScrollLock"],"mappings":"AAAA;AACA,SAASA,aAAa,QAAQ,qBAAqB;AAEnD;;;;;;;;CAQC,GACD,OAAO,SAASC;IACdD,cAAc;IACd,OAAO;AACT"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/scroll/getScrollbarWidth.ts"],"sourcesContent":["let cache: number | undefined;\n\n/**\n * @internal\n */\nexport function getScrollbarWidth(force = false): number {\n /* istanbul ignore if */\n if (typeof window === \"undefined\") {\n return 0;\n }\n\n let value = cache;\n if (!force && typeof value === \"number\") {\n return value;\n }\n\n const outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.overflow = \"scroll\";\n document.body.appendChild(outer);\n\n const inner = document.createElement(\"div\");\n outer.appendChild(inner);\n\n // the scrollbar width can be determined by comparing the width of the parent\n // element that has scrollbars to the child element that does not.\n value = outer.offsetWidth - inner.offsetWidth;\n cache = value;\n document.body.removeChild(outer);\n\n return value;\n}\n"],"names":["cache","getScrollbarWidth","force","window","value","outer","document","createElement","style","visibility","overflow","body","appendChild","inner","offsetWidth","removeChild"],"mappings":"AAAA,IAAIA;AAEJ;;CAEC,GACD,OAAO,SAASC,kBAAkBC,QAAQ,KAAK;IAC7C,sBAAsB,GACtB,IAAI,OAAOC,WAAW,aAAa;QACjC,OAAO;IACT;IAEA,IAAIC,QAAQJ;IACZ,IAAI,CAACE,SAAS,OAAOE,UAAU,UAAU;QACvC,OAAOA;IACT;IAEA,MAAMC,QAAQC,SAASC,aAAa,CAAC;IACrCF,MAAMG,KAAK,CAACC,UAAU,GAAG;IACzBJ,MAAMG,KAAK,CAACE,QAAQ,GAAG;IACvBJ,SAASK,IAAI,CAACC,WAAW,CAACP;IAE1B,MAAMQ,QAAQP,SAASC,aAAa,CAAC;IACrCF,MAAMO,WAAW,CAACC;IAElB,6EAA6E;IAC7E,kEAAkE;IAClET,QAAQC,MAAMS,WAAW,GAAGD,MAAMC,WAAW;IAC7Cd,QAAQI;IACRE,SAASK,IAAI,CAACI,WAAW,CAACV;IAE1B,OAAOD;AACT"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/scroll/useScrollLock.ts"],"sourcesContent":["\"use client\";\nimport { useEffect } from \"react\";\nimport { getScrollbarWidth } from \"./getScrollbarWidth.js\";\n\nexport const SCROLLBAR_SIZE_VAR = \"--rmd-scrollbar-size\";\n\n// this is really just so that nested dialogs will work correctly. Only the\n// first created dialog should prevent scroll locking on the `document.body`\nlet isLocked = false;\n\n/**\n *\n * @internal\n * @remarks\n * \\@since 6.0.0 No longer support scroll locking elements other than\n * the `document.body` since it's more reliable to scroll lock with an overlay.\n * \\@since 6.0.0 Now applies `paddingRight` equal to the current OS's\n * scrollbar width if there is a full page scrollbar to prevent layout shifting.\n *\n * @param locked - The `document.body` will not be scrollable when this is\n * `true`.\n */\nexport function useScrollLock(locked: boolean): void {\n useEffect(() => {\n if (isLocked || !locked) {\n return;\n }\n\n isLocked = true;\n\n const size = `${getScrollbarWidth()}px`;\n const el = document.body;\n const { paddingRight } = el.style;\n const isScrollbarVisible = el.scrollHeight > el.offsetHeight;\n\n el.style.overflow = \"hidden\";\n if (isScrollbarVisible) {\n el.style.setProperty(SCROLLBAR_SIZE_VAR, size);\n el.style.paddingRight = `var(${SCROLLBAR_SIZE_VAR})`;\n }\n\n return () => {\n isLocked = false;\n\n el.style.removeProperty(SCROLLBAR_SIZE_VAR);\n el.style.overflow = \"\";\n if (isScrollbarVisible) {\n el.style.paddingRight = paddingRight;\n }\n };\n }, [locked]);\n}\n"],"names":["useEffect","getScrollbarWidth","SCROLLBAR_SIZE_VAR","isLocked","useScrollLock","locked","size","el","document","body","paddingRight","style","isScrollbarVisible","scrollHeight","offsetHeight","overflow","setProperty","removeProperty"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,QAAQ;AAClC,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,OAAO,MAAMC,qBAAqB,uBAAuB;AAEzD,2EAA2E;AAC3E,4EAA4E;AAC5E,IAAIC,WAAW;AAEf;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,cAAcC,MAAe;IAC3CL,UAAU;QACR,IAAIG,YAAY,CAACE,QAAQ;YACvB;QACF;QAEAF,WAAW;QAEX,MAAMG,OAAO,CAAC,EAAEL,oBAAoB,EAAE,CAAC;QACvC,MAAMM,KAAKC,SAASC,IAAI;QACxB,MAAM,EAAEC,YAAY,EAAE,GAAGH,GAAGI,KAAK;QACjC,MAAMC,qBAAqBL,GAAGM,YAAY,GAAGN,GAAGO,YAAY;QAE5DP,GAAGI,KAAK,CAACI,QAAQ,GAAG;QACpB,IAAIH,oBAAoB;YACtBL,GAAGI,KAAK,CAACK,WAAW,CAACd,oBAAoBI;YACzCC,GAAGI,KAAK,CAACD,YAAY,GAAG,CAAC,IAAI,EAAER,mBAAmB,CAAC,CAAC;QACtD;QAEA,OAAO;YACLC,WAAW;YAEXI,GAAGI,KAAK,CAACM,cAAc,CAACf;YACxBK,GAAGI,KAAK,CAACI,QAAQ,GAAG;YACpB,IAAIH,oBAAoB;gBACtBL,GAAGI,KAAK,CAACD,YAAY,GAAGA;YAC1B;QACF;IACF,GAAG;QAACL;KAAO;AACb"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/segmented-button/SegmentedButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { useMaxWidthTransition } from \"../transition/useMaxWidthTransition.js\";\nimport { segmentedButton } from \"./segmentedButtonStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Set this to `true` to apply selected styles and an optional\n * {@link selectedIcon}\n *\n * @defaultValue `false`\n */\n selected?: boolean;\n\n /** @defaultValue `getIcon(\"selected\")` */\n selectedIcon?: ReactNode;\n\n /**\n * An optional className to apply when {@link selected} is `true`.\n */\n selectedClassName?: string;\n\n /**\n * Set this to `true` to not render the {@link selectedIcon} when\n * {@link selected} is `true`.\n *\n * @defaultValue `false`\n */\n disableSelectedIcon?: boolean;\n\n /**\n * Set this to `true` to disable the {@link selectedIcon} enter/exit\n * transition and instead just use `display: none`.\n *\n * @defaultValue `false`\n */\n disableSelectedTransition?: boolean;\n\n /**\n * An optional addon to render before the {@link children} and after the\n * {@link selectedIcon}. This is only useful when rendering text children so\n * it can appear above the interaction states.\n */\n leftAddon?: ReactNode;\n\n /**\n * An optional addon to render after the {@link children}. This is only useful\n * when rendering text children so it can appear above the interaction states.\n */\n rightAddon?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * SegmentedButton,\n * SegmentedButtonContainer,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [value, setValue] = useState(\"a\");\n * return (\n * <SegmentedButtonContainer>\n * <SegmentedButton\n * onClick={() => setValue(\"a\")}\n * selected={value === \"a\"}\n * >\n * First\n * </SegmentedButton>\n * <SegmentedButton\n * onClick={() => setValue(\"b\")}\n * selected={value === \"b\"}\n * >\n * Second\n * </SegmentedButton>\n * <SegmentedButton\n * onClick={() => setValue(\"c\")}\n * selected={value === \"c\"}\n * disableSelectedIcon\n * >\n * Third\n * </SegmentedButton>\n * </SegmentedButtonContainer>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const SegmentedButton = forwardRef<\n HTMLButtonElement,\n SegmentedButtonProps\n>(function SegmentedButton(props, ref) {\n const {\n className,\n type = \"button\",\n leftAddon,\n rightAddon,\n children: propChildren,\n selected,\n selectedIcon: propSelectedIcon,\n selectedClassName,\n disableSelectedIcon,\n disableSelectedTransition,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n ...remaining\n } = props;\n\n const children = useHigherContrastChildren(propChildren);\n const selectedIconNode = getIcon(\"selected\", propSelectedIcon);\n const selectedIcon = useMaxWidthTransition({\n element: selectedIconNode,\n transitionIn: !!selected,\n disabled: disableSelectedIcon,\n disableTransition: disableSelectedTransition,\n });\n const { pressedClassName, handlers, ripples } = useElementInteraction({\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n });\n\n return (\n <button\n {...remaining}\n {...handlers}\n aria-pressed={selected}\n ref={ref}\n type={type}\n disabled={disabled}\n className={segmentedButton({\n className,\n selected,\n selectedClassName,\n pressedClassName,\n })}\n >\n {!disableSelectedIcon && selectedIcon}\n {leftAddon}\n {children}\n {rightAddon}\n {ripples}\n </button>\n );\n});\n"],"names":["forwardRef","getIcon","useElementInteraction","useHigherContrastChildren","useMaxWidthTransition","segmentedButton","SegmentedButton","props","ref","className","type","leftAddon","rightAddon","children","propChildren","selected","selectedIcon","propSelectedIcon","selectedClassName","disableSelectedIcon","disableSelectedTransition","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","disabled","remaining","selectedIconNode","element","transitionIn","disableTransition","pressedClassName","handlers","ripples","button","aria-pressed"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAmD,QAAQ;AAC9E,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AACxF,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,eAAe,QAAQ,6BAA6B;AAqD7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,MAAMC,gCAAkBN,WAG7B,SAASM,gBAAgBC,KAAK,EAAEC,GAAG;IACnC,MAAM,EACJC,SAAS,EACTC,OAAO,QAAQ,EACfC,SAAS,EACTC,UAAU,EACVC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,cAAcC,gBAAgB,EAC9BC,iBAAiB,EACjBC,mBAAmB,EACnBC,yBAAyB,EACzBC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACR,GAAGC,WACJ,GAAG1B;IAEJ,MAAMM,WAAWV,0BAA0BW;IAC3C,MAAMoB,mBAAmBjC,QAAQ,YAAYgB;IAC7C,MAAMD,eAAeZ,sBAAsB;QACzC+B,SAASD;QACTE,cAAc,CAAC,CAACrB;QAChBiB,UAAUb;QACVkB,mBAAmBjB;IACrB;IACA,MAAM,EAAEkB,gBAAgB,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAGtC,sBAAsB;QACpEmB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,qBACE,MAACS;QACE,GAAGR,SAAS;QACZ,GAAGM,QAAQ;QACZG,gBAAc3B;QACdP,KAAKA;QACLE,MAAMA;QACNsB,UAAUA;QACVvB,WAAWJ,gBAAgB;YACzBI;YACAM;YACAG;YACAoB;QACF;;YAEC,CAACnB,uBAAuBH;YACxBL;YACAE;YACAD;YACA4B;;;AAGP,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/segmented-button/SegmentedButtonContainer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n segmentedButtonContainerStyles,\n type SegmentedButtonContainerClassNameOptions,\n} from \"./segmentedButtonContainerStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n SegmentedButtonContainerClassNameOptions {\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * Simple wrapper `div` to apply the segmented button container styles. You can\n * just use the {@link segmentedButtonContainerStyles} util function instead.\n *\n * @example\n * Without This Component\n * ```tsx\n * import {\n * SegmentedButton,\n * segmentedButtonContainerStyles,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * import { CustomWrapperComponent } from \"./CustomWrapperComponent.jsx\";\n *\n * function Example(): ReactElement {\n * return (\n * <CustomWrapperComponent className={segmentedButtonContainerStyles()}>\n * <SegmentedButton>One</SegmentedButton>\n * <SegmentedButton>Two</SegmentedButton>\n * <SegmentedButton>Three</SegmentedButton>\n * </CustomWrapperComponent>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const SegmentedButtonContainer = forwardRef<\n HTMLDivElement,\n SegmentedButtonContainerProps\n>(function SegmentedButtonContainer(props, ref) {\n const { className, disableFullWidth, children, ...remaining } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={segmentedButtonContainerStyles({\n className,\n disableFullWidth,\n })}\n >\n {children}\n </div>\n );\n});\n"],"names":["forwardRef","segmentedButtonContainerStyles","SegmentedButtonContainer","props","ref","className","disableFullWidth","children","remaining","div"],"mappings":";AAAA,SAASA,UAAU,QAA6C,QAAQ;AACxE,SACEC,8BAA8B,QAEzB,sCAAsC;AAW7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,yCAA2BF,WAGtC,SAASE,yBAAyBC,KAAK,EAAEC,GAAG;IAC5C,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAEhE,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,+BAA+B;YACxCI;YACAC;QACF;kBAECC;;AAGP,GAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/segmented-button/segmentedButtonContainerStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-segmented-button-container\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonContainerClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n disableFullWidth?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function segmentedButtonContainerStyles(\n options: SegmentedButtonContainerClassNameOptions = {}\n): string {\n const { className, disableFullWidth } = options;\n\n return cnb(styles({ \"full-width\": !disableFullWidth }), className);\n}\n"],"names":["cnb","bem","styles","segmentedButtonContainerStyles","options","className","disableFullWidth"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAYnB;;CAEC,GACD,OAAO,SAASE,+BACdC,UAAoD,CAAC,CAAC;IAEtD,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAE,GAAGF;IAExC,OAAOJ,IAAIE,OAAO;QAAE,cAAc,CAACI;IAAiB,IAAID;AAC1D"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/segmented-button/segmentedButtonStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-segmented-button\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n selected?: boolean;\n\n /**\n * An optional className to apply when {@link selected} is `true`\n */\n selectedClassName?: string;\n\n /** @internal */\n pressedClassName?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function segmentedButton(\n options: SegmentedButtonClassNameOptions = {}\n): string {\n const { className, selected, selectedClassName, pressedClassName } = options;\n\n return cnb(\n styles({ selected }),\n selected && selectedClassName,\n pressedClassName,\n cssUtils({ surface: true }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","segmentedButton","options","className","selected","selectedClassName","pressedClassName","surface"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAoBnB;;CAEC,GACD,OAAO,SAASE,gBACdC,UAA2C,CAAC,CAAC;IAE7C,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAE,GAAGJ;IAErE,OAAOL,IACLG,OAAO;QAAEI;IAAS,IAClBA,YAAYC,mBACZC,kBACAR,SAAS;QAAES,SAAS;IAAK,IACzBJ;AAEJ"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sheet/Sheet.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { Dialog, type BaseDialogProps } from \"../dialog/Dialog.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { sheet, type BaseSheetClassNameOptions } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-sheet-height\"?: string | number;\n \"--rmd-sheet-width\"?: string | number;\n \"--rmd-sheet-max-height\"?: string | number;\n \"--rmd-sheet-touch-width\"?: string | number;\n \"--rmd-sheet-touch-max-height\"?: string | number;\n \"--rmd-sheet-static-width\"?: string | number;\n \"--rmd-sheet-transform-offscreen\"?: string | number;\n \"--rmd-sheet-z-index\"?: number;\n }\n}\n\nexport const DEFAULT_SHEET_TIMEOUT: Readonly<TransitionTimeout> = {\n enter: 200,\n exit: 150,\n};\n\nexport const DEFAULT_SHEET_CLASSNAMES: Readonly<CSSTransitionClassNames> = {\n appear: \"rmd-sheet--offscreen\",\n appearActive: \"rmd-sheet--enter rmd-sheet--visible\",\n enter: \"rmd-sheet--offscreen\",\n enterActive: \"rmd-sheet--enter rmd-sheet--visible\",\n exit: \"rmd-sheet--exit\",\n exitActive: \"rmd-sheet--offscreen\",\n exitDone: \"rmd-sheet--offscreen rmd-sheet--hidden\",\n};\n\nexport type SheetDialogProps = Omit<BaseDialogProps, \"role\" | \"type\" | \"modal\">;\n\nexport interface BaseSheetProps\n extends SheetDialogProps,\n BaseSheetClassNameOptions {\n /**\n * @defaultValue `\"dialog\"`\n */\n role?: \"dialog\" | \"menu\" | \"none\";\n\n /**\n * @defaultValue `true`\n * @see {@link SheetDialogProps.exitedHidden}\n * @remarks \\@since 6.0.0\n */\n exitedHidden?: boolean;\n}\n\nexport type SheetProps = LabelRequiredForA11y<BaseSheetProps>;\n\n/**\n * **Client Component**\n *\n */\nexport const Sheet = forwardRef<HTMLDivElement, SheetProps>(\n function Sheet(props, ref) {\n const {\n role = \"dialog\",\n className,\n position = \"left\",\n horizontalSize = \"media\",\n verticalSize = \"recommended\",\n timeout = DEFAULT_SHEET_TIMEOUT,\n classNames = DEFAULT_SHEET_CLASSNAMES,\n visible,\n temporary = true,\n exitedHidden = true,\n children,\n ...remaining\n } = props;\n const { disableOverlay } = props;\n\n return (\n <Dialog\n {...remaining}\n ref={ref}\n role={role}\n type=\"custom\"\n timeout={timeout}\n classNames={classNames}\n visible={visible}\n temporary={temporary}\n exitedHidden={exitedHidden}\n className={sheet({\n position,\n horizontalSize,\n verticalSize,\n disableOverlay,\n className,\n })}\n >\n {children}\n </Dialog>\n );\n }\n);\n"],"names":["forwardRef","Dialog","sheet","DEFAULT_SHEET_TIMEOUT","enter","exit","DEFAULT_SHEET_CLASSNAMES","appear","appearActive","enterActive","exitActive","exitDone","Sheet","props","ref","role","className","position","horizontalSize","verticalSize","timeout","classNames","visible","temporary","exitedHidden","children","remaining","disableOverlay","type"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,MAAM,QAA8B,sBAAsB;AAMnE,SAASC,KAAK,QAAwC,cAAc;AAepE,OAAO,MAAMC,wBAAqD;IAChEC,OAAO;IACPC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,2BAA8D;IACzEC,QAAQ;IACRC,cAAc;IACdJ,OAAO;IACPK,aAAa;IACbJ,MAAM;IACNK,YAAY;IACZC,UAAU;AACZ,EAAE;AAsBF;;;CAGC,GACD,OAAO,MAAMC,sBAAQZ,WACnB,SAASY,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,OAAO,QAAQ,EACfC,SAAS,EACTC,WAAW,MAAM,EACjBC,iBAAiB,OAAO,EACxBC,eAAe,aAAa,EAC5BC,UAAUjB,qBAAqB,EAC/BkB,aAAaf,wBAAwB,EACrCgB,OAAO,EACPC,YAAY,IAAI,EAChBC,eAAe,IAAI,EACnBC,QAAQ,EACR,GAAGC,WACJ,GAAGb;IACJ,MAAM,EAAEc,cAAc,EAAE,GAAGd;IAE3B,qBACE,KAACZ;QACE,GAAGyB,SAAS;QACbZ,KAAKA;QACLC,MAAMA;QACNa,MAAK;QACLR,SAASA;QACTC,YAAYA;QACZC,SAASA;QACTC,WAAWA;QACXC,cAAcA;QACdR,WAAWd,MAAM;YACfe;YACAC;YACAC;YACAQ;YACAX;QACF;kBAECS;;AAGP,GACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/sheet/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-sheet\");\n\n/**\n * The location that the sheet should be located within the viewport.\n */\nexport type SheetPosition = \"top\" | \"right\" | \"bottom\" | \"left\";\n\n/**\n * The size to use for sheets that have been positioned left or right. The\n * default supported values are:\n *\n * - `\"none\"` - the size is based on content, but is still limited to the\n * viewport width so that the horizontal scrolling will not occur within the\n * page. No limits added to sizing.\n * - `\"touch\"` - the `width` is set to be the entire viewport width minus a\n * touchable area and is normally recommended for mobile devices.\n * - `\"static\"` - the `width` is set to a static `16rem` and generally used for\n * landscape tablets and desktops.\n * - `\"media\"` - automatically switches between \"touch\" and \"static\" based on\n * css media queries. (this is the default)\n */\nexport type SheetHorizontalSize = \"none\" | \"media\" | \"touch\" | \"static\";\n\n/**\n * The size to use for sheets that have been positioned top or bottom. The\n * supported sizes are:\n *\n * - `\"none\"` - the size is based on content and is limited to the viewport\n * height\n * - `\"touch\"` - the size is based on content and is limited to the viewport\n * height minus a small touchable area\n * - `\"recommended\"` - the material design recommended sizing that forces a\n * `max-height` of 50vh and `min-height` of 3.5rem\n */\nexport type SheetVerticalSize = \"none\" | \"touch\" | \"recommended\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface BaseSheetClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `\"left\"`\n */\n position?: SheetPosition;\n\n /**\n * @defaultValue `\"media\"`\n */\n horizontalSize?: SheetHorizontalSize;\n\n /**\n * @defaultValue `\"recommended\"`\n */\n verticalSize?: SheetVerticalSize;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface SheetClassNameOptions extends BaseSheetClassNameOptions {\n offscreen?: boolean;\n disableOverlay?: boolean;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport function sheet(options: SheetClassNameOptions): string {\n const {\n position = \"left\",\n horizontalSize = \"media\",\n verticalSize = \"recommended\",\n offscreen = false,\n disableOverlay,\n className,\n } = options;\n const horizontal = position === \"left\" || position === \"right\";\n\n return cnb(\n styles({\n horizontal,\n vertical: !horizontal,\n raised: !disableOverlay,\n offscreen,\n [position]: true,\n \"media-width\": horizontal && horizontalSize === \"media\",\n \"touch-width\": horizontal && horizontalSize === \"touch\",\n \"static-width\": horizontal && horizontalSize === \"static\",\n \"viewport-height\": !horizontal && verticalSize === \"none\",\n \"touchable-height\": !horizontal && verticalSize === \"touch\",\n \"recommended-height\": !horizontal && verticalSize === \"recommended\",\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","sheet","options","position","horizontalSize","verticalSize","offscreen","disableOverlay","className","horizontal","vertical","raised"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiEnB,2BAA2B,GAC3B,OAAO,SAASE,MAAMC,OAA8B;IAClD,MAAM,EACJC,WAAW,MAAM,EACjBC,iBAAiB,OAAO,EACxBC,eAAe,aAAa,EAC5BC,YAAY,KAAK,EACjBC,cAAc,EACdC,SAAS,EACV,GAAGN;IACJ,MAAMO,aAAaN,aAAa,UAAUA,aAAa;IAEvD,OAAOL,IACLE,OAAO;QACLS;QACAC,UAAU,CAACD;QACXE,QAAQ,CAACJ;QACTD;QACA,CAACH,SAAS,EAAE;QACZ,eAAeM,cAAcL,mBAAmB;QAChD,eAAeK,cAAcL,mBAAmB;QAChD,gBAAgBK,cAAcL,mBAAmB;QACjD,mBAAmB,CAACK,cAAcJ,iBAAiB;QACnD,oBAAoB,CAACI,cAAcJ,iBAAiB;QACpD,sBAAsB,CAACI,cAAcJ,iBAAiB;IACxD,IACAG;AAEJ"}