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

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 (840) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/.turbo/turbo-lint.log +3 -3
  3. package/.turbo/turbo-test.log +142 -129
  4. package/.turbo/turbo-typecheck.log +1 -1
  5. package/CHANGELOG.md +111 -0
  6. package/coverage/clover.xml +437 -3
  7. package/coverage/coverage-final.json +4 -1
  8. package/coverage/lcov-report/Avatar.tsx.html +472 -0
  9. package/coverage/lcov-report/DefaultToastRenderer.tsx.html +166 -112
  10. package/coverage/lcov-report/IconRotator.tsx.html +322 -0
  11. package/coverage/lcov-report/ListItem.tsx.html +892 -0
  12. package/coverage/lcov-report/Portal.tsx.html +223 -0
  13. package/coverage/lcov-report/PortalContainerProvider.tsx.html +367 -0
  14. package/coverage/lcov-report/SkeletonPlaceholder.tsx.html +613 -0
  15. package/coverage/lcov-report/Snackbar.tsx.html +360 -402
  16. package/coverage/lcov-report/Tab.tsx.html +261 -147
  17. package/coverage/lcov-report/Toast.tsx.html +868 -0
  18. package/coverage/lcov-report/ToastManager.tsx.html +1783 -0
  19. package/coverage/lcov-report/ToastManagerProvider.tsx.html +216 -216
  20. package/coverage/lcov-report/TreeGroup.tsx.html +313 -0
  21. package/coverage/lcov-report/app-bar/AppBar.tsx.html +178 -28
  22. package/coverage/lcov-report/app-bar/index.html +7 -7
  23. package/coverage/lcov-report/button/TooltippedButton.tsx.html +445 -0
  24. package/coverage/lcov-report/button/index.html +10 -10
  25. package/coverage/lcov-report/card/Card.tsx.html +349 -0
  26. package/coverage/lcov-report/card/CardContent.tsx.html +223 -0
  27. package/coverage/lcov-report/card/ClickableCard.tsx.html +400 -0
  28. package/coverage/lcov-report/card/index.html +21 -21
  29. package/coverage/lcov-report/card/styles.ts.html +428 -392
  30. package/coverage/lcov-report/cssUtils.ts.html +86 -59
  31. package/coverage/lcov-report/draggable/index.html +21 -36
  32. package/coverage/lcov-report/draggable/useDraggable.ts.html +377 -368
  33. package/coverage/lcov-report/draggable/utils.ts.html +96 -195
  34. package/coverage/lcov-report/expansion-panel/ExpansionList.tsx.html +211 -0
  35. package/coverage/lcov-report/expansion-panel/ExpansionPanel.tsx.html +12 -15
  36. package/coverage/lcov-report/expansion-panel/index.html +34 -19
  37. package/coverage/lcov-report/expansion-panel/useExpansionPanels.ts.html +928 -0
  38. package/coverage/lcov-report/form/MenuItemInputToggle.tsx.html +2 -2
  39. package/coverage/lcov-report/form/Select.tsx.html +1663 -0
  40. package/coverage/lcov-report/form/Slider.tsx.html +163 -40
  41. package/coverage/lcov-report/form/index.html +21 -21
  42. package/coverage/lcov-report/icon/FontIcon.tsx.html +28 -28
  43. package/coverage/lcov-report/icon/index.html +1 -1
  44. package/coverage/lcov-report/index.html +41 -11
  45. package/coverage/lcov-report/interaction/UserInteractionModeProvider.tsx.html +679 -0
  46. package/coverage/lcov-report/interaction/config.ts.html +181 -0
  47. package/coverage/lcov-report/interaction/index.html +33 -18
  48. package/coverage/lcov-report/list/List.tsx.html +490 -0
  49. package/coverage/lcov-report/list/ListItem.tsx.html +886 -0
  50. package/coverage/lcov-report/list/ListItemAddon.tsx.html +286 -0
  51. package/coverage/lcov-report/list/ListItemChildren.tsx.html +445 -0
  52. package/coverage/lcov-report/list/ListItemLink.tsx.html +5 -5
  53. package/coverage/lcov-report/list/index.html +81 -6
  54. package/coverage/lcov-report/list/listItemStyles.ts.html +703 -0
  55. package/coverage/lcov-report/media-queries/appSize.ts.html +1 -1
  56. package/coverage/lcov-report/media-queries/index.html +1 -1
  57. package/coverage/lcov-report/menu/Menu.tsx.html +37 -19
  58. package/coverage/lcov-report/menu/index.html +14 -44
  59. package/coverage/lcov-report/sheet/index.html +8 -8
  60. package/coverage/lcov-report/sheet/styles.ts.html +376 -0
  61. package/coverage/lcov-report/skeletonPlaceholderUtils.ts.html +400 -0
  62. package/coverage/lcov-report/snackbar/Snackbar.tsx.html +55 -97
  63. package/coverage/lcov-report/snackbar/Toast.tsx.html +546 -501
  64. package/coverage/lcov-report/snackbar/ToastManager.tsx.html +269 -269
  65. package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +23 -23
  66. package/coverage/lcov-report/snackbar/index.html +59 -14
  67. package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +12 -87
  68. package/coverage/lcov-report/snackbar/toastStyles.ts.html +206 -146
  69. package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +226 -0
  70. package/coverage/lcov-report/snackbarStyles.ts.html +46 -121
  71. package/coverage/lcov-report/src/CoreProviders.tsx.html +20 -20
  72. package/coverage/lcov-report/src/NoSsr.tsx.html +1 -1
  73. package/coverage/lcov-report/src/SsrProvider.tsx.html +10 -10
  74. package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +143 -23
  75. package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +1 -1
  76. package/coverage/lcov-report/src/app-bar/index.html +5 -5
  77. package/coverage/lcov-report/src/avatar/Avatar.tsx.html +2 -2
  78. package/coverage/lcov-report/src/avatar/index.html +1 -1
  79. package/coverage/lcov-report/src/avatar/styles.ts.html +1 -1
  80. package/coverage/lcov-report/src/badge/Badge.tsx.html +1 -1
  81. package/coverage/lcov-report/src/badge/index.html +1 -1
  82. package/coverage/lcov-report/src/box/Box.tsx.html +1 -1
  83. package/coverage/lcov-report/src/box/index.html +23 -8
  84. package/coverage/lcov-report/src/box/styles.ts.html +46 -46
  85. package/coverage/lcov-report/src/button/AsyncButton.tsx.html +1 -1
  86. package/coverage/lcov-report/src/button/Button.tsx.html +84 -84
  87. package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +1 -1
  88. package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +11 -11
  89. package/coverage/lcov-report/src/button/TooltippedButton.tsx.html +445 -0
  90. package/coverage/lcov-report/src/button/buttonStyles.ts.html +52 -52
  91. package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +1 -1
  92. package/coverage/lcov-report/src/button/index.html +83 -8
  93. package/coverage/lcov-report/src/card/Card.tsx.html +37 -31
  94. package/coverage/lcov-report/src/card/CardContent.tsx.html +4 -4
  95. package/coverage/lcov-report/src/card/CardFooter.tsx.html +1 -1
  96. package/coverage/lcov-report/src/card/CardHeader.tsx.html +1 -1
  97. package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +1 -1
  98. package/coverage/lcov-report/src/card/CardTitle.tsx.html +1 -1
  99. package/coverage/lcov-report/src/card/ClickableCard.tsx.html +400 -0
  100. package/coverage/lcov-report/src/card/index.html +24 -9
  101. package/coverage/lcov-report/src/card/styles.ts.html +58 -31
  102. package/coverage/lcov-report/src/chip/Chip.tsx.html +1 -1
  103. package/coverage/lcov-report/src/chip/index.html +7 -7
  104. package/coverage/lcov-report/src/chip/styles.ts.html +9 -12
  105. package/coverage/lcov-report/src/cssUtils.ts.html +53 -53
  106. package/coverage/lcov-report/src/delegateEvent.ts.html +109 -109
  107. package/coverage/lcov-report/src/dialog/Dialog.tsx.html +1 -1
  108. package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +1 -1
  109. package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +1 -1
  110. package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +1 -1
  111. package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +1 -1
  112. package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +1 -1
  113. package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +1 -1
  114. package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +1 -1
  115. package/coverage/lcov-report/src/dialog/index.html +129 -9
  116. package/coverage/lcov-report/src/dialog/styles.ts.html +1 -1
  117. package/coverage/lcov-report/src/divider/Divider.tsx.html +4 -7
  118. package/coverage/lcov-report/src/divider/index.html +5 -5
  119. package/coverage/lcov-report/src/divider/styles.ts.html +1 -1
  120. package/coverage/lcov-report/src/draggable/index.html +27 -27
  121. package/coverage/lcov-report/src/draggable/useDraggable.ts.html +47 -44
  122. package/coverage/lcov-report/src/draggable/utils.ts.html +29 -131
  123. package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +1 -1
  124. package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +1 -1
  125. package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +1 -1
  126. package/coverage/lcov-report/src/expansion-panel/index.html +8 -8
  127. package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +1 -1
  128. package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +36 -24
  129. package/coverage/lcov-report/src/focus/index.html +1 -1
  130. package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +1 -1
  131. package/coverage/lcov-report/src/focus/utils.ts.html +1 -1
  132. package/coverage/lcov-report/src/form/Checkbox.tsx.html +1 -1
  133. package/coverage/lcov-report/src/form/Fieldset.tsx.html +1 -1
  134. package/coverage/lcov-report/src/form/FileInput.tsx.html +1 -1
  135. package/coverage/lcov-report/src/form/Form.tsx.html +1 -1
  136. package/coverage/lcov-report/src/form/FormMessage.tsx.html +1 -1
  137. package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +5 -5
  138. package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +1 -1
  139. package/coverage/lcov-report/src/form/InputToggle.tsx.html +110 -110
  140. package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +63 -63
  141. package/coverage/lcov-report/src/form/Label.tsx.html +98 -98
  142. package/coverage/lcov-report/src/form/Legend.tsx.html +1 -1
  143. package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +1 -1
  144. package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +1 -1
  145. package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +2 -2
  146. package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +1 -1
  147. package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +1 -1
  148. package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +1 -1
  149. package/coverage/lcov-report/src/form/NativeSelect.tsx.html +1 -1
  150. package/coverage/lcov-report/src/form/OptGroup.tsx.html +1 -1
  151. package/coverage/lcov-report/src/form/Option.tsx.html +1 -1
  152. package/coverage/lcov-report/src/form/Password.tsx.html +1 -1
  153. package/coverage/lcov-report/src/form/Radio.tsx.html +3 -3
  154. package/coverage/lcov-report/src/form/Select.tsx.html +29 -5
  155. package/coverage/lcov-report/src/form/SelectValue.tsx.html +1 -1
  156. package/coverage/lcov-report/src/form/Slider.tsx.html +1 -1
  157. package/coverage/lcov-report/src/form/SliderContainer.tsx.html +1 -1
  158. package/coverage/lcov-report/src/form/SliderMark.tsx.html +1 -1
  159. package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +1 -1
  160. package/coverage/lcov-report/src/form/SliderThumb.tsx.html +1 -1
  161. package/coverage/lcov-report/src/form/SliderTrack.tsx.html +1 -1
  162. package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +1 -1
  163. package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +1 -1
  164. package/coverage/lcov-report/src/form/Switch.tsx.html +1 -1
  165. package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +1 -1
  166. package/coverage/lcov-report/src/form/TextArea.tsx.html +2 -2
  167. package/coverage/lcov-report/src/form/TextField.tsx.html +1 -1
  168. package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +1 -1
  169. package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +1 -1
  170. package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +8 -8
  171. package/coverage/lcov-report/src/form/fileUtils.ts.html +1 -1
  172. package/coverage/lcov-report/src/form/formConfig.ts.html +1 -1
  173. package/coverage/lcov-report/src/form/formMessageStyles.ts.html +1 -1
  174. package/coverage/lcov-report/src/form/index.html +940 -10
  175. package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +30 -30
  176. package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +1 -1
  177. package/coverage/lcov-report/src/form/optionStyles.ts.html +1 -1
  178. package/coverage/lcov-report/src/form/passwordStyles.ts.html +1 -1
  179. package/coverage/lcov-report/src/form/selectStyles.ts.html +1 -1
  180. package/coverage/lcov-report/src/form/selectUtils.ts.html +1 -1
  181. package/coverage/lcov-report/src/form/sliderUtils.ts.html +1 -1
  182. package/coverage/lcov-report/src/form/switchStyles.ts.html +1 -1
  183. package/coverage/lcov-report/src/form/textAreaStyles.ts.html +3 -3
  184. package/coverage/lcov-report/src/form/textFieldStyles.ts.html +1 -1
  185. package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +1 -1
  186. package/coverage/lcov-report/src/form/useFileUpload.ts.html +1 -1
  187. package/coverage/lcov-report/src/form/useListboxProvider.ts.html +1 -1
  188. package/coverage/lcov-report/src/form/useNumberField.ts.html +1 -1
  189. package/coverage/lcov-report/src/form/useRadioGroup.ts.html +47 -47
  190. package/coverage/lcov-report/src/form/useRangeSlider.ts.html +1 -1
  191. package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +1 -1
  192. package/coverage/lcov-report/src/form/useSlider.ts.html +1 -1
  193. package/coverage/lcov-report/src/form/useTextField.ts.html +1 -1
  194. package/coverage/lcov-report/src/form/utils.ts.html +1 -1
  195. package/coverage/lcov-report/src/form/validation.ts.html +1 -1
  196. package/coverage/lcov-report/src/hoverMode/index.html +1 -1
  197. package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +98 -98
  198. package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +19 -19
  199. package/coverage/lcov-report/src/icon/FontIcon.tsx.html +28 -28
  200. package/coverage/lcov-report/src/icon/IconRotator.tsx.html +5 -8
  201. package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +1 -1
  202. package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +1 -1
  203. package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +1 -1
  204. package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +1 -1
  205. package/coverage/lcov-report/src/icon/iconConfig.tsx.html +8 -8
  206. package/coverage/lcov-report/src/icon/index.html +7 -7
  207. package/coverage/lcov-report/src/icon/material.ts.html +1 -1
  208. package/coverage/lcov-report/src/icon/materialConfig.ts.html +1 -1
  209. package/coverage/lcov-report/src/icon/styles.ts.html +38 -38
  210. package/coverage/lcov-report/src/index.html +354 -9
  211. package/coverage/lcov-report/src/interaction/Ripple.tsx.html +1 -1
  212. package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +1 -1
  213. package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +87 -87
  214. package/coverage/lcov-report/src/interaction/config.ts.html +7 -7
  215. package/coverage/lcov-report/src/interaction/index.html +1 -1
  216. package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +123 -123
  217. package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +17 -17
  218. package/coverage/lcov-report/src/interaction/utils.ts.html +1 -1
  219. package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +1 -1
  220. package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +60 -60
  221. package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +1 -1
  222. package/coverage/lcov-report/src/layout/Main.tsx.html +1 -1
  223. package/coverage/lcov-report/src/layout/index.html +15 -15
  224. package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +5 -5
  225. package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +1 -1
  226. package/coverage/lcov-report/src/layout/mainStyles.ts.html +1 -1
  227. package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +1 -1
  228. package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +1 -1
  229. package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +20 -32
  230. package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +1 -1
  231. package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +1 -1
  232. package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +1 -1
  233. package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +1 -1
  234. package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +1 -1
  235. package/coverage/lcov-report/src/link/Link.tsx.html +1 -1
  236. package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +1 -1
  237. package/coverage/lcov-report/src/link/index.html +1 -1
  238. package/coverage/lcov-report/src/link/styles.ts.html +1 -1
  239. package/coverage/lcov-report/src/list/List.tsx.html +30 -30
  240. package/coverage/lcov-report/src/list/ListItem.tsx.html +37 -16
  241. package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +13 -7
  242. package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +12 -6
  243. package/coverage/lcov-report/src/list/ListItemLink.tsx.html +4 -4
  244. package/coverage/lcov-report/src/list/ListItemText.tsx.html +1 -1
  245. package/coverage/lcov-report/src/list/ListSubheader.tsx.html +1 -1
  246. package/coverage/lcov-report/src/list/getListItemHeight.ts.html +1 -1
  247. package/coverage/lcov-report/src/list/index.html +11 -11
  248. package/coverage/lcov-report/src/list/listItemStyles.ts.html +39 -9
  249. package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +54 -54
  250. package/coverage/lcov-report/src/media-queries/appSize.ts.html +1 -1
  251. package/coverage/lcov-report/src/media-queries/index.html +1 -1
  252. package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +25 -25
  253. package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +1 -1
  254. package/coverage/lcov-report/src/menu/Menu.tsx.html +2 -2
  255. package/coverage/lcov-report/src/menu/MenuBar.tsx.html +1 -1
  256. package/coverage/lcov-report/src/menu/MenuButton.tsx.html +1 -1
  257. package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +1 -1
  258. package/coverage/lcov-report/src/menu/MenuItem.tsx.html +1 -1
  259. package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +1 -1
  260. package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +1 -1
  261. package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +1 -1
  262. package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +1 -1
  263. package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +1 -1
  264. package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +1 -1
  265. package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +1 -1
  266. package/coverage/lcov-report/src/menu/index.html +1 -1
  267. package/coverage/lcov-report/src/menu/useContextMenu.ts.html +1 -1
  268. package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +1 -1
  269. package/coverage/lcov-report/src/menu/utils.ts.html +1 -1
  270. package/coverage/lcov-report/src/movement/constants.ts.html +1 -1
  271. package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +1 -1
  272. package/coverage/lcov-report/src/movement/index.html +1 -1
  273. package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +3 -3
  274. package/coverage/lcov-report/src/movement/utils.ts.html +1 -1
  275. package/coverage/lcov-report/src/overlay/Overlay.tsx.html +1 -1
  276. package/coverage/lcov-report/src/overlay/index.html +1 -1
  277. package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +1 -1
  278. package/coverage/lcov-report/src/portal/Portal.tsx.html +7 -7
  279. package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +59 -35
  280. package/coverage/lcov-report/src/portal/index.html +7 -7
  281. package/coverage/lcov-report/src/positioning/constants.ts.html +1 -1
  282. package/coverage/lcov-report/src/positioning/createHorizontalPosition.ts.html +47 -47
  283. package/coverage/lcov-report/src/positioning/createVerticalPosition.ts.html +55 -55
  284. package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +89 -89
  285. package/coverage/lcov-report/src/positioning/index.html +1 -1
  286. package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +193 -193
  287. package/coverage/lcov-report/src/positioning/utils.ts.html +59 -59
  288. package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +3 -3
  289. package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +3 -3
  290. package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +1 -1
  291. package/coverage/lcov-report/src/progress/index.html +20 -5
  292. package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +1 -1
  293. package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +1 -1
  294. package/coverage/lcov-report/src/responsive-item/index.html +1 -1
  295. package/coverage/lcov-report/src/responsive-item/styles.ts.html +1 -1
  296. package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +1 -1
  297. package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +1 -1
  298. package/coverage/lcov-report/src/scroll/index.html +1 -1
  299. package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +1 -1
  300. package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +1 -1
  301. package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +1 -1
  302. package/coverage/lcov-report/src/segmented-button/index.html +1 -1
  303. package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +1 -1
  304. package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +1 -1
  305. package/coverage/lcov-report/src/sheet/Sheet.tsx.html +1 -1
  306. package/coverage/lcov-report/src/sheet/index.html +5 -5
  307. package/coverage/lcov-report/src/sheet/styles.ts.html +45 -48
  308. package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +80 -80
  309. package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +21 -45
  310. package/coverage/lcov-report/src/snackbar/Toast.tsx.html +108 -93
  311. package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +1 -1
  312. package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +1 -1
  313. package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +48 -48
  314. package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +278 -275
  315. package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +6 -6
  316. package/coverage/lcov-report/src/snackbar/index.html +19 -19
  317. package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +15 -15
  318. package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +14 -14
  319. package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +27 -27
  320. package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +1 -1
  321. package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +1 -1
  322. package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +1 -1
  323. package/coverage/lcov-report/src/suspense/index.html +20 -5
  324. package/coverage/lcov-report/src/table/Table.tsx.html +45 -114
  325. package/coverage/lcov-report/src/table/TableBody.tsx.html +43 -43
  326. package/coverage/lcov-report/src/table/TableCell.tsx.html +109 -298
  327. package/coverage/lcov-report/src/table/TableCellContent.tsx.html +81 -27
  328. package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +16 -10
  329. package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +20 -20
  330. package/coverage/lcov-report/src/table/TableContainer.tsx.html +7 -28
  331. package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +1 -1
  332. package/coverage/lcov-report/src/table/TableFooter.tsx.html +64 -43
  333. package/coverage/lcov-report/src/table/TableHeader.tsx.html +41 -92
  334. package/coverage/lcov-report/src/table/TableRadio.tsx.html +676 -0
  335. package/coverage/lcov-report/src/table/TableRow.tsx.html +38 -119
  336. package/coverage/lcov-report/src/table/index.html +151 -46
  337. package/coverage/lcov-report/src/table/tableCellStyles.ts.html +334 -0
  338. package/coverage/lcov-report/src/table/tableContainerStyles.ts.html +142 -0
  339. package/coverage/lcov-report/src/table/tableFooterStyles.ts.html +166 -0
  340. package/coverage/lcov-report/src/table/tableHeaderStyles.ts.html +172 -0
  341. package/coverage/lcov-report/src/table/tableRowStyles.ts.html +169 -0
  342. package/coverage/lcov-report/src/table/tableStyles.ts.html +157 -0
  343. package/coverage/lcov-report/src/tabs/Tab.tsx.html +263 -143
  344. package/coverage/lcov-report/src/tabs/TabList.tsx.html +1 -1
  345. package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +1 -1
  346. package/coverage/lcov-report/src/tabs/index.html +25 -25
  347. package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +37 -7
  348. package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +1 -1
  349. package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +2 -2
  350. package/coverage/lcov-report/src/tabs/tabStyles.ts.html +64 -28
  351. package/coverage/lcov-report/src/tabs/useTabList.ts.html +44 -38
  352. package/coverage/lcov-report/src/tabs/useTabs.ts.html +1 -1
  353. package/coverage/lcov-report/src/tabs/utils.ts.html +3 -3
  354. package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +1 -1
  355. package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +205 -205
  356. package/coverage/lcov-report/src/test-utils/data-testid.ts.html +1 -1
  357. package/coverage/lcov-report/src/test-utils/drag.ts.html +1 -1
  358. package/coverage/lcov-report/src/test-utils/index.html +4 -4
  359. package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +9 -9
  360. package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +4 -4
  361. package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +4 -4
  362. package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +3 -3
  363. package/coverage/lcov-report/src/test-utils/polyfills/index.html +1 -1
  364. package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +6 -6
  365. package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +14 -14
  366. package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +5 -5
  367. package/coverage/lcov-report/src/test-utils/render.tsx.html +21 -21
  368. package/coverage/lcov-report/src/test-utils/timers.ts.html +1 -1
  369. package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +1 -1
  370. package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +1 -1
  371. package/coverage/lcov-report/src/theme/colors.ts.html +1 -1
  372. package/coverage/lcov-report/src/theme/cssVars.ts.html +1 -1
  373. package/coverage/lcov-report/src/theme/index.html +1 -1
  374. package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +25 -25
  375. package/coverage/lcov-report/src/theme/useColorScheme.ts.html +1 -1
  376. package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +1 -1
  377. package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +1 -1
  378. package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +1 -1
  379. package/coverage/lcov-report/src/theme/utils.ts.html +1 -1
  380. package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +62 -62
  381. package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +3 -3
  382. package/coverage/lcov-report/src/tooltip/constants.ts.html +1 -1
  383. package/coverage/lcov-report/src/tooltip/index.html +9 -9
  384. package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +12 -12
  385. package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +243 -222
  386. package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +27 -27
  387. package/coverage/lcov-report/src/tooltip/utils.ts.html +22 -22
  388. package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +1 -1
  389. package/coverage/lcov-report/src/transition/Collapse.tsx.html +1 -1
  390. package/coverage/lcov-report/src/transition/CrossFade.tsx.html +1 -1
  391. package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +1 -1
  392. package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +374 -338
  393. package/coverage/lcov-report/src/transition/Slide.tsx.html +1 -1
  394. package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +1 -1
  395. package/coverage/lcov-report/src/transition/collapseStyles.ts.html +13 -13
  396. package/coverage/lcov-report/src/transition/config.ts.html +5 -5
  397. package/coverage/lcov-report/src/transition/index.html +47 -32
  398. package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +1 -1
  399. package/coverage/lcov-report/src/transition/skeletonPlaceholderUtils.ts.html +400 -0
  400. package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +68 -68
  401. package/coverage/lcov-report/src/transition/useCarousel.ts.html +1 -1
  402. package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +87 -87
  403. package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +1 -1
  404. package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +1 -1
  405. package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +18 -18
  406. package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +607 -562
  407. package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +1 -1
  408. package/coverage/lcov-report/src/transition/useTransition.ts.html +237 -237
  409. package/coverage/lcov-report/src/transition/utils.ts.html +43 -43
  410. package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +18 -6
  411. package/coverage/lcov-report/src/tree/Tree.tsx.html +20 -8
  412. package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +45 -45
  413. package/coverage/lcov-report/src/tree/TreeItem.tsx.html +7 -10
  414. package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +1 -1
  415. package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +8 -8
  416. package/coverage/lcov-report/src/tree/index.html +11 -11
  417. package/coverage/lcov-report/src/tree/styles.ts.html +8 -35
  418. package/coverage/lcov-report/src/tree/useTree.ts.html +1 -1
  419. package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +1 -1
  420. package/coverage/lcov-report/src/tree/useTreeItems.ts.html +1 -1
  421. package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +1 -1
  422. package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +1 -1
  423. package/coverage/lcov-report/src/tree/utils.ts.html +1 -1
  424. package/coverage/lcov-report/src/typography/SrOnly.tsx.html +1 -1
  425. package/coverage/lcov-report/src/typography/TextContainer.tsx.html +1 -1
  426. package/coverage/lcov-report/src/typography/Typography.tsx.html +1 -1
  427. package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +1 -1
  428. package/coverage/lcov-report/src/typography/index.html +1 -1
  429. package/coverage/lcov-report/src/useAsyncAction.ts.html +1 -1
  430. package/coverage/lcov-report/src/useDebouncedFunction.ts.html +1 -1
  431. package/coverage/lcov-report/src/useDropzone.ts.html +1 -1
  432. package/coverage/lcov-report/src/useElementSize.ts.html +334 -0
  433. package/coverage/lcov-report/src/useEnsuredId.ts.html +8 -8
  434. package/coverage/lcov-report/src/useEnsuredRef.ts.html +14 -14
  435. package/coverage/lcov-report/src/useEnsuredState.ts.html +1 -1
  436. package/coverage/lcov-report/src/useHtmlClassName.ts.html +1 -1
  437. package/coverage/lcov-report/src/useIntersectionObserver.ts.html +1 -1
  438. package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +1 -1
  439. package/coverage/lcov-report/src/useLocalStorage.ts.html +1 -1
  440. package/coverage/lcov-report/src/useOrientation.ts.html +32 -32
  441. package/coverage/lcov-report/src/usePageInactive.ts.html +30 -30
  442. package/coverage/lcov-report/src/useResizeListener.ts.html +38 -32
  443. package/coverage/lcov-report/src/useResizeObserver.ts.html +68 -179
  444. package/coverage/lcov-report/src/useThrottledFunction.ts.html +1 -1
  445. package/coverage/lcov-report/src/useToggle.ts.html +1 -1
  446. package/coverage/lcov-report/src/useUnmounted.ts.html +1 -1
  447. package/coverage/lcov-report/src/useWindowSize.ts.html +124 -94
  448. package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +1 -1
  449. package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +1 -1
  450. package/coverage/lcov-report/src/utils/applyRef.ts.html +11 -11
  451. package/coverage/lcov-report/src/utils/bem.ts.html +45 -45
  452. package/coverage/lcov-report/src/utils/filters.ts.html +1 -1
  453. package/coverage/lcov-report/src/utils/getClientPosition.ts.html +1 -1
  454. package/coverage/lcov-report/src/utils/getMiddleOfRange.ts.html +163 -0
  455. package/coverage/lcov-report/src/utils/getPercentage.ts.html +9 -9
  456. package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +66 -87
  457. package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +7 -7
  458. package/coverage/lcov-report/src/utils/identity.ts.html +1 -1
  459. package/coverage/lcov-report/src/utils/index.html +46 -31
  460. package/coverage/lcov-report/src/utils/isElementVisible.ts.html +1 -1
  461. package/coverage/lcov-report/src/utils/isValidNumber.ts.html +118 -0
  462. package/coverage/lcov-report/src/utils/loop.ts.html +1 -1
  463. package/coverage/lcov-report/src/utils/nearest.ts.html +21 -21
  464. package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +18 -18
  465. package/coverage/lcov-report/src/utils/randomInt.ts.html +52 -52
  466. package/coverage/lcov-report/src/utils/wait.ts.html +1 -1
  467. package/coverage/lcov-report/src/utils/withinRange.ts.html +1 -1
  468. package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +1 -1
  469. package/coverage/lcov-report/src/window-splitter/index.html +14 -14
  470. package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +19 -67
  471. package/coverage/lcov-report/src/window-splitter/useWindowSplitterMaxValue.ts.html +256 -0
  472. package/coverage/lcov-report/suspense/CircularProgressSuspense.tsx.html +283 -0
  473. package/coverage/lcov-report/suspense/NullSuspense.tsx.html +202 -0
  474. package/coverage/lcov-report/suspense/index.html +131 -0
  475. package/coverage/lcov-report/tabIndicatorStyles.ts.html +43 -13
  476. package/coverage/lcov-report/tabListStyles.ts.html +35 -26
  477. package/coverage/lcov-report/tabStyles.ts.html +68 -26
  478. package/coverage/lcov-report/tabs/Tab.tsx.html +233 -143
  479. package/coverage/lcov-report/tabs/TabList.tsx.html +85 -85
  480. package/coverage/lcov-report/tabs/index.html +56 -11
  481. package/coverage/lcov-report/tabs/tabIndicatorStyles.ts.html +187 -0
  482. package/coverage/lcov-report/tabs/tabListStyles.ts.html +241 -0
  483. package/coverage/lcov-report/tabs/tabStyles.ts.html +253 -0
  484. package/coverage/lcov-report/tabs/useTabList.ts.html +736 -0
  485. package/coverage/lcov-report/tabs/useTabs.ts.html +1 -1
  486. package/coverage/lcov-report/tabs/utils.ts.html +1 -1
  487. package/coverage/lcov-report/test-utils/index.html +21 -21
  488. package/coverage/lcov-report/test-utils/use.ts.html +187 -0
  489. package/coverage/lcov-report/tooltip/Tooltip.tsx.html +62 -62
  490. package/coverage/lcov-report/tooltip/index.html +10 -70
  491. package/coverage/lcov-report/tooltip/useTooltip.ts.html +243 -222
  492. package/coverage/lcov-report/transition/SkeletonPlaceholder.tsx.html +595 -0
  493. package/coverage/lcov-report/transition/config.ts.html +5 -5
  494. package/coverage/lcov-report/transition/index.html +1 -1
  495. package/coverage/lcov-report/transition/skeletonPlaceholderUtils.ts.html +400 -0
  496. package/coverage/lcov-report/transition/useSkeletonPlaceholder.ts.html +952 -0
  497. package/coverage/lcov-report/tree/TreeItem.tsx.html +7 -10
  498. package/coverage/lcov-report/tree/index.html +12 -27
  499. package/coverage/lcov-report/tree/styles.ts.html +538 -0
  500. package/coverage/lcov-report/typography/Typography.tsx.html +138 -432
  501. package/coverage/lcov-report/typography/WritingDirectionProvider.tsx.html +75 -75
  502. package/coverage/lcov-report/typography/index.html +18 -18
  503. package/coverage/lcov-report/useSkeletonPlaceholder.ts.html +952 -0
  504. package/coverage/lcov-report/useTabList.ts.html +142 -136
  505. package/coverage/lcov-report/useWindowSplitter.ts.html +640 -0
  506. package/coverage/lcov-report/useWindowSplitterMaxValue.ts.html +256 -0
  507. package/coverage/lcov-report/utils/index.html +16 -31
  508. package/coverage/lcov-report/utils/isElementVisible.ts.html +14 -14
  509. package/coverage/lcov-report/utils/randomInt.ts.html +148 -0
  510. package/coverage/lcov-report/utils/wait.ts.html +1 -1
  511. package/coverage/lcov-report/window-splitter/index.html +21 -36
  512. package/coverage/lcov-report/window-splitter/useWindowSplitter.ts.html +406 -328
  513. package/coverage/lcov.info +474 -0
  514. package/dist/_box-shadows.scss +12 -2
  515. package/dist/_core.scss +34 -3
  516. package/dist/_utils.scss +79 -0
  517. package/dist/app-bar/AppBar.d.ts +4 -9
  518. package/dist/app-bar/AppBar.js +29 -7
  519. package/dist/app-bar/AppBar.js.map +1 -1
  520. package/dist/app-bar/_app-bar.scss +22 -32
  521. package/dist/avatar/Avatar.d.ts +1 -1
  522. package/dist/avatar/Avatar.js.map +1 -1
  523. package/dist/avatar/_avatar.scss +25 -34
  524. package/dist/badge/_badge.scss +80 -48
  525. package/dist/box/_box.scss +18 -29
  526. package/dist/button/TooltippedButton.d.ts +62 -0
  527. package/dist/button/TooltippedButton.js +62 -0
  528. package/dist/button/TooltippedButton.js.map +1 -0
  529. package/dist/button/_button.scss +50 -62
  530. package/dist/card/Card.js +3 -2
  531. package/dist/card/Card.js.map +1 -1
  532. package/dist/card/CardContent.js +1 -1
  533. package/dist/card/CardContent.js.map +1 -1
  534. package/dist/card/ClickableCard.d.ts +42 -0
  535. package/dist/card/ClickableCard.js +73 -0
  536. package/dist/card/ClickableCard.js.map +1 -0
  537. package/dist/card/_card.scss +29 -32
  538. package/dist/card/styles.d.ts +8 -0
  539. package/dist/card/styles.js +6 -3
  540. package/dist/card/styles.js.map +1 -1
  541. package/dist/chip/_chip.scss +33 -46
  542. package/dist/dialog/_dialog.scss +118 -103
  543. package/dist/divider/Divider.d.ts +0 -1
  544. package/dist/divider/Divider.js.map +1 -1
  545. package/dist/divider/_divider.scss +40 -51
  546. package/dist/draggable/useDraggable.d.ts +12 -23
  547. package/dist/draggable/useDraggable.js +15 -6
  548. package/dist/draggable/useDraggable.js.map +1 -1
  549. package/dist/draggable/utils.d.ts +4 -17
  550. package/dist/draggable/utils.js +9 -25
  551. package/dist/draggable/utils.js.map +1 -1
  552. package/dist/expansion-panel/_expansion-panel.scss +25 -16
  553. package/dist/expansion-panel/useExpansionPanels.d.ts +5 -3
  554. package/dist/expansion-panel/useExpansionPanels.js +16 -9
  555. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  556. package/dist/form/Label.d.ts +5 -5
  557. package/dist/form/Label.js.map +1 -1
  558. package/dist/form/MenuItemInputToggle.d.ts +1 -1
  559. package/dist/form/MenuItemInputToggle.js.map +1 -1
  560. package/dist/form/Select.js +6 -1
  561. package/dist/form/Select.js.map +1 -1
  562. package/dist/form/TextArea.js +1 -1
  563. package/dist/form/TextArea.js.map +1 -1
  564. package/dist/form/TextFieldContainerStyles.d.ts +7 -7
  565. package/dist/form/TextFieldContainerStyles.js.map +1 -1
  566. package/dist/form/_form.scss +240 -225
  567. package/dist/form/textAreaStyles.d.ts +2 -2
  568. package/dist/form/textAreaStyles.js.map +1 -1
  569. package/dist/form/types.d.ts +0 -2
  570. package/dist/form/types.js.map +1 -1
  571. package/dist/icon/IconRotator.js +2 -3
  572. package/dist/icon/IconRotator.js.map +1 -1
  573. package/dist/icon/_icon.scss +38 -49
  574. package/dist/index.d.ts +5 -0
  575. package/dist/index.js +5 -0
  576. package/dist/index.js.map +1 -1
  577. package/dist/interaction/_interaction.scss +59 -66
  578. package/dist/layout/_layout.scss +14 -19
  579. package/dist/layout/useLayoutAppBarHeight.js +5 -9
  580. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  581. package/dist/link/_link.scss +41 -35
  582. package/dist/list/ListItem.d.ts +8 -3
  583. package/dist/list/ListItem.js +4 -3
  584. package/dist/list/ListItem.js.map +1 -1
  585. package/dist/list/ListItemAddon.js +2 -1
  586. package/dist/list/ListItemAddon.js.map +1 -1
  587. package/dist/list/ListItemChildren.js +3 -2
  588. package/dist/list/ListItemChildren.js.map +1 -1
  589. package/dist/list/ListItemLink.js +3 -3
  590. package/dist/list/ListItemLink.js.map +1 -1
  591. package/dist/list/_list.scss +75 -74
  592. package/dist/list/listItemStyles.d.ts +9 -1
  593. package/dist/list/listItemStyles.js +5 -5
  594. package/dist/list/listItemStyles.js.map +1 -1
  595. package/dist/list/types.d.ts +14 -4
  596. package/dist/list/types.js.map +1 -1
  597. package/dist/menu/Menu.d.ts +1 -1
  598. package/dist/menu/Menu.js.map +1 -1
  599. package/dist/menu/_menu.scss +19 -41
  600. package/dist/overlay/_overlay.scss +14 -19
  601. package/dist/portal/PortalContainerProvider.d.ts +2 -2
  602. package/dist/portal/PortalContainerProvider.js +6 -1
  603. package/dist/portal/PortalContainerProvider.js.map +1 -1
  604. package/dist/progress/_progress.scss +25 -30
  605. package/dist/segmented-button/_segmented-button.scss +32 -43
  606. package/dist/sheet/_sheet.scss +24 -42
  607. package/dist/sheet/styles.d.ts +14 -15
  608. package/dist/sheet/styles.js.map +1 -1
  609. package/dist/snackbar/DefaultToastRenderer.js +1 -1
  610. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  611. package/dist/snackbar/Snackbar.d.ts +1 -3
  612. package/dist/snackbar/Snackbar.js +2 -3
  613. package/dist/snackbar/Snackbar.js.map +1 -1
  614. package/dist/snackbar/Toast.d.ts +1 -1
  615. package/dist/snackbar/Toast.js +5 -1
  616. package/dist/snackbar/Toast.js.map +1 -1
  617. package/dist/snackbar/ToastManager.d.ts +2 -1
  618. package/dist/snackbar/ToastManager.js +1 -1
  619. package/dist/snackbar/ToastManager.js.map +1 -1
  620. package/dist/snackbar/_snackbar.scss +15 -23
  621. package/dist/table/TableCheckbox.d.ts +3 -2
  622. package/dist/table/TableCheckbox.js +4 -2
  623. package/dist/table/TableCheckbox.js.map +1 -1
  624. package/dist/table/TableRadio.d.ts +3 -2
  625. package/dist/table/TableRadio.js +4 -2
  626. package/dist/table/TableRadio.js.map +1 -1
  627. package/dist/table/_table.scss +55 -70
  628. package/dist/table/tableCellStyles.d.ts +1 -1
  629. package/dist/table/tableCellStyles.js.map +1 -1
  630. package/dist/tabs/Tab.d.ts +24 -3
  631. package/dist/tabs/Tab.js +15 -8
  632. package/dist/tabs/Tab.js.map +1 -1
  633. package/dist/tabs/_tabs.scss +54 -47
  634. package/dist/tabs/tabIndicatorStyles.d.ts +2 -1
  635. package/dist/tabs/tabIndicatorStyles.js +6 -3
  636. package/dist/tabs/tabIndicatorStyles.js.map +1 -1
  637. package/dist/tabs/tabListStyles.js +2 -1
  638. package/dist/tabs/tabListStyles.js.map +1 -1
  639. package/dist/tabs/tabStyles.d.ts +2 -0
  640. package/dist/tabs/tabStyles.js +6 -3
  641. package/dist/tabs/tabStyles.js.map +1 -1
  642. package/dist/tabs/useTabList.d.ts +3 -3
  643. package/dist/tabs/useTabList.js +9 -6
  644. package/dist/tabs/useTabList.js.map +1 -1
  645. package/dist/theme/_theme.scss +31 -89
  646. package/dist/tooltip/_tooltip.scss +16 -25
  647. package/dist/tooltip/useTooltip.d.ts +14 -14
  648. package/dist/tooltip/useTooltip.js.map +1 -1
  649. package/dist/transition/SkeletonPlaceholder.d.ts +2 -2
  650. package/dist/transition/SkeletonPlaceholder.js +8 -3
  651. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  652. package/dist/transition/_transition.scss +50 -44
  653. package/dist/transition/skeletonPlaceholderUtils.d.ts +77 -0
  654. package/dist/transition/skeletonPlaceholderUtils.js +38 -0
  655. package/dist/transition/skeletonPlaceholderUtils.js.map +1 -0
  656. package/dist/transition/useSkeletonPlaceholder.d.ts +12 -7
  657. package/dist/transition/useSkeletonPlaceholder.js +38 -37
  658. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  659. package/dist/tree/DefaultTreeItemRenderer.d.ts +2 -2
  660. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  661. package/dist/tree/Tree.d.ts +8 -4
  662. package/dist/tree/Tree.js.map +1 -1
  663. package/dist/tree/TreeItem.js +3 -4
  664. package/dist/tree/TreeItem.js.map +1 -1
  665. package/dist/tree/_tree.scss +106 -106
  666. package/dist/tree/styles.d.ts +0 -6
  667. package/dist/tree/styles.js +1 -2
  668. package/dist/tree/styles.js.map +1 -1
  669. package/dist/types.d.ts +7 -0
  670. package/dist/types.js +1 -2
  671. package/dist/types.js.map +1 -1
  672. package/dist/typography/_typography.scss +30 -25
  673. package/dist/useElementSize.d.ts +40 -0
  674. package/dist/useElementSize.js +53 -0
  675. package/dist/useElementSize.js.map +1 -0
  676. package/dist/useResizeListener.d.ts +1 -1
  677. package/dist/useResizeListener.js +1 -0
  678. package/dist/useResizeListener.js.map +1 -1
  679. package/dist/useResizeObserver.d.ts +4 -43
  680. package/dist/useResizeObserver.js +3 -42
  681. package/dist/useResizeObserver.js.map +1 -1
  682. package/dist/useWindowSize.d.ts +14 -11
  683. package/dist/useWindowSize.js +12 -7
  684. package/dist/useWindowSize.js.map +1 -1
  685. package/dist/utils/getMiddleOfRange.d.ts +13 -0
  686. package/dist/utils/getMiddleOfRange.js +20 -0
  687. package/dist/utils/getMiddleOfRange.js.map +1 -0
  688. package/dist/utils/getRangeDefaultValue.d.ts +3 -5
  689. package/dist/utils/getRangeDefaultValue.js +3 -13
  690. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  691. package/dist/utils/getRangeSteps.d.ts +1 -1
  692. package/dist/utils/getRangeSteps.js +2 -2
  693. package/dist/utils/getRangeSteps.js.map +1 -1
  694. package/dist/utils/nearest.js +1 -1
  695. package/dist/utils/nearest.js.map +1 -1
  696. package/dist/window-splitter/_window-splitter.scss +30 -61
  697. package/dist/window-splitter/useWindowSplitter.d.ts +3 -5
  698. package/dist/window-splitter/useWindowSplitter.js +3 -11
  699. package/dist/window-splitter/useWindowSplitter.js.map +1 -1
  700. package/package.json +18 -18
  701. package/src/__tests__/useElementSize.tsx +181 -0
  702. package/src/__tests__/useWindowSize.node.tsx +56 -0
  703. package/src/__tests__/useWindowSize.tsx +156 -0
  704. package/src/_box-shadows.scss +12 -2
  705. package/src/_core.scss +34 -3
  706. package/src/_utils.scss +79 -0
  707. package/src/app-bar/AppBar.tsx +59 -19
  708. package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +21 -21
  709. package/src/app-bar/_app-bar.scss +22 -32
  710. package/src/avatar/Avatar.tsx +1 -1
  711. package/src/avatar/_avatar.scss +25 -34
  712. package/src/badge/_badge.scss +80 -48
  713. package/src/box/_box.scss +18 -29
  714. package/src/button/TooltippedButton.tsx +120 -0
  715. package/src/button/__tests__/TooltippedButton.tsx +60 -0
  716. package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +26 -0
  717. package/src/button/_button.scss +50 -62
  718. package/src/card/Card.tsx +5 -3
  719. package/src/card/CardContent.tsx +3 -3
  720. package/src/card/ClickableCard.tsx +105 -0
  721. package/src/card/__tests__/ClickableCard.tsx +66 -0
  722. package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +1 -1
  723. package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +2 -2
  724. package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +20 -0
  725. package/src/card/__tests__/__snapshots__/styles.ts.snap +1 -1
  726. package/src/card/_card.scss +29 -32
  727. package/src/card/styles.ts +19 -10
  728. package/src/chip/_chip.scss +33 -46
  729. package/src/dialog/_dialog.scss +118 -103
  730. package/src/divider/Divider.tsx +0 -1
  731. package/src/divider/_divider.scss +40 -51
  732. package/src/draggable/useDraggable.ts +26 -25
  733. package/src/draggable/utils.ts +16 -50
  734. package/src/expansion-panel/__tests__/ExpansionPanel.tsx +2 -2
  735. package/src/expansion-panel/_expansion-panel.scss +25 -16
  736. package/src/expansion-panel/useExpansionPanels.ts +20 -16
  737. package/src/form/Label.tsx +5 -5
  738. package/src/form/MenuItemInputToggle.tsx +1 -1
  739. package/src/form/Select.tsx +9 -1
  740. package/src/form/TextArea.tsx +1 -1
  741. package/src/form/TextFieldContainerStyles.ts +7 -7
  742. package/src/form/_form.scss +240 -225
  743. package/src/form/textAreaStyles.ts +2 -2
  744. package/src/form/types.ts +0 -2
  745. package/src/icon/IconRotator.tsx +1 -2
  746. package/src/icon/_icon.scss +38 -49
  747. package/src/index.ts +5 -0
  748. package/src/interaction/_interaction.scss +59 -66
  749. package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +4 -4
  750. package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +1 -1
  751. package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +18 -18
  752. package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +1 -1
  753. package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +1 -1
  754. package/src/layout/_layout.scss +14 -19
  755. package/src/layout/useLayoutAppBarHeight.ts +5 -9
  756. package/src/link/_link.scss +41 -35
  757. package/src/list/ListItem.tsx +19 -12
  758. package/src/list/ListItemAddon.tsx +5 -3
  759. package/src/list/ListItemChildren.tsx +4 -2
  760. package/src/list/ListItemLink.tsx +3 -3
  761. package/src/list/__tests__/ListItem.tsx +1 -1
  762. package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +1 -1
  763. package/src/list/_list.scss +75 -74
  764. package/src/list/listItemStyles.ts +15 -5
  765. package/src/list/types.ts +15 -4
  766. package/src/menu/Menu.tsx +1 -1
  767. package/src/menu/_menu.scss +19 -41
  768. package/src/overlay/_overlay.scss +14 -19
  769. package/src/portal/PortalContainerProvider.tsx +10 -2
  770. package/src/portal/__tests__/PortalContainerProvider.tsx +23 -0
  771. package/src/progress/_progress.scss +25 -30
  772. package/src/segmented-button/_segmented-button.scss +32 -43
  773. package/src/sheet/_sheet.scss +24 -42
  774. package/src/sheet/styles.ts +14 -15
  775. package/src/snackbar/DefaultToastRenderer.tsx +1 -1
  776. package/src/snackbar/Snackbar.tsx +17 -25
  777. package/src/snackbar/Toast.tsx +7 -2
  778. package/src/snackbar/ToastManager.tsx +3 -2
  779. package/src/snackbar/__tests__/Snackbar.tsx +12 -11
  780. package/src/snackbar/__tests__/ToastManagerProvider.tsx +20 -42
  781. package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +127 -27
  782. package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +23 -8
  783. package/src/snackbar/_snackbar.scss +15 -23
  784. package/src/suspense/__tests__/CircularProgressSuspense.tsx +90 -0
  785. package/src/suspense/__tests__/NullSuspense.tsx +46 -0
  786. package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +24 -0
  787. package/src/table/TableCheckbox.tsx +4 -2
  788. package/src/table/TableRadio.tsx +4 -2
  789. package/src/table/_table.scss +55 -70
  790. package/src/table/tableCellStyles.ts +1 -1
  791. package/src/tabs/Tab.tsx +110 -70
  792. package/src/tabs/__tests__/Tab.tsx +25 -2
  793. package/src/tabs/__tests__/TabList.tsx +4 -4
  794. package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +2 -2
  795. package/src/tabs/_tabs.scss +54 -47
  796. package/src/tabs/tabIndicatorStyles.ts +13 -3
  797. package/src/tabs/tabListStyles.ts +1 -1
  798. package/src/tabs/tabStyles.ts +16 -4
  799. package/src/tabs/useTabList.ts +10 -8
  800. package/src/theme/_theme.scss +31 -89
  801. package/src/tooltip/_tooltip.scss +16 -25
  802. package/src/tooltip/useTooltip.ts +23 -16
  803. package/src/transition/SkeletonPlaceholder.tsx +18 -6
  804. package/src/transition/__tests__/SkeletonPlaceholder.tsx +72 -0
  805. package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +24 -0
  806. package/src/transition/_transition.scss +50 -44
  807. package/src/transition/skeletonPlaceholderUtils.ts +105 -0
  808. package/src/transition/useSkeletonPlaceholder.ts +62 -47
  809. package/src/tree/DefaultTreeItemRenderer.tsx +6 -2
  810. package/src/tree/Tree.tsx +8 -4
  811. package/src/tree/TreeItem.tsx +3 -4
  812. package/src/tree/__tests__/Tree.tsx +1 -1
  813. package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +124 -124
  814. package/src/tree/_tree.scss +106 -106
  815. package/src/tree/styles.ts +0 -9
  816. package/src/types.ts +8 -0
  817. package/src/typography/_typography.scss +30 -25
  818. package/src/useElementSize.ts +83 -0
  819. package/src/useResizeListener.ts +3 -1
  820. package/src/useResizeObserver.ts +7 -44
  821. package/src/useWindowSize.ts +29 -19
  822. package/src/utils/__tests__/getMiddleOfRange.ts +12 -0
  823. package/src/utils/__tests__/getRangeDefaultValue.ts +47 -0
  824. package/src/utils/getMiddleOfRange.ts +26 -0
  825. package/src/utils/getRangeDefaultValue.ts +8 -15
  826. package/src/utils/getRangeSteps.ts +2 -2
  827. package/src/utils/nearest.ts +1 -1
  828. package/src/window-splitter/_window-splitter.scss +30 -61
  829. package/src/window-splitter/useWindowSplitter.ts +12 -28
  830. package/dist/divider/VerticalDivider.d.ts +0 -32
  831. package/dist/divider/useVerticalDividerHeight.d.ts +0 -37
  832. package/dist/icon/MaterialIconsProvider.d.ts +0 -12
  833. package/dist/icon/MaterialIconsProvider.js +0 -17
  834. package/dist/icon/MaterialIconsProvider.js.map +0 -1
  835. package/dist/icon/MaterialSymbolsProvider.d.ts +0 -145
  836. package/dist/icon/MaterialSymbolsProvider.js +0 -60
  837. package/dist/icon/MaterialSymbolsProvider.js.map +0 -1
  838. package/dist/link/LinkProvider.d.ts +0 -29
  839. package/dist/menu/menuConfig.d.ts +0 -60
  840. package/dist/tooltip/useOverflowTooltip.d.ts +0 -61
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type AriaRole,\n type ComponentType,\n type HTMLAttributes,\n} from \"react\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n DefaultToastRenderer,\n type ToastRendererProps,\n} from \"./DefaultToastRenderer.js\";\nimport { type ConfigurableToastProps } from \"./Toast.js\";\nimport { useToastQueue } from \"./ToastManagerProvider.js\";\nimport { snackbar, type SnackbarPosition } from \"./snackbarStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0 The `id` prop is optional\n */\nexport interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * @defaultValue `\"snackbar-\" + useId()`\n */\n id?: string;\n\n /** @defaultValue `\"status\"` */\n role?: AriaRole;\n\n /**\n * Set this to the number of toasts that can be visible within the snackbar at\n * the same time. Any toasts added after this value will be added into the\n * queue to be shown.\n *\n * @defaultValue `1`\n */\n limit?: number;\n\n /**\n * @defaultValue `\"bottom\"`\n */\n position?: SnackbarPosition;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * This can be used to create a custom toast implementation.\n *\n * @example\n * ```ts\n * import type { ToastRendererProps } from \"@react-md/core\";\n * import {\n * Snackbar,\n * Toast,\n * ToastContent,\n * useToastManager,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function CustomToast(props: CustomToastRendererProps): ReactElement {\n * // Pretend like we don't need anything else from the toast since the\n * // custom behavior is related to the `toastId`\n * const { toastId, visible, duplicates, visibleTime } = props;\n *\n * const toastManager = useToastManager();\n *\n * // Note: If you want to rely on the `action` and `closeButton` behavior,\n * // you must also wrap the `Toast` with:\n * // <RemoveToastProvider value={() => toastManager.removeToast(toastId, true)}>\n *\n * return (\n * <Toast\n * theme={isError(toastId) ? \"error\" : \"surface\"}\n * visible={visible}\n * onEntered={() => {\n * toastManager.startRemoveTimeout(toastId);\n * }}\n * onExited={() => {\n * toastManager.removeToast(toastId, false)\n * }}\n * disableContentWrapper\n * >\n * <ToastContent>\n * <TranslateMessage id={toastId} />\n * </ToastContent>\n * {isActionable(toastId) && (\n * <Button\n * onClick={async () => {\n * await someApiCall();\n * toastManager.removeToast(toastId, true);\n * }}\n * >\n * Dismiss\n * </Button>\n * )}\n * </Toast>\n * );\n * }\n *\n * function Example(): ReactElement {\n * return <Snackbar renderToast={CustomToast} />\n * }\n * ```\n *\n * @see {@link DefaultToastRenderer}\n * @defaultValue `DefaultToastRenderer`\n */\n renderToast?: ComponentType<ToastRendererProps>;\n\n /**\n * Optional props that should be passed to each `Toast` from the `Snackbar`.\n * This is a great way to enforce each toast having a close button, a custom\n * class name, theme, etc.\n *\n * @see {@link DefaultToastRenderer}\n */\n toastDefaults?: ConfigurableToastProps;\n}\n\n/**\n * **Client Component**\n *\n * @example\n * Super SImple Example\n * ```tsx\n * import { Button, Snackbar, addToast } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <Button\n * onClick={() => {\n * addToast({ children: \"A new toast!\" });\n * }}\n * >\n * Toast!\n * </Button>\n * <Snackbar />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link SnackbarProps.renderToast} for creating a custom toast\n * implementation.\n * @remarks \\@since 6.0.0 Rewritten to use a new API that supports adding toasts\n * outside of React components and rendering multiple toasts at once.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(\n function Snackbar(props, ref) {\n const {\n id: propId,\n role = \"status\",\n className,\n limit = 1,\n position = \"bottom\",\n renderToast: RenderToast = DefaultToastRenderer,\n disablePortal,\n toastDefaults,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"snackbar\");\n const queue = useToastQueue(limit);\n\n return (\n <Portal disabled={disablePortal}>\n <div\n {...remaining}\n id={id}\n ref={ref}\n role={role}\n className={snackbar({ position, className })}\n >\n {queue.map((toast) => (\n <RenderToast\n {...toast}\n key={toast.toastId}\n toastDefaults={toastDefaults}\n />\n ))}\n </div>\n </Portal>\n );\n }\n);\n"],"names":["forwardRef","Portal","useEnsuredId","DefaultToastRenderer","useToastQueue","snackbar","Snackbar","props","ref","id","propId","role","className","limit","position","renderToast","RenderToast","disablePortal","toastDefaults","remaining","queue","disabled","div","map","toast","key","toastId"],"mappings":"AAAA;;;AACA,SACEA,UAAU,QAIL,QAAQ;AACf,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,oBAAoB,QAEf,4BAA4B;AAEnC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,QAAQ,QAA+B,sBAAsB;AA2GtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,yBAAWN,WACtB,SAASM,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAO,QAAQ,EACfC,SAAS,EACTC,QAAQ,CAAC,EACTC,WAAW,QAAQ,EACnBC,aAAaC,cAAcb,oBAAoB,EAC/Cc,aAAa,EACbC,aAAa,EACb,GAAGC,WACJ,GAAGZ;IACJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMU,QAAQhB,cAAcS;IAE5B,qBACE,KAACZ;QAAOoB,UAAUJ;kBAChB,cAAA,KAACK;YACE,GAAGH,SAAS;YACbV,IAAIA;YACJD,KAAKA;YACLG,MAAMA;YACNC,WAAWP,SAAS;gBAAES;gBAAUF;YAAU;sBAEzCQ,MAAMG,GAAG,CAAC,CAACC,sBACV,eAACR;oBACE,GAAGQ,KAAK;oBACTC,KAAKD,MAAME,OAAO;oBAClBR,eAAeA;;;;AAM3B,GACA"}
1
+ {"version":3,"sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type ComponentType, type HTMLAttributes } from \"react\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n DefaultToastRenderer,\n type ToastRendererProps,\n} from \"./DefaultToastRenderer.js\";\nimport { type ConfigurableToastProps } from \"./Toast.js\";\nimport { useToastQueue } from \"./ToastManagerProvider.js\";\nimport { snackbar, type SnackbarPosition } from \"./snackbarStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0 The `id` prop is optional\n */\nexport interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * @defaultValue `\"snackbar-\" + useId()`\n */\n id?: string;\n\n /**\n * Set this to the number of toasts that can be visible within the snackbar at\n * the same time. Any toasts added after this value will be added into the\n * queue to be shown.\n *\n * @defaultValue `1`\n */\n limit?: number;\n\n /**\n * @defaultValue `\"bottom\"`\n */\n position?: SnackbarPosition;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * This can be used to create a custom toast implementation.\n *\n * @example\n * ```ts\n * import type { ToastRendererProps } from \"@react-md/core\";\n * import {\n * Snackbar,\n * Toast,\n * ToastContent,\n * useToastManager,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function CustomToast(props: CustomToastRendererProps): ReactElement {\n * // Pretend like we don't need anything else from the toast since the\n * // custom behavior is related to the `toastId`\n * const { toastId, visible, duplicates, visibleTime } = props;\n *\n * const toastManager = useToastManager();\n *\n * // Note: If you want to rely on the `action` and `closeButton` behavior,\n * // you must also wrap the `Toast` with:\n * // <RemoveToastProvider value={() => toastManager.removeToast(toastId, true)}>\n *\n * return (\n * <Toast\n * theme={isError(toastId) ? \"error\" : \"surface\"}\n * visible={visible}\n * onEntered={() => {\n * toastManager.startRemoveTimeout(toastId);\n * }}\n * onExited={() => {\n * toastManager.removeToast(toastId, false)\n * }}\n * disableContentWrapper\n * >\n * <ToastContent>\n * <TranslateMessage id={toastId} />\n * </ToastContent>\n * {isActionable(toastId) && (\n * <Button\n * onClick={async () => {\n * await someApiCall();\n * toastManager.removeToast(toastId, true);\n * }}\n * >\n * Dismiss\n * </Button>\n * )}\n * </Toast>\n * );\n * }\n *\n * function Example(): ReactElement {\n * return <Snackbar renderToast={CustomToast} />\n * }\n * ```\n *\n * @see {@link DefaultToastRenderer}\n * @defaultValue `DefaultToastRenderer`\n */\n renderToast?: ComponentType<ToastRendererProps>;\n\n /**\n * Optional props that should be passed to each `Toast` from the `Snackbar`.\n * This is a great way to enforce each toast having a close button, a custom\n * class name, theme, etc.\n *\n * @see {@link DefaultToastRenderer}\n */\n toastDefaults?: ConfigurableToastProps;\n}\n\n/**\n * **Client Component**\n *\n * @example\n * Super SImple Example\n * ```tsx\n * import { Button, Snackbar, addToast } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <Button\n * onClick={() => {\n * addToast({ children: \"A new toast!\" });\n * }}\n * >\n * Toast!\n * </Button>\n * <Snackbar />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link SnackbarProps.renderToast} for creating a custom toast\n * implementation.\n * @remarks \\@since 6.0.0 Rewritten to use a new API that supports adding toasts\n * outside of React components and rendering multiple toasts at once.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(\n function Snackbar(props, ref) {\n const {\n id: propId,\n className,\n limit = 1,\n position = \"bottom\",\n renderToast: RenderToast = DefaultToastRenderer,\n disablePortal,\n toastDefaults,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"snackbar\");\n const queue = useToastQueue(limit);\n\n return (\n <Portal disabled={disablePortal}>\n {queue.length > 0 && (\n <div\n {...remaining}\n id={id}\n ref={ref}\n className={snackbar({ position, className })}\n >\n {queue.map((toast) => (\n <RenderToast\n {...toast}\n key={toast.toastId}\n toastDefaults={toastDefaults}\n />\n ))}\n </div>\n )}\n </Portal>\n );\n }\n);\n"],"names":["forwardRef","Portal","useEnsuredId","DefaultToastRenderer","useToastQueue","snackbar","Snackbar","props","ref","id","propId","className","limit","position","renderToast","RenderToast","disablePortal","toastDefaults","remaining","queue","disabled","length","div","map","toast","key","toastId"],"mappings":"AAAA;;;AACA,SAASA,UAAU,QAAiD,QAAQ;AAC5E,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,oBAAoB,QAEf,4BAA4B;AAEnC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,QAAQ,QAA+B,sBAAsB;AAwGtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,yBAAWN,WACtB,SAASM,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,CAAC,EACTC,WAAW,QAAQ,EACnBC,aAAaC,cAAcZ,oBAAoB,EAC/Ca,aAAa,EACbC,aAAa,EACb,GAAGC,WACJ,GAAGX;IACJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMS,QAAQf,cAAcQ;IAE5B,qBACE,KAACX;QAAOmB,UAAUJ;kBACfG,MAAME,MAAM,GAAG,mBACd,KAACC;YACE,GAAGJ,SAAS;YACbT,IAAIA;YACJD,KAAKA;YACLG,WAAWN,SAAS;gBAAEQ;gBAAUF;YAAU;sBAEzCQ,MAAMI,GAAG,CAAC,CAACC,sBACV,eAACT;oBACE,GAAGS,KAAK;oBACTC,KAAKD,MAAME,OAAO;oBAClBT,eAAeA;;;;AAO7B,GACA"}
@@ -17,7 +17,7 @@ export interface ConfigurableToastProps extends HTMLAttributes<HTMLDivElement>,
17
17
  /**
18
18
  * Note: This is set while creating the toast.
19
19
  *
20
- * @defaultValue `visibleTime === null ? "alert" : undefined`
20
+ * @defaultValue `visibleTime === null ? "alert" : "status"`
21
21
  */
22
22
  role?: AriaRole;
23
23
  /**
@@ -15,7 +15,7 @@ import { toast } from "./toastStyles.js";
15
15
  *
16
16
  * @remarks \@since 6.0.0
17
17
  */ export const Toast = /*#__PURE__*/ forwardRef(function Toast(props, ref) {
18
- const { id: propId, className, timeout, classNames, theme = "surface", action: propAction, actionButton: propActionButton, paused, visible, closeIcon, closeButtonProps, closeButton = !!closeButtonProps, contentProps, disableToastContent, stacked, multiline, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, ...remaining } = props;
18
+ const { id: propId, className, timeout, classNames, theme = "surface", action: propAction, actionButton: propActionButton, paused, visible, closeIcon: propCloseIcon, closeButtonProps, closeButton = !!closeButtonProps, contentProps, disableToastContent, stacked, multiline, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, ...remaining } = props;
19
19
  const id = useEnsuredId(propId, "toast");
20
20
  let actionButton = propActionButton;
21
21
  if (propAction) {
@@ -35,6 +35,10 @@ import { toast } from "./toastStyles.js";
35
35
  children: buttonChildren
36
36
  });
37
37
  }
38
+ let closeIcon = propCloseIcon;
39
+ if (typeof closeButtonProps?.children !== "undefined") {
40
+ closeIcon = closeButtonProps.children;
41
+ }
38
42
  const action = !!actionButton;
39
43
  const reordered = stacked && action && closeButton;
40
44
  const { elementProps, rendered } = useScaleTransition({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snackbar/Toast.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n isValidElement,\n type AriaRole,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type ButtonProps } from \"../button/Button.js\";\nimport { type BackgroundColor } from \"../cssUtils.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useScaleTransition } from \"../transition/useScaleTransition.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { ToastActionButton } from \"./ToastActionButton.js\";\nimport { ToastCloseButton } from \"./ToastCloseButton.js\";\nimport { ToastContent, type ToastContentProps } from \"./ToastContent.js\";\nimport { toast } from \"./toastStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ConfigurableToastProps\n extends HTMLAttributes<HTMLDivElement>,\n TransitionCallbacks {\n /**\n * Note: this default value will only be generated in the `Toast` component.\n *\n * @defaultValue `\"toast-\" + useId()`\n */\n id?: string;\n\n /**\n * Note: This is set while creating the toast.\n *\n * @defaultValue `visibleTime === null ? \"alert\" : undefined`\n */\n role?: AriaRole;\n\n /**\n * @defaultValue `\"surface\"`\n */\n theme?: BackgroundColor;\n\n /**\n * Set this to `true` to stack the content above the {@link action}. It is not\n * recommended to enable this prop if the {@link closeButton} is enabled.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * If this is not provided, a `ResizeObserver` will be used to determine if\n * there are multiple lines of content.\n */\n multiline?: boolean;\n\n /**\n * When this is a string or React element, it will be rendered as the\n * `children` within a `Button`\n */\n action?: ButtonProps | ReactElement | string;\n\n /**\n * This can be used to replace the custom action button behavior.\n */\n actionButton?: ReactNode;\n\n /**\n * @defaultValue `getIcon(\"close\")`\n */\n closeIcon?: ReactNode;\n\n /**\n * Set this to `true` if a close button should be rendered to the right of the\n * `children`.\n *\n * @defaultValue `!!closeButtonProps`\n */\n closeButton?: boolean;\n\n /**\n * Use this prop to override most of the close button behavior. The\n */\n closeButtonProps?: ButtonProps;\n\n /**\n * Any additional props that should be provided to the `<div>` that surrounds\n * the toast `children`.\n */\n contentProps?: PropsWithRef<ToastContentProps, HTMLDivElement>;\n\n /**\n * Set this to `true` if the `children` for the toast should no longer be\n * wrapped in an additional `<div>` that applies some toast layout styles.\n * This should normally only be used for custom `Toast` implementations.\n *\n * @see the `Snackbar`'s `renderToast` prop for an example.\n */\n disableToastContent?: boolean;\n\n /**\n * The toast's transition timeout for entering and exiting. This is **not**\n * how long the toast should remain visible.\n *\n * @defaultValue `SCALE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n * The toast's transition class names for entering and exiting.\n *\n * @defaultValue `SCALE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastProps extends ConfigurableToastProps {\n paused?: boolean;\n visible: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This component is just used for toast styling and does not implement any of\n * the visibility behavior.\n *\n * @remarks \\@since 6.0.0\n */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(\n function Toast(props, ref) {\n const {\n id: propId,\n className,\n timeout,\n classNames,\n theme = \"surface\",\n action: propAction,\n actionButton: propActionButton,\n paused,\n visible,\n closeIcon,\n closeButtonProps,\n closeButton = !!closeButtonProps,\n contentProps,\n disableToastContent,\n stacked,\n multiline,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"toast\");\n\n let actionButton = propActionButton;\n if (propAction) {\n let overrides: ButtonProps = {};\n let buttonChildren: ReactNode;\n // have to use `any` to correctly filter out all react elements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isValidElement<any>(propAction) || typeof propAction !== \"object\") {\n buttonChildren = propAction;\n } else {\n ({ children: buttonChildren, ...overrides } = propAction);\n }\n\n actionButton = (\n <ToastActionButton\n theme={theme === \"surface\" ? \"secondary\" : \"clear\"}\n reordered={stacked && closeButton}\n {...overrides}\n >\n {buttonChildren}\n </ToastActionButton>\n );\n }\n\n const action = !!actionButton;\n const reordered = stacked && action && closeButton;\n const { elementProps, rendered } = useScaleTransition({\n appear: true,\n nodeRef: ref,\n className: toast({\n className,\n theme,\n action,\n paused,\n stacked,\n reordered,\n closeButton,\n }),\n timeout,\n classNames,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n temporary: true,\n transitionIn: visible,\n exitedHidden: true,\n });\n\n // this might get rid of the weird popping-back-in for a split second\n // that sometimes happens on mobile firefox\n if (!rendered) {\n return null;\n }\n\n return (\n <div {...remaining} {...elementProps} id={id}>\n <ToastContent\n action={action}\n stacked={stacked}\n multiline={multiline}\n closeButton={closeButton}\n disableWrapper={disableToastContent}\n {...contentProps}\n >\n {children}\n </ToastContent>\n {actionButton}\n {closeButton && (\n <ToastCloseButton reordered={reordered} {...closeButtonProps}>\n {closeIcon}\n </ToastCloseButton>\n )}\n </div>\n );\n }\n);\n"],"names":["forwardRef","isValidElement","useScaleTransition","useEnsuredId","ToastActionButton","ToastCloseButton","ToastContent","toast","Toast","props","ref","id","propId","className","timeout","classNames","theme","action","propAction","actionButton","propActionButton","paused","visible","closeIcon","closeButtonProps","closeButton","contentProps","disableToastContent","stacked","multiline","onEnter","onEntering","onEntered","onExit","onExiting","onExited","children","remaining","overrides","buttonChildren","reordered","elementProps","rendered","appear","nodeRef","temporary","transitionIn","exitedHidden","div","disableWrapper"],"mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,cAAc,QAKT,QAAQ;AAQf,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,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;YACAG;YACAC;YACAI;YACAO;YACAY;YACAf;QACF;QACAX;QACAC;QACAe;QACAC;QACAC;QACAC;QACAC;QACAC;QACAU,WAAW;QACXC,cAAcxB;QACdyB,cAAc;IAChB;IAEA,qEAAqE;IACrE,2CAA2C;IAC3C,IAAI,CAACL,UAAU;QACb,OAAO;IACT;IAEA,qBACE,MAACM;QAAK,GAAGX,SAAS;QAAG,GAAGI,YAAY;QAAE9B,IAAIA;;0BACxC,KAACL;gBACCW,QAAQA;gBACRW,SAASA;gBACTC,WAAWA;gBACXJ,aAAaA;gBACbwB,gBAAgBtB;gBACf,GAAGD,YAAY;0BAEfU;;YAEFjB;YACAM,6BACC,KAACpB;gBAAiBmC,WAAWA;gBAAY,GAAGhB,gBAAgB;0BACzDD;;;;AAKX,GACA"}
1
+ {"version":3,"sources":["../../src/snackbar/Toast.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n isValidElement,\n type AriaRole,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type ButtonProps } from \"../button/Button.js\";\nimport { type BackgroundColor } from \"../cssUtils.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useScaleTransition } from \"../transition/useScaleTransition.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { ToastActionButton } from \"./ToastActionButton.js\";\nimport { ToastCloseButton } from \"./ToastCloseButton.js\";\nimport { ToastContent, type ToastContentProps } from \"./ToastContent.js\";\nimport { toast } from \"./toastStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ConfigurableToastProps\n extends HTMLAttributes<HTMLDivElement>,\n TransitionCallbacks {\n /**\n * Note: this default value will only be generated in the `Toast` component.\n *\n * @defaultValue `\"toast-\" + useId()`\n */\n id?: string;\n\n /**\n * Note: This is set while creating the toast.\n *\n * @defaultValue `visibleTime === null ? \"alert\" : \"status\"`\n */\n role?: AriaRole;\n\n /**\n * @defaultValue `\"surface\"`\n */\n theme?: BackgroundColor;\n\n /**\n * Set this to `true` to stack the content above the {@link action}. It is not\n * recommended to enable this prop if the {@link closeButton} is enabled.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * If this is not provided, a `ResizeObserver` will be used to determine if\n * there are multiple lines of content.\n */\n multiline?: boolean;\n\n /**\n * When this is a string or React element, it will be rendered as the\n * `children` within a `Button`\n */\n action?: ButtonProps | ReactElement | string;\n\n /**\n * This can be used to replace the custom action button behavior.\n */\n actionButton?: ReactNode;\n\n /**\n * @defaultValue `getIcon(\"close\")`\n */\n closeIcon?: ReactNode;\n\n /**\n * Set this to `true` if a close button should be rendered to the right of the\n * `children`.\n *\n * @defaultValue `!!closeButtonProps`\n */\n closeButton?: boolean;\n\n /**\n * Use this prop to override most of the close button behavior. The\n */\n closeButtonProps?: ButtonProps;\n\n /**\n * Any additional props that should be provided to the `<div>` that surrounds\n * the toast `children`.\n */\n contentProps?: PropsWithRef<ToastContentProps, HTMLDivElement>;\n\n /**\n * Set this to `true` if the `children` for the toast should no longer be\n * wrapped in an additional `<div>` that applies some toast layout styles.\n * This should normally only be used for custom `Toast` implementations.\n *\n * @see the `Snackbar`'s `renderToast` prop for an example.\n */\n disableToastContent?: boolean;\n\n /**\n * The toast's transition timeout for entering and exiting. This is **not**\n * how long the toast should remain visible.\n *\n * @defaultValue `SCALE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n * The toast's transition class names for entering and exiting.\n *\n * @defaultValue `SCALE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ToastProps extends ConfigurableToastProps {\n paused?: boolean;\n visible: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This component is just used for toast styling and does not implement any of\n * the visibility behavior.\n *\n * @remarks \\@since 6.0.0\n */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(\n function Toast(props, ref) {\n const {\n id: propId,\n className,\n timeout,\n classNames,\n theme = \"surface\",\n action: propAction,\n actionButton: propActionButton,\n paused,\n visible,\n closeIcon: propCloseIcon,\n closeButtonProps,\n closeButton = !!closeButtonProps,\n contentProps,\n disableToastContent,\n stacked,\n multiline,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"toast\");\n\n let actionButton = propActionButton;\n if (propAction) {\n let overrides: ButtonProps = {};\n let buttonChildren: ReactNode;\n // have to use `any` to correctly filter out all react elements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isValidElement<any>(propAction) || typeof propAction !== \"object\") {\n buttonChildren = propAction;\n } else {\n ({ children: buttonChildren, ...overrides } = propAction);\n }\n\n actionButton = (\n <ToastActionButton\n theme={theme === \"surface\" ? \"secondary\" : \"clear\"}\n reordered={stacked && closeButton}\n {...overrides}\n >\n {buttonChildren}\n </ToastActionButton>\n );\n }\n\n let closeIcon = propCloseIcon;\n if (typeof closeButtonProps?.children !== \"undefined\") {\n closeIcon = closeButtonProps.children;\n }\n\n const action = !!actionButton;\n const reordered = stacked && action && closeButton;\n const { elementProps, rendered } = useScaleTransition({\n appear: true,\n nodeRef: ref,\n className: toast({\n className,\n theme,\n action,\n paused,\n stacked,\n reordered,\n closeButton,\n }),\n timeout,\n classNames,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n temporary: true,\n transitionIn: visible,\n exitedHidden: true,\n });\n\n // this might get rid of the weird popping-back-in for a split second\n // that sometimes happens on mobile firefox\n if (!rendered) {\n return null;\n }\n\n return (\n <div {...remaining} {...elementProps} id={id}>\n <ToastContent\n action={action}\n stacked={stacked}\n multiline={multiline}\n closeButton={closeButton}\n disableWrapper={disableToastContent}\n {...contentProps}\n >\n {children}\n </ToastContent>\n {actionButton}\n {closeButton && (\n <ToastCloseButton reordered={reordered} {...closeButtonProps}>\n {closeIcon}\n </ToastCloseButton>\n )}\n </div>\n );\n }\n);\n"],"names":["forwardRef","isValidElement","useScaleTransition","useEnsuredId","ToastActionButton","ToastCloseButton","ToastContent","toast","Toast","props","ref","id","propId","className","timeout","classNames","theme","action","propAction","actionButton","propActionButton","paused","visible","closeIcon","propCloseIcon","closeButtonProps","closeButton","contentProps","disableToastContent","stacked","multiline","onEnter","onEntering","onEntered","onExit","onExiting","onExited","children","remaining","overrides","buttonChildren","reordered","elementProps","rendered","appear","nodeRef","temporary","transitionIn","exitedHidden","div","disableWrapper"],"mappings":"AAAA;;AACA,SACEA,UAAU,EACVC,cAAc,QAKT,QAAQ;AAQf,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,YAAY,QAAgC,oBAAoB;AACzE,SAASC,KAAK,QAAQ,mBAAmB;AA6GzC;;;;;;;CAOC,GACD,OAAO,MAAMC,sBAAQR,WACnB,SAASQ,MAAMC,KAAK,EAAEC,GAAG;IACvB,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,QAAQ,SAAS,EACjBC,QAAQC,UAAU,EAClBC,cAAcC,gBAAgB,EAC9BC,MAAM,EACNC,OAAO,EACPC,WAAWC,aAAa,EACxBC,gBAAgB,EAChBC,cAAc,CAAC,CAACD,gBAAgB,EAChCE,YAAY,EACZC,mBAAmB,EACnBC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAG7B;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,IAAIO,eAAeC;IACnB,IAAIF,YAAY;QACd,IAAIqB,YAAyB,CAAC;QAC9B,IAAIC;QACJ,+DAA+D;QAC/D,8DAA8D;QAC9D,kBAAIvC,eAAoBiB,eAAe,OAAOA,eAAe,UAAU;YACrEsB,iBAAiBtB;QACnB,OAAO;YACJ,CAAA,EAAEmB,UAAUG,cAAc,EAAE,GAAGD,WAAW,GAAGrB,UAAS;QACzD;QAEAC,6BACE,KAACf;YACCY,OAAOA,UAAU,YAAY,cAAc;YAC3CyB,WAAWZ,WAAWH;YACrB,GAAGa,SAAS;sBAEZC;;IAGP;IAEA,IAAIjB,YAAYC;IAChB,IAAI,OAAOC,kBAAkBY,aAAa,aAAa;QACrDd,YAAYE,iBAAiBY,QAAQ;IACvC;IAEA,MAAMpB,SAAS,CAAC,CAACE;IACjB,MAAMsB,YAAYZ,WAAWZ,UAAUS;IACvC,MAAM,EAAEgB,YAAY,EAAEC,QAAQ,EAAE,GAAGzC,mBAAmB;QACpD0C,QAAQ;QACRC,SAASnC;QACTG,WAAWN,MAAM;YACfM;YACAG;YACAC;YACAI;YACAQ;YACAY;YACAf;QACF;QACAZ;QACAC;QACAgB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAU,WAAW;QACXC,cAAczB;QACd0B,cAAc;IAChB;IAEA,qEAAqE;IACrE,2CAA2C;IAC3C,IAAI,CAACL,UAAU;QACb,OAAO;IACT;IAEA,qBACE,MAACM;QAAK,GAAGX,SAAS;QAAG,GAAGI,YAAY;QAAE/B,IAAIA;;0BACxC,KAACL;gBACCW,QAAQA;gBACRY,SAASA;gBACTC,WAAWA;gBACXJ,aAAaA;gBACbwB,gBAAgBtB;gBACf,GAAGD,YAAY;0BAEfU;;YAEFlB;YACAO,6BACC,KAACrB;gBAAiBoC,WAAWA;gBAAY,GAAGhB,gBAAgB;0BACzDF;;;;AAKX,GACA"}
@@ -12,7 +12,8 @@ export declare const DEFAULT_TOAST_VISIBLE_TIME = 5000;
12
12
  * - `"replace"` - if there is a currently visible toast, it will start the
13
13
  * leave transition and display the newly added toast instead.
14
14
  * - `"immediate"` - the same behavior as `"replace"` except that if there was a
15
- * currently visible toast, it will be shown once the newly added toast again.
15
+ * currently visible toast, the toast will be shown again once the `"immediate"`
16
+ * toast is hidden.
16
17
  *
17
18
  * @remarks \@since 6.0.0 Renamed from `MessagePriority` to `ToastPriority`
18
19
  */
@@ -221,7 +221,7 @@ var _queue = /*#__PURE__*/ new WeakMap(), _timers = /*#__PURE__*/ new WeakMap(),
221
221
  * });
222
222
  * ```
223
223
  */ _define_property(this, "addToast", (toast)=>{
224
- const { toastId = nanoid(), visibleTime = DEFAULT_TOAST_VISIBLE_TIME, role = visibleTime === null ? "alert" : undefined, priority = "normal", duplicates = "restart" } = toast;
224
+ const { toastId = nanoid(), visibleTime = DEFAULT_TOAST_VISIBLE_TIME, role = visibleTime === null ? "alert" : "status", priority = "normal", duplicates = "restart" } = toast;
225
225
  const existingIndex = _class_private_field_get(this, _getToastIndex).call(this, toast.toastId);
226
226
  if (existingIndex !== -1 && duplicates !== "allow") {
227
227
  const existingToast = _class_private_field_get(this, _queue)[existingIndex];
@@ -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, it will be shown once the newly added toast again.\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\" : undefined,\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","undefined","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;IA4H7C,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,CA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,GAAG;AAEhF;;;CAGC,GACD,OAAO,MAAMP,cAA2C,CAAC/C,SAASmD,aAChEU,aAAad,WAAW,CAAC/C,SAASmD,YAAY;AAEhD;;;CAGC,GACD,OAAO,MAAMK,cAAc,IAAYK,aAAaL,WAAW,GAAG"}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;GAKC,GACD0C,uBAAAA,eAAc,CAACC,cAAc,KAAK;2CAC1B5D,QAAQ,EAAE;YAChB,yBAAA,IAAI,EAAE8B,SAAO5B,OAAO,CAAC,CAAC2D;gBACpBhB,OAAOC,YAAY,CAACe,KAAKd,WAAW;YACtC;YACA,yBAAA,IAAI,EAAEjB,SAAOgC,KAAK;YAClB,IAAI,CAACF,aAAa;gBAChB,yBAAA,IAAI,EAAE3C,YAAN,IAAI;YACN;QACF;uCAlYQjB,QAAQ,EAAE;uCACV8B,SAAS,IAAIiC;uCACb9D,YAAY,EAAE;IAEpB,2EAA2E;IAC3E,2EAA2E;IAC3E,gCAAgC;IAChC,EAAE;IACF,OAAO;IACP,wBAAwB;IACxB,mCAAmC;IACnC,8BAA8B;IAC9B,8BAA8B;IAC9B,KAAK;IACP;AAqXF;AAEA;;;;;;CAMC,GACD,OAAO,MAAM+D,eAAe,IAAIlE,eAAe;AAE/C;;;CAGC,GACD,OAAO,MAAMyB,WAAqC,CAACjB,QACjD0D,aAAazC,QAAQ,CAACjB,OAAO;AAE/B;;;CAGC,GACD,OAAO,MAAM2D,0BAA8D,CACzE7D,UACG4D,aAAa9B,kBAAkB,CAAC9B,SAAS;AAE9C;;;CAGC,GACD,OAAO,MAAMqD,WAAqC,IAAMO,aAAaP,QAAQ,GAAG;AAEhF;;;CAGC,GACD,OAAO,MAAMP,cAA2C,CAAC9C,SAASkD,aAChEU,aAAad,WAAW,CAAC9C,SAASkD,YAAY;AAEhD;;;CAGC,GACD,OAAO,MAAMK,cAAc,IAAYK,aAAaL,WAAW,GAAG"}
@@ -60,43 +60,35 @@ $background-color: theme.get-default-color(
60
60
  ) !default;
61
61
  $color: theme.get-default-color($light-theme-color, $dark-theme-color) !default;
62
62
 
63
- $var-lookup: (
64
- color: (
65
- var: --rmd-toast-color,
66
- value: $color,
67
- ),
68
- background-color: (
69
- var: --rmd-toast-background-color,
70
- value: $background-color,
71
- ),
72
- offset: (
73
- var: --rmd-snackbar-offset,
74
- value: 0,
75
- ),
76
- );
63
+ $variables: (background-color, color, offset);
77
64
 
78
65
  @function get-var($name, $fallback: null) {
79
- $found: utils.validate($var-lookup, $name, "alert var");
80
- $var: map.get($found, var);
81
- $value: if($fallback, $fallback, map.get($found, value));
82
-
83
- @if $value {
84
- @return var(#{$var}, #{$value});
66
+ $var: utils.get-var-name($variables, $name, "snackbar");
67
+ @if $fallback {
68
+ @return var(#{$var}, #{$fallback});
85
69
  }
86
70
 
87
71
  @return var(#{$var});
88
72
  }
89
73
 
90
74
  @mixin set-var($name, $value) {
91
- $var: map.get(utils.validate($var-lookup, $name, "alert var"), var);
92
-
93
- #{$var}: #{$value};
75
+ @if $value {
76
+ #{utils.get-var-name($variables, $name, "snackbar")}: #{$value};
77
+ }
94
78
  }
95
79
 
96
80
  @mixin use-var($property, $name: $property, $fallback: null) {
97
81
  #{$property}: get-var($name, $fallback);
98
82
  }
99
83
 
84
+ @mixin variables {
85
+ @if not $disable-everything {
86
+ @include set-var(background-color, $background-color);
87
+ @include set-var(color, $color);
88
+ @include set-var(offset, 0);
89
+ }
90
+ }
91
+
100
92
  @mixin styles {
101
93
  @if not $disable-everything {
102
94
  .rmd-snackbar {
@@ -44,8 +44,9 @@ export interface TableCheckboxProps extends TableCheckboxTdHTMLAttributes, Table
44
44
  checkboxProps?: PropsWithRef<CheckboxProps, HTMLInputElement>;
45
45
  }
46
46
  /**
47
- * **Server Component**
48
- * This might actually be a client component.
47
+ * **Client Component**
48
+ * The `TableCheckbox` is used to render a `Checkbox` within a `TableCell` by applying
49
+ * some minimal styles.
49
50
  *
50
51
  * @example
51
52
  * Simple Example
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { Checkbox } from "../form/Checkbox.js";
@@ -6,8 +7,9 @@ const noop = ()=>{
6
7
  // do nothing
7
8
  };
8
9
  /**
9
- * **Server Component**
10
- * This might actually be a client component.
10
+ * **Client Component**
11
+ * The `TableCheckbox` is used to render a `Checkbox` within a `TableCell` by applying
12
+ * some minimal styles.
11
13
  *
12
14
  * @example
13
15
  * Simple Example
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableCheckbox.tsx"],"sourcesContent":["import { 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 * **Server Component**\n * This might actually be a client component.\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,SAASA,UAAU,QAA+B,QAAQ;AAC1D,SAASC,QAAQ,QAAQ,sBAAsB;AAG/C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEC,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"],"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"}
@@ -38,8 +38,9 @@ export interface TableRadioProps extends TableRadioTdHTMLAttributes, TableRadioS
38
38
  radioProps?: PropsWithRef<RadioProps, HTMLInputElement>;
39
39
  }
40
40
  /**
41
- * **Server Component**
42
- * This might actually be a client component.
41
+ * **Client Component**
42
+ * The `TableRadio` is used to render a `Radio` within a `TableCell` by applying
43
+ * some minimal styles.
43
44
  *
44
45
  * @example
45
46
  * Simple Example
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { Radio } from "../form/Radio.js";
@@ -6,8 +7,9 @@ const noop = ()=>{
6
7
  // do nothing
7
8
  };
8
9
  /**
9
- * **Server Component**
10
- * This might actually be a client component.
10
+ * **Client Component**
11
+ * The `TableRadio` is used to render a `Radio` within a `TableCell` by applying
12
+ * some minimal styles.
11
13
  *
12
14
  * @example
13
15
  * Simple Example
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/table/TableRadio.tsx"],"sourcesContent":["import { 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 * **Server Component**\n * This might actually be a client component.\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,SAASA,UAAU,QAA+B,QAAQ;AAE1D,SAASC,KAAK,QAAQ,mBAAmB;AAEzC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEC,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"],"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"}
@@ -108,85 +108,37 @@ $sticky-footer-active-styles: $sticky-header-active-styles !default;
108
108
  $row-hover-color: interaction.get-var(hover-background-color) !default;
109
109
  $row-selected-color: interaction.get-var(selected-background-color) !default;
110
110
 
111
- $var-lookup: (
112
- background-color: (
113
- var: --rmd-table-background-color,
114
- value: $background-color,
115
- ),
116
- border-size: (
117
- var: --rmd-table-border-size,
118
- value: $border-size,
119
- ),
120
- border-color: (
121
- var: --rmd-table-border-color,
122
- value: $border-color,
123
- ),
124
- header-background-color: (
125
- var: --rmd-table-header-background-color,
126
- value: $header-background-color,
127
- ),
128
- cell-color: (
129
- var: --rmd-table-cell-color,
130
- value: $cell-color,
131
- ),
132
- cell-height: (
133
- var: --rmd-table-cell-height,
134
- value: $cell-height,
135
- ),
136
- cell-horizontal-padding: (
137
- var: --rmd-table-cell-horizontal-padding,
138
- value: $cell-horizontal-padding,
139
- ),
140
- cell-vertical-padding: (
141
- var: --rmd-table-cell-vertical-padding,
142
- value: $cell-vertical-padding,
143
- ),
144
- header-cell-height: (
145
- var: --rmd-table-header-cell-height,
146
- value: $cell-header-height,
147
- ),
148
- hover-color: (
149
- var: --rmd-table-hover-color,
150
- value: $row-hover-color,
151
- ),
152
- selected-color: (
153
- var: --rmd-table-selected-color,
154
- value: $row-selected-color,
155
- ),
156
- sticky-cell: (
157
- var: --rmd-table-sticky-cell,
158
- value: $sticky-cell-position,
159
- ),
160
- sticky-header: (
161
- var: --rmd-table-sticky-header,
162
- value: $sticky-header-position,
163
- ),
164
- sticky-footer: (
165
- var: --rmd-table-sticky-footer,
166
- value: $sticky-footer-position,
167
- ),
168
- sticky-background-color: (
169
- var: --rmd-table-sticky-background-color,
170
- value: $sticky-background-color,
171
- ),
111
+ $variables: (
112
+ background-color,
113
+ border-size,
114
+ border-color,
115
+ header-background-color,
116
+ cell-color,
117
+ cell-height,
118
+ cell-horizontal-padding,
119
+ cell-vertical-padding,
120
+ header-cell-height,
121
+ hover-color,
122
+ selected-color,
123
+ sticky-cell,
124
+ sticky-header,
125
+ sticky-footer,
126
+ sticky-background-color
172
127
  );
173
128
 
174
129
  @function get-var($name, $fallback: null) {
175
- $found: utils.validate($var-lookup, $name, "table var");
176
- $var: map.get($found, var);
177
- $value: if($fallback, $fallback, map.get($found, value));
178
-
179
- @if $value {
180
- @return var(#{$var}, #{$value});
130
+ $var: utils.get-var-name($variables, $name, "table");
131
+ @if $fallback {
132
+ @return var(#{$var}, #{$fallback});
181
133
  }
182
134
 
183
135
  @return var(#{$var});
184
136
  }
185
137
 
186
138
  @mixin set-var($name, $value) {
187
- $var: map.get(utils.validate($var-lookup, $name, "table var"), var);
188
-
189
- #{$var}: #{$value};
139
+ @if $value {
140
+ #{utils.get-var-name($variables, $name, "table")}: #{$value};
141
+ }
190
142
  }
191
143
 
192
144
  @mixin use-var($property, $name: $property, $fallback: null) {
@@ -227,6 +179,39 @@ $row-selected-styles: (
227
179
  }
228
180
  }
229
181
 
182
+ @mixin variables {
183
+ @if not $disable-everything {
184
+ @include set-var(background-color, $background-color);
185
+ @include set-var(header-background-color, $header-background-color);
186
+ @include set-var(cell-color, $cell-color);
187
+ @include set-var(cell-height, $cell-height);
188
+ @include set-var(cell-horizontal-padding, $cell-horizontal-padding);
189
+ @include set-var(cell-vertical-padding, $cell-vertical-padding);
190
+ @include set-var(header-cell-height, $cell-header-height);
191
+ @include set-var(selected-color, $row-selected-color);
192
+
193
+ @if not $disable-bordered {
194
+ @include set-var(border-size, $border-size);
195
+ @include set-var(border-color, $border-color);
196
+ }
197
+ @if not $disable-hoverable {
198
+ @include set-var(hover-color, $row-hover-color);
199
+ }
200
+ @if not $disable-sticky-cell {
201
+ @include set-var(sticky-cell, $sticky-cell-position);
202
+ }
203
+ @if not $disable-sticky-header {
204
+ @include set-var(sticky-header, $sticky-header-position);
205
+ }
206
+ @if not $disable-sticky-footer {
207
+ @include set-var(sticky-footer, $sticky-footer-position);
208
+ }
209
+ @if not $disable-sticky-header or not $disable-sticky-footer {
210
+ @include set-var(sticky-background-color, $sticky-background-color);
211
+ }
212
+ }
213
+ }
214
+
230
215
  @mixin styles {
231
216
  @if not $disable-everything {
232
217
  @if not $disable-container {
@@ -1,4 +1,4 @@
1
- import { type TableCellHorizontalAlignment, type TableCellVerticalAlignment } from "./TableConfigurationProvider.jsx";
1
+ import { type TableCellHorizontalAlignment, type TableCellVerticalAlignment } from "./TableConfigurationProvider.js";
2
2
  /** @remarks \@since 6.0.0 */
3
3
  export interface TableCellClassNameOptions {
4
4
  className?: string;