@react-md/core 1.0.0-next.10 → 1.0.0-next.12

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 (423) hide show
  1. package/.turbo/turbo-build.log +22 -22
  2. package/.turbo/turbo-lint.log +3 -3
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/CHANGELOG.md +12 -0
  5. package/dist/CoreProviders.js.map +1 -1
  6. package/dist/NoSsr.js.map +1 -1
  7. package/dist/RootHtml.js.map +1 -1
  8. package/dist/SsrProvider.js.map +1 -1
  9. package/dist/app-bar/AppBar.js.map +1 -1
  10. package/dist/app-bar/AppBarTitle.d.ts +2 -1
  11. package/dist/app-bar/AppBarTitle.js.map +1 -1
  12. package/dist/avatar/Avatar.js.map +1 -1
  13. package/dist/avatar/styles.js.map +1 -1
  14. package/dist/badge/Badge.js.map +1 -1
  15. package/dist/box/Box.js.map +1 -1
  16. package/dist/box/styles.js.map +1 -1
  17. package/dist/button/AsyncButton.js.map +1 -1
  18. package/dist/button/Button.js.map +1 -1
  19. package/dist/button/ButtonUnstyled.js.map +1 -1
  20. package/dist/button/FloatingActionButton.js.map +1 -1
  21. package/dist/button/TooltippedButton.js.map +1 -1
  22. package/dist/button/buttonStyles.js.map +1 -1
  23. package/dist/button/buttonUnstyledStyles.js.map +1 -1
  24. package/dist/card/Card.js.map +1 -1
  25. package/dist/card/CardContent.js.map +1 -1
  26. package/dist/card/CardFooter.js.map +1 -1
  27. package/dist/card/CardHeader.js.map +1 -1
  28. package/dist/card/CardSubtitle.js.map +1 -1
  29. package/dist/card/CardTitle.js.map +1 -1
  30. package/dist/card/ClickableCard.js.map +1 -1
  31. package/dist/card/styles.js.map +1 -1
  32. package/dist/chip/Chip.js.map +1 -1
  33. package/dist/chip/styles.js.map +1 -1
  34. package/dist/cssUtils.js.map +1 -1
  35. package/dist/delegateEvent.js.map +1 -1
  36. package/dist/dialog/Dialog.js.map +1 -1
  37. package/dist/dialog/DialogContainer.js.map +1 -1
  38. package/dist/dialog/DialogContent.js.map +1 -1
  39. package/dist/dialog/DialogFooter.js.map +1 -1
  40. package/dist/dialog/DialogHeader.js.map +1 -1
  41. package/dist/dialog/DialogTitle.d.ts +2 -1
  42. package/dist/dialog/DialogTitle.js.map +1 -1
  43. package/dist/dialog/FixedDialog.js.map +1 -1
  44. package/dist/dialog/NestedDialogProvider.js.map +1 -1
  45. package/dist/dialog/styles.js.map +1 -1
  46. package/dist/divider/Divider.js.map +1 -1
  47. package/dist/divider/styles.js.map +1 -1
  48. package/dist/draggable/useDraggable.js.map +1 -1
  49. package/dist/draggable/utils.js.map +1 -1
  50. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  51. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  52. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +2 -1
  53. package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
  54. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  55. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  56. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  57. package/dist/focus/useFocusContainer.js.map +1 -1
  58. package/dist/focus/utils.js.map +1 -1
  59. package/dist/form/Checkbox.js.map +1 -1
  60. package/dist/form/Fieldset.js.map +1 -1
  61. package/dist/form/FileInput.js.map +1 -1
  62. package/dist/form/Form.js.map +1 -1
  63. package/dist/form/FormMessage.js.map +1 -1
  64. package/dist/form/FormMessageContainer.js.map +1 -1
  65. package/dist/form/FormMessageCounter.js.map +1 -1
  66. package/dist/form/InputToggle.js.map +1 -1
  67. package/dist/form/InputToggleIcon.js.map +1 -1
  68. package/dist/form/Label.js.map +1 -1
  69. package/dist/form/Legend.js.map +1 -1
  70. package/dist/form/MenuItemCheckbox.js.map +1 -1
  71. package/dist/form/MenuItemFileInput.js.map +1 -1
  72. package/dist/form/MenuItemInputToggle.js.map +1 -1
  73. package/dist/form/MenuItemRadio.js.map +1 -1
  74. package/dist/form/MenuItemSwitch.js.map +1 -1
  75. package/dist/form/MenuItemTextField.js.map +1 -1
  76. package/dist/form/NativeSelect.js.map +1 -1
  77. package/dist/form/OptGroup.js.map +1 -1
  78. package/dist/form/Option.js.map +1 -1
  79. package/dist/form/Password.js.map +1 -1
  80. package/dist/form/Radio.js.map +1 -1
  81. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  82. package/dist/form/Select.js.map +1 -1
  83. package/dist/form/SelectedOption.js.map +1 -1
  84. package/dist/form/Slider.js.map +1 -1
  85. package/dist/form/SliderContainer.js.map +1 -1
  86. package/dist/form/SliderMark.js.map +1 -1
  87. package/dist/form/SliderMarkLabel.d.ts +2 -1
  88. package/dist/form/SliderMarkLabel.js.map +1 -1
  89. package/dist/form/SliderThumb.js.map +1 -1
  90. package/dist/form/SliderTrack.js.map +1 -1
  91. package/dist/form/SliderValueMarks.js.map +1 -1
  92. package/dist/form/SliderValueTooltip.js.map +1 -1
  93. package/dist/form/Switch.js.map +1 -1
  94. package/dist/form/SwitchTrack.js.map +1 -1
  95. package/dist/form/TextArea.js.map +1 -1
  96. package/dist/form/TextField.js.map +1 -1
  97. package/dist/form/TextFieldAddon.js.map +1 -1
  98. package/dist/form/TextFieldContainer.js +2 -2
  99. package/dist/form/TextFieldContainer.js.map +1 -1
  100. package/dist/form/fileUtils.js.map +1 -1
  101. package/dist/form/formConfig.js.map +1 -1
  102. package/dist/form/formMessageStyles.js.map +1 -1
  103. package/dist/form/inputToggleStyles.js.map +1 -1
  104. package/dist/form/menuItemInputToggleStyles.js.map +1 -1
  105. package/dist/form/nativeSelectStyles.js.map +1 -1
  106. package/dist/form/optionStyles.js.map +1 -1
  107. package/dist/form/passwordStyles.js.map +1 -1
  108. package/dist/form/selectStyles.js.map +1 -1
  109. package/dist/form/selectUtils.js.map +1 -1
  110. package/dist/form/sliderUtils.js.map +1 -1
  111. package/dist/form/switchStyles.js.map +1 -1
  112. package/dist/form/textAreaStyles.js.map +1 -1
  113. package/dist/form/{TextFieldContainerStyles.js → textFieldContainerStyles.js} +1 -1
  114. package/dist/form/{TextFieldContainerStyles.js.map → textFieldContainerStyles.js.map} +1 -1
  115. package/dist/form/textFieldStyles.js.map +1 -1
  116. package/dist/form/types.js.map +1 -1
  117. package/dist/form/useCheckboxGroup.js.map +1 -1
  118. package/dist/form/useCombobox.js.map +1 -1
  119. package/dist/form/useEditableCombobox.js.map +1 -1
  120. package/dist/form/useFileUpload.js.map +1 -1
  121. package/dist/form/useFormReset.js.map +1 -1
  122. package/dist/form/useListboxProvider.js.map +1 -1
  123. package/dist/form/useNumberField.js.map +1 -1
  124. package/dist/form/useRadioGroup.js.map +1 -1
  125. package/dist/form/useRangeSlider.js.map +1 -1
  126. package/dist/form/useResizingTextArea.js.map +1 -1
  127. package/dist/form/useSelectCombobox.js.map +1 -1
  128. package/dist/form/useSlider.js.map +1 -1
  129. package/dist/form/useTextField.js.map +1 -1
  130. package/dist/form/utils.js.map +1 -1
  131. package/dist/form/validation.js.map +1 -1
  132. package/dist/hoverMode/useHoverMode.js.map +1 -1
  133. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  134. package/dist/icon/FontIcon.js.map +1 -1
  135. package/dist/icon/IconRotator.js.map +1 -1
  136. package/dist/icon/MaterialIcon.js.map +1 -1
  137. package/dist/icon/MaterialSymbol.js.map +1 -1
  138. package/dist/icon/SVGIcon.js.map +1 -1
  139. package/dist/icon/TextIconSpacing.js.map +1 -1
  140. package/dist/icon/iconConfig.js.map +1 -1
  141. package/dist/icon/material.js.map +1 -1
  142. package/dist/icon/materialConfig.js.map +1 -1
  143. package/dist/icon/styles.js.map +1 -1
  144. package/dist/index.d.ts +3 -1
  145. package/dist/index.js +3 -1
  146. package/dist/index.js.map +1 -1
  147. package/dist/interaction/Ripple.js.map +1 -1
  148. package/dist/interaction/RippleContainer.js.map +1 -1
  149. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  150. package/dist/interaction/config.js.map +1 -1
  151. package/dist/interaction/types.js.map +1 -1
  152. package/dist/interaction/useElementInteraction.js.map +1 -1
  153. package/dist/interaction/useHigherContrastChildren.js.map +1 -1
  154. package/dist/interaction/utils.js.map +1 -1
  155. package/dist/layout/LayoutAppBar.js.map +1 -1
  156. package/dist/layout/LayoutNav.js.map +1 -1
  157. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  158. package/dist/layout/Main.js.map +1 -1
  159. package/dist/layout/layoutNavStyles.js.map +1 -1
  160. package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
  161. package/dist/layout/mainStyles.js.map +1 -1
  162. package/dist/layout/useExpandableLayout.js.map +1 -1
  163. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  164. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  165. package/dist/layout/useLayoutTree.js.map +1 -1
  166. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  167. package/dist/layout/useMainTabIndex.js.map +1 -1
  168. package/dist/layout/useResizableLayout.js.map +1 -1
  169. package/dist/layout/useTemporaryLayout.js.map +1 -1
  170. package/dist/link/Link.js.map +1 -1
  171. package/dist/link/SkipToMainContent.js.map +1 -1
  172. package/dist/link/styles.js.map +1 -1
  173. package/dist/list/List.js.map +1 -1
  174. package/dist/list/ListItem.js.map +1 -1
  175. package/dist/list/ListItemAddon.js.map +1 -1
  176. package/dist/list/ListItemChildren.js.map +1 -1
  177. package/dist/list/ListItemLink.js.map +1 -1
  178. package/dist/list/ListItemText.js.map +1 -1
  179. package/dist/list/ListSubheader.js.map +1 -1
  180. package/dist/list/getListItemHeight.js.map +1 -1
  181. package/dist/list/listItemStyles.js.map +1 -1
  182. package/dist/list/types.js.map +1 -1
  183. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  184. package/dist/media-queries/appSize.js.map +1 -1
  185. package/dist/media-queries/useMediaQuery.js.map +1 -1
  186. package/dist/menu/DropdownMenu.js.map +1 -1
  187. package/dist/menu/Menu.js.map +1 -1
  188. package/dist/menu/MenuBar.js.map +1 -1
  189. package/dist/menu/MenuButton.js.map +1 -1
  190. package/dist/menu/MenuConfigurationProvider.js.map +1 -1
  191. package/dist/menu/MenuItem.js.map +1 -1
  192. package/dist/menu/MenuItemButton.js.map +1 -1
  193. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  194. package/dist/menu/MenuItemGroup.js.map +1 -1
  195. package/dist/menu/MenuItemSeparator.js.map +1 -1
  196. package/dist/menu/MenuSheet.js.map +1 -1
  197. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  198. package/dist/menu/MenuWidget.js.map +1 -1
  199. package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
  200. package/dist/menu/useContextMenu.js.map +1 -1
  201. package/dist/menu/useMenuBarProvider.js.map +1 -1
  202. package/dist/menu/utils.js.map +1 -1
  203. package/dist/movement/constants.js.map +1 -1
  204. package/dist/movement/findMatchIndex.js.map +1 -1
  205. package/dist/movement/types.js.map +1 -1
  206. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  207. package/dist/movement/utils.js.map +1 -1
  208. package/dist/overlay/Overlay.js.map +1 -1
  209. package/dist/overlay/overlayStyles.js.map +1 -1
  210. package/dist/portal/Portal.js.map +1 -1
  211. package/dist/portal/PortalContainerProvider.js.map +1 -1
  212. package/dist/positioning/constants.js.map +1 -1
  213. package/dist/positioning/createHorizontalPosition.js.map +1 -1
  214. package/dist/positioning/createVerticalPosition.js.map +1 -1
  215. package/dist/positioning/getFixedPosition.js.map +1 -1
  216. package/dist/positioning/types.js.map +1 -1
  217. package/dist/positioning/useFixedPositioning.js.map +1 -1
  218. package/dist/positioning/utils.js.map +1 -1
  219. package/dist/progress/CircularProgress.js.map +1 -1
  220. package/dist/progress/LinearProgress.js.map +1 -1
  221. package/dist/progress/getProgressA11y.js.map +1 -1
  222. package/dist/progress/types.js.map +1 -1
  223. package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
  224. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  225. package/dist/responsive-item/styles.js.map +1 -1
  226. package/dist/scroll/ScrollLock.js.map +1 -1
  227. package/dist/scroll/getScrollbarWidth.js.map +1 -1
  228. package/dist/scroll/useScrollLock.js.map +1 -1
  229. package/dist/searching/caseInsensitive.js.map +1 -1
  230. package/dist/searching/fuzzy.js.map +1 -1
  231. package/dist/searching/toSearchQuery.js.map +1 -1
  232. package/dist/searching/types.js.map +1 -1
  233. package/dist/searching/useFuzzyMatch.js.map +1 -1
  234. package/dist/searching/utils.js.map +1 -1
  235. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  236. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  237. package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
  238. package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
  239. package/dist/sheet/Sheet.js.map +1 -1
  240. package/dist/sheet/styles.js.map +1 -1
  241. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  242. package/dist/snackbar/Snackbar.js.map +1 -1
  243. package/dist/snackbar/Toast.js.map +1 -1
  244. package/dist/snackbar/ToastActionButton.js.map +1 -1
  245. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  246. package/dist/snackbar/ToastContent.js.map +1 -1
  247. package/dist/snackbar/ToastManager.js.map +1 -1
  248. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  249. package/dist/snackbar/snackbarStyles.js.map +1 -1
  250. package/dist/snackbar/toastContentStyles.js.map +1 -1
  251. package/dist/snackbar/toastStyles.js.map +1 -1
  252. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  253. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  254. package/dist/suspense/NullSuspense.js.map +1 -1
  255. package/dist/table/Table.js.map +1 -1
  256. package/dist/table/TableBody.js.map +1 -1
  257. package/dist/table/TableCell.js.map +1 -1
  258. package/dist/table/TableCellContent.js.map +1 -1
  259. package/dist/table/TableCheckbox.js.map +1 -1
  260. package/dist/table/TableConfigurationProvider.js.map +1 -1
  261. package/dist/table/TableContainer.js.map +1 -1
  262. package/dist/table/TableContainerProvider.js.map +1 -1
  263. package/dist/table/TableFooter.js.map +1 -1
  264. package/dist/table/TableHeader.js.map +1 -1
  265. package/dist/table/TableRadio.js.map +1 -1
  266. package/dist/table/TableRow.js.map +1 -1
  267. package/dist/table/tableCellStyles.js.map +1 -1
  268. package/dist/table/tableContainerStyles.js.map +1 -1
  269. package/dist/table/tableFooterStyles.js.map +1 -1
  270. package/dist/table/tableHeaderStyles.js.map +1 -1
  271. package/dist/table/tableRowStyles.js.map +1 -1
  272. package/dist/table/tableStyles.js.map +1 -1
  273. package/dist/table/types.js.map +1 -1
  274. package/dist/tabs/Tab.js.map +1 -1
  275. package/dist/tabs/TabList.js.map +1 -1
  276. package/dist/tabs/TabListScrollButton.js.map +1 -1
  277. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  278. package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
  279. package/dist/tabs/tabListStyles.js.map +1 -1
  280. package/dist/tabs/tabStyles.js.map +1 -1
  281. package/dist/tabs/useTabList.js.map +1 -1
  282. package/dist/tabs/useTabs.js.map +1 -1
  283. package/dist/tabs/utils.js.map +1 -1
  284. package/dist/test-utils/IntersectionObserver.js.map +1 -1
  285. package/dist/test-utils/ResizeObserver.js.map +1 -1
  286. package/dist/test-utils/data-testid.js.map +1 -1
  287. package/dist/test-utils/index.js.map +1 -1
  288. package/dist/test-utils/jest-setup.js.map +1 -1
  289. package/dist/test-utils/matchMedia.js.map +1 -1
  290. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  291. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  292. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  293. package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
  294. package/dist/test-utils/polyfills/index.js.map +1 -1
  295. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  296. package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
  297. package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
  298. package/dist/test-utils/render.js.map +1 -1
  299. package/dist/test-utils/timers.js.map +1 -1
  300. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  301. package/dist/theme/ThemeProvider.js.map +1 -1
  302. package/dist/theme/colors.js.map +1 -1
  303. package/dist/theme/cssVars.js.map +1 -1
  304. package/dist/theme/types.js.map +1 -1
  305. package/dist/theme/useCSSVariables.js.map +1 -1
  306. package/dist/theme/useColorScheme.js.map +1 -1
  307. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  308. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  309. package/dist/theme/usePrefersColorScheme.js.map +1 -1
  310. package/dist/theme/utils.js.map +1 -1
  311. package/dist/tooltip/Tooltip.js.map +1 -1
  312. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  313. package/dist/tooltip/constants.js.map +1 -1
  314. package/dist/tooltip/tooltipStyles.js.map +1 -1
  315. package/dist/tooltip/useTooltip.js.map +1 -1
  316. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  317. package/dist/tooltip/utils.js.map +1 -1
  318. package/dist/transition/CSSTransition.js.map +1 -1
  319. package/dist/transition/Collapse.js.map +1 -1
  320. package/dist/transition/CrossFade.js.map +1 -1
  321. package/dist/transition/ScaleTransition.js.map +1 -1
  322. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  323. package/dist/transition/Slide.js.map +1 -1
  324. package/dist/transition/SlideContainer.js.map +1 -1
  325. package/dist/transition/collapseStyles.js.map +1 -1
  326. package/dist/transition/config.js.map +1 -1
  327. package/dist/transition/maxWidthTransition.js.map +1 -1
  328. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
  329. package/dist/transition/types.js.map +1 -1
  330. package/dist/transition/useCSSTransition.js.map +1 -1
  331. package/dist/transition/useCarousel.js.map +1 -1
  332. package/dist/transition/useCollapseTransition.js.map +1 -1
  333. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  334. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  335. package/dist/transition/useScaleTransition.js.map +1 -1
  336. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  337. package/dist/transition/useSlideTransition.js.map +1 -1
  338. package/dist/transition/useTransition.js.map +1 -1
  339. package/dist/transition/utils.js.map +1 -1
  340. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  341. package/dist/tree/Tree.js.map +1 -1
  342. package/dist/tree/TreeGroup.js.map +1 -1
  343. package/dist/tree/TreeItem.js.map +1 -1
  344. package/dist/tree/TreeItemExpander.js.map +1 -1
  345. package/dist/tree/TreeProvider.js.map +1 -1
  346. package/dist/tree/styles.js.map +1 -1
  347. package/dist/tree/types.js.map +1 -1
  348. package/dist/tree/useTree.js.map +1 -1
  349. package/dist/tree/useTreeExpansion.js.map +1 -1
  350. package/dist/tree/useTreeItems.js.map +1 -1
  351. package/dist/tree/useTreeMovement.js.map +1 -1
  352. package/dist/tree/useTreeSelection.js.map +1 -1
  353. package/dist/tree/utils.js.map +1 -1
  354. package/dist/types.js.map +1 -1
  355. package/dist/typography/SrOnly.js.map +1 -1
  356. package/dist/typography/TextContainer.d.ts +1 -40
  357. package/dist/typography/TextContainer.js +1 -30
  358. package/dist/typography/TextContainer.js.map +1 -1
  359. package/dist/typography/Typography.d.ts +1 -112
  360. package/dist/typography/Typography.js +1 -89
  361. package/dist/typography/Typography.js.map +1 -1
  362. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  363. package/dist/typography/textContainerStyles.d.ts +40 -0
  364. package/dist/typography/textContainerStyles.js +32 -0
  365. package/dist/typography/textContainerStyles.js.map +1 -0
  366. package/dist/typography/typographyStyles.d.ts +112 -0
  367. package/dist/typography/typographyStyles.js +91 -0
  368. package/dist/typography/typographyStyles.js.map +1 -0
  369. package/dist/useAsyncAction.js.map +1 -1
  370. package/dist/useDebouncedFunction.js.map +1 -1
  371. package/dist/useDropzone.js.map +1 -1
  372. package/dist/useElementSize.js.map +1 -1
  373. package/dist/useEnsuredId.js.map +1 -1
  374. package/dist/useEnsuredRef.js.map +1 -1
  375. package/dist/useEnsuredState.js.map +1 -1
  376. package/dist/useHtmlClassName.js.map +1 -1
  377. package/dist/useIntersectionObserver.js.map +1 -1
  378. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  379. package/dist/useLocalStorage.js.map +1 -1
  380. package/dist/useOrientation.js.map +1 -1
  381. package/dist/usePageInactive.js.map +1 -1
  382. package/dist/useResizeListener.js.map +1 -1
  383. package/dist/useResizeObserver.js.map +1 -1
  384. package/dist/useThrottledFunction.js.map +1 -1
  385. package/dist/useToggle.js.map +1 -1
  386. package/dist/useUnmounted.js.map +1 -1
  387. package/dist/useWindowSize.js.map +1 -1
  388. package/dist/utils/RenderRecursively.js.map +1 -1
  389. package/dist/utils/alphaNumericSort.js.map +1 -1
  390. package/dist/utils/applyRef.js.map +1 -1
  391. package/dist/utils/bem.js.map +1 -1
  392. package/dist/utils/getClientPosition.js.map +1 -1
  393. package/dist/utils/getMiddleOfRange.js.map +1 -1
  394. package/dist/utils/getPercentage.js.map +1 -1
  395. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  396. package/dist/utils/getRangeSteps.js.map +1 -1
  397. package/dist/utils/identity.js.map +1 -1
  398. package/dist/utils/isElementVisible.js.map +1 -1
  399. package/dist/utils/loop.js.map +1 -1
  400. package/dist/utils/nearest.js.map +1 -1
  401. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  402. package/dist/utils/randomInt.js.map +1 -1
  403. package/dist/utils/wait.js.map +1 -1
  404. package/dist/utils/withinRange.js.map +1 -1
  405. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  406. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  407. package/package.json +21 -13
  408. package/src/app-bar/AppBarTitle.tsx +2 -5
  409. package/src/dialog/DialogTitle.tsx +1 -1
  410. package/src/expansion-panel/ExpansionPanelHeader.tsx +3 -6
  411. package/src/form/SliderMarkLabel.tsx +1 -1
  412. package/src/form/TextFieldContainer.tsx +2 -2
  413. package/src/index.ts +3 -1
  414. package/src/typography/TextContainer.tsx +4 -53
  415. package/src/typography/Typography.tsx +5 -145
  416. package/src/typography/__tests__/TextContainer.tsx +2 -1
  417. package/src/typography/__tests__/Typography.tsx +2 -1
  418. package/src/typography/textContainerStyles.ts +53 -0
  419. package/src/typography/typographyStyles.ts +145 -0
  420. package/tsconfig.types.json +1 -1
  421. package/.turbo/turbo-test.log +0 -5512
  422. /package/dist/form/{TextFieldContainerStyles.d.ts → textFieldContainerStyles.d.ts} +0 -0
  423. /package/src/form/{TextFieldContainerStyles.ts → textFieldContainerStyles.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/ToastManager.tsx"],"sourcesContent":["import { nanoid } from \"nanoid\";\nimport { type ConfigurableToastProps } from \"./Toast.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_TOAST_VISIBLE_TIME = 5000;\n\n/**\n * - `\"normal\"` - the toast will be added to the end of the queue\n * - `\"next\"` - the toast will be inserted next-in-line in the queue, waiting\n * for the current visible toast to exit before being shown. If the toast does\n * not support duplicates, the existing toast will be moved instead and merged\n * with the toast.\n * - `\"replace\"` - if there is a currently visible toast, it will start the\n * leave transition and display the newly added toast instead.\n * - `\"immediate\"` - the same behavior as `\"replace\"` except that if there was a\n * currently visible toast, the toast will be shown again once the `\"immediate\"`\n * toast is hidden.\n *\n * @remarks \\@since 6.0.0 Renamed from `MessagePriority` to `ToastPriority`\n */\nexport type ToastPriority = \"normal\" | \"next\" | \"replace\" | \"immediate\";\n\n/**\n * - `\"allow\"` - toasts with the same `toastId` can be added into the queue, but\n * the leave timeout behavior might not work if multiple toasts can be shown\n * at the same time.\n * - `\"restart\"` - (default) toasts that have the same `toastId` as a toast\n * being shown will restart the exit timeout and update the toast with any\n * differences in the toast. If the toast is not currently being shown, a new\n * toast will not be added.\n * - `\"update\"` - toasts that have the same `toastId` will just update the toast\n * with the latest content while maintaining any existing timeouts\n *\n * @remarks \\@since 6.0.0 Renamed from `DuplicateBehavior`\n */\nexport type ToastDuplicateBehavior = \"allow\" | \"restart\" | \"update\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastMeta {\n /**\n * This will be `true` if the exit timeout has been paused either by hovering\n * the toast or the page has become inactive through blur or minimizing.\n */\n paused: boolean;\n\n /**\n * This will be `true` when the toast should be visible and `false` during the\n * exit animation.\n */\n visible: boolean;\n\n /**\n * The current toast's id which can be used with the:\n * - {@link ToastManager.removeToast}\n * - {@link ToastManager.startRemoveTimeout}\n * - {@link ToastManager.pauseRemoveTimeout}\n * - {@link ToastManager.resumeRemoveTimeout}\n */\n toastId: string;\n priority: ToastPriority;\n duplicates: ToastDuplicateBehavior;\n visibleTime: number | null;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CreateToastOptions extends ConfigurableToastProps {\n /**\n * @defaultValue `nanoid()`\n */\n toastId?: string;\n\n /**\n * @see {@link ToastDuplicateBehavior}\n * @defaultValue `\"restart\"`\n */\n duplicates?: ToastDuplicateBehavior;\n\n /**\n * @see {@link ToastPriority}\n * @defaultValue `\"normal\"`\n */\n priority?: ToastPriority;\n\n /**\n * Set this to `null` to prevent the toast from automatically hiding,\n * otherwise set this to the number of milliseconds to remain visible.\n *\n * @see {@link DEFAULT_TOAST_VISIBLE_TIME}\n * @defaultValue `DEFAULT_TOAST_VISIBLE_TIME`\n */\n visibleTime?: number | null;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface QueuedToast extends ConfigurableToastProps, ToastMeta {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ToastQueue = readonly Readonly<QueuedToast>[];\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ToastCallback = (queue: ToastQueue) => void;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface ToastVisibilityTimers {\n inactive: boolean;\n startTime: number;\n elapsedTime: number;\n exitTimeout?: number;\n}\n\n/**\n * @see {@link ToastManagerProvider}\n *\n * @remarks \\@since 6.0.0\n */\nexport class ToastManager {\n #queue: QueuedToast[];\n #timers: Map<string, ToastVisibilityTimers>;\n #listeners: ToastCallback[];\n\n constructor() {\n this.#queue = [];\n this.#timers = new Map();\n this.#listeners = [];\n\n // All of the class methods must be arrow functions to preserve the correct\n // `this` value. If they aren't arrow functions, I'd have to wrap each call\n // in an arrow function to work.\n //\n // i.e.\n // useSyncExternalStore(\n // (cb) => manager.subscribe(cb),\n // () => manager.getQueue(),\n // () => manager.getQueue(),\n // );\n }\n\n #emit = (): void => {\n // shallow clone to ensure react updates\n this.#queue = [...this.#queue];\n this.#listeners.forEach((callback) => {\n callback(this.#queue);\n });\n };\n\n #getToastIndex = (toastId: string | undefined): number => {\n if (!toastId) {\n return -1;\n }\n\n return this.#queue.findIndex((toast) => toast.toastId === toastId);\n };\n\n #getToast = (toastId: string | undefined): QueuedToast | undefined => {\n return this.#queue[this.#getToastIndex(toastId)];\n };\n\n /**\n * Starts the exit transition for the currently shown toast and adds the next\n * toast into the queue. This requires a manual call to `this.#emit()`\n * afterwards.\n */\n #addToastImmediately = (nextToast: QueuedToast): void => {\n const [current] = this.#queue;\n this.clearTimer(current.toastId);\n this.#queue[0] = {\n ...current,\n visible: false,\n };\n if (nextToast.priority === \"immediate\") {\n this.#queue.splice(1, 0, nextToast, current);\n } else {\n this.#queue.splice(1, 0, nextToast);\n }\n };\n\n /**\n * This calls `this.#emit()` if the toast was updated\n */\n #updateToast = (\n toastIdOrIndex: string | number,\n patch: Partial<QueuedToast>\n ): void => {\n const index =\n typeof toastIdOrIndex === \"number\"\n ? toastIdOrIndex\n : this.#getToastIndex(toastIdOrIndex);\n\n if (index === -1) {\n return;\n }\n\n this.#queue[index] = {\n ...this.#queue[index],\n ...patch,\n };\n this.#emit();\n };\n\n /**\n * This is just used to subscribe to changes in the {@link useToastQueue}.\n *\n * ```tsx\n * useSyncExternalStore(\n * toastManager.subscribe,\n * toastManager.getQueue,\n * toastManager.getQueue,\n * );\n * ```\n *\n * @internal\n */\n subscribe = (callback: ToastCallback): (() => void) => {\n this.#listeners.push(callback);\n\n return () => {\n this.#listeners = this.#listeners.filter((cb) => cb !== callback);\n };\n };\n\n /**\n * @see {@link subscribe}\n * @internal\n */\n getQueue = (): ToastQueue => {\n return this.#queue;\n };\n\n /**\n * Either adds the toast to the queue or updates an existing toast when using\n * an existing `toastId`.\n *\n * @example\n * Adding toasts\n * ```tsx\n * // create a toast when the user is offline that will not disappear\n * addToast({ toastId: \"offline\", visibleTime: null });\n *\n * // add a new toast that displays `\"Toast\"` to the queue\n * addToast({ children: \"Toast!\" });\n *\n * // add an online toast notification. since these three use the same toast\n * // id, the hide timer will be reset each time\n * addToast({ toastId: \"online\" });\n * addToast({ toastId: \"online\" });\n * addToast({ toastId: \"online\" });\n *\n * // add a server error toast to the queue where the second one will be\n * // ignored\n * addToast({\n * toastId: \"ServerError\",\n * theme: \"error\",\n * duplicates: \"prevent\",\n * });\n * addToast({\n * toastId: \"ServerError\",\n * theme: \"error\",\n * duplicates: \"prevent\",\n * });\n *\n * // add a toast to the queue that has an action button that says \"Goodbye\"\n * addToast({\n * children: \"Hello, world!\",\n * action: \"Goodbye\",\n * });\n *\n * // add a toast to the queue that has an action button that says \"Goodbye\"\n * // and a custom click handler\n * addToast({\n * children: \"Hello, world!\",\n * action: {\n * onClick: () => {\n * logout();\n * },\n * children: \"Goodbye\",\n * },\n * });\n *\n * // add a toast to the queue that renders a react component in the content,\n * // a custom action button implementation (using `ToastActionButton`), and a\n * // close button\n * addToast({\n * children: <SomeCustomComponent />,\n * actionButton: <SomeCustomActionButton />,\n * closeButton: true,\n * });\n * ```\n */\n addToast = (toast: CreateToastOptions): void => {\n const {\n toastId = nanoid(),\n visibleTime = DEFAULT_TOAST_VISIBLE_TIME,\n role = visibleTime === null ? \"alert\" : \"status\",\n priority = \"normal\",\n duplicates = \"restart\",\n } = toast;\n\n const existingIndex = this.#getToastIndex(toast.toastId);\n if (existingIndex !== -1 && duplicates !== \"allow\") {\n const existingToast = this.#queue[existingIndex];\n\n // reorder/move the existing toast to be the next item in the queue by:\n // - removing the toast from the queue\n // - inserting it into the next position with the updates\n if (priority === \"next\" && existingIndex > 1) {\n this.#queue.splice(existingIndex, 1);\n this.#queue.splice(1, 0, { ...existingToast, ...toast });\n this.#emit();\n return;\n }\n\n // only need to reorder the queue if it is not being shown\n if (\n (priority === \"replace\" || priority === \"immediate\") &&\n existingIndex !== 0\n ) {\n this.#queue.splice(existingIndex, 1);\n this.#addToastImmediately({\n ...existingToast,\n ...toast,\n });\n this.#emit();\n return;\n }\n\n const timers = this.#timers.get(toastId);\n if (existingToast.visible && duplicates === \"restart\" && timers) {\n this.#timers.set(toastId, { ...timers, elapsedTime: 0 });\n this.startRemoveTimeout(toastId);\n }\n\n this.#updateToast(existingIndex, toast);\n return;\n }\n\n const nextToast: QueuedToast = {\n ...toast,\n role,\n paused: false,\n visible: true,\n toastId,\n priority,\n duplicates,\n visibleTime,\n };\n\n const queueSize = this.#queue.length;\n if (priority === \"next\" && queueSize > 1) {\n this.#queue.splice(1, 0, nextToast);\n } else if (\n (priority === \"replace\" || priority === \"immediate\") &&\n queueSize > 0\n ) {\n this.#addToastImmediately(nextToast);\n } else {\n this.#queue.push(nextToast);\n }\n\n this.#emit();\n };\n\n /**\n * Attempts to start the timeout for removing the toast when the `visibleTime`\n * is not null for a toast.\n *\n * @param toastId - The specific toastId to update\n */\n startRemoveTimeout = (toastId: string): void => {\n const toast = this.#getToast(toastId);\n if (!toast) {\n return;\n }\n\n const { visibleTime } = toast;\n if (visibleTime === null) {\n // Must manually be closed\n return;\n }\n\n const cached = this.#timers.get(toastId);\n const timers = (cached && { ...cached }) || {\n inactive: false,\n startTime: Date.now(),\n elapsedTime: 0,\n };\n window.clearTimeout(timers.exitTimeout);\n\n let duration = visibleTime;\n if (timers.elapsedTime) {\n duration -= timers.elapsedTime;\n }\n\n timers.inactive = false;\n timers.exitTimeout = window.setTimeout(() => {\n this.removeToast(toastId, true);\n }, duration);\n this.#timers.set(toastId, timers);\n };\n\n /**\n * Pauses the remove timeout for a specific toast normally with hover events\n * or the browser becoming inactive.\n *\n * @param toastId - The specific toastId to pause\n */\n pauseRemoveTimeout = (toastId: string): void => {\n const toast = this.#getToast(toastId);\n const cached = this.#timers.get(toastId);\n if (!toast || !cached || cached.inactive) {\n return;\n }\n\n window.clearTimeout(cached.exitTimeout);\n const timers = { ...cached };\n timers.inactive = true;\n timers.elapsedTime = Date.now() - timers.startTime + timers.elapsedTime;\n this.#timers.set(toastId, timers);\n this.#updateToast(toastId, { paused: true });\n };\n\n /**\n * Resumes the current remove timeout if it was paused by\n * {@link pauseRemoveTimeout}.\n *\n * @param toastId - The specific toastId to resume\n */\n resumeRemoveTimeout = (toastId: string): void => {\n const toastIndex = this.#getToastIndex(toastId);\n const timers = this.#timers.get(toastId);\n if (toastIndex === -1 || !timers?.startTime) {\n return;\n }\n\n this.#updateToast(toastIndex, { paused: false });\n this.startRemoveTimeout(toastId);\n };\n\n /**\n * Removes a toast by id from the queue without any exit animation.\n *\n * @param toastId - The specific {@link QueuedToast.toastId}\n * @param transition - Set this to `true` to remove the toast by the exit\n * transition instead of immediately.\n */\n removeToast = (toastId: string, transition: boolean): void => {\n const toastIndex = this.#getToastIndex(toastId);\n if (toastIndex === -1) {\n return;\n }\n\n if (transition) {\n this.clearTimer(toastId);\n this.#updateToast(toastIndex, { visible: false });\n return;\n }\n\n this.#queue.splice(toastIndex, 1);\n this.#emit();\n };\n\n /**\n * Clears any pending timers for the provided toast id. This should generally\n * be used in the `useEffect` cleanup effect for any custom toast renderer\n * implementations.\n *\n * @example\n * ```tsx\n * const { toastId } = toast;\n * const toastManager = useToastManager();\n *\n * useEffect(() => {\n * return () => {\n * toastManager.clearTimer(toastId):\n * }\n * }, [toastManager, toastId]);\n * ```\n */\n clearTimer = (toastId: string): void => {\n const timer = this.#timers.get(toastId);\n window.clearTimeout(timer?.exitTimeout);\n this.#timers.delete(toastId);\n };\n\n /**\n * Removes first toast from the queue without any exit animation. You most\n * likely want to use {@link removeToast} instead.\n */\n popToast = (): void => {\n this.#queue.pop();\n this.#emit();\n };\n\n /**\n * Removes all toasts from the queue. There will be no exit animation.\n *\n * @param disableEmit - Set this to `true` to disable emitting the empty queue.\n * Mostly used for tests.\n */\n clearToasts = (disableEmit = false): void => {\n this.#queue = [];\n this.#timers.forEach((meta) => {\n window.clearTimeout(meta.exitTimeout);\n });\n this.#timers.clear();\n if (!disableEmit) {\n this.#emit();\n }\n };\n}\n\n/**\n * The default toast manager for react-md apps that will allow toasts to be\n * added without setting up the {@link ToastManagerProvider}.\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const toastManager = new ToastManager();\n\n/**\n * @see {@link ToastManager.addToast}\n * @remarks \\@since 6.0.0\n */\nexport const addToast: ToastManager[\"addToast\"] = (toast) =>\n toastManager.addToast(toast);\n\n/**\n * @see {@link ToastManager.startRemoveTimeout}\n * @remarks \\@since 6.0.0\n */\nexport const startRemoveToastTimeout: ToastManager[\"startRemoveTimeout\"] = (\n toastId\n) => toastManager.startRemoveTimeout(toastId);\n\n/**\n * @see {@link ToastManager.popToast}\n * @remarks \\@since 6.0.0\n */\nexport const popToast: ToastManager[\"popToast\"] = () => toastManager.popToast();\n\n/**\n * @see {@link ToastManager.removeToast}\n * @remarks \\@since 6.0.0\n */\nexport const removeToast: ToastManager[\"removeToast\"] = (toastId, transition) =>\n toastManager.removeToast(toastId, transition);\n\n/**\n * @see {@link ToastManager.clearToasts}\n * @remarks \\@since 6.0.0\n */\nexport const clearToasts = (): void => toastManager.clearToasts();\n"],"names":["nanoid","DEFAULT_TOAST_VISIBLE_TIME","ToastManager","constructor","queue","listeners","forEach","callback","toastId","findIndex","toast","getToastIndex","nextToast","current","clearTimer","visible","priority","splice","toastIdOrIndex","patch","index","emit","subscribe","push","filter","cb","getQueue","addToast","visibleTime","role","duplicates","existingIndex","existingToast","addToastImmediately","timers","get","set","elapsedTime","startRemoveTimeout","updateToast","paused","queueSize","length","getToast","cached","inactive","startTime","Date","now","window","clearTimeout","exitTimeout","duration","setTimeout","removeToast","pauseRemoveTimeout","resumeRemoveTimeout","toastIndex","transition","timer","delete","popToast","pop","clearToasts","disableEmit","meta","clear","Map","toastManager","startRemoveToastTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,SAAS;AAGhC;;CAEC,GACD,OAAO,MAAMC,6BAA6B,KAAK;IA6H7C,sCACA,uCACA,0CAmBA,qCAQA,8CAQA,yCAIA;;;;GAIC,GACD,oDAcA;;GAEC,GACD;AArEF;;;;CAIC,GACD,OAAO,MAAMC;IAKXC,aAAc;QAJd,gCAAA;;mBAAA,KAAA;;QACA,gCAAA;;mBAAA,KAAA;;QACA,gCAAA;;mBAAA,KAAA;;QAmBA,gCAAA;;mBAAQ;gBACN,wCAAwC;+CAClCC,QAAQ;gDAAI,IAAI,EAAEA;iBAAM;gBAC9B,yBAAA,IAAI,EAAEC,YAAUC,OAAO,CAAC,CAACC;oBACvBA,kCAAS,IAAI,EAAEH;gBACjB;YACF;;QAEA,gCAAA;;mBAAiB,CAACI;gBAChB,IAAI,CAACA,SAAS;oBACZ,OAAO,CAAC;gBACV;gBAEA,OAAO,yBAAA,IAAI,EAAEJ,QAAMK,SAAS,CAAC,CAACC,QAAUA,MAAMF,OAAO,KAAKA;YAC5D;;QAEA,gCAAA;;mBAAY,CAACA;gBACX,OAAO,yBAAA,IAAI,EAAEJ,OAAK,CAAC,yBAAA,IAAI,EAAEO,qBAAN,IAAI,EAAgBH,SAAS;YAClD;;QAOA,gCAAA;;mBAAuB,CAACI;gBACtB,MAAM,CAACC,QAAQ,4BAAG,IAAI,EAAET;gBACxB,IAAI,CAACU,UAAU,CAACD,QAAQL,OAAO;gBAC/B,yBAAA,IAAI,EAAEJ,OAAK,CAAC,EAAE,GAAG;oBACf,GAAGS,OAAO;oBACVE,SAAS;gBACX;gBACA,IAAIH,U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ToastManager.tsx"],"sourcesContent":["import { nanoid } from \"nanoid\";\nimport { type ConfigurableToastProps } from \"./Toast.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_TOAST_VISIBLE_TIME = 5000;\n\n/**\n * - `\"normal\"` - the toast will be added to the end of the queue\n * - `\"next\"` - the toast will be inserted next-in-line in the queue, waiting\n * for the current visible toast to exit before being shown. If the toast does\n * not support duplicates, the existing toast will be moved instead and merged\n * with the toast.\n * - `\"replace\"` - if there is a currently visible toast, it will start the\n * leave transition and display the newly added toast instead.\n * - `\"immediate\"` - the same behavior as `\"replace\"` except that if there was a\n * currently visible toast, the toast will be shown again once the `\"immediate\"`\n * toast is hidden.\n *\n * @remarks \\@since 6.0.0 Renamed from `MessagePriority` to `ToastPriority`\n */\nexport type ToastPriority = \"normal\" | \"next\" | \"replace\" | \"immediate\";\n\n/**\n * - `\"allow\"` - toasts with the same `toastId` can be added into the queue, but\n * the leave timeout behavior might not work if multiple toasts can be shown\n * at the same time.\n * - `\"restart\"` - (default) toasts that have the same `toastId` as a toast\n * being shown will restart the exit timeout and update the toast with any\n * differences in the toast. If the toast is not currently being shown, a new\n * toast will not be added.\n * - `\"update\"` - toasts that have the same `toastId` will just update the toast\n * with the latest content while maintaining any existing timeouts\n *\n * @remarks \\@since 6.0.0 Renamed from `DuplicateBehavior`\n */\nexport type ToastDuplicateBehavior = \"allow\" | \"restart\" | \"update\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastMeta {\n /**\n * This will be `true` if the exit timeout has been paused either by hovering\n * the toast or the page has become inactive through blur or minimizing.\n */\n paused: boolean;\n\n /**\n * This will be `true` when the toast should be visible and `false` during the\n * exit animation.\n */\n visible: boolean;\n\n /**\n * The current toast's id which can be used with the:\n * - {@link ToastManager.removeToast}\n * - {@link ToastManager.startRemoveTimeout}\n * - {@link ToastManager.pauseRemoveTimeout}\n * - {@link ToastManager.resumeRemoveTimeout}\n */\n toastId: string;\n priority: ToastPriority;\n duplicates: ToastDuplicateBehavior;\n visibleTime: number | null;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CreateToastOptions extends ConfigurableToastProps {\n /**\n * @defaultValue `nanoid()`\n */\n toastId?: string;\n\n /**\n * @see {@link ToastDuplicateBehavior}\n * @defaultValue `\"restart\"`\n */\n duplicates?: ToastDuplicateBehavior;\n\n /**\n * @see {@link ToastPriority}\n * @defaultValue `\"normal\"`\n */\n priority?: ToastPriority;\n\n /**\n * Set this to `null` to prevent the toast from automatically hiding,\n * otherwise set this to the number of milliseconds to remain visible.\n *\n * @see {@link DEFAULT_TOAST_VISIBLE_TIME}\n * @defaultValue `DEFAULT_TOAST_VISIBLE_TIME`\n */\n visibleTime?: number | null;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface QueuedToast extends ConfigurableToastProps, ToastMeta {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ToastQueue = readonly Readonly<QueuedToast>[];\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ToastCallback = (queue: ToastQueue) => void;\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface ToastVisibilityTimers {\n inactive: boolean;\n startTime: number;\n elapsedTime: number;\n exitTimeout?: number;\n}\n\n/**\n * @see {@link ToastManagerProvider}\n *\n * @remarks \\@since 6.0.0\n */\nexport class ToastManager {\n #queue: QueuedToast[];\n #timers: Map<string, ToastVisibilityTimers>;\n #listeners: ToastCallback[];\n\n constructor() {\n this.#queue = [];\n this.#timers = new Map();\n this.#listeners = [];\n\n // All of the class methods must be arrow functions to preserve the correct\n // `this` value. If they aren't arrow functions, I'd have to wrap each call\n // in an arrow function to work.\n //\n // i.e.\n // useSyncExternalStore(\n // (cb) => manager.subscribe(cb),\n // () => manager.getQueue(),\n // () => manager.getQueue(),\n // );\n }\n\n #emit = (): void => {\n // shallow clone to ensure react updates\n this.#queue = [...this.#queue];\n this.#listeners.forEach((callback) => {\n callback(this.#queue);\n });\n };\n\n #getToastIndex = (toastId: string | undefined): number => {\n if (!toastId) {\n return -1;\n }\n\n return this.#queue.findIndex((toast) => toast.toastId === toastId);\n };\n\n #getToast = (toastId: string | undefined): QueuedToast | undefined => {\n return this.#queue[this.#getToastIndex(toastId)];\n };\n\n /**\n * Starts the exit transition for the currently shown toast and adds the next\n * toast into the queue. This requires a manual call to `this.#emit()`\n * afterwards.\n */\n #addToastImmediately = (nextToast: QueuedToast): void => {\n const [current] = this.#queue;\n this.clearTimer(current.toastId);\n this.#queue[0] = {\n ...current,\n visible: false,\n };\n if (nextToast.priority === \"immediate\") {\n this.#queue.splice(1, 0, nextToast, current);\n } else {\n this.#queue.splice(1, 0, nextToast);\n }\n };\n\n /**\n * This calls `this.#emit()` if the toast was updated\n */\n #updateToast = (\n toastIdOrIndex: string | number,\n patch: Partial<QueuedToast>\n ): void => {\n const index =\n typeof toastIdOrIndex === \"number\"\n ? toastIdOrIndex\n : this.#getToastIndex(toastIdOrIndex);\n\n if (index === -1) {\n return;\n }\n\n this.#queue[index] = {\n ...this.#queue[index],\n ...patch,\n };\n this.#emit();\n };\n\n /**\n * This is just used to subscribe to changes in the {@link useToastQueue}.\n *\n * ```tsx\n * useSyncExternalStore(\n * toastManager.subscribe,\n * toastManager.getQueue,\n * toastManager.getQueue,\n * );\n * ```\n *\n * @internal\n */\n subscribe = (callback: ToastCallback): (() => void) => {\n this.#listeners.push(callback);\n\n return () => {\n this.#listeners = this.#listeners.filter((cb) => cb !== callback);\n };\n };\n\n /**\n * @see {@link subscribe}\n * @internal\n */\n getQueue = (): ToastQueue => {\n return this.#queue;\n };\n\n /**\n * Either adds the toast to the queue or updates an existing toast when using\n * an existing `toastId`.\n *\n * @example\n * Adding toasts\n * ```tsx\n * // create a toast when the user is offline that will not disappear\n * addToast({ toastId: \"offline\", visibleTime: null });\n *\n * // add a new toast that displays `\"Toast\"` to the queue\n * addToast({ children: \"Toast!\" });\n *\n * // add an online toast notification. since these three use the same toast\n * // id, the hide timer will be reset each time\n * addToast({ toastId: \"online\" });\n * addToast({ toastId: \"online\" });\n * addToast({ toastId: \"online\" });\n *\n * // add a server error toast to the queue where the second one will be\n * // ignored\n * addToast({\n * toastId: \"ServerError\",\n * theme: \"error\",\n * duplicates: \"prevent\",\n * });\n * addToast({\n * toastId: \"ServerError\",\n * theme: \"error\",\n * duplicates: \"prevent\",\n * });\n *\n * // add a toast to the queue that has an action button that says \"Goodbye\"\n * addToast({\n * children: \"Hello, world!\",\n * action: \"Goodbye\",\n * });\n *\n * // add a toast to the queue that has an action button that says \"Goodbye\"\n * // and a custom click handler\n * addToast({\n * children: \"Hello, world!\",\n * action: {\n * onClick: () => {\n * logout();\n * },\n * children: \"Goodbye\",\n * },\n * });\n *\n * // add a toast to the queue that renders a react component in the content,\n * // a custom action button implementation (using `ToastActionButton`), and a\n * // close button\n * addToast({\n * children: <SomeCustomComponent />,\n * actionButton: <SomeCustomActionButton />,\n * closeButton: true,\n * });\n * ```\n */\n addToast = (toast: CreateToastOptions): void => {\n const {\n toastId = nanoid(),\n visibleTime = DEFAULT_TOAST_VISIBLE_TIME,\n role = visibleTime === null ? \"alert\" : \"status\",\n priority = \"normal\",\n duplicates = \"restart\",\n } = toast;\n\n const existingIndex = this.#getToastIndex(toast.toastId);\n if (existingIndex !== -1 && duplicates !== \"allow\") {\n const existingToast = this.#queue[existingIndex];\n\n // reorder/move the existing toast to be the next item in the queue by:\n // - removing the toast from the queue\n // - inserting it into the next position with the updates\n if (priority === \"next\" && existingIndex > 1) {\n this.#queue.splice(existingIndex, 1);\n this.#queue.splice(1, 0, { ...existingToast, ...toast });\n this.#emit();\n return;\n }\n\n // only need to reorder the queue if it is not being shown\n if (\n (priority === \"replace\" || priority === \"immediate\") &&\n existingIndex !== 0\n ) {\n this.#queue.splice(existingIndex, 1);\n this.#addToastImmediately({\n ...existingToast,\n ...toast,\n });\n this.#emit();\n return;\n }\n\n const timers = this.#timers.get(toastId);\n if (existingToast.visible && duplicates === \"restart\" && timers) {\n this.#timers.set(toastId, { ...timers, elapsedTime: 0 });\n this.startRemoveTimeout(toastId);\n }\n\n this.#updateToast(existingIndex, toast);\n return;\n }\n\n const nextToast: QueuedToast = {\n ...toast,\n role,\n paused: false,\n visible: true,\n toastId,\n priority,\n duplicates,\n visibleTime,\n };\n\n const queueSize = this.#queue.length;\n if (priority === \"next\" && queueSize > 1) {\n this.#queue.splice(1, 0, nextToast);\n } else if (\n (priority === \"replace\" || priority === \"immediate\") &&\n queueSize > 0\n ) {\n this.#addToastImmediately(nextToast);\n } else {\n this.#queue.push(nextToast);\n }\n\n this.#emit();\n };\n\n /**\n * Attempts to start the timeout for removing the toast when the `visibleTime`\n * is not null for a toast.\n *\n * @param toastId - The specific toastId to update\n */\n startRemoveTimeout = (toastId: string): void => {\n const toast = this.#getToast(toastId);\n if (!toast) {\n return;\n }\n\n const { visibleTime } = toast;\n if (visibleTime === null) {\n // Must manually be closed\n return;\n }\n\n const cached = this.#timers.get(toastId);\n const timers = (cached && { ...cached }) || {\n inactive: false,\n startTime: Date.now(),\n elapsedTime: 0,\n };\n window.clearTimeout(timers.exitTimeout);\n\n let duration = visibleTime;\n if (timers.elapsedTime) {\n duration -= timers.elapsedTime;\n }\n\n timers.inactive = false;\n timers.exitTimeout = window.setTimeout(() => {\n this.removeToast(toastId, true);\n }, duration);\n this.#timers.set(toastId, timers);\n };\n\n /**\n * Pauses the remove timeout for a specific toast normally with hover events\n * or the browser becoming inactive.\n *\n * @param toastId - The specific toastId to pause\n */\n pauseRemoveTimeout = (toastId: string): void => {\n const toast = this.#getToast(toastId);\n const cached = this.#timers.get(toastId);\n if (!toast || !cached || cached.inactive) {\n return;\n }\n\n window.clearTimeout(cached.exitTimeout);\n const timers = { ...cached };\n timers.inactive = true;\n timers.elapsedTime = Date.now() - timers.startTime + timers.elapsedTime;\n this.#timers.set(toastId, timers);\n this.#updateToast(toastId, { paused: true });\n };\n\n /**\n * Resumes the current remove timeout if it was paused by\n * {@link pauseRemoveTimeout}.\n *\n * @param toastId - The specific toastId to resume\n */\n resumeRemoveTimeout = (toastId: string): void => {\n const toastIndex = this.#getToastIndex(toastId);\n const timers = this.#timers.get(toastId);\n if (toastIndex === -1 || !timers?.startTime) {\n return;\n }\n\n this.#updateToast(toastIndex, { paused: false });\n this.startRemoveTimeout(toastId);\n };\n\n /**\n * Removes a toast by id from the queue without any exit animation.\n *\n * @param toastId - The specific {@link QueuedToast.toastId}\n * @param transition - Set this to `true` to remove the toast by the exit\n * transition instead of immediately.\n */\n removeToast = (toastId: string, transition: boolean): void => {\n const toastIndex = this.#getToastIndex(toastId);\n if (toastIndex === -1) {\n return;\n }\n\n if (transition) {\n this.clearTimer(toastId);\n this.#updateToast(toastIndex, { visible: false });\n return;\n }\n\n this.#queue.splice(toastIndex, 1);\n this.#emit();\n };\n\n /**\n * Clears any pending timers for the provided toast id. This should generally\n * be used in the `useEffect` cleanup effect for any custom toast renderer\n * implementations.\n *\n * @example\n * ```tsx\n * const { toastId } = toast;\n * const toastManager = useToastManager();\n *\n * useEffect(() => {\n * return () => {\n * toastManager.clearTimer(toastId):\n * }\n * }, [toastManager, toastId]);\n * ```\n */\n clearTimer = (toastId: string): void => {\n const timer = this.#timers.get(toastId);\n window.clearTimeout(timer?.exitTimeout);\n this.#timers.delete(toastId);\n };\n\n /**\n * Removes first toast from the queue without any exit animation. You most\n * likely want to use {@link removeToast} instead.\n */\n popToast = (): void => {\n this.#queue.pop();\n this.#emit();\n };\n\n /**\n * Removes all toasts from the queue. There will be no exit animation.\n *\n * @param disableEmit - Set this to `true` to disable emitting the empty queue.\n * Mostly used for tests.\n */\n clearToasts = (disableEmit = false): void => {\n this.#queue = [];\n this.#timers.forEach((meta) => {\n window.clearTimeout(meta.exitTimeout);\n });\n this.#timers.clear();\n if (!disableEmit) {\n this.#emit();\n }\n };\n}\n\n/**\n * The default toast manager for react-md apps that will allow toasts to be\n * added without setting up the {@link ToastManagerProvider}.\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const toastManager = new ToastManager();\n\n/**\n * @see {@link ToastManager.addToast}\n * @remarks \\@since 6.0.0\n */\nexport const addToast: ToastManager[\"addToast\"] = (toast) =>\n toastManager.addToast(toast);\n\n/**\n * @see {@link ToastManager.startRemoveTimeout}\n * @remarks \\@since 6.0.0\n */\nexport const startRemoveToastTimeout: ToastManager[\"startRemoveTimeout\"] = (\n toastId\n) => toastManager.startRemoveTimeout(toastId);\n\n/**\n * @see {@link ToastManager.popToast}\n * @remarks \\@since 6.0.0\n */\nexport const popToast: ToastManager[\"popToast\"] = () => toastManager.popToast();\n\n/**\n * @see {@link ToastManager.removeToast}\n * @remarks \\@since 6.0.0\n */\nexport const removeToast: ToastManager[\"removeToast\"] = (toastId, transition) =>\n toastManager.removeToast(toastId, transition);\n\n/**\n * @see {@link ToastManager.clearToasts}\n * @remarks \\@since 6.0.0\n */\nexport const clearToasts = (): void => toastManager.clearToasts();\n"],"names":["nanoid","DEFAULT_TOAST_VISIBLE_TIME","ToastManager","constructor","queue","listeners","forEach","callback","toastId","findIndex","toast","getToastIndex","nextToast","current","clearTimer","visible","priority","splice","toastIdOrIndex","patch","index","emit","subscribe","push","filter","cb","getQueue","addToast","visibleTime","role","duplicates","existingIndex","existingToast","addToastImmediately","timers","get","set","elapsedTime","startRemoveTimeout","updateToast","paused","queueSize","length","getToast","cached","inactive","startTime","Date","now","window","clearTimeout","exitTimeout","duration","setTimeout","removeToast","pauseRemoveTimeout","resumeRemoveTimeout","toastIndex","transition","timer","delete","popToast","pop","clearToasts","disableEmit","meta","clear","Map","toastManager","startRemoveToastTimeout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AChEU,aAAad,WAAW,CAAC9C,SAASkD,YAAY;AAEhD;;;CAGC,GACD,OAAO,MAAMK,cAAc,IAAYK,aAAaL,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/ToastManagerProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useMemo,\n useSyncExternalStore,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n toastManager,\n type ToastManager,\n type ToastQueue,\n} from \"./ToastManager.js\";\n\nconst context = createContext(toastManager);\ncontext.displayName = \"ToastManager\";\nconst { Provider } = context;\n\n/**\n * This is mostly an internal hook to implement the toast functionality but can\n * be used externally as well for custom toast behavior if the other hooks do\n * not support your needs.\n *\n * @see {@link useAddToast}\n * @see {@link useToastQueue}\n * @see {@link useRemoveToast}\n *\n * @returns The current `ToastManager` set in the `ToastManagerProvider`.\n * Defaults to {@link toastManager} if there are no parent providers.\n * @remarks \\@since 6.0.0\n */\nexport function useToastManager(): ToastManager {\n return useContext(context);\n}\n\n/**\n * @see {@link ToastManager.addToast}\n * @remarks \\@since 6.0.0\n */\nexport function useAddToast(): ToastManager[\"addToast\"] {\n return useToastManager().addToast;\n}\n\n/**\n * @see {@link ToastManager.removeToast}\n * @remarks \\@since 6.0.0\n */\nexport function useRemoveToast(): ToastManager[\"removeToast\"] {\n return useToastManager().removeToast;\n}\n\n/**\n * @param limit - the total number of toasts that can be visible at once.\n * @remarks \\@since 6.0.0\n */\nexport function useToastQueue(limit?: number): ToastQueue {\n const toastManager = useToastManager();\n\n const queue = useSyncExternalStore(\n toastManager.subscribe,\n toastManager.getQueue,\n toastManager.getQueue\n );\n\n return useMemo(() => {\n if (!limit) {\n return queue;\n }\n\n return queue.slice(0, limit);\n }, [limit, queue]);\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastManagerProviderProps {\n children: ReactNode;\n\n /**\n * @defaultValue `toastManager`\n */\n manager?: ToastManager;\n}\n\n/**\n * **Client Component**\n *\n * This component can be used to implement separate instances of toasts if\n * required in your app. This probably shouldn't be required for most apps with\n * the default {@link addToast}, {@link removeToast}, and {@link clearToasts}\n * implementation.\n *\n * @see {@link ToastManager} for example usage.\n * @remarks \\@since 6.0.0\n */\nexport function ToastManagerProvider(\n props: ToastManagerProviderProps\n): ReactElement {\n const { children, manager = toastManager } = props;\n\n return <Provider value={manager}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","useSyncExternalStore","toastManager","context","displayName","Provider","useToastManager","useAddToast","addToast","useRemoveToast","removeToast","useToastQueue","limit","queue","subscribe","getQueue","slice","ToastManagerProvider","props","children","manager","value"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,oBAAoB,QAGf,QAAQ;AACf,SACEC,YAAY,QAGP,oBAAoB;AAE3B,MAAMC,wBAAUL,cAAcI;AAC9BC,QAAQC,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;;;;;;;;;;CAYC,GACD,OAAO,SAASG;IACd,OAAOP,WAAWI;AACpB;AAEA;;;CAGC,GACD,OAAO,SAASI;IACd,OAAOD,kBAAkBE,QAAQ;AACnC;AAEA;;;CAGC,GACD,OAAO,SAASC;IACd,OAAOH,kBAAkBI,WAAW;AACtC;AAEA;;;CAGC,GACD,OAAO,SAASC,cAAcC,KAAc;IAC1C,MAAMV,eAAeI;IAErB,MAAMO,QAAQZ,qBACZC,aAAaY,SAAS,EACtBZ,aAAaa,QAAQ,EACrBb,aAAaa,QAAQ;IAGvB,OAAOf,QAAQ;QACb,IAAI,CAACY,OAAO;YACV,OAAOC;QACT;QAEA,OAAOA,MAAMG,KAAK,CAAC,GAAGJ;IACxB,GAAG;QAACA;QAAOC;KAAM;AACnB;AAcA;;;;;;;;;;CAUC,GACD,OAAO,SAASI,qBACdC,KAAgC;IAEhC,MAAM,EAAEC,QAAQ,EAAEC,UAAUlB,YAAY,EAAE,GAAGgB;IAE7C,qBAAO,KAACb;QAASgB,OAAOD;kBAAUD;;AACpC"}
1
+ {"version":3,"sources":["../../src/snackbar/ToastManagerProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useMemo,\n useSyncExternalStore,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n toastManager,\n type ToastManager,\n type ToastQueue,\n} from \"./ToastManager.js\";\n\nconst context = createContext(toastManager);\ncontext.displayName = \"ToastManager\";\nconst { Provider } = context;\n\n/**\n * This is mostly an internal hook to implement the toast functionality but can\n * be used externally as well for custom toast behavior if the other hooks do\n * not support your needs.\n *\n * @see {@link useAddToast}\n * @see {@link useToastQueue}\n * @see {@link useRemoveToast}\n *\n * @returns The current `ToastManager` set in the `ToastManagerProvider`.\n * Defaults to {@link toastManager} if there are no parent providers.\n * @remarks \\@since 6.0.0\n */\nexport function useToastManager(): ToastManager {\n return useContext(context);\n}\n\n/**\n * @see {@link ToastManager.addToast}\n * @remarks \\@since 6.0.0\n */\nexport function useAddToast(): ToastManager[\"addToast\"] {\n return useToastManager().addToast;\n}\n\n/**\n * @see {@link ToastManager.removeToast}\n * @remarks \\@since 6.0.0\n */\nexport function useRemoveToast(): ToastManager[\"removeToast\"] {\n return useToastManager().removeToast;\n}\n\n/**\n * @param limit - the total number of toasts that can be visible at once.\n * @remarks \\@since 6.0.0\n */\nexport function useToastQueue(limit?: number): ToastQueue {\n const toastManager = useToastManager();\n\n const queue = useSyncExternalStore(\n toastManager.subscribe,\n toastManager.getQueue,\n toastManager.getQueue\n );\n\n return useMemo(() => {\n if (!limit) {\n return queue;\n }\n\n return queue.slice(0, limit);\n }, [limit, queue]);\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastManagerProviderProps {\n children: ReactNode;\n\n /**\n * @defaultValue `toastManager`\n */\n manager?: ToastManager;\n}\n\n/**\n * **Client Component**\n *\n * This component can be used to implement separate instances of toasts if\n * required in your app. This probably shouldn't be required for most apps with\n * the default {@link addToast}, {@link removeToast}, and {@link clearToasts}\n * implementation.\n *\n * @see {@link ToastManager} for example usage.\n * @remarks \\@since 6.0.0\n */\nexport function ToastManagerProvider(\n props: ToastManagerProviderProps\n): ReactElement {\n const { children, manager = toastManager } = props;\n\n return <Provider value={manager}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","useSyncExternalStore","toastManager","context","displayName","Provider","useToastManager","useAddToast","addToast","useRemoveToast","removeToast","useToastQueue","limit","queue","subscribe","getQueue","slice","ToastManagerProvider","props","children","manager","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,oBAAoB,QAGf,QAAQ;AACf,SACEC,YAAY,QAGP,oBAAoB;AAE3B,MAAMC,wBAAUL,cAAcI;AAC9BC,QAAQC,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;;;;;;;;;;CAYC,GACD,OAAO,SAASG;IACd,OAAOP,WAAWI;AACpB;AAEA;;;CAGC,GACD,OAAO,SAASI;IACd,OAAOD,kBAAkBE,QAAQ;AACnC;AAEA;;;CAGC,GACD,OAAO,SAASC;IACd,OAAOH,kBAAkBI,WAAW;AACtC;AAEA;;;CAGC,GACD,OAAO,SAASC,cAAcC,KAAc;IAC1C,MAAMV,eAAeI;IAErB,MAAMO,QAAQZ,qBACZC,aAAaY,SAAS,EACtBZ,aAAaa,QAAQ,EACrBb,aAAaa,QAAQ;IAGvB,OAAOf,QAAQ;QACb,IAAI,CAACY,OAAO;YACV,OAAOC;QACT;QAEA,OAAOA,MAAMG,KAAK,CAAC,GAAGJ;IACxB,GAAG;QAACA;QAAOC;KAAM;AACnB;AAcA;;;;;;;;;;CAUC,GACD,OAAO,SAASI,qBACdC,KAAgC;IAEhC,MAAM,EAAEC,QAAQ,EAAEC,UAAUlB,YAAY,EAAE,GAAGgB;IAE7C,qBAAO,KAACb;QAASgB,OAAOD;kBAAUD;;AACpC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/snackbarStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-snackbar\");\n\n/**\n * @remarks\n * \\@since 2.0.0\n * \\@since 6.0.0 Added the `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, and\n * `\"bottom-right\"` positions\n */\nexport type SnackbarPosition =\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top\"\n | \"top-left\"\n | \"top-right\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface SnackbarClassNameOptions {\n className?: string;\n absolute?: boolean;\n position: SnackbarPosition;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function snackbar(options: SnackbarClassNameOptions): string {\n const { className, absolute, position } = options;\n const top =\n position === \"top\" || position === \"top-left\" || position === \"top-right\";\n\n return cnb(\n styles({\n absolute,\n top,\n bottom: !top,\n start: position === \"top-left\" || position === \"bottom-left\",\n end: position === \"top-right\" || position === \"bottom-right\",\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","snackbar","options","className","absolute","position","top","bottom","start","end"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAuBnB;;CAEC,GACD,OAAO,SAASE,SAASC,OAAiC;IACxD,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IAC1C,MAAMI,MACJD,aAAa,SAASA,aAAa,cAAcA,aAAa;IAEhE,OAAOP,IACLE,OAAO;QACLI;QACAE;QACAC,QAAQ,CAACD;QACTE,OAAOH,aAAa,cAAcA,aAAa;QAC/CI,KAAKJ,aAAa,eAAeA,aAAa;IAChD,IACAF;AAEJ"}
1
+ {"version":3,"sources":["../../src/snackbar/snackbarStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-snackbar\");\n\n/**\n * @remarks\n * \\@since 2.0.0\n * \\@since 6.0.0 Added the `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, and\n * `\"bottom-right\"` positions\n */\nexport type SnackbarPosition =\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top\"\n | \"top-left\"\n | \"top-right\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface SnackbarClassNameOptions {\n className?: string;\n absolute?: boolean;\n position: SnackbarPosition;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function snackbar(options: SnackbarClassNameOptions): string {\n const { className, absolute, position } = options;\n const top =\n position === \"top\" || position === \"top-left\" || position === \"top-right\";\n\n return cnb(\n styles({\n absolute,\n top,\n bottom: !top,\n start: position === \"top-left\" || position === \"bottom-left\",\n end: position === \"top-right\" || position === \"bottom-right\",\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","snackbar","options","className","absolute","position","top","bottom","start","end"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAuBnB;;CAEC,GACD,OAAO,SAASE,SAASC,OAAiC;IACxD,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGH;IAC1C,MAAMI,MACJD,aAAa,SAASA,aAAa,cAAcA,aAAa;IAEhE,OAAOP,IACLE,OAAO;QACLI;QACAE;QACAC,QAAQ,CAACD;QACTE,OAAOH,aAAa,cAAcA,aAAa;QAC/CI,KAAKJ,aAAa,eAAeA,aAAa;IAChD,IACAF;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/toastContentStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-toast-content\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastContentClassNameOptions {\n className?: string;\n /** @defaultValue `false` */\n action?: boolean;\n /** @defaultValue `false` */\n stacked?: boolean;\n /** @defaultValue `false` */\n multiline?: boolean;\n /** @defaultValue `false` */\n closeButton?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function toastContent(\n options: ToastContentClassNameOptions = {}\n): string {\n const { action, closeButton, multiline, stacked, className } = options;\n\n return cnb(\n styles({\n gap: action && closeButton,\n \"v-padding\": multiline && (closeButton || !action),\n \"t-padding\": multiline && stacked,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","toastContent","options","action","closeButton","multiline","stacked","className","gap"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiBnB;;CAEC,GACD,OAAO,SAASE,aACdC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGL;IAE/D,OAAOJ,IACLE,OAAO;QACLQ,KAAKL,UAAUC;QACf,aAAaC,aAAcD,CAAAA,eAAe,CAACD,MAAK;QAChD,aAAaE,aAAaC;IAC5B,IACAC;AAEJ"}
1
+ {"version":3,"sources":["../../src/snackbar/toastContentStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-toast-content\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastContentClassNameOptions {\n className?: string;\n /** @defaultValue `false` */\n action?: boolean;\n /** @defaultValue `false` */\n stacked?: boolean;\n /** @defaultValue `false` */\n multiline?: boolean;\n /** @defaultValue `false` */\n closeButton?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function toastContent(\n options: ToastContentClassNameOptions = {}\n): string {\n const { action, closeButton, multiline, stacked, className } = options;\n\n return cnb(\n styles({\n gap: action && closeButton,\n \"v-padding\": multiline && (closeButton || !action),\n \"t-padding\": multiline && stacked,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","toastContent","options","action","closeButton","multiline","stacked","className","gap"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAiBnB;;CAEC,GACD,OAAO,SAASE,aACdC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGL;IAE/D,OAAOJ,IACLE,OAAO;QACLQ,KAAKL,UAAUC;QACf,aAAaC,aAAcD,CAAAA,eAAe,CAACD,MAAK;QAChD,aAAaE,aAAaC;IAC5B,IACAC;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/toastStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type BackgroundColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-toast-color\"?: string;\n \"--rmd-toast-background-color\"?: string;\n \"--rmd-toast-offset\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-toast\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ToastClassNameOptions {\n className?: string;\n /** @defaultValue `\"surface\"` */\n theme?: BackgroundColor;\n /** @defaultValue `false` */\n action?: boolean;\n /** @defaultValue `false` */\n paused?: boolean;\n /** @defaultValue `false` */\n stacked?: boolean;\n /** @defaultValue `false` */\n reordered?: boolean;\n /** @defaultValue `false` */\n closeButton?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function toast(options: ToastClassNameOptions = {}): string {\n const {\n className,\n theme = \"surface\",\n action,\n paused,\n stacked,\n reordered,\n closeButton,\n } = options;\n\n return cnb(\n styles({\n x: closeButton,\n action,\n paused,\n \"small-gap\": closeButton && action,\n stacked,\n reordered: stacked && reordered,\n }),\n cssUtils({\n backgroundColor:\n theme !== \"surface\" && theme !== \"current-color\" ? theme : undefined,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","toast","options","className","theme","action","paused","stacked","reordered","closeButton","x","backgroundColor","undefined"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAA8B,iBAAiB;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AAUtC,MAAMC,SAASD,IAAI;AAmBnB;;CAEC,GACD,OAAO,SAASE,MAAMC,UAAiC,CAAC,CAAC;IACvD,MAAM,EACJC,SAAS,EACTC,QAAQ,SAAS,EACjBC,MAAM,EACNC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,WAAW,EACZ,GAAGP;IAEJ,OAAOL,IACLG,OAAO;QACLU,GAAGD;QACHJ;QACAC;QACA,aAAaG,eAAeJ;QAC5BE;QACAC,WAAWD,WAAWC;IACxB,IACAV,SAAS;QACPa,iBACEP,UAAU,aAAaA,UAAU,kBAAkBA,QAAQQ;IAC/D,IACAT;AAEJ"}
1
+ {"version":3,"sources":["../../src/snackbar/toastStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type BackgroundColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-toast-color\"?: string;\n \"--rmd-toast-background-color\"?: string;\n \"--rmd-toast-offset\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-toast\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ToastClassNameOptions {\n className?: string;\n /** @defaultValue `\"surface\"` */\n theme?: BackgroundColor;\n /** @defaultValue `false` */\n action?: boolean;\n /** @defaultValue `false` */\n paused?: boolean;\n /** @defaultValue `false` */\n stacked?: boolean;\n /** @defaultValue `false` */\n reordered?: boolean;\n /** @defaultValue `false` */\n closeButton?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function toast(options: ToastClassNameOptions = {}): string {\n const {\n className,\n theme = \"surface\",\n action,\n paused,\n stacked,\n reordered,\n closeButton,\n } = options;\n\n return cnb(\n styles({\n x: closeButton,\n action,\n paused,\n \"small-gap\": closeButton && action,\n stacked,\n reordered: stacked && reordered,\n }),\n cssUtils({\n backgroundColor:\n theme !== \"surface\" && theme !== \"current-color\" ? theme : undefined,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","toast","options","className","theme","action","paused","stacked","reordered","closeButton","x","backgroundColor","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAA8B,iBAAiB;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AAUtC,MAAMC,SAASD,IAAI;AAmBnB;;CAEC,GACD,OAAO,SAASE,MAAMC,UAAiC,CAAC,CAAC;IACvD,MAAM,EACJC,SAAS,EACTC,QAAQ,SAAS,EACjBC,MAAM,EACNC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,WAAW,EACZ,GAAGP;IAEJ,OAAOL,IACLG,OAAO;QACLU,GAAGD;QACHJ;QACAC;QACA,aAAaG,eAAeJ;QAC5BE;QACAC,WAAWD,WAAWC;IACxB,IACAV,SAAS;QACPa,iBACEP,UAAU,aAAaA,UAAU,kBAAkBA,QAAQQ;IAC/D,IACAT;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/useCurrentToastActions.ts"],"sourcesContent":["\"use client\";\nimport { createContext, useContext } from \"react\";\n\n/**\n * A simplified version of the {@link ToastManager} that has the actions bound\n * to the current {@link QueuedToast.toastId}.\n *\n * @remarks \\@since 6.0.0\n */\nexport interface CurrentToastActions {\n /** @see {@link ToastManager.clearTimer} */\n clearTimer(): void;\n /** @see {@link ToastManager.removeToast} */\n removeToast(transition: boolean): void;\n /** @see {@link ToastManager.startRemoveTimeout} */\n startRemoveTimeout(): void;\n /** @see {@link ToastManager.pauseRemoveTimeout} */\n pauseRemoveTimeout(): void;\n /** @see {@link ToastManager.resumeRemoveTimeout} */\n resumeRemoveTimeout(): void;\n}\n\nconst context = createContext<CurrentToastActions | null>(null);\ncontext.displayName = \"CurrentToastActions\";\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const { Provider: CurrentToastActionsProvider } = context;\n\n/**\n * This is only required if you have multiple `Snackbar` implementations in your\n * app.\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCurrentToastActions(): CurrentToastActions {\n const actions = useContext(context);\n if (!actions) {\n throw new Error(\n \"The `CurrentToastActionsProvider` has not been initialized\"\n );\n }\n\n return actions;\n}\n"],"names":["createContext","useContext","context","displayName","Provider","CurrentToastActionsProvider","useCurrentToastActions","actions","Error"],"mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAqBlD,MAAMC,UAAUF,cAA0C;AAC1DE,QAAQC,WAAW,GAAG;AAEtB;;;CAGC,GACD,OAAO,MAAM,EAAEC,UAAUC,2BAA2B,EAAE,GAAGH,QAAQ;AAEjE;;;;;CAKC,GACD,OAAO,SAASI;IACd,MAAMC,UAAUN,WAAWC;IAC3B,IAAI,CAACK,SAAS;QACZ,MAAM,IAAIC,MACR;IAEJ;IAEA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../../src/snackbar/useCurrentToastActions.ts"],"sourcesContent":["\"use client\";\nimport { createContext, useContext } from \"react\";\n\n/**\n * A simplified version of the {@link ToastManager} that has the actions bound\n * to the current {@link QueuedToast.toastId}.\n *\n * @remarks \\@since 6.0.0\n */\nexport interface CurrentToastActions {\n /** @see {@link ToastManager.clearTimer} */\n clearTimer(): void;\n /** @see {@link ToastManager.removeToast} */\n removeToast(transition: boolean): void;\n /** @see {@link ToastManager.startRemoveTimeout} */\n startRemoveTimeout(): void;\n /** @see {@link ToastManager.pauseRemoveTimeout} */\n pauseRemoveTimeout(): void;\n /** @see {@link ToastManager.resumeRemoveTimeout} */\n resumeRemoveTimeout(): void;\n}\n\nconst context = createContext<CurrentToastActions | null>(null);\ncontext.displayName = \"CurrentToastActions\";\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport const { Provider: CurrentToastActionsProvider } = context;\n\n/**\n * This is only required if you have multiple `Snackbar` implementations in your\n * app.\n *\n * @remarks \\@since 6.0.0\n */\nexport function useCurrentToastActions(): CurrentToastActions {\n const actions = useContext(context);\n if (!actions) {\n throw new Error(\n \"The `CurrentToastActionsProvider` has not been initialized\"\n );\n }\n\n return actions;\n}\n"],"names":["createContext","useContext","context","displayName","Provider","CurrentToastActionsProvider","useCurrentToastActions","actions","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAqBlD,MAAMC,UAAUF,cAA0C;AAC1DE,QAAQC,WAAW,GAAG;AAEtB;;;CAGC,GACD,OAAO,MAAM,EAAEC,UAAUC,2BAA2B,EAAE,GAAGH,QAAQ;AAEjE;;;;;CAKC,GACD,OAAO,SAASI;IACd,MAAMC,UAAUN,WAAWC;IAC3B,IAAI,CAACK,SAAS;QACZ,MAAM,IAAIC,MACR;IAEJ;IAEA,OAAOD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/suspense/CircularProgressSuspense.tsx"],"sourcesContent":["import { Suspense, type ReactElement, type ReactNode } from \"react\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CircularProgressSuspenseProps extends CircularProgressProps {\n /**\n * @defaultValue `\"Loading\"`\n */\n \"aria-label\"?: string;\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * This is just a convenience component to set the `fallback` to the\n * {@link CircularProgress} component.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { CircularProgressSuspense } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { lazy } from \"react\";\n *\n * const Component = lazy(() => import('./Some/Path/To/Component'));\n *\n * function Example(): ReactElement {\n * return (\n * <CircularProgressSuspense>\n * <Component />\n * </CircularProgressSuspense>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function CircularProgressSuspense(\n props: CircularProgressSuspenseProps\n): ReactElement {\n const {\n children,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Loading\",\n ...progressProps\n } = props;\n return (\n <Suspense\n fallback={\n <CircularProgress\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n {...progressProps}\n />\n }\n >\n {children}\n </Suspense>\n );\n}\n"],"names":["Suspense","CircularProgress","CircularProgressSuspense","props","children","ariaLabelledBy","ariaLabel","undefined","progressProps","fallback","aria-label","aria-labelledby"],"mappings":";AAAA,SAASA,QAAQ,QAA2C,QAAQ;AACpE,SACEC,gBAAgB,QAEX,kCAAkC;AAazC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASC,yBACdC,KAAoC;IAEpC,MAAM,EACJC,QAAQ,EACR,mBAAmBC,cAAc,EACjC,cAAcC,YAAYD,iBAAiBE,YAAY,SAAS,EAChE,GAAGC,eACJ,GAAGL;IACJ,qBACE,KAACH;QACCS,wBACE,KAACR;YACCS,cAAYJ;YACZK,mBAAiBN;YAChB,GAAGG,aAAa;;kBAIpBJ;;AAGP"}
1
+ {"version":3,"sources":["../../src/suspense/CircularProgressSuspense.tsx"],"sourcesContent":["import { Suspense, type ReactElement, type ReactNode } from \"react\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface CircularProgressSuspenseProps extends CircularProgressProps {\n /**\n * @defaultValue `\"Loading\"`\n */\n \"aria-label\"?: string;\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * This is just a convenience component to set the `fallback` to the\n * {@link CircularProgress} component.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { CircularProgressSuspense } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { lazy } from \"react\";\n *\n * const Component = lazy(() => import('./Some/Path/To/Component'));\n *\n * function Example(): ReactElement {\n * return (\n * <CircularProgressSuspense>\n * <Component />\n * </CircularProgressSuspense>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function CircularProgressSuspense(\n props: CircularProgressSuspenseProps\n): ReactElement {\n const {\n children,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Loading\",\n ...progressProps\n } = props;\n return (\n <Suspense\n fallback={\n <CircularProgress\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n {...progressProps}\n />\n }\n >\n {children}\n </Suspense>\n );\n}\n"],"names":["Suspense","CircularProgress","CircularProgressSuspense","props","children","ariaLabelledBy","ariaLabel","undefined","progressProps","fallback","aria-label","aria-labelledby"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,QAAQ,QAA2C,QAAQ;AACpE,SACEC,gBAAgB,QAEX,kCAAkC;AAazC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASC,yBACdC,KAAoC;IAEpC,MAAM,EACJC,QAAQ,EACR,mBAAmBC,cAAc,EACjC,cAAcC,YAAYD,iBAAiBE,YAAY,SAAS,EAChE,GAAGC,eACJ,GAAGL;IACJ,qBACE,KAACH;QACCS,wBACE,KAACR;YACCS,cAAYJ;YACZK,mBAAiBN;YAChB,GAAGG,aAAa;;kBAIpBJ;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/suspense/NullSuspense.tsx"],"sourcesContent":["import { Suspense, type ReactElement, type ReactNode } from \"react\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface NullSuspenseProps {\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * This is just a convenience component to set the `fallback` to `null`.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { NullSuspense } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { lazy } from \"react\";\n *\n * const Component = lazy(() => import('./Some/Path/To/Component'));\n *\n * function Example() {\n * return (\n * <NullSuspense>\n * <Component />\n * </NullSuspense>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function NullSuspense(props: NullSuspenseProps): ReactElement {\n const { children } = props;\n\n return <Suspense fallback={null}>{children}</Suspense>;\n}\n"],"names":["Suspense","NullSuspense","props","children","fallback"],"mappings":";AAAA,SAASA,QAAQ,QAA2C,QAAQ;AASpE;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,qBAAO,KAACF;QAASI,UAAU;kBAAOD;;AACpC"}
1
+ {"version":3,"sources":["../../src/suspense/NullSuspense.tsx"],"sourcesContent":["import { Suspense, type ReactElement, type ReactNode } from \"react\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface NullSuspenseProps {\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * This is just a convenience component to set the `fallback` to `null`.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { NullSuspense } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { lazy } from \"react\";\n *\n * const Component = lazy(() => import('./Some/Path/To/Component'));\n *\n * function Example() {\n * return (\n * <NullSuspense>\n * <Component />\n * </NullSuspense>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function NullSuspense(props: NullSuspenseProps): ReactElement {\n const { children } = props;\n\n return <Suspense fallback={null}>{children}</Suspense>;\n}\n"],"names":["Suspense","NullSuspense","props","children","fallback"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,QAAQ,QAA2C,QAAQ;AASpE;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,qBAAO,KAACF;QAASI,UAAU;kBAAOD;;AACpC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/Table.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo, type TableHTMLAttributes } from \"react\";\nimport {\n TableConfigProvider,\n type TableConfigContext,\n type TableConfiguration,\n} from \"./TableConfigurationProvider.js\";\nimport { table } from \"./tableStyles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-table-background-color\"?: string;\n \"--rmd-table-border-size\"?: string | number;\n \"--rmd-table-border-color\"?: string;\n \"--rmd-table-header-background-color\"?: string;\n \"--rmd-table-cell-color\"?: string;\n \"--rmd-table-cell-height\"?: string | number;\n \"--rmd-table-cell-horizontal-padding\"?: string | number;\n \"--rmd-table-cell-vertical-padding\"?: string | number;\n \"--rmd-table-header-cell-height\"?: string | number;\n \"--rmd-table-hover-color\"?: string;\n \"--rmd-table-selected-color\"?: string;\n \"--rmd-table-sticky-cell\"?: string | number;\n \"--rmd-table-sticky-header\"?: string | number;\n \"--rmd-table-sticky-footer\"?: string | number;\n \"--rmd-table-sticky-background-color\"?: string;\n }\n}\n\nexport interface TableProps\n extends TableHTMLAttributes<HTMLTableElement>,\n TableConfiguration {}\n\n/**\n * **Client Component**\n *\n * @example\n * Responsive Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCell>Header 1</TableCell>\n * <TableCell>Header 2</TableCell>\n * <TableCell>Header 3</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Row 1 Cell 1</TableCell>\n * <TableCell>Row 1 Cell 2</TableCell>\n * <TableCell>Row 1 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 2 Cell 1</TableCell>\n * <TableCell>Row 2 Cell 2</TableCell>\n * <TableCell>Row 2 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 3 Cell 1</TableCell>\n * <TableCell>Row 3 Cell 2</TableCell>\n * <TableCell>Row 3 Cell 3</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(\n function Table(props, ref) {\n const {\n className,\n children,\n dense = false,\n hAlign = \"left\",\n vAlign = \"middle\",\n lineWrap = false,\n fullWidth = false,\n disableHover = false,\n disableBorders = false,\n ...remaining\n } = props;\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: false,\n hAlign,\n vAlign,\n lineWrap,\n disableHover,\n disableBorders,\n }),\n [dense, hAlign, vAlign, lineWrap, disableHover, disableBorders]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <table\n {...remaining}\n ref={ref}\n className={table({ dense, fullWidth, className })}\n >\n {children}\n </table>\n </TableConfigProvider>\n );\n }\n);\n"],"names":["forwardRef","useMemo","TableConfigProvider","table","Table","props","ref","className","children","dense","hAlign","vAlign","lineWrap","fullWidth","disableHover","disableBorders","remaining","configuration","header","value"],"mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAAkC,QAAQ;AACtE,SACEC,mBAAmB,QAGd,kCAAkC;AACzC,SAASC,KAAK,QAAQ,mBAAmB;AA0BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDC,GACD,OAAO,MAAMC,sBAAQJ,WACnB,SAASI,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,QAAQ,KAAK,EACbC,SAAS,MAAM,EACfC,SAAS,QAAQ,EACjBC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,eAAe,KAAK,EACpBC,iBAAiB,KAAK,EACtB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,gBAAgBhB,QACpB,IAAO,CAAA;YACLQ;YACAS,QAAQ;YACRR;YACAC;YACAC;YACAE;YACAC;QACF,CAAA,GACA;QAACN;QAAOC;QAAQC;QAAQC;QAAUE;QAAcC;KAAe;IAGjE,qBACE,KAACb;QAAoBiB,OAAOF;kBAC1B,cAAA,KAACd;YACE,GAAGa,SAAS;YACbV,KAAKA;YACLC,WAAWJ,MAAM;gBAAEM;gBAAOI;gBAAWN;YAAU;sBAE9CC;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/table/Table.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo, type TableHTMLAttributes } from \"react\";\nimport {\n TableConfigProvider,\n type TableConfigContext,\n type TableConfiguration,\n} from \"./TableConfigurationProvider.js\";\nimport { table } from \"./tableStyles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-table-background-color\"?: string;\n \"--rmd-table-border-size\"?: string | number;\n \"--rmd-table-border-color\"?: string;\n \"--rmd-table-header-background-color\"?: string;\n \"--rmd-table-cell-color\"?: string;\n \"--rmd-table-cell-height\"?: string | number;\n \"--rmd-table-cell-horizontal-padding\"?: string | number;\n \"--rmd-table-cell-vertical-padding\"?: string | number;\n \"--rmd-table-header-cell-height\"?: string | number;\n \"--rmd-table-hover-color\"?: string;\n \"--rmd-table-selected-color\"?: string;\n \"--rmd-table-sticky-cell\"?: string | number;\n \"--rmd-table-sticky-header\"?: string | number;\n \"--rmd-table-sticky-footer\"?: string | number;\n \"--rmd-table-sticky-background-color\"?: string;\n }\n}\n\nexport interface TableProps\n extends TableHTMLAttributes<HTMLTableElement>,\n TableConfiguration {}\n\n/**\n * **Client Component**\n *\n * @example\n * Responsive Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCell>Header 1</TableCell>\n * <TableCell>Header 2</TableCell>\n * <TableCell>Header 3</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Row 1 Cell 1</TableCell>\n * <TableCell>Row 1 Cell 2</TableCell>\n * <TableCell>Row 1 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 2 Cell 1</TableCell>\n * <TableCell>Row 2 Cell 2</TableCell>\n * <TableCell>Row 2 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 3 Cell 1</TableCell>\n * <TableCell>Row 3 Cell 2</TableCell>\n * <TableCell>Row 3 Cell 3</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(\n function Table(props, ref) {\n const {\n className,\n children,\n dense = false,\n hAlign = \"left\",\n vAlign = \"middle\",\n lineWrap = false,\n fullWidth = false,\n disableHover = false,\n disableBorders = false,\n ...remaining\n } = props;\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: false,\n hAlign,\n vAlign,\n lineWrap,\n disableHover,\n disableBorders,\n }),\n [dense, hAlign, vAlign, lineWrap, disableHover, disableBorders]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <table\n {...remaining}\n ref={ref}\n className={table({ dense, fullWidth, className })}\n >\n {children}\n </table>\n </TableConfigProvider>\n );\n }\n);\n"],"names":["forwardRef","useMemo","TableConfigProvider","table","Table","props","ref","className","children","dense","hAlign","vAlign","lineWrap","fullWidth","disableHover","disableBorders","remaining","configuration","header","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAAkC,QAAQ;AACtE,SACEC,mBAAmB,QAGd,kCAAkC;AACzC,SAASC,KAAK,QAAQ,mBAAmB;AA0BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDC,GACD,OAAO,MAAMC,sBAAQJ,WACnB,SAASI,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,QAAQ,KAAK,EACbC,SAAS,MAAM,EACfC,SAAS,QAAQ,EACjBC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,eAAe,KAAK,EACpBC,iBAAiB,KAAK,EACtB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,gBAAgBhB,QACpB,IAAO,CAAA;YACLQ;YACAS,QAAQ;YACRR;YACAC;YACAC;YACAE;YACAC;QACF,CAAA,GACA;QAACN;QAAOC;QAAQC;QAAQC;QAAUE;QAAcC;KAAe;IAGjE,qBACE,KAACb;QAAoBiB,OAAOF;kBAC1B,cAAA,KAACd;YACE,GAAGa,SAAS;YACbV,KAAKA;YACLC,WAAWJ,MAAM;gBAAEM;gBAAOI;gBAAWN;YAAU;sBAE9CC;;;AAIT,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableBody.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, useMemo, type HTMLAttributes } from \"react\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\n\nexport interface TableBodyProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Omit<TableConfig, \"header\"> {}\n\n/**\n * **Client Component**\n *\n * Creates a `<tbody>` element that also allows for overriding all the child\n * `TableCell` components with additional styling behavior.\n */\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n function TableBody(props, ref) {\n const {\n className,\n children,\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<thead>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n header: false,\n dense,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <tbody {...remaining} ref={ref} className={cnb(\"rmd-tbody\", className)}>\n {children}\n </tbody>\n </TableConfigProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useMemo","TableConfigProvider","useTableConfig","TableBody","props","ref","className","children","hAlign","propHAlign","vAlign","propVAlign","lineWrap","propLineWrap","disableHover","propDisableHover","disableBorders","propDisableBorders","remaining","dense","configuration","header","value","tbody"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,EAAEC,OAAO,QAA6B,QAAQ;AACjE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AAMzC;;;;;CAKC,GACD,OAAO,MAAMC,0BAAYJ,WACvB,SAASI,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,UAAUC,YAAY,EACtBC,cAAcC,gBAAgB,EAC9BC,gBAAgBC,kBAAkB,EAClC,GAAGC,WACJ,GAAGd;IAEJ,6EAA6E;IAC7E,MAAM,EAAEe,KAAK,EAAEX,MAAM,EAAEE,MAAM,EAAEE,QAAQ,EAAEE,YAAY,EAAEE,cAAc,EAAE,GACrEd,eAAe;QACbM,QAAQC;QACRC,QAAQC;QACRC,UAAUC;QACVC,cAAcC;QACdC,gBAAgBC;IAClB;IAEF,MAAMG,gBAAgBpB,QACpB,IAAO,CAAA;YACLqB,QAAQ;YACRF;YACAX;YACAE;YACAE;YACAI;YACAF;QACF,CAAA,GACA;QAACK;QAAOX;QAAQE;QAAQE;QAAUI;QAAgBF;KAAa;IAGjE,qBACE,KAACb;QAAoBqB,OAAOF;kBAC1B,cAAA,KAACG;YAAO,GAAGL,SAAS;YAAEb,KAAKA;YAAKC,WAAWR,IAAI,aAAaQ;sBACzDC;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/table/TableBody.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, useMemo, type HTMLAttributes } from \"react\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\n\nexport interface TableBodyProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Omit<TableConfig, \"header\"> {}\n\n/**\n * **Client Component**\n *\n * Creates a `<tbody>` element that also allows for overriding all the child\n * `TableCell` components with additional styling behavior.\n */\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n function TableBody(props, ref) {\n const {\n className,\n children,\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<thead>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n header: false,\n dense,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <tbody {...remaining} ref={ref} className={cnb(\"rmd-tbody\", className)}>\n {children}\n </tbody>\n </TableConfigProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useMemo","TableConfigProvider","useTableConfig","TableBody","props","ref","className","children","hAlign","propHAlign","vAlign","propVAlign","lineWrap","propLineWrap","disableHover","propDisableHover","disableBorders","propDisableBorders","remaining","dense","configuration","header","value","tbody"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,EAAEC,OAAO,QAA6B,QAAQ;AACjE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AAMzC;;;;;CAKC,GACD,OAAO,MAAMC,0BAAYJ,WACvB,SAASI,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,UAAUC,YAAY,EACtBC,cAAcC,gBAAgB,EAC9BC,gBAAgBC,kBAAkB,EAClC,GAAGC,WACJ,GAAGd;IAEJ,6EAA6E;IAC7E,MAAM,EAAEe,KAAK,EAAEX,MAAM,EAAEE,MAAM,EAAEE,QAAQ,EAAEE,YAAY,EAAEE,cAAc,EAAE,GACrEd,eAAe;QACbM,QAAQC;QACRC,QAAQC;QACRC,UAAUC;QACVC,cAAcC;QACdC,gBAAgBC;IAClB;IAEF,MAAMG,gBAAgBpB,QACpB,IAAO,CAAA;YACLqB,QAAQ;YACRF;YACAX;YACAE;YACAE;YACAI;YACAF;QACF,CAAA,GACA;QAACK;QAAOX;QAAQE;QAAQE;QAAUI;QAAgBF;KAAa;IAGjE,qBACE,KAACb;QAAoBqB,OAAOF;kBAC1B,cAAA,KAACG;YAAO,GAAGL,SAAS;YAAEb,KAAKA;YAAKC,WAAWR,IAAI,aAAaQ;sBACzDC;;;AAIT,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableCell.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type ReactNode,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport {\n TableCellContent,\n type SortOrder,\n type TableCellContentsIconRotatorProps,\n} from \"./TableCellContent.js\";\nimport {\n useTableConfig,\n type TableCellConfig,\n} from \"./TableConfigurationProvider.js\";\nimport { tableCell } from \"./tableCellStyles.js\";\n\nexport type TableCellAttributes = Omit<\n | TdHTMLAttributes<HTMLTableCellElement>\n | ThHTMLAttributes<HTMLTableCellElement>,\n \"scope\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TableCellOptions extends TableCellConfig {\n /**\n * This is a bit of a \"weird\" prop since all it does is apply `width: 100%` to\n * this cell. This will make this specific cell fill the remaining width of\n * the table (if there is any). If no cells have this prop enabled and the\n * `fullWidth` table configuration is enabled, all cells will have an\n * equal-sized width.\n *\n * @defaultValue `false`\n */\n grow?: boolean;\n\n /**\n * This prop is only valid when the `header` prop is enabled or the\n * `TableCell` is a child of the `TableHeader` component. This will generally\n * be used with a value of `\"row\"` if you have table headers that are at the\n * start of each row instead of at the top of the table.\n *\n * @defaultValue `\"col\"`\n */\n scope?: \"row\" | \"col\" | \"rowgroup\" | \"colgroup\";\n\n /**\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0 This prop is only a boolean.\n */\n sticky?: boolean;\n\n /**\n * @internal\n * @defaultValue `false`\n */\n inputToggle?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0 Removed the `colSpan=\"100%\"` support since `colSpan`\n * really only supports numbers.\n */\nexport interface TableCellProps extends TableCellAttributes, TableCellOptions {\n /**\n * If you want to apply a sort icon for a header cell, set this prop to either\n * `\"ascending\"` or `\"descending\"`. When you change the sort order, this prop\n * should change as well which will cause the sort icon to rotate. The default\n * behavior is to have the icon facing upwards and not-rotated when\n * `\"ascending\"`, otherwise it will rotate downwards when `\"descending\"`.\n *\n * If this prop is set to `\"none\"`, the cell will render the clickable button\n * in the children, just without the sort icon. This is so that the sort\n * behavior can still be toggled for keyboard users and will be tab-focusable.\n *\n * @see {@link beforeChildren}\n * @see {@link afterChildren}\n */\n \"aria-sort\"?: SortOrder;\n\n /**\n * An optional sort icon to use. This will be defaulted to the configured sort\n * icon from the `@react-md/core` package. If you do not want the default\n * implementation for the sort icon behavior from `react-md`, you can set this\n * prop to `null`.\n */\n sortIcon?: ReactNode;\n\n /**\n * Boolean if the sort icon should appear after the children in the cell\n * instead of before.\n */\n sortIconAfter?: boolean;\n\n /**\n * Boolean if the sort icon should be rotated instead of the default\n * direction. When this is `undefined`, it will only be `true` when the\n * `\"aria-sort\"` prop is set to `\"descending\"`. If this is not `undefined`,\n * its boolean value will always be used.\n */\n sortIconRotated?: boolean;\n\n /**\n * @defaultValue `\"horizontal\"`\n */\n padding?: \"horizontal\" | \"vertical\" | \"none\";\n\n /**\n * This can be used to apply styling or any other props to the\n * `UnstyledButton` that surrounds the `children` when the `\"aria-sort\"` prop\n * has been provided.\n *\n * @remarks \\@since 6.0.0\n */\n contentProps?: PropsWithRef<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /**\n * Any additional props to pass to the `IconRotator` when the `aria-sort` prop\n * has been provided.\n *\n * @remarks \\@since 6.0.0\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @see {@link afterChildren} for an example.\n * @remarks \\@since 6.0.0\n */\n beforeChildren?: ReactNode;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @example\n * ```tsx\n * import type { SortOrder } from \"@react-md/core\";\n * import { Button, Dialog, TableCell } from \"@react-md/core\";\n * import MoreVertIcon from \"@react-md/material-icons/MoreVertIcon\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * interface Props {\n * setSort(sort: string): void;\n * sortKey: string;\n * sortOrder: SortOrder;\n * }\n *\n * function Example({ sortKey, sortOrder, setSort }: Props): ReactElement {\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <>\n * <TableCell\n * aria-sort={sortKey === \"example\" ? sortOrder : \"none\"}\n * onClick={() => setSort(\"example\")}\n * afterChildren={\n * <Button\n * aria-label=\"Options\"\n * buttonType=\"icon\"\n * onClick={() => {\n * setVisible(true)\n * }}\n * >\n * <MoreVertIcon />\n * </Button>\n * }\n * >\n * Example content\n * </TableCell>\n * <Dialog\n * aria-label=\"Options\"\n * visible={visible}\n * onRequestClose={() => setVisible(false)}\n * >\n * Pretend Content...\n * </Dialog>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\n afterChildren?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Creates a `<th>` or `<td>` cell with sensible styled defaults. You can create\n * a `<th>` element by enabling the `header` prop OR having a `TableCell` as a\n * child of the `TableHeader` component.\n *\n * Note: If you have a checkbox/radio column in the `TableHeader` without any\n * labels, you will need to manually set the `header={false}` prop for that cell\n * since it is invalid to have a `<th>` without any readable content for screen\n * readers.\n */\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n function TableCell(props, ref) {\n const {\n \"aria-sort\": sortOrder,\n className,\n grow = false,\n scope: propScope,\n hAlign: propHAlign,\n vAlign: propVAlign,\n header: propHeader,\n lineWrap: propDisableLineWrap,\n inputToggle,\n children,\n beforeChildren,\n afterChildren,\n sticky,\n sortIcon: propSortIcon,\n sortIconAfter = false,\n sortIconRotated,\n iconRotatorProps,\n padding = \"horizontal\",\n contentProps,\n ...remaining\n } = props;\n\n const sortIcon = getIcon(\"sort\", propSortIcon);\n\n // Note: unlike the other usages of `useTableConfig`, the `propHeader`\n // is not provided. This is so that `TableCheckbox` components can still\n // be a sticky header without being rendered as a `<th>`. This also makes\n // it so the scope can be defaulted to `col` or `row` automatically.\n const {\n header: inheritedHeader,\n hAlign,\n vAlign,\n lineWrap,\n } = useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propDisableLineWrap,\n });\n const header = propHeader ?? inheritedHeader;\n\n let scope = propScope;\n if (!scope && header) {\n scope = !inheritedHeader && propHeader ? \"row\" : \"col\";\n }\n\n const Component = header ? \"th\" : \"td\";\n return (\n <Component\n {...remaining}\n ref={ref}\n aria-sort={sortOrder === \"none\" ? undefined : sortOrder}\n className={tableCell({\n className,\n grow,\n header,\n sticky,\n inputToggle,\n hAlign,\n vAlign,\n lineWrap: !sortOrder && lineWrap,\n padding: sortIcon && sortOrder ? \"none\" : padding,\n isInTableHeader: inheritedHeader,\n })}\n scope={scope}\n >\n {beforeChildren}\n <TableCellContent\n {...contentProps}\n icon={sortIcon}\n iconAfter={sortIconAfter}\n iconRotatorProps={iconRotatorProps}\n sortOrder={sortOrder}\n hAlign={hAlign}\n rotated={sortIconRotated}\n >\n {children}\n </TableCellContent>\n {afterChildren}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","getIcon","TableCellContent","useTableConfig","tableCell","TableCell","props","ref","sortOrder","className","grow","scope","propScope","hAlign","propHAlign","vAlign","propVAlign","header","propHeader","lineWrap","propDisableLineWrap","inputToggle","children","beforeChildren","afterChildren","sticky","sortIcon","propSortIcon","sortIconAfter","sortIconRotated","iconRotatorProps","padding","contentProps","remaining","inheritedHeader","Component","aria-sort","undefined","isInTableHeader","icon","iconAfter","rotated"],"mappings":"AAAA;;AACA,SACEA,UAAU,QAKL,QAAQ;AACf,SAASC,OAAO,QAAQ,wBAAwB;AAEhD,SACEC,gBAAgB,QAGX,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AChBO,MAAMb;gBACNc,WAAWZ;gBACXE,kBAAkBA;gBAClBtB,WAAWA;gBACXK,QAAQA;gBACR4B,SAASZ;0BAERP;;YAEFE;;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/table/TableCell.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type ReactNode,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport {\n TableCellContent,\n type SortOrder,\n type TableCellContentsIconRotatorProps,\n} from \"./TableCellContent.js\";\nimport {\n useTableConfig,\n type TableCellConfig,\n} from \"./TableConfigurationProvider.js\";\nimport { tableCell } from \"./tableCellStyles.js\";\n\nexport type TableCellAttributes = Omit<\n | TdHTMLAttributes<HTMLTableCellElement>\n | ThHTMLAttributes<HTMLTableCellElement>,\n \"scope\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TableCellOptions extends TableCellConfig {\n /**\n * This is a bit of a \"weird\" prop since all it does is apply `width: 100%` to\n * this cell. This will make this specific cell fill the remaining width of\n * the table (if there is any). If no cells have this prop enabled and the\n * `fullWidth` table configuration is enabled, all cells will have an\n * equal-sized width.\n *\n * @defaultValue `false`\n */\n grow?: boolean;\n\n /**\n * This prop is only valid when the `header` prop is enabled or the\n * `TableCell` is a child of the `TableHeader` component. This will generally\n * be used with a value of `\"row\"` if you have table headers that are at the\n * start of each row instead of at the top of the table.\n *\n * @defaultValue `\"col\"`\n */\n scope?: \"row\" | \"col\" | \"rowgroup\" | \"colgroup\";\n\n /**\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0 This prop is only a boolean.\n */\n sticky?: boolean;\n\n /**\n * @internal\n * @defaultValue `false`\n */\n inputToggle?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0 Removed the `colSpan=\"100%\"` support since `colSpan`\n * really only supports numbers.\n */\nexport interface TableCellProps extends TableCellAttributes, TableCellOptions {\n /**\n * If you want to apply a sort icon for a header cell, set this prop to either\n * `\"ascending\"` or `\"descending\"`. When you change the sort order, this prop\n * should change as well which will cause the sort icon to rotate. The default\n * behavior is to have the icon facing upwards and not-rotated when\n * `\"ascending\"`, otherwise it will rotate downwards when `\"descending\"`.\n *\n * If this prop is set to `\"none\"`, the cell will render the clickable button\n * in the children, just without the sort icon. This is so that the sort\n * behavior can still be toggled for keyboard users and will be tab-focusable.\n *\n * @see {@link beforeChildren}\n * @see {@link afterChildren}\n */\n \"aria-sort\"?: SortOrder;\n\n /**\n * An optional sort icon to use. This will be defaulted to the configured sort\n * icon from the `@react-md/core` package. If you do not want the default\n * implementation for the sort icon behavior from `react-md`, you can set this\n * prop to `null`.\n */\n sortIcon?: ReactNode;\n\n /**\n * Boolean if the sort icon should appear after the children in the cell\n * instead of before.\n */\n sortIconAfter?: boolean;\n\n /**\n * Boolean if the sort icon should be rotated instead of the default\n * direction. When this is `undefined`, it will only be `true` when the\n * `\"aria-sort\"` prop is set to `\"descending\"`. If this is not `undefined`,\n * its boolean value will always be used.\n */\n sortIconRotated?: boolean;\n\n /**\n * @defaultValue `\"horizontal\"`\n */\n padding?: \"horizontal\" | \"vertical\" | \"none\";\n\n /**\n * This can be used to apply styling or any other props to the\n * `UnstyledButton` that surrounds the `children` when the `\"aria-sort\"` prop\n * has been provided.\n *\n * @remarks \\@since 6.0.0\n */\n contentProps?: PropsWithRef<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /**\n * Any additional props to pass to the `IconRotator` when the `aria-sort` prop\n * has been provided.\n *\n * @remarks \\@since 6.0.0\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @see {@link afterChildren} for an example.\n * @remarks \\@since 6.0.0\n */\n beforeChildren?: ReactNode;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @example\n * ```tsx\n * import type { SortOrder } from \"@react-md/core\";\n * import { Button, Dialog, TableCell } from \"@react-md/core\";\n * import MoreVertIcon from \"@react-md/material-icons/MoreVertIcon\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * interface Props {\n * setSort(sort: string): void;\n * sortKey: string;\n * sortOrder: SortOrder;\n * }\n *\n * function Example({ sortKey, sortOrder, setSort }: Props): ReactElement {\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <>\n * <TableCell\n * aria-sort={sortKey === \"example\" ? sortOrder : \"none\"}\n * onClick={() => setSort(\"example\")}\n * afterChildren={\n * <Button\n * aria-label=\"Options\"\n * buttonType=\"icon\"\n * onClick={() => {\n * setVisible(true)\n * }}\n * >\n * <MoreVertIcon />\n * </Button>\n * }\n * >\n * Example content\n * </TableCell>\n * <Dialog\n * aria-label=\"Options\"\n * visible={visible}\n * onRequestClose={() => setVisible(false)}\n * >\n * Pretend Content...\n * </Dialog>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\n afterChildren?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Creates a `<th>` or `<td>` cell with sensible styled defaults. You can create\n * a `<th>` element by enabling the `header` prop OR having a `TableCell` as a\n * child of the `TableHeader` component.\n *\n * Note: If you have a checkbox/radio column in the `TableHeader` without any\n * labels, you will need to manually set the `header={false}` prop for that cell\n * since it is invalid to have a `<th>` without any readable content for screen\n * readers.\n */\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n function TableCell(props, ref) {\n const {\n \"aria-sort\": sortOrder,\n className,\n grow = false,\n scope: propScope,\n hAlign: propHAlign,\n vAlign: propVAlign,\n header: propHeader,\n lineWrap: propDisableLineWrap,\n inputToggle,\n children,\n beforeChildren,\n afterChildren,\n sticky,\n sortIcon: propSortIcon,\n sortIconAfter = false,\n sortIconRotated,\n iconRotatorProps,\n padding = \"horizontal\",\n contentProps,\n ...remaining\n } = props;\n\n const sortIcon = getIcon(\"sort\", propSortIcon);\n\n // Note: unlike the other usages of `useTableConfig`, the `propHeader`\n // is not provided. This is so that `TableCheckbox` components can still\n // be a sticky header without being rendered as a `<th>`. This also makes\n // it so the scope can be defaulted to `col` or `row` automatically.\n const {\n header: inheritedHeader,\n hAlign,\n vAlign,\n lineWrap,\n } = useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propDisableLineWrap,\n });\n const header = propHeader ?? inheritedHeader;\n\n let scope = propScope;\n if (!scope && header) {\n scope = !inheritedHeader && propHeader ? \"row\" : \"col\";\n }\n\n const Component = header ? \"th\" : \"td\";\n return (\n <Component\n {...remaining}\n ref={ref}\n aria-sort={sortOrder === \"none\" ? undefined : sortOrder}\n className={tableCell({\n className,\n grow,\n header,\n sticky,\n inputToggle,\n hAlign,\n vAlign,\n lineWrap: !sortOrder && lineWrap,\n padding: sortIcon && sortOrder ? \"none\" : padding,\n isInTableHeader: inheritedHeader,\n })}\n scope={scope}\n >\n {beforeChildren}\n <TableCellContent\n {...contentProps}\n icon={sortIcon}\n iconAfter={sortIconAfter}\n iconRotatorProps={iconRotatorProps}\n sortOrder={sortOrder}\n hAlign={hAlign}\n rotated={sortIconRotated}\n >\n {children}\n </TableCellContent>\n {afterChildren}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","getIcon","TableCellContent","useTableConfig","tableCell","TableCell","props","ref","sortOrder","className","grow","scope","propScope","hAlign","propHAlign","vAlign","propVAlign","header","propHeader","lineWrap","propDisableLineWrap","inputToggle","children","beforeChildren","afterChildren","sticky","sortIcon","propSortIcon","sortIconAfter","sortIconRotated","iconRotatorProps","padding","contentProps","remaining","inheritedHeader","Component","aria-sort","undefined","isInTableHeader","icon","iconAfter","rotated"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AASL,YAAYlB,YAAY,SAASuB;YAC1CO,iBAAiBJ;QACnB;QACAvB,OAAOA;;YAENY;0BACD,KAACrB;gBACE,GAAG8B,YAAY;gBAChBO,MAAMb;gBACNc,WAAWZ;gBACXE,kBAAkBA;gBAClBtB,WAAWA;gBACXK,QAAQA;gBACR4B,SAASZ;0BAERP;;YAEFE;;;AAGP,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableCellContent.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { ButtonUnstyled } from \"../button/ButtonUnstyled.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type TableCellHorizontalAlignment } from \"./TableConfigurationProvider.js\";\n\nexport type SortOrder = \"ascending\" | \"descending\" | \"none\" | \"other\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCellContentsIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @remarks \\@since 6.0.0 Extends the `ButtonHTMLAttributes` so the extra props\n * can be passed to the `ButtonUnstyled`\n * @internal\n */\nexport interface TableCellContentProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The current sort order for this cell. Setting this to `null` will prevent\n * the button from being rendered.\n */\n sortOrder?: SortOrder;\n\n /**\n * This should normally be the `getIcon(\"sort\")`\n */\n icon?: ReactNode;\n\n /** @defaultValue `false` */\n iconAfter?: boolean;\n\n /**\n * Boolean if the icon should be rotated.\n */\n rotated?: boolean;\n\n /**\n * Any additional props to pass to the `IconRotator`.\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * @remarks \\@since 4.0.3\n * @see {@link TableCellHorizontalAlignment}\n */\n hAlign?: TableCellHorizontalAlignment;\n}\n\nconst styles = bem(\"rmd-table-cell\");\n\n/**\n * **Server Component**\n * This might actually be a client component.\n *\n * This is mostly an internal component since it is automatically used within\n * the `TableCell` component but this will conditionally wrap the `children`\n * within an `UnstyledButton` to make a clickable cell. This is really to help\n * with sort behavior within headers.\n *\n * @internal\n */\nexport const TableCellContent = forwardRef<\n HTMLButtonElement,\n TableCellContentProps\n>(function TableCellContent(props, ref) {\n const {\n icon: propIcon,\n style,\n className,\n sortOrder,\n children,\n rotated: propRotated,\n hAlign = \"left\",\n iconAfter,\n iconRotatorProps,\n ...remaining\n } = props;\n if (!sortOrder || propIcon === null) {\n return <>{children}</>;\n }\n\n let icon: ReactNode = null;\n if (sortOrder !== \"none\") {\n const rotated = propRotated ?? sortOrder === \"descending\";\n\n icon = (\n <IconRotator {...iconRotatorProps} rotated={rotated}>\n {propIcon}\n </IconRotator>\n );\n }\n\n return (\n <ButtonUnstyled\n {...remaining}\n ref={ref}\n style={style}\n className={cnb(\n styles(\"content\", {\n [hAlign]: hAlign !== \"left\",\n }),\n className\n )}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </ButtonUnstyled>\n );\n});\n"],"names":["cnb","forwardRef","ButtonUnstyled","IconRotator","bem","styles","TableCellContent","props","ref","icon","propIcon","style","className","sortOrder","children","rotated","propRotated","hAlign","iconAfter","iconRotatorProps","remaining"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAmD,QAAQ;AAC9E,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,GAAG,QAAQ,kBAAkB;AAmDtC,MAAMC,SAASD,IAAI;AAEnB;;;;;;;;;;CAUC,GACD,OAAO,MAAME,iCAAmBL,WAG9B,SAASK,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,MAAMC,QAAQ,EACdC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,SAASC,WAAW,EACpBC,SAAS,MAAM,EACfC,SAAS,EACTC,gBAAgB,EAChB,GAAGC,WACJ,GAAGb;IACJ,IAAI,CAACM,aAAaH,aAAa,MAAM;QACnC,qBAAO;sBAAGI;;IACZ;IAEA,IAAIL,OAAkB;IACtB,IAAII,cAAc,QAAQ;QACxB,MAAME,UAAUC,eAAeH,cAAc;QAE7CJ,qBACE,KAACN;YAAa,GAAGgB,gBAAgB;YAAEJ,SAASA;sBACzCL;;IAGP;IAEA,qBACE,MAACR;QACE,GAAGkB,SAAS;QACbZ,KAAKA;QACLG,OAAOA;QACPC,WAAWZ,IACTK,OAAO,WAAW;YAChB,CAACY,OAAO,EAAEA,WAAW;QACvB,IACAL;;YAGD,CAACM,aAAaT;YACdK;YACAI,aAAaT;;;AAGpB,GAAG"}
1
+ {"version":3,"sources":["../../src/table/TableCellContent.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { ButtonUnstyled } from \"../button/ButtonUnstyled.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type TableCellHorizontalAlignment } from \"./TableConfigurationProvider.js\";\n\nexport type SortOrder = \"ascending\" | \"descending\" | \"none\" | \"other\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCellContentsIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @remarks \\@since 6.0.0 Extends the `ButtonHTMLAttributes` so the extra props\n * can be passed to the `ButtonUnstyled`\n * @internal\n */\nexport interface TableCellContentProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The current sort order for this cell. Setting this to `null` will prevent\n * the button from being rendered.\n */\n sortOrder?: SortOrder;\n\n /**\n * This should normally be the `getIcon(\"sort\")`\n */\n icon?: ReactNode;\n\n /** @defaultValue `false` */\n iconAfter?: boolean;\n\n /**\n * Boolean if the icon should be rotated.\n */\n rotated?: boolean;\n\n /**\n * Any additional props to pass to the `IconRotator`.\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * @remarks \\@since 4.0.3\n * @see {@link TableCellHorizontalAlignment}\n */\n hAlign?: TableCellHorizontalAlignment;\n}\n\nconst styles = bem(\"rmd-table-cell\");\n\n/**\n * **Server Component**\n * This might actually be a client component.\n *\n * This is mostly an internal component since it is automatically used within\n * the `TableCell` component but this will conditionally wrap the `children`\n * within an `UnstyledButton` to make a clickable cell. This is really to help\n * with sort behavior within headers.\n *\n * @internal\n */\nexport const TableCellContent = forwardRef<\n HTMLButtonElement,\n TableCellContentProps\n>(function TableCellContent(props, ref) {\n const {\n icon: propIcon,\n style,\n className,\n sortOrder,\n children,\n rotated: propRotated,\n hAlign = \"left\",\n iconAfter,\n iconRotatorProps,\n ...remaining\n } = props;\n if (!sortOrder || propIcon === null) {\n return <>{children}</>;\n }\n\n let icon: ReactNode = null;\n if (sortOrder !== \"none\") {\n const rotated = propRotated ?? sortOrder === \"descending\";\n\n icon = (\n <IconRotator {...iconRotatorProps} rotated={rotated}>\n {propIcon}\n </IconRotator>\n );\n }\n\n return (\n <ButtonUnstyled\n {...remaining}\n ref={ref}\n style={style}\n className={cnb(\n styles(\"content\", {\n [hAlign]: hAlign !== \"left\",\n }),\n className\n )}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </ButtonUnstyled>\n );\n});\n"],"names":["cnb","forwardRef","ButtonUnstyled","IconRotator","bem","styles","TableCellContent","props","ref","icon","propIcon","style","className","sortOrder","children","rotated","propRotated","hAlign","iconAfter","iconRotatorProps","remaining"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAAmD,QAAQ;AAC9E,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,GAAG,QAAQ,kBAAkB;AAmDtC,MAAMC,SAASD,IAAI;AAEnB;;;;;;;;;;CAUC,GACD,OAAO,MAAME,iCAAmBL,WAG9B,SAASK,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,MAAMC,QAAQ,EACdC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,SAASC,WAAW,EACpBC,SAAS,MAAM,EACfC,SAAS,EACTC,gBAAgB,EAChB,GAAGC,WACJ,GAAGb;IACJ,IAAI,CAACM,aAAaH,aAAa,MAAM;QACnC,qBAAO;sBAAGI;;IACZ;IAEA,IAAIL,OAAkB;IACtB,IAAII,cAAc,QAAQ;QACxB,MAAME,UAAUC,eAAeH,cAAc;QAE7CJ,qBACE,KAACN;YAAa,GAAGgB,gBAAgB;YAAEJ,SAASA;sBACzCL;;IAGP;IAEA,qBACE,MAACR;QACE,GAAGkB,SAAS;QACbZ,KAAKA;QACLG,OAAOA;QACPC,WAAWZ,IACTK,OAAO,WAAW;YAChB,CAACY,OAAO,EAAEA,WAAW;QACvB,IACAL;;YAGD,CAACM,aAAaT;YACdK;YACAI,aAAaT;;;AAGpB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableCheckbox.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type TdHTMLAttributes } from \"react\";\nimport { Checkbox } from \"../form/Checkbox.js\";\nimport { type CheckboxProps } from \"../form/InputToggle.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { TableCell } from \"./TableCell.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCheckboxTdHTMLAttributes = Omit<\n TdHTMLAttributes<HTMLTableCellElement>,\n \"aria-sort\" | \"scope\" | \"onChange\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCheckboxSupportedCheckboxProps = Pick<\n CheckboxProps,\n | \"name\"\n | \"value\"\n | \"icon\"\n | \"iconStyle\"\n | \"iconClassName\"\n | \"iconProps\"\n | \"checkedIcon\"\n | \"indeterminateIcon\"\n | \"checked\"\n | \"onChange\"\n | \"defaultChecked\"\n | \"indeterminate\"\n | \"aria-controls\"\n>;\n\n/**\n * @remarks\n * \\@since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * \\@since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * \\@since 6,0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport interface TableCheckboxProps\n extends TableCheckboxTdHTMLAttributes,\n TableCheckboxSupportedCheckboxProps {\n /**\n * @defaultValue `!props[\"aria-labelledby\"] ? \"Select Row\" : undefined`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `false` */\n sticky?: boolean;\n\n /**\n * This allows you to override any props for the checkbox that are not\n * configurable as top-level props.\n *\n * @example\n * Simple Example\n * ```tsx\n * checkboxProps={{\n * id: \"some-custom-id\",\n * ref: checkboxRef,\n * }}\n * ```\n *\n * @see {@link TableCheckboxSupportedCheckboxProps}\n * @remarks \\@since 6.0.0\n */\n checkboxProps?: PropsWithRef<CheckboxProps, HTMLInputElement>;\n}\n\n/**\n * **Client Component**\n * The `TableCheckbox` is used to render a `Checkbox` within a `TableCell` by applying\n * some minimal styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableCheckbox,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * useCheckboxGroup\n * } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * const rows = [\n * { name: \"Frozen Yogurt\", type: \"Ice Cream\" },\n * { name: \"Ice cream sandwich\", type: \"Ice Cream\" },\n * { name: \"Eclair\", type: \"Pastry\" },\n * // ...other content\n * ] as const;\n *\n * function Example(): ReactElement {\n * const { getCheckboxProps, getIndeterminateProps } = useCheckboxGroup({\n * values: rows.map(({ name }) => name),\n * name: \"selected\",\n * });\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCheckbox {...getIndeterminateProps()} />\n * <TableCell>Name</TableCell>\n * <TableCell>Type</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * {rows.map(({ name, type }) => {\n * const checkboxProps = getCheckboxProps(name);\n * const { checked, onChange } = checkboxProps;\n *\n * return (\n * <TableRow\n * key={name}\n * onClick={onChange}\n * clickable\n * selected={checked}\n * >\n * <TableCheckbox {...checkboxProps} />\n * <TableCell>{name}</TableCell>\n * <TableCell hAlign=\"right\">{type}</TableCell>\n * </TableRow>\n * );\n * })}\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n *\n * @remarks\n * \\@since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * \\@since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * \\@since 6,0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport const TableCheckbox = forwardRef<\n HTMLTableCellElement,\n TableCheckboxProps\n>(function TableCheckbox(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = !ariaLabelledBy ? \"Select Row\" : undefined,\n \"aria-controls\": ariaControls,\n name,\n icon,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n indeterminateIcon,\n value,\n checked,\n onChange,\n defaultChecked,\n indeterminate,\n checkboxProps,\n onClick = noop,\n ...remaining\n } = props;\n\n return (\n <TableCell\n {...remaining}\n ref={ref}\n header={false}\n inputToggle\n onClick={(event) => {\n event.stopPropagation();\n onClick(event);\n }}\n >\n <Checkbox\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-controls={ariaControls}\n name={name}\n icon={icon}\n iconProps={iconProps}\n iconStyle={iconStyle}\n iconClassName={iconClassName}\n checkedIcon={checkedIcon}\n indeterminateIcon={indeterminateIcon}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n onChange={onChange}\n indeterminate={indeterminate}\n {...checkboxProps}\n />\n </TableCell>\n );\n});\n"],"names":["forwardRef","Checkbox","TableCell","noop","TableCheckbox","props","ref","ariaLabelledBy","ariaLabel","undefined","ariaControls","name","icon","iconProps","iconStyle","iconClassName","checkedIcon","indeterminateIcon","value","checked","onChange","defaultChecked","indeterminate","checkboxProps","onClick","remaining","header","inputToggle","event","stopPropagation","aria-label","aria-labelledby","aria-controls"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA+B,QAAQ;AAC1D,SAASC,QAAQ,QAAQ,sBAAsB;AAG/C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EC,GACD,OAAO,MAAMC,8BAAgBJ,WAG3B,SAASI,cAAcC,KAAK,EAAEC,GAAG;IACjC,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAY,CAACD,iBAAiB,eAAeE,SAAS,EACpE,iBAAiBC,YAAY,EAC7BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,iBAAiB,EACjBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,UAAUrB,IAAI,EACd,GAAGsB,WACJ,GAAGpB;IAEJ,qBACE,KAACH;QACE,GAAGuB,SAAS;QACbnB,KAAKA;QACLoB,QAAQ;QACRC,WAAW;QACXH,SAAS,CAACI;YACRA,MAAMC,eAAe;YACrBL,QAAQI;QACV;kBAEA,cAAA,KAAC3B;YACC6B,cAAYtB;YACZuB,mBAAiBxB;YACjByB,iBAAetB;YACfC,MAAMA;YACNC,MAAMA;YACNC,WAAWA;YACXC,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,mBAAmBA;YACnBC,OAAOA;YACPC,SAASA;YACTE,gBAAgBA;YAChBD,UAAUA;YACVE,eAAeA;YACd,GAAGC,aAAa;;;AAIzB,GAAG"}
1
+ {"version":3,"sources":["../../src/table/TableCheckbox.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type TdHTMLAttributes } from \"react\";\nimport { Checkbox } from \"../form/Checkbox.js\";\nimport { type CheckboxProps } from \"../form/InputToggle.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { TableCell } from \"./TableCell.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCheckboxTdHTMLAttributes = Omit<\n TdHTMLAttributes<HTMLTableCellElement>,\n \"aria-sort\" | \"scope\" | \"onChange\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableCheckboxSupportedCheckboxProps = Pick<\n CheckboxProps,\n | \"name\"\n | \"value\"\n | \"icon\"\n | \"iconStyle\"\n | \"iconClassName\"\n | \"iconProps\"\n | \"checkedIcon\"\n | \"indeterminateIcon\"\n | \"checked\"\n | \"onChange\"\n | \"defaultChecked\"\n | \"indeterminate\"\n | \"aria-controls\"\n>;\n\n/**\n * @remarks\n * \\@since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * \\@since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * \\@since 6,0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport interface TableCheckboxProps\n extends TableCheckboxTdHTMLAttributes,\n TableCheckboxSupportedCheckboxProps {\n /**\n * @defaultValue `!props[\"aria-labelledby\"] ? \"Select Row\" : undefined`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `false` */\n sticky?: boolean;\n\n /**\n * This allows you to override any props for the checkbox that are not\n * configurable as top-level props.\n *\n * @example\n * Simple Example\n * ```tsx\n * checkboxProps={{\n * id: \"some-custom-id\",\n * ref: checkboxRef,\n * }}\n * ```\n *\n * @see {@link TableCheckboxSupportedCheckboxProps}\n * @remarks \\@since 6.0.0\n */\n checkboxProps?: PropsWithRef<CheckboxProps, HTMLInputElement>;\n}\n\n/**\n * **Client Component**\n * The `TableCheckbox` is used to render a `Checkbox` within a `TableCell` by applying\n * some minimal styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableCheckbox,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * useCheckboxGroup\n * } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * const rows = [\n * { name: \"Frozen Yogurt\", type: \"Ice Cream\" },\n * { name: \"Ice cream sandwich\", type: \"Ice Cream\" },\n * { name: \"Eclair\", type: \"Pastry\" },\n * // ...other content\n * ] as const;\n *\n * function Example(): ReactElement {\n * const { getCheckboxProps, getIndeterminateProps } = useCheckboxGroup({\n * values: rows.map(({ name }) => name),\n * name: \"selected\",\n * });\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCheckbox {...getIndeterminateProps()} />\n * <TableCell>Name</TableCell>\n * <TableCell>Type</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * {rows.map(({ name, type }) => {\n * const checkboxProps = getCheckboxProps(name);\n * const { checked, onChange } = checkboxProps;\n *\n * return (\n * <TableRow\n * key={name}\n * onClick={onChange}\n * clickable\n * selected={checked}\n * >\n * <TableCheckbox {...checkboxProps} />\n * <TableCell>{name}</TableCell>\n * <TableCell hAlign=\"right\">{type}</TableCell>\n * </TableRow>\n * );\n * })}\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n *\n * @remarks\n * \\@since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * \\@since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * \\@since 6,0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport const TableCheckbox = forwardRef<\n HTMLTableCellElement,\n TableCheckboxProps\n>(function TableCheckbox(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = !ariaLabelledBy ? \"Select Row\" : undefined,\n \"aria-controls\": ariaControls,\n name,\n icon,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n indeterminateIcon,\n value,\n checked,\n onChange,\n defaultChecked,\n indeterminate,\n checkboxProps,\n onClick = noop,\n ...remaining\n } = props;\n\n return (\n <TableCell\n {...remaining}\n ref={ref}\n header={false}\n inputToggle\n onClick={(event) => {\n event.stopPropagation();\n onClick(event);\n }}\n >\n <Checkbox\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-controls={ariaControls}\n name={name}\n icon={icon}\n iconProps={iconProps}\n iconStyle={iconStyle}\n iconClassName={iconClassName}\n checkedIcon={checkedIcon}\n indeterminateIcon={indeterminateIcon}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n onChange={onChange}\n indeterminate={indeterminate}\n {...checkboxProps}\n />\n </TableCell>\n );\n});\n"],"names":["forwardRef","Checkbox","TableCell","noop","TableCheckbox","props","ref","ariaLabelledBy","ariaLabel","undefined","ariaControls","name","icon","iconProps","iconStyle","iconClassName","checkedIcon","indeterminateIcon","value","checked","onChange","defaultChecked","indeterminate","checkboxProps","onClick","remaining","header","inputToggle","event","stopPropagation","aria-label","aria-labelledby","aria-controls"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAA+B,QAAQ;AAC1D,SAASC,QAAQ,QAAQ,sBAAsB;AAG/C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EC,GACD,OAAO,MAAMC,8BAAgBJ,WAG3B,SAASI,cAAcC,KAAK,EAAEC,GAAG;IACjC,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAY,CAACD,iBAAiB,eAAeE,SAAS,EACpE,iBAAiBC,YAAY,EAC7BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,iBAAiB,EACjBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,UAAUrB,IAAI,EACd,GAAGsB,WACJ,GAAGpB;IAEJ,qBACE,KAACH;QACE,GAAGuB,SAAS;QACbnB,KAAKA;QACLoB,QAAQ;QACRC,WAAW;QACXH,SAAS,CAACI;YACRA,MAAMC,eAAe;YACrBL,QAAQI;QACV;kBAEA,cAAA,KAAC3B;YACC6B,cAAYtB;YACZuB,mBAAiBxB;YACjByB,iBAAetB;YACfC,MAAMA;YACNC,MAAMA;YACNC,WAAWA;YACXC,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,mBAAmBA;YACnBC,OAAOA;YACPC,SAASA;YACTE,gBAAgBA;YAChBD,UAAUA;YACVE,eAAeA;YACd,GAAGC,aAAa;;;AAIzB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableConfigurationProvider.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext } from \"react\";\n\n// interfaces that are \"public\" should be the full word `Configuration` while\n// the private/internal should just be `Config`. \"Great\" naming convention!\n\nexport interface TableRowConfiguration {\n /**\n * Set to `true` if rows should no longer change background color while\n * hovered.\n *\n * @defaultValue `false`\n */\n disableHover?: boolean;\n\n /**\n * Set to `true` if the rows in the `TableBody` should no longer have borders\n * applied.\n *\n * @defaultValue `false`\n */\n disableBorders?: boolean;\n}\n\n/**\n * The horizontal alignment for the content within a cell.\n *\n * Note: Table default behavior is to align to the left.\n */\nexport type TableCellHorizontalAlignment = \"left\" | \"center\" | \"right\";\n\n/**\n * The vertical alignment for the content within a cell.\n *\n * Note: When this is set to `\"top\"` or `\"bottom\"`, `padding-top` or\n * `padding-bottom` will also be applied due to how styling tables work.\n */\nexport type TableCellVerticalAlignment = \"top\" | \"middle\" | \"bottom\";\n\nexport interface TableCellConfiguration {\n hAlign?: TableCellHorizontalAlignment;\n vAlign?: TableCellVerticalAlignment;\n\n /**\n * Set this to `true` to allow `TableCell` content to line wrap.\n *\n * @defaultValue `false`\n */\n lineWrap?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface TableCellConfig extends TableCellConfiguration {\n /**\n * Boolean if all the `TableCell` components should be rendered as a `<th>`\n * instead of a `<td>`. This is really just a convenience prop for the\n * `TableHeader` component so the user of `react-md` doesn't need to keep\n * setting the `type=\"th\"` fot the `TableCell` if using the low-level\n * components.\n *\n * @internal\n */\n header?: boolean;\n}\n\nexport interface TableConfig extends TableRowConfiguration, TableCellConfig {\n /**\n * Set this to `true` to decrease the height of all cells within the table.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n}\n\nexport interface TableConfiguration extends TableConfig {\n /**\n * Set this to `true` to allow the table to span the full width of the\n * container element instead of having the width be determined by the content\n * within the table.\n *\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n}\n\nexport type TableConfigContext = Required<TableConfig>;\n\nconst context = createContext<TableConfigContext>({\n dense: false,\n header: false,\n hAlign: \"left\",\n vAlign: \"middle\",\n lineWrap: false,\n disableHover: false,\n disableBorders: false,\n});\n\n/**\n * An internal hook for getting the current table configuration in child\n * components for the table. This will use the inherited table configuration\n * context if the prop value is `undefined`.\n *\n * @internal\n */\nexport function useTableConfig(options: TableConfig): TableConfigContext {\n const inherited = useContext(context);\n const dense = options.dense ?? inherited.dense;\n const header = options.header ?? inherited.header;\n const hAlign = options.hAlign ?? inherited.hAlign;\n const vAlign = options.vAlign ?? inherited.vAlign;\n const lineWrap = options.lineWrap ?? inherited.lineWrap;\n const disableHover = options.disableHover ?? inherited.disableHover;\n const disableBorders = options.disableBorders ?? inherited.disableBorders;\n\n return {\n dense,\n header,\n hAlign,\n vAlign,\n lineWrap,\n disableHover,\n disableBorders,\n };\n}\n\n/**\n * **Client Component**\n *\n * @internal\n */\nexport const { Provider: TableConfigProvider } = context;\n"],"names":["createContext","useContext","context","dense","header","hAlign","vAlign","lineWrap","disableHover","disableBorders","useTableConfig","options","inherited","Provider","TableConfigProvider"],"mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAwFlD,MAAMC,wBAAUF,cAAkC;IAChDG,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,cAAc;IACdC,gBAAgB;AAClB;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,eAAeC,OAAoB;IACjD,MAAMC,YAAYX,WAAWC;IAC7B,MAAMC,QAAQQ,QAAQR,KAAK,IAAIS,UAAUT,KAAK;IAC9C,MAAMC,SAASO,QAAQP,MAAM,IAAIQ,UAAUR,MAAM;IACjD,MAAMC,SAASM,QAAQN,MAAM,IAAIO,UAAUP,MAAM;IACjD,MAAMC,SAASK,QAAQL,MAAM,IAAIM,UAAUN,MAAM;IACjD,MAAMC,WAAWI,QAAQJ,QAAQ,IAAIK,UAAUL,QAAQ;IACvD,MAAMC,eAAeG,QAAQH,YAAY,IAAII,UAAUJ,YAAY;IACnE,MAAMC,iBAAiBE,QAAQF,cAAc,IAAIG,UAAUH,cAAc;IAEzE,OAAO;QACLN;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAM,EAAEI,UAAUC,mBAAmB,EAAE,GAAGZ,QAAQ"}
1
+ {"version":3,"sources":["../../src/table/TableConfigurationProvider.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext } from \"react\";\n\n// interfaces that are \"public\" should be the full word `Configuration` while\n// the private/internal should just be `Config`. \"Great\" naming convention!\n\nexport interface TableRowConfiguration {\n /**\n * Set to `true` if rows should no longer change background color while\n * hovered.\n *\n * @defaultValue `false`\n */\n disableHover?: boolean;\n\n /**\n * Set to `true` if the rows in the `TableBody` should no longer have borders\n * applied.\n *\n * @defaultValue `false`\n */\n disableBorders?: boolean;\n}\n\n/**\n * The horizontal alignment for the content within a cell.\n *\n * Note: Table default behavior is to align to the left.\n */\nexport type TableCellHorizontalAlignment = \"left\" | \"center\" | \"right\";\n\n/**\n * The vertical alignment for the content within a cell.\n *\n * Note: When this is set to `\"top\"` or `\"bottom\"`, `padding-top` or\n * `padding-bottom` will also be applied due to how styling tables work.\n */\nexport type TableCellVerticalAlignment = \"top\" | \"middle\" | \"bottom\";\n\nexport interface TableCellConfiguration {\n hAlign?: TableCellHorizontalAlignment;\n vAlign?: TableCellVerticalAlignment;\n\n /**\n * Set this to `true` to allow `TableCell` content to line wrap.\n *\n * @defaultValue `false`\n */\n lineWrap?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface TableCellConfig extends TableCellConfiguration {\n /**\n * Boolean if all the `TableCell` components should be rendered as a `<th>`\n * instead of a `<td>`. This is really just a convenience prop for the\n * `TableHeader` component so the user of `react-md` doesn't need to keep\n * setting the `type=\"th\"` fot the `TableCell` if using the low-level\n * components.\n *\n * @internal\n */\n header?: boolean;\n}\n\nexport interface TableConfig extends TableRowConfiguration, TableCellConfig {\n /**\n * Set this to `true` to decrease the height of all cells within the table.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n}\n\nexport interface TableConfiguration extends TableConfig {\n /**\n * Set this to `true` to allow the table to span the full width of the\n * container element instead of having the width be determined by the content\n * within the table.\n *\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n}\n\nexport type TableConfigContext = Required<TableConfig>;\n\nconst context = createContext<TableConfigContext>({\n dense: false,\n header: false,\n hAlign: \"left\",\n vAlign: \"middle\",\n lineWrap: false,\n disableHover: false,\n disableBorders: false,\n});\n\n/**\n * An internal hook for getting the current table configuration in child\n * components for the table. This will use the inherited table configuration\n * context if the prop value is `undefined`.\n *\n * @internal\n */\nexport function useTableConfig(options: TableConfig): TableConfigContext {\n const inherited = useContext(context);\n const dense = options.dense ?? inherited.dense;\n const header = options.header ?? inherited.header;\n const hAlign = options.hAlign ?? inherited.hAlign;\n const vAlign = options.vAlign ?? inherited.vAlign;\n const lineWrap = options.lineWrap ?? inherited.lineWrap;\n const disableHover = options.disableHover ?? inherited.disableHover;\n const disableBorders = options.disableBorders ?? inherited.disableBorders;\n\n return {\n dense,\n header,\n hAlign,\n vAlign,\n lineWrap,\n disableHover,\n disableBorders,\n };\n}\n\n/**\n * **Client Component**\n *\n * @internal\n */\nexport const { Provider: TableConfigProvider } = context;\n"],"names":["createContext","useContext","context","dense","header","hAlign","vAlign","lineWrap","disableHover","disableBorders","useTableConfig","options","inherited","Provider","TableConfigProvider"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAwFlD,MAAMC,wBAAUF,cAAkC;IAChDG,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,cAAc;IACdC,gBAAgB;AAClB;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,eAAeC,OAAoB;IACjD,MAAMC,YAAYX,WAAWC;IAC7B,MAAMC,QAAQQ,QAAQR,KAAK,IAAIS,UAAUT,KAAK;IAC9C,MAAMC,SAASO,QAAQP,MAAM,IAAIQ,UAAUR,MAAM;IACjD,MAAMC,SAASM,QAAQN,MAAM,IAAIO,UAAUP,MAAM;IACjD,MAAMC,SAASK,QAAQL,MAAM,IAAIM,UAAUN,MAAM;IACjD,MAAMC,WAAWI,QAAQJ,QAAQ,IAAIK,UAAUL,QAAQ;IACvD,MAAMC,eAAeG,QAAQH,YAAY,IAAII,UAAUJ,YAAY;IACnE,MAAMC,iBAAiBE,QAAQF,cAAc,IAAIG,UAAUH,cAAc;IAEzE,OAAO;QACLN;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;AACF;AAEA;;;;CAIC,GACD,OAAO,MAAM,EAAEI,UAAUC,mBAAmB,EAAE,GAAGZ,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableContainer.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo, type HTMLAttributes } from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport {\n TableContainerProvider,\n type TableContainerContext,\n} from \"./TableContainerProvider.js\";\nimport { tableContainer } from \"./tableContainerStyles.js\";\n\nexport type TableContainerProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * **Client Component**\n *\n * An extremely \"useful\" component that should be used with the `Table`\n * component if you want to make a responsive table within the page. If you\n * don't want to use this component, you can just apply `overflow: auto` to a\n * parent element of the table.\n */\nexport const TableContainer = forwardRef<HTMLDivElement, TableContainerProps>(\n function TableContainer(props, ref) {\n const { className, children, ...remaining } = props;\n const [nodeRef, refCallback] = useEnsuredRef(ref);\n\n const value = useMemo<TableContainerContext>(\n () => ({\n exists: true,\n containerRef: nodeRef,\n }),\n [nodeRef]\n );\n\n return (\n <TableContainerProvider value={value}>\n <div\n {...remaining}\n ref={refCallback}\n className={tableContainer({ className })}\n >\n {children}\n </div>\n </TableContainerProvider>\n );\n }\n);\n"],"names":["forwardRef","useMemo","useEnsuredRef","TableContainerProvider","tableContainer","TableContainer","props","ref","className","children","remaining","nodeRef","refCallback","value","exists","containerRef","div"],"mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAA6B,QAAQ;AACjE,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SACEC,sBAAsB,QAEjB,8BAA8B;AACrC,SAASC,cAAc,QAAQ,4BAA4B;AAI3D;;;;;;;CAOC,GACD,OAAO,MAAMC,+BAAiBL,WAC5B,SAASK,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAC9C,MAAM,CAACK,SAASC,YAAY,GAAGV,cAAcK;IAE7C,MAAMM,QAAQZ,QACZ,IAAO,CAAA;YACLa,QAAQ;YACRC,cAAcJ;QAChB,CAAA,GACA;QAACA;KAAQ;IAGX,qBACE,KAACR;QAAuBU,OAAOA;kBAC7B,cAAA,KAACG;YACE,GAAGN,SAAS;YACbH,KAAKK;YACLJ,WAAWJ,eAAe;gBAAEI;YAAU;sBAErCC;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/table/TableContainer.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo, type HTMLAttributes } from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport {\n TableContainerProvider,\n type TableContainerContext,\n} from \"./TableContainerProvider.js\";\nimport { tableContainer } from \"./tableContainerStyles.js\";\n\nexport type TableContainerProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * **Client Component**\n *\n * An extremely \"useful\" component that should be used with the `Table`\n * component if you want to make a responsive table within the page. If you\n * don't want to use this component, you can just apply `overflow: auto` to a\n * parent element of the table.\n */\nexport const TableContainer = forwardRef<HTMLDivElement, TableContainerProps>(\n function TableContainer(props, ref) {\n const { className, children, ...remaining } = props;\n const [nodeRef, refCallback] = useEnsuredRef(ref);\n\n const value = useMemo<TableContainerContext>(\n () => ({\n exists: true,\n containerRef: nodeRef,\n }),\n [nodeRef]\n );\n\n return (\n <TableContainerProvider value={value}>\n <div\n {...remaining}\n ref={refCallback}\n className={tableContainer({ className })}\n >\n {children}\n </div>\n </TableContainerProvider>\n );\n }\n);\n"],"names":["forwardRef","useMemo","useEnsuredRef","TableContainerProvider","tableContainer","TableContainer","props","ref","className","children","remaining","nodeRef","refCallback","value","exists","containerRef","div"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAA6B,QAAQ;AACjE,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SACEC,sBAAsB,QAEjB,8BAA8B;AACrC,SAASC,cAAc,QAAQ,4BAA4B;AAI3D;;;;;;;CAOC,GACD,OAAO,MAAMC,+BAAiBL,WAC5B,SAASK,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAC9C,MAAM,CAACK,SAASC,YAAY,GAAGV,cAAcK;IAE7C,MAAMM,QAAQZ,QACZ,IAAO,CAAA;YACLa,QAAQ;YACRC,cAAcJ;QAChB,CAAA,GACA;QAACA;KAAQ;IAGX,qBACE,KAACR;QAAuBU,OAAOA;kBAC7B,cAAA,KAACG;YACE,GAAGN,SAAS;YACbH,KAAKK;YACLJ,WAAWJ,eAAe;gBAAEI;YAAU;sBAErCC;;;AAIT,GACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableContainerProvider.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface TableContainerContext {\n exists: boolean;\n containerRef: RefObject<HTMLDivElement>;\n}\n\nconst context = createContext<Readonly<TableContainerContext>>({\n exists: false,\n containerRef: { current: null },\n});\ncontext.displayName = \"TableContainer\";\n\n/**\n * **Client Component**\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const { Provider: TableContainerProvider } = context;\n\n/**\n * This is used to implement the sticky header and footer intersection observer\n * behavior.\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function useTableContainer(): Readonly<TableContainerContext> {\n return useContext(context);\n}\n"],"names":["createContext","useContext","context","exists","containerRef","current","displayName","Provider","TableContainerProvider","useTableContainer"],"mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAwB,QAAQ;AAWlE,MAAMC,wBAAUF,cAA+C;IAC7DG,QAAQ;IACRC,cAAc;QAAEC,SAAS;IAAK;AAChC;AACAH,QAAQI,WAAW,GAAG;AAEtB;;;;;CAKC,GACD,OAAO,MAAM,EAAEC,UAAUC,sBAAsB,EAAE,GAAGN,QAAQ;AAE5D;;;;;;CAMC,GACD,OAAO,SAASO;IACd,OAAOR,WAAWC;AACpB"}
1
+ {"version":3,"sources":["../../src/table/TableContainerProvider.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\n/**\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport interface TableContainerContext {\n exists: boolean;\n containerRef: RefObject<HTMLDivElement>;\n}\n\nconst context = createContext<Readonly<TableContainerContext>>({\n exists: false,\n containerRef: { current: null },\n});\ncontext.displayName = \"TableContainer\";\n\n/**\n * **Client Component**\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport const { Provider: TableContainerProvider } = context;\n\n/**\n * This is used to implement the sticky header and footer intersection observer\n * behavior.\n *\n * @internal\n * @remarks \\@since 6.0.0\n */\nexport function useTableContainer(): Readonly<TableContainerContext> {\n return useContext(context);\n}\n"],"names":["createContext","useContext","context","exists","containerRef","current","displayName","Provider","TableContainerProvider","useTableContainer"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAwB,QAAQ;AAWlE,MAAMC,wBAAUF,cAA+C;IAC7DG,QAAQ;IACRC,cAAc;QAAEC,SAAS;IAAK;AAChC;AACAH,QAAQI,WAAW,GAAG;AAEtB;;;;;CAKC,GACD,OAAO,MAAM,EAAEC,UAAUC,sBAAsB,EAAE,GAAGN,QAAQ;AAE5D;;;;;;CAMC,GACD,OAAO,SAASO;IACd,OAAOR,WAAWC;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableFooter.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n} from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIntersectionObserver } from \"../useIntersectionObserver.js\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableCellConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\nimport { useTableContainer } from \"./TableContainerProvider.js\";\nimport { tableFooter } from \"./tableFooterStyles.js\";\nimport {\n type IsStickyTableSectionActive,\n type TableStickySectionProps,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const isTableFooterStickyActive: IsStickyTableSectionActive = (\n entry,\n isInTableContainer\n) => {\n const { intersectionRatio, boundingClientRect, isIntersecting } = entry;\n if (isInTableContainer) {\n return !isIntersecting;\n }\n\n return intersectionRatio < 1 && boundingClientRect.top >= 0;\n};\n/**\n * @remarks \\@since 6.0.0 Added support for \"sticky-active\" state.\n */\nexport interface TableFooterProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Pick<TableCellConfig, \"lineWrap\">,\n TableStickySectionProps {\n /**\n * This is a rename of the `disableHover` of the `TableConfig` since table\n * footers are not hoverable by default. This prop can be enabled to add the\n * row hover color within table footers, but it is not really recommended.\n *\n * @defaultValue `false`\n */\n hoverable?: boolean;\n\n /** @defaultValue {@link isTableFooterStickyActive} */\n isStickyActive?: IsStickyTableSectionActive;\n}\n\n/**\n * **Client Component**\n * TODO: Create separate useStickyTableFooter + StickyTableFooter component\n *\n * Creates a `<tfoot>` element with some basic styles. This component will\n * disable the hover effect and line wrapping by default, but the hover effect\n * and line-wrapping can be re-enabled if desired through the `hoverable` and\n * `disableNoWrap` props.\n */\nexport const TableFooter = forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(function TableFooter(props, propRef) {\n const {\n className,\n hoverable = false,\n lineWrap: propLineWrap,\n children,\n sticky = false,\n stickyOptions,\n isStickyActive = isTableFooterStickyActive,\n disableStickyStyles = false,\n stickyActiveClassName,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<tfoot>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n lineWrap: propLineWrap,\n disableHover: !hoverable,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: false,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n const [tfootRef, tfootRefCallback] = useEnsuredRef(propRef);\n const { exists, containerRef } = useTableContainer();\n const [stickyActive, setStickyActive] = useState(false);\n const targetRef = useIntersectionObserver<\n HTMLTableSectionElement | HTMLElement\n >({\n ref: exists ? undefined : tfootRefCallback,\n root: containerRef,\n disabled: !sticky || disableStickyStyles,\n threshold: exists ? 0 : 1,\n getRootMargin: useCallback(() => {\n const topOffset =\n exists && tfootRef.current ? tfootRef.current.offsetHeight - 1 : 1;\n\n return `0px 0px -${topOffset}px 0px`;\n }, [exists, tfootRef]),\n onUpdate: useCallback(\n ([entry]) => {\n setStickyActive(isStickyActive(entry, exists));\n },\n [exists, isStickyActive]\n ),\n // allow the user defined sticky options to override the default behavior\n ...stickyOptions,\n });\n\n return (\n <TableConfigProvider value={configuration}>\n {exists && sticky && !disableStickyStyles && (\n // rendering a `<tbody>` since it is valid to have 0-many in a table\n // https://html.spec.whatwg.org/multipage/tables.html#the-table-element\n <tbody aria-hidden ref={targetRef} />\n )}\n <tfoot\n {...remaining}\n ref={exists ? tfootRefCallback : targetRef}\n className={tableFooter({\n className,\n sticky,\n stickyActive,\n stickyActiveClassName,\n })}\n >\n {children}\n </tfoot>\n </TableConfigProvider>\n );\n});\n"],"names":["forwardRef","useCallback","useMemo","useState","useEnsuredRef","useIntersectionObserver","TableConfigProvider","useTableConfig","useTableContainer","tableFooter","isTableFooterStickyActive","entry","isInTableContainer","intersectionRatio","boundingClientRect","isIntersecting","top","TableFooter","props","propRef","className","hoverable","lineWrap","propLineWrap","children","sticky","stickyOptions","isStickyActive","disableStickyStyles","stickyActiveClassName","remaining","dense","hAlign","vAlign","disableHover","disableBorders","configuration","header","tfootRef","tfootRefCallback","exists","containerRef","stickyActive","setStickyActive","targetRef","ref","undefined","root","disabled","threshold","getRootMargin","topOffset","current","offsetHeight","onUpdate","value","tbody","aria-hidden","tfoot"],"mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,QAAQ,QAEH,QAAQ;AACf,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,yBAAyB;AAMrD;;CAEC,GACD,OAAO,MAAMC,4BAAwD,CACnEC,OACAC;IAEA,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,cAAc,EAAE,GAAGJ;IAClE,IAAIC,oBAAoB;QACtB,OAAO,CAACG;IACV;IAEA,OAAOF,oBAAoB,KAAKC,mBAAmBE,GAAG,IAAI;AAC5D,EAAE;AAqBF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAAcjB,WAGzB,SAASiB,YAAYC,KAAK,EAAEC,OAAO;IACnC,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,KAAK,EACdC,aAAa,EACbC,iBAAiBjB,yBAAyB,EAC1CkB,sBAAsB,KAAK,EAC3BC,qBAAqB,EACrB,GAAGC,WACJ,GAAGZ;IAEJ,6EAA6E;IAC7E,MAAM,EAAEa,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEX,QAAQ,EAAEY,YAAY,EAAEC,cAAc,EAAE,GACrE5B,eAAe;QACbe,UAAUC;QACVW,cAAc,CAACb;IACjB;IAEF,MAAMe,gBAAgBlC,QACpB,IAAO,CAAA;YACL6B;YACAM,QAAQ;YACRL;YACAC;YACAX;YACAa;YACAD;QACF,CAAA,GACA;QAACH;QAAOC;QAAQC;QAAQX;QAAUa;QAAgBD;KAAa;IAGjE,MAAM,CAACI,UAAUC,iBAAiB,GAAGnC,cAAce;IACnD,MAAM,EAAEqB,MAAM,EAAEC,YAAY,EAAE,GAAGjC;IACjC,MAAM,CAACkC,cAAcC,gBAAgB,GAAGxC,SAAS;IACjD,MAAMyC,YAAYvC,wBAEhB;QACAwC,KAAKL,SAASM,YAAYP;QAC1BQ,MAAMN;QACNO,UAAU,CAACvB,UAAUG;QACrBqB,WAAWT,SAAS,IAAI;QACxBU,eAAejD,YAAY;YACzB,MAAMkD,YACJX,UAAUF,SAASc,OAAO,GAAGd,SAASc,OAAO,CAACC,YAAY,GAAG,IAAI;YAEnE,OAAO,CAAC,SAAS,EAAEF,UAAU,MAAM,CAAC;QACtC,GAAG;YAACX;YAAQF;SAAS;QACrBgB,UAAUrD,YACR,CAAC,CAACU,MAAM;YACNgC,gBAAgBhB,eAAehB,OAAO6B;QACxC,GACA;YAACA;YAAQb;SAAe;QAE1B,yEAAyE;QACzE,GAAGD,aAAa;IAClB;IAEA,qBACE,MAACpB;QAAoBiD,OAAOnB;;YACzBI,UAAUf,UAAU,CAACG,uBACpB,oEAAoE;YACpE,uEAAuE;0BACvE,KAAC4B;gBAAMC,aAAW;gBAACZ,KAAKD;;0BAE1B,KAACc;gBACE,GAAG5B,SAAS;gBACbe,KAAKL,SAASD,mBAAmBK;gBACjCxB,WAAWX,YAAY;oBACrBW;oBACAK;oBACAiB;oBACAb;gBACF;0BAECL;;;;AAIT,GAAG"}
1
+ {"version":3,"sources":["../../src/table/TableFooter.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n} from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIntersectionObserver } from \"../useIntersectionObserver.js\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableCellConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\nimport { useTableContainer } from \"./TableContainerProvider.js\";\nimport { tableFooter } from \"./tableFooterStyles.js\";\nimport {\n type IsStickyTableSectionActive,\n type TableStickySectionProps,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const isTableFooterStickyActive: IsStickyTableSectionActive = (\n entry,\n isInTableContainer\n) => {\n const { intersectionRatio, boundingClientRect, isIntersecting } = entry;\n if (isInTableContainer) {\n return !isIntersecting;\n }\n\n return intersectionRatio < 1 && boundingClientRect.top >= 0;\n};\n/**\n * @remarks \\@since 6.0.0 Added support for \"sticky-active\" state.\n */\nexport interface TableFooterProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Pick<TableCellConfig, \"lineWrap\">,\n TableStickySectionProps {\n /**\n * This is a rename of the `disableHover` of the `TableConfig` since table\n * footers are not hoverable by default. This prop can be enabled to add the\n * row hover color within table footers, but it is not really recommended.\n *\n * @defaultValue `false`\n */\n hoverable?: boolean;\n\n /** @defaultValue {@link isTableFooterStickyActive} */\n isStickyActive?: IsStickyTableSectionActive;\n}\n\n/**\n * **Client Component**\n * TODO: Create separate useStickyTableFooter + StickyTableFooter component\n *\n * Creates a `<tfoot>` element with some basic styles. This component will\n * disable the hover effect and line wrapping by default, but the hover effect\n * and line-wrapping can be re-enabled if desired through the `hoverable` and\n * `disableNoWrap` props.\n */\nexport const TableFooter = forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(function TableFooter(props, propRef) {\n const {\n className,\n hoverable = false,\n lineWrap: propLineWrap,\n children,\n sticky = false,\n stickyOptions,\n isStickyActive = isTableFooterStickyActive,\n disableStickyStyles = false,\n stickyActiveClassName,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<tfoot>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n lineWrap: propLineWrap,\n disableHover: !hoverable,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: false,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n const [tfootRef, tfootRefCallback] = useEnsuredRef(propRef);\n const { exists, containerRef } = useTableContainer();\n const [stickyActive, setStickyActive] = useState(false);\n const targetRef = useIntersectionObserver<\n HTMLTableSectionElement | HTMLElement\n >({\n ref: exists ? undefined : tfootRefCallback,\n root: containerRef,\n disabled: !sticky || disableStickyStyles,\n threshold: exists ? 0 : 1,\n getRootMargin: useCallback(() => {\n const topOffset =\n exists && tfootRef.current ? tfootRef.current.offsetHeight - 1 : 1;\n\n return `0px 0px -${topOffset}px 0px`;\n }, [exists, tfootRef]),\n onUpdate: useCallback(\n ([entry]) => {\n setStickyActive(isStickyActive(entry, exists));\n },\n [exists, isStickyActive]\n ),\n // allow the user defined sticky options to override the default behavior\n ...stickyOptions,\n });\n\n return (\n <TableConfigProvider value={configuration}>\n {exists && sticky && !disableStickyStyles && (\n // rendering a `<tbody>` since it is valid to have 0-many in a table\n // https://html.spec.whatwg.org/multipage/tables.html#the-table-element\n <tbody aria-hidden ref={targetRef} />\n )}\n <tfoot\n {...remaining}\n ref={exists ? tfootRefCallback : targetRef}\n className={tableFooter({\n className,\n sticky,\n stickyActive,\n stickyActiveClassName,\n })}\n >\n {children}\n </tfoot>\n </TableConfigProvider>\n );\n});\n"],"names":["forwardRef","useCallback","useMemo","useState","useEnsuredRef","useIntersectionObserver","TableConfigProvider","useTableConfig","useTableContainer","tableFooter","isTableFooterStickyActive","entry","isInTableContainer","intersectionRatio","boundingClientRect","isIntersecting","top","TableFooter","props","propRef","className","hoverable","lineWrap","propLineWrap","children","sticky","stickyOptions","isStickyActive","disableStickyStyles","stickyActiveClassName","remaining","dense","hAlign","vAlign","disableHover","disableBorders","configuration","header","tfootRef","tfootRefCallback","exists","containerRef","stickyActive","setStickyActive","targetRef","ref","undefined","root","disabled","threshold","getRootMargin","topOffset","current","offsetHeight","onUpdate","value","tbody","aria-hidden","tfoot"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,QAAQ,QAEH,QAAQ;AACf,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,yBAAyB;AAMrD;;CAEC,GACD,OAAO,MAAMC,4BAAwD,CACnEC,OACAC;IAEA,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,cAAc,EAAE,GAAGJ;IAClE,IAAIC,oBAAoB;QACtB,OAAO,CAACG;IACV;IAEA,OAAOF,oBAAoB,KAAKC,mBAAmBE,GAAG,IAAI;AAC5D,EAAE;AAqBF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAAcjB,WAGzB,SAASiB,YAAYC,KAAK,EAAEC,OAAO;IACnC,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,KAAK,EACdC,aAAa,EACbC,iBAAiBjB,yBAAyB,EAC1CkB,sBAAsB,KAAK,EAC3BC,qBAAqB,EACrB,GAAGC,WACJ,GAAGZ;IAEJ,6EAA6E;IAC7E,MAAM,EAAEa,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEX,QAAQ,EAAEY,YAAY,EAAEC,cAAc,EAAE,GACrE5B,eAAe;QACbe,UAAUC;QACVW,cAAc,CAACb;IACjB;IAEF,MAAMe,gBAAgBlC,QACpB,IAAO,CAAA;YACL6B;YACAM,QAAQ;YACRL;YACAC;YACAX;YACAa;YACAD;QACF,CAAA,GACA;QAACH;QAAOC;QAAQC;QAAQX;QAAUa;QAAgBD;KAAa;IAGjE,MAAM,CAACI,UAAUC,iBAAiB,GAAGnC,cAAce;IACnD,MAAM,EAAEqB,MAAM,EAAEC,YAAY,EAAE,GAAGjC;IACjC,MAAM,CAACkC,cAAcC,gBAAgB,GAAGxC,SAAS;IACjD,MAAMyC,YAAYvC,wBAEhB;QACAwC,KAAKL,SAASM,YAAYP;QAC1BQ,MAAMN;QACNO,UAAU,CAACvB,UAAUG;QACrBqB,WAAWT,SAAS,IAAI;QACxBU,eAAejD,YAAY;YACzB,MAAMkD,YACJX,UAAUF,SAASc,OAAO,GAAGd,SAASc,OAAO,CAACC,YAAY,GAAG,IAAI;YAEnE,OAAO,CAAC,SAAS,EAAEF,UAAU,MAAM,CAAC;QACtC,GAAG;YAACX;YAAQF;SAAS;QACrBgB,UAAUrD,YACR,CAAC,CAACU,MAAM;YACNgC,gBAAgBhB,eAAehB,OAAO6B;QACxC,GACA;YAACA;YAAQb;SAAe;QAE1B,yEAAyE;QACzE,GAAGD,aAAa;IAClB;IAEA,qBACE,MAACpB;QAAoBiD,OAAOnB;;YACzBI,UAAUf,UAAU,CAACG,uBACpB,oEAAoE;YACpE,uEAAuE;0BACvE,KAAC4B;gBAAMC,aAAW;gBAACZ,KAAKD;;0BAE1B,KAACc;gBACE,GAAG5B,SAAS;gBACbe,KAAKL,SAASD,mBAAmBK;gBACjCxB,WAAWX,YAAY;oBACrBW;oBACAK;oBACAiB;oBACAb;gBACF;0BAECL;;;;AAIT,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableHeader.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n} from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIntersectionObserver } from \"../useIntersectionObserver.js\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableCellConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\nimport { useTableContainer } from \"./TableContainerProvider.js\";\nimport { tableHeader } from \"./tableHeaderStyles.js\";\nimport {\n type IsStickyTableSectionActive,\n type TableStickySectionProps,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const isTableHeaderStickyActive: IsStickyTableSectionActive = (\n entry\n) => {\n return (\n entry.intersectionRatio < 1 &&\n entry.boundingClientRect.bottom <= window.innerHeight\n );\n};\n\n/**\n * @remarks \\@since 6.0.0 Added support for \"sticky-active\" state.\n */\nexport interface TableHeaderProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Pick<TableCellConfig, \"lineWrap\">,\n TableStickySectionProps {\n /**\n * This is a rename of the `disableHover` of the `TableConfig` since table\n * headers are not hoverable by default. This prop can be enabled to add the\n * row hover color within table headers, but it is not really recommended.\n *\n * @defaultValue `false`\n */\n hoverable?: boolean;\n\n /** @defaultValue {@link isTableHeaderStickyActive} */\n isStickyActive?: IsStickyTableSectionActive;\n}\n\n/**\n * **Client Component**\n * TODO: Create separate useStickyTableHeader + StickyTableHeader component\n *\n * Creates a `<thead>` element with some basic styles. This component will also\n * update the table configuration so that all the `TableCell` children will\n * automatically become `<th>` elements instead of the normal `<td>` as well as\n * disabling the hover effect and line wrapping. The hover effect and\n * line-wrapping can be re-enabled if desired through the `hoverable` and\n * `disableNoWrap` props.\n */\nexport const TableHeader = forwardRef<\n HTMLTableSectionElement,\n TableHeaderProps\n>(function TableHeader(props, propRef) {\n const {\n className,\n hoverable = false,\n lineWrap: propLineWrap,\n children,\n sticky = false,\n stickyOptions,\n isStickyActive = isTableHeaderStickyActive,\n disableStickyStyles = false,\n stickyActiveClassName,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<thead>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n lineWrap: propLineWrap,\n disableHover: !hoverable,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: true,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n const [theadRef, theadRefCallback] = useEnsuredRef(propRef);\n const { exists, containerRef } = useTableContainer();\n const [stickyActive, setStickyActive] = useState(false);\n const targetRef = useIntersectionObserver({\n ref: exists ? undefined : theadRefCallback,\n root: containerRef,\n disabled: !sticky || disableStickyStyles,\n threshold: exists ? 0 : 1,\n getRootMargin: useCallback(() => {\n const thead = theadRef.current;\n if (!thead) {\n return;\n }\n\n let topOffset: number;\n if (exists) {\n topOffset = thead.offsetHeight - 1;\n } else {\n const top = parseFloat(window.getComputedStyle(thead).top);\n topOffset = Number.isNaN(top) ? 1 : top + 1;\n }\n\n return `-${topOffset}px 0px 0px`;\n }, [exists, theadRef]),\n onUpdate: useCallback(\n ([entry]) => {\n setStickyActive(isStickyActive(entry, exists));\n },\n [exists, isStickyActive]\n ),\n // allow the user defined sticky options to override the default behavior\n ...stickyOptions,\n });\n\n return (\n <TableConfigProvider value={configuration}>\n <thead\n {...remaining}\n ref={exists ? theadRefCallback : targetRef}\n className={tableHeader({\n className,\n dense,\n sticky,\n stickyActive,\n stickyActiveClassName,\n })}\n >\n {children}\n </thead>\n {exists && sticky && !disableStickyStyles && (\n // rendering a `<tbody>` since it is valid to have 0-many in a table\n // https://html.spec.whatwg.org/multipage/tables.html#the-table-element\n <tbody aria-hidden ref={targetRef} />\n )}\n </TableConfigProvider>\n );\n});\n"],"names":["forwardRef","useCallback","useMemo","useState","useEnsuredRef","useIntersectionObserver","TableConfigProvider","useTableConfig","useTableContainer","tableHeader","isTableHeaderStickyActive","entry","intersectionRatio","boundingClientRect","bottom","window","innerHeight","TableHeader","props","propRef","className","hoverable","lineWrap","propLineWrap","children","sticky","stickyOptions","isStickyActive","disableStickyStyles","stickyActiveClassName","remaining","dense","hAlign","vAlign","disableHover","disableBorders","configuration","header","theadRef","theadRefCallback","exists","containerRef","stickyActive","setStickyActive","targetRef","ref","undefined","root","disabled","threshold","getRootMargin","thead","current","topOffset","offsetHeight","top","parseFloat","getComputedStyle","Number","isNaN","onUpdate","value","tbody","aria-hidden"],"mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,QAAQ,QAEH,QAAQ;AACf,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,yBAAyB;AAMrD;;CAEC,GACD,OAAO,MAAMC,4BAAwD,CACnEC;IAEA,OACEA,MAAMC,iBAAiB,GAAG,KAC1BD,MAAME,kBAAkB,CAACC,MAAM,IAAIC,OAAOC,WAAW;AAEzD,EAAE;AAsBF;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,4BAAcjB,WAGzB,SAASiB,YAAYC,KAAK,EAAEC,OAAO;IACnC,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,KAAK,EACdC,aAAa,EACbC,iBAAiBjB,yBAAyB,EAC1CkB,sBAAsB,KAAK,EAC3BC,qBAAqB,EACrB,GAAGC,WACJ,GAAGZ;IAEJ,6EAA6E;IAC7E,MAAM,EAAEa,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEX,QAAQ,EAAEY,YAAY,EAAEC,cAAc,EAAE,GACrE5B,eAAe;QACbe,UAAUC;QACVW,cAAc,CAACb;IACjB;IAEF,MAAMe,gBAAgBlC,QACpB,IAAO,CAAA;YACL6B;YACAM,QAAQ;YACRL;YACAC;YACAX;YACAa;YACAD;QACF,CAAA,GACA;QAACH;QAAOC;QAAQC;QAAQX;QAAUa;QAAgBD;KAAa;IAGjE,MAAM,CAACI,UAAUC,iBAAiB,GAAGnC,cAAce;IACnD,MAAM,EAAEqB,MAAM,EAAEC,YAAY,EAAE,GAAGjC;IACjC,MAAM,CAACkC,cAAcC,gBAAgB,GAAGxC,SAAS;IACjD,MAAMyC,YAAYvC,wBAAwB;QACxCwC,KAAKL,SAASM,YAAYP;QAC1BQ,MAAMN;QACNO,UAAU,CAACvB,UAAUG;QACrBqB,WAAWT,SAAS,IAAI;QACxBU,eAAejD,YAAY;YACzB,MAAMkD,QAAQb,SAASc,OAAO;YAC9B,IAAI,CAACD,OAAO;gBACV;YACF;YAEA,IAAIE;YACJ,IAAIb,QAAQ;gBACVa,YAAYF,MAAMG,YAAY,GAAG;YACnC,OAAO;gBACL,MAAMC,MAAMC,WAAWzC,OAAO0C,gBAAgB,CAACN,OAAOI,GAAG;gBACzDF,YAAYK,OAAOC,KAAK,CAACJ,OAAO,IAAIA,MAAM;YAC5C;YAEA,OAAO,CAAC,CAAC,EAAEF,UAAU,UAAU,CAAC;QAClC,GAAG;YAACb;YAAQF;SAAS;QACrBsB,UAAU3D,YACR,CAAC,CAACU,MAAM;YACNgC,gBAAgBhB,eAAehB,OAAO6B;QACxC,GACA;YAACA;YAAQb;SAAe;QAE1B,yEAAyE;QACzE,GAAGD,aAAa;IAClB;IAEA,qBACE,MAACpB;QAAoBuD,OAAOzB;;0BAC1B,KAACe;gBACE,GAAGrB,SAAS;gBACbe,KAAKL,SAASD,mBAAmBK;gBACjCxB,WAAWX,YAAY;oBACrBW;oBACAW;oBACAN;oBACAiB;oBACAb;gBACF;0BAECL;;YAEFgB,UAAUf,UAAU,CAACG,uBACpB,oEAAoE;YACpE,uEAAuE;0BACvE,KAACkC;gBAAMC,aAAW;gBAAClB,KAAKD;;;;AAIhC,GAAG"}
1
+ {"version":3,"sources":["../../src/table/TableHeader.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n useCallback,\n useMemo,\n useState,\n type HTMLAttributes,\n} from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIntersectionObserver } from \"../useIntersectionObserver.js\";\nimport {\n TableConfigProvider,\n useTableConfig,\n type TableCellConfig,\n type TableConfigContext,\n} from \"./TableConfigurationProvider.js\";\nimport { useTableContainer } from \"./TableContainerProvider.js\";\nimport { tableHeader } from \"./tableHeaderStyles.js\";\nimport {\n type IsStickyTableSectionActive,\n type TableStickySectionProps,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const isTableHeaderStickyActive: IsStickyTableSectionActive = (\n entry\n) => {\n return (\n entry.intersectionRatio < 1 &&\n entry.boundingClientRect.bottom <= window.innerHeight\n );\n};\n\n/**\n * @remarks \\@since 6.0.0 Added support for \"sticky-active\" state.\n */\nexport interface TableHeaderProps\n extends HTMLAttributes<HTMLTableSectionElement>,\n Pick<TableCellConfig, \"lineWrap\">,\n TableStickySectionProps {\n /**\n * This is a rename of the `disableHover` of the `TableConfig` since table\n * headers are not hoverable by default. This prop can be enabled to add the\n * row hover color within table headers, but it is not really recommended.\n *\n * @defaultValue `false`\n */\n hoverable?: boolean;\n\n /** @defaultValue {@link isTableHeaderStickyActive} */\n isStickyActive?: IsStickyTableSectionActive;\n}\n\n/**\n * **Client Component**\n * TODO: Create separate useStickyTableHeader + StickyTableHeader component\n *\n * Creates a `<thead>` element with some basic styles. This component will also\n * update the table configuration so that all the `TableCell` children will\n * automatically become `<th>` elements instead of the normal `<td>` as well as\n * disabling the hover effect and line wrapping. The hover effect and\n * line-wrapping can be re-enabled if desired through the `hoverable` and\n * `disableNoWrap` props.\n */\nexport const TableHeader = forwardRef<\n HTMLTableSectionElement,\n TableHeaderProps\n>(function TableHeader(props, propRef) {\n const {\n className,\n hoverable = false,\n lineWrap: propLineWrap,\n children,\n sticky = false,\n stickyOptions,\n isStickyActive = isTableHeaderStickyActive,\n disableStickyStyles = false,\n stickyActiveClassName,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<thead>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n lineWrap: propLineWrap,\n disableHover: !hoverable,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: true,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n const [theadRef, theadRefCallback] = useEnsuredRef(propRef);\n const { exists, containerRef } = useTableContainer();\n const [stickyActive, setStickyActive] = useState(false);\n const targetRef = useIntersectionObserver({\n ref: exists ? undefined : theadRefCallback,\n root: containerRef,\n disabled: !sticky || disableStickyStyles,\n threshold: exists ? 0 : 1,\n getRootMargin: useCallback(() => {\n const thead = theadRef.current;\n if (!thead) {\n return;\n }\n\n let topOffset: number;\n if (exists) {\n topOffset = thead.offsetHeight - 1;\n } else {\n const top = parseFloat(window.getComputedStyle(thead).top);\n topOffset = Number.isNaN(top) ? 1 : top + 1;\n }\n\n return `-${topOffset}px 0px 0px`;\n }, [exists, theadRef]),\n onUpdate: useCallback(\n ([entry]) => {\n setStickyActive(isStickyActive(entry, exists));\n },\n [exists, isStickyActive]\n ),\n // allow the user defined sticky options to override the default behavior\n ...stickyOptions,\n });\n\n return (\n <TableConfigProvider value={configuration}>\n <thead\n {...remaining}\n ref={exists ? theadRefCallback : targetRef}\n className={tableHeader({\n className,\n dense,\n sticky,\n stickyActive,\n stickyActiveClassName,\n })}\n >\n {children}\n </thead>\n {exists && sticky && !disableStickyStyles && (\n // rendering a `<tbody>` since it is valid to have 0-many in a table\n // https://html.spec.whatwg.org/multipage/tables.html#the-table-element\n <tbody aria-hidden ref={targetRef} />\n )}\n </TableConfigProvider>\n );\n});\n"],"names":["forwardRef","useCallback","useMemo","useState","useEnsuredRef","useIntersectionObserver","TableConfigProvider","useTableConfig","useTableContainer","tableHeader","isTableHeaderStickyActive","entry","intersectionRatio","boundingClientRect","bottom","window","innerHeight","TableHeader","props","propRef","className","hoverable","lineWrap","propLineWrap","children","sticky","stickyOptions","isStickyActive","disableStickyStyles","stickyActiveClassName","remaining","dense","hAlign","vAlign","disableHover","disableBorders","configuration","header","theadRef","theadRefCallback","exists","containerRef","stickyActive","setStickyActive","targetRef","ref","undefined","root","disabled","threshold","getRootMargin","thead","current","topOffset","offsetHeight","top","parseFloat","getComputedStyle","Number","isNaN","onUpdate","value","tbody","aria-hidden"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,QAAQ,QAEH,QAAQ;AACf,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SACEC,mBAAmB,EACnBC,cAAc,QAGT,kCAAkC;AACzC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,yBAAyB;AAMrD;;CAEC,GACD,OAAO,MAAMC,4BAAwD,CACnEC;IAEA,OACEA,MAAMC,iBAAiB,GAAG,KAC1BD,MAAME,kBAAkB,CAACC,MAAM,IAAIC,OAAOC,WAAW;AAEzD,EAAE;AAsBF;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,4BAAcjB,WAGzB,SAASiB,YAAYC,KAAK,EAAEC,OAAO;IACnC,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,KAAK,EACdC,aAAa,EACbC,iBAAiBjB,yBAAyB,EAC1CkB,sBAAsB,KAAK,EAC3BC,qBAAqB,EACrB,GAAGC,WACJ,GAAGZ;IAEJ,6EAA6E;IAC7E,MAAM,EAAEa,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEX,QAAQ,EAAEY,YAAY,EAAEC,cAAc,EAAE,GACrE5B,eAAe;QACbe,UAAUC;QACVW,cAAc,CAACb;IACjB;IAEF,MAAMe,gBAAgBlC,QACpB,IAAO,CAAA;YACL6B;YAC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"version":3,"sources":["../../src/table/TableRadio.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type TdHTMLAttributes } from \"react\";\nimport { type RadioProps } from \"../form/InputToggle.js\";\nimport { Radio } from \"../form/Radio.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { TableCell } from \"./TableCell.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableRadioTdHTMLAttributes = Omit<\n TdHTMLAttributes<HTMLTableCellElement>,\n \"aria-sort\" | \"scope\" | \"onChange\" | \"onInvalid\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableRadioSupportedRadioProps = Pick<\n RadioProps,\n | \"name\"\n | \"value\"\n | \"icon\"\n | \"iconStyle\"\n | \"iconClassName\"\n | \"iconProps\"\n | \"checkedIcon\"\n | \"checked\"\n | \"onChange\"\n | \"defaultChecked\"\n | \"error\"\n | \"required\"\n | \"onInvalid\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TableRadioProps\n extends TableRadioTdHTMLAttributes,\n TableRadioSupportedRadioProps {\n /**\n * @defaultValue `!props[\"aria-labelledby\"] ? \"Select Row\" : undefined`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `false` */\n sticky?: boolean;\n\n /**\n * This allows you to override any props for the checkbox that are not\n * configurable as top-level props.\n *\n * @example\n * Simple Example\n * ```tsx\n * checkboxProps={{\n * id: \"some-custom-id\",\n * ref: checkboxRef,\n * }}\n * ```\n *\n * @see {@link TableRadioSupportedRadioProps}\n * @remarks \\@since 6.0.0\n */\n radioProps?: PropsWithRef<RadioProps, HTMLInputElement>;\n}\n\n/**\n * **Client Component**\n * The `TableRadio` is used to render a `Radio` within a `TableCell` by applying\n * some minimal styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableRadio,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * useRadioGroup,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * const rows = [\n * { name: \"Frozen Yogurt\", type: \"Ice Cream\" },\n * { name: \"Ice cream sandwich\", type: \"Ice Cream\" },\n * { name: \"Eclair\", type: \"Pastry\" },\n * // ...other content\n * ] as const;\n *\n * function Example(): ReactElement {\n * const { getRadioProps } = useRadioGroup({\n * name: \"selected\",\n * });\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCell header={false} />\n * <TableCell>Name</TableCell>\n * <TableCell>Type</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * {rows.map(({ name, type }) => {\n * const radioProps = getRadioProps(name);\n * const { checked, onChange } = radioProps;\n *\n * return (\n * <TableRow\n * key={name}\n * onClick={onChange}\n * clickable\n * selected={checked}\n * >\n * <TableRadio {...radioProps} />\n * <TableCell>{name}</TableCell>\n * <TableCell hAlign=\"right\">{type}</TableCell>\n * </TableRow>\n * );\n * })}\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport const TableRadio = forwardRef<HTMLTableCellElement, TableRadioProps>(\n function TableRadio(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = !ariaLabelledBy ? \"Select Row\" : undefined,\n \"aria-controls\": ariaControls,\n name,\n icon,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n value,\n checked,\n onChange,\n defaultChecked,\n radioProps,\n onClick = noop,\n error,\n required,\n onInvalid,\n ...remaining\n } = props;\n\n return (\n <TableCell\n {...remaining}\n ref={ref}\n header={false}\n inputToggle\n onClick={(event) => {\n event.stopPropagation();\n onClick(event);\n }}\n >\n <Radio\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-controls={ariaControls}\n name={name}\n icon={icon}\n iconProps={iconProps}\n iconStyle={iconStyle}\n iconClassName={iconClassName}\n checkedIcon={checkedIcon}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n error={error}\n required={required}\n onChange={onChange}\n onInvalid={onInvalid}\n {...radioProps}\n />\n </TableCell>\n );\n }\n);\n"],"names":["forwardRef","Radio","TableCell","noop","TableRadio","props","ref","ariaLabelledBy","ariaLabel","undefined","ariaControls","name","icon","iconProps","iconStyle","iconClassName","checkedIcon","value","checked","onChange","defaultChecked","radioProps","onClick","error","required","onInvalid","remaining","header","inputToggle","event","stopPropagation","aria-label","aria-labelledby","aria-controls"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA+B,QAAQ;AAE1D,SAASC,KAAK,QAAQ,mBAAmB;AAEzC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEC,GACD,OAAO,MAAMC,2BAAaJ,WACxB,SAASI,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAY,CAACD,iBAAiB,eAAeE,SAAS,EACpE,iBAAiBC,YAAY,EAC7BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC,UAAUnB,IAAI,EACdoB,KAAK,EACLC,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGrB;IAEJ,qBACE,KAACH;QACE,GAAGwB,SAAS;QACbpB,KAAKA;QACLqB,QAAQ;QACRC,WAAW;QACXN,SAAS,CAACO;YACRA,MAAMC,eAAe;YACrBR,QAAQO;QACV;kBAEA,cAAA,KAAC5B;YACC8B,cAAYvB;YACZwB,mBAAiBzB;YACjB0B,iBAAevB;YACfC,MAAMA;YACNC,MAAMA;YACNC,WAAWA;YACXC,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,OAAOA;YACPC,SAASA;YACTE,gBAAgBA;YAChBG,OAAOA;YACPC,UAAUA;YACVL,UAAUA;YACVM,WAAWA;YACV,GAAGJ,UAAU;;;AAItB,GACA"}
1
+ {"version":3,"sources":["../../src/table/TableRadio.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type TdHTMLAttributes } from \"react\";\nimport { type RadioProps } from \"../form/InputToggle.js\";\nimport { Radio } from \"../form/Radio.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { TableCell } from \"./TableCell.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableRadioTdHTMLAttributes = Omit<\n TdHTMLAttributes<HTMLTableCellElement>,\n \"aria-sort\" | \"scope\" | \"onChange\" | \"onInvalid\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type TableRadioSupportedRadioProps = Pick<\n RadioProps,\n | \"name\"\n | \"value\"\n | \"icon\"\n | \"iconStyle\"\n | \"iconClassName\"\n | \"iconProps\"\n | \"checkedIcon\"\n | \"checked\"\n | \"onChange\"\n | \"defaultChecked\"\n | \"error\"\n | \"required\"\n | \"onInvalid\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TableRadioProps\n extends TableRadioTdHTMLAttributes,\n TableRadioSupportedRadioProps {\n /**\n * @defaultValue `!props[\"aria-labelledby\"] ? \"Select Row\" : undefined`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `false` */\n sticky?: boolean;\n\n /**\n * This allows you to override any props for the checkbox that are not\n * configurable as top-level props.\n *\n * @example\n * Simple Example\n * ```tsx\n * checkboxProps={{\n * id: \"some-custom-id\",\n * ref: checkboxRef,\n * }}\n * ```\n *\n * @see {@link TableRadioSupportedRadioProps}\n * @remarks \\@since 6.0.0\n */\n radioProps?: PropsWithRef<RadioProps, HTMLInputElement>;\n}\n\n/**\n * **Client Component**\n * The `TableRadio` is used to render a `Radio` within a `TableCell` by applying\n * some minimal styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableRadio,\n * TableContainer,\n * TableHeader,\n * TableRow,\n * useRadioGroup,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * const rows = [\n * { name: \"Frozen Yogurt\", type: \"Ice Cream\" },\n * { name: \"Ice cream sandwich\", type: \"Ice Cream\" },\n * { name: \"Eclair\", type: \"Pastry\" },\n * // ...other content\n * ] as const;\n *\n * function Example(): ReactElement {\n * const { getRadioProps } = useRadioGroup({\n * name: \"selected\",\n * });\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCell header={false} />\n * <TableCell>Name</TableCell>\n * <TableCell>Type</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * {rows.map(({ name, type }) => {\n * const radioProps = getRadioProps(name);\n * const { checked, onChange } = radioProps;\n *\n * return (\n * <TableRow\n * key={name}\n * onClick={onChange}\n * clickable\n * selected={checked}\n * >\n * <TableRadio {...radioProps} />\n * <TableCell>{name}</TableCell>\n * <TableCell hAlign=\"right\">{type}</TableCell>\n * </TableRow>\n * );\n * })}\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport const TableRadio = forwardRef<HTMLTableCellElement, TableRadioProps>(\n function TableRadio(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = !ariaLabelledBy ? \"Select Row\" : undefined,\n \"aria-controls\": ariaControls,\n name,\n icon,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n value,\n checked,\n onChange,\n defaultChecked,\n radioProps,\n onClick = noop,\n error,\n required,\n onInvalid,\n ...remaining\n } = props;\n\n return (\n <TableCell\n {...remaining}\n ref={ref}\n header={false}\n inputToggle\n onClick={(event) => {\n event.stopPropagation();\n onClick(event);\n }}\n >\n <Radio\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-controls={ariaControls}\n name={name}\n icon={icon}\n iconProps={iconProps}\n iconStyle={iconStyle}\n iconClassName={iconClassName}\n checkedIcon={checkedIcon}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n error={error}\n required={required}\n onChange={onChange}\n onInvalid={onInvalid}\n {...radioProps}\n />\n </TableCell>\n );\n }\n);\n"],"names":["forwardRef","Radio","TableCell","noop","TableRadio","props","ref","ariaLabelledBy","ariaLabel","undefined","ariaControls","name","icon","iconProps","iconStyle","iconClassName","checkedIcon","value","checked","onChange","defaultChecked","radioProps","onClick","error","required","onInvalid","remaining","header","inputToggle","event","stopPropagation","aria-label","aria-labelledby","aria-controls"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAA+B,QAAQ;AAE1D,SAASC,KAAK,QAAQ,mBAAmB;AAEzC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEC,GACD,OAAO,MAAMC,2BAAaJ,WACxB,SAASI,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAY,CAACD,iBAAiB,eAAeE,SAAS,EACpE,iBAAiBC,YAAY,EAC7BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC,UAAUnB,IAAI,EACdoB,KAAK,EACLC,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGrB;IAEJ,qBACE,KAACH;QACE,GAAGwB,SAAS;QACbpB,KAAKA;QACLqB,QAAQ;QACRC,WAAW;QACXN,SAAS,CAACO;YACRA,MAAMC,eAAe;YACrBR,QAAQO;QACV;kBAEA,cAAA,KAAC5B;YACC8B,cAAYvB;YACZwB,mBAAiBzB;YACjB0B,iBAAevB;YACfC,MAAMA;YACNC,MAAMA;YACNC,WAAWA;YACXC,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,OAAOA;YACPC,SAASA;YACTE,gBAAgBA;YAChBG,OAAOA;YACPC,UAAUA;YACVL,UAAUA;YACVM,WAAWA;YACV,GAAGJ,UAAU;;;AAItB,GACA"}