material-plus-ui 1.6.0 → 1.8.0

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 (501) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +20 -14
  3. package/dist/components/accordion/MPAccordion.d.ts +21 -1
  4. package/dist/components/accordion/MPAccordion.js +1 -1
  5. package/dist/components/alert/MPAlert.d.ts +34 -3
  6. package/dist/components/alert/MPAlert.js +1 -1
  7. package/dist/components/anchor/MPAnchor.d.ts +107 -0
  8. package/dist/components/anchor/MPAnchor.js +2 -0
  9. package/dist/components/anchor/index.d.ts +2 -0
  10. package/dist/components/anchor/index.js +1 -0
  11. package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
  12. package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
  13. package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
  14. package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
  15. package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
  16. package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
  17. package/dist/components/animate-counter/index.d.ts +2 -0
  18. package/dist/components/animate-counter/index.js +1 -0
  19. package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
  20. package/dist/components/animate-fade/MPAnimateFade.js +2 -1
  21. package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
  22. package/dist/components/animate-float/MPAnimateFloat.js +2 -0
  23. package/dist/components/animate-float/index.d.ts +2 -0
  24. package/dist/components/animate-float/index.js +1 -0
  25. package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
  26. package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
  27. package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
  28. package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
  29. package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
  30. package/dist/components/animate-reveal/index.d.ts +2 -0
  31. package/dist/components/animate-reveal/index.js +1 -0
  32. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
  33. package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
  34. package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
  35. package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
  36. package/dist/components/animate-scramble/index.d.ts +2 -0
  37. package/dist/components/animate-scramble/index.js +1 -0
  38. package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
  39. package/dist/components/animate-shake/MPAnimateShake.js +2 -0
  40. package/dist/components/animate-shake/index.d.ts +2 -0
  41. package/dist/components/animate-shake/index.js +1 -0
  42. package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
  43. package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
  44. package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
  45. package/dist/components/animate-split/MPAnimateSplit.js +2 -0
  46. package/dist/components/animate-split/index.d.ts +2 -0
  47. package/dist/components/animate-split/index.js +1 -0
  48. package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
  49. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
  50. package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
  51. package/dist/components/app-logo/MPAppLogo.d.ts +171 -0
  52. package/dist/components/app-logo/MPAppLogo.js +2 -0
  53. package/dist/components/app-logo/index.d.ts +2 -0
  54. package/dist/components/app-logo/index.js +1 -0
  55. package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
  56. package/dist/components/area-chart/MPAreaChart.js +2 -0
  57. package/dist/components/area-chart/index.d.ts +2 -0
  58. package/dist/components/area-chart/index.js +1 -0
  59. package/dist/components/aspect-ratio/MPAspectRatio.d.ts +1 -1
  60. package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
  61. package/dist/components/avatar/MPAvatar.d.ts +10 -1
  62. package/dist/components/avatar/MPAvatar.js +1 -1
  63. package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
  64. package/dist/components/bar-chart/MPBarChart.js +2 -0
  65. package/dist/components/bar-chart/index.d.ts +2 -0
  66. package/dist/components/bar-chart/index.js +1 -0
  67. package/dist/components/blockquote/MPBlockquote.d.ts +18 -1
  68. package/dist/components/blockquote/MPBlockquote.js +1 -1
  69. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +2 -18
  70. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
  71. package/dist/components/box/MPBox.d.ts +43 -8
  72. package/dist/components/box/MPBox.js +2 -1
  73. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  74. package/dist/components/button/MPButton.js +1 -1
  75. package/dist/components/calendar/MPCalendar.js +1 -1
  76. package/dist/components/card/MPCard.js +1 -1
  77. package/dist/components/carousel/MPCarousel.js +1 -1
  78. package/dist/components/checkbox/MPCheckbox.js +1 -1
  79. package/dist/components/chip/MPChip.d.ts +11 -2
  80. package/dist/components/chip/MPChip.js +1 -1
  81. package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
  82. package/dist/components/code-block/MPCodeBlock.js +2 -0
  83. package/dist/components/code-block/index.d.ts +2 -0
  84. package/dist/components/code-block/index.js +1 -0
  85. package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
  86. package/dist/components/collapsible/MPCollapsible.js +1 -1
  87. package/dist/components/color-picker/MPColorPicker.js +1 -1
  88. package/dist/components/combobox/MPCombobox.d.ts +21 -4
  89. package/dist/components/combobox/MPCombobox.js +1 -1
  90. package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
  91. package/dist/components/command-palette/MPCommandPalette.js +1 -1
  92. package/dist/components/config/MPConfigProvider.d.ts +49 -7
  93. package/dist/components/config/MPConfigProvider.js +1 -1
  94. package/dist/components/confirm/MPConfirmProvider.js +1 -1
  95. package/dist/components/container/MPContainer.d.ts +9 -2
  96. package/dist/components/container/MPContainer.js +2 -1
  97. package/dist/components/data-list/MPDataList.d.ts +82 -0
  98. package/dist/components/data-list/MPDataList.js +2 -0
  99. package/dist/components/data-list/index.d.ts +2 -0
  100. package/dist/components/data-list/index.js +1 -0
  101. package/dist/components/data-table/MPDataTable.d.ts +314 -0
  102. package/dist/components/data-table/MPDataTable.js +2 -0
  103. package/dist/components/data-table/index.d.ts +2 -0
  104. package/dist/components/data-table/index.js +1 -0
  105. package/dist/components/date-picker/MPDatePicker.js +1 -1
  106. package/dist/components/dialog/MPDialog.d.ts +10 -2
  107. package/dist/components/dialog/MPDialog.js +1 -1
  108. package/dist/components/drawer/MPDrawer.d.ts +8 -2
  109. package/dist/components/drawer/MPDrawer.js +1 -1
  110. package/dist/components/empty/MPEmpty.d.ts +10 -1
  111. package/dist/components/empty/MPEmpty.js +1 -1
  112. package/dist/components/fieldset/MPFieldset.js +1 -1
  113. package/dist/components/file-picker/MPFilePicker.js +1 -1
  114. package/dist/components/flex/MPFlex.d.ts +95 -0
  115. package/dist/components/flex/MPFlex.js +2 -0
  116. package/dist/components/flex/index.d.ts +2 -0
  117. package/dist/components/flex/index.js +1 -0
  118. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  119. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
  120. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
  121. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  122. package/dist/components/floating-bottom-navigation/index.js +1 -0
  123. package/dist/components/footer/MPFooter.d.ts +24 -4
  124. package/dist/components/footer/MPFooter.js +1 -1
  125. package/dist/components/form/MPForm.js +1 -1
  126. package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
  127. package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
  128. package/dist/components/gauge-chart/index.d.ts +2 -0
  129. package/dist/components/gauge-chart/index.js +1 -0
  130. package/dist/components/grid/MPGrid.d.ts +25 -8
  131. package/dist/components/grid/MPGrid.js +1 -1
  132. package/dist/components/header/MPHeader.d.ts +26 -4
  133. package/dist/components/header/MPHeader.js +1 -1
  134. package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
  135. package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
  136. package/dist/components/heatmap-chart/index.d.ts +2 -0
  137. package/dist/components/heatmap-chart/index.js +1 -0
  138. package/dist/components/hover-card/MPHoverCard.d.ts +101 -0
  139. package/dist/components/hover-card/MPHoverCard.js +2 -0
  140. package/dist/components/hover-card/index.d.ts +2 -0
  141. package/dist/components/hover-card/index.js +1 -0
  142. package/dist/components/icon/MPIcon.js +1 -1
  143. package/dist/components/image/MPImage.d.ts +122 -5
  144. package/dist/components/image/MPImage.js +1 -1
  145. package/dist/components/image/index.d.ts +1 -1
  146. package/dist/components/line-chart/MPLineChart.d.ts +66 -0
  147. package/dist/components/line-chart/MPLineChart.js +2 -0
  148. package/dist/components/line-chart/index.d.ts +2 -0
  149. package/dist/components/line-chart/index.js +1 -0
  150. package/dist/components/list/MPList.d.ts +23 -1
  151. package/dist/components/list/MPList.js +1 -1
  152. package/dist/components/menu/MPMenu.d.ts +1 -1
  153. package/dist/components/menu/MPMenu.js +1 -1
  154. package/dist/components/menubar/MPMenubar.js +1 -1
  155. package/dist/components/meter/MPMeter.d.ts +87 -0
  156. package/dist/components/meter/MPMeter.js +2 -0
  157. package/dist/components/meter/index.d.ts +2 -0
  158. package/dist/components/meter/index.js +1 -0
  159. package/dist/components/mockup/MPMockup.d.ts +143 -0
  160. package/dist/components/mockup/MPMockup.js +2 -0
  161. package/dist/components/mockup/index.d.ts +2 -0
  162. package/dist/components/mockup/index.js +1 -0
  163. package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
  164. package/dist/components/number-field/MPNumberField.js +1 -1
  165. package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
  166. package/dist/components/pie-chart/MPPieChart.js +2 -0
  167. package/dist/components/pie-chart/index.d.ts +2 -0
  168. package/dist/components/pie-chart/index.js +1 -0
  169. package/dist/components/pill/MPPill.js +1 -1
  170. package/dist/components/popconfirm/MPPopconfirm.d.ts +2 -2
  171. package/dist/components/popover/MPPopover.d.ts +1 -0
  172. package/dist/components/popover/MPPopover.js +1 -1
  173. package/dist/components/portal/MPPortal.d.ts +75 -0
  174. package/dist/components/portal/MPPortal.js +2 -0
  175. package/dist/components/portal/index.d.ts +2 -0
  176. package/dist/components/portal/index.js +1 -0
  177. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  178. package/dist/components/rating/MPRating.js +1 -1
  179. package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
  180. package/dist/components/scatter-chart/MPScatterChart.js +2 -0
  181. package/dist/components/scatter-chart/index.d.ts +2 -0
  182. package/dist/components/scatter-chart/index.js +1 -0
  183. package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
  184. package/dist/components/scroll-area/MPScrollArea.js +2 -0
  185. package/dist/components/scroll-area/index.d.ts +2 -0
  186. package/dist/components/scroll-area/index.js +1 -0
  187. package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
  188. package/dist/components/scroll-zone/MPScrollZone.js +2 -0
  189. package/dist/components/scroll-zone/index.d.ts +2 -0
  190. package/dist/components/scroll-zone/index.js +1 -0
  191. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  192. package/dist/components/select/MPSelect.d.ts +27 -4
  193. package/dist/components/select/MPSelect.js +1 -1
  194. package/dist/components/show/MPShow.d.ts +78 -0
  195. package/dist/components/show/MPShow.js +2 -0
  196. package/dist/components/show/index.d.ts +2 -0
  197. package/dist/components/show/index.js +1 -0
  198. package/dist/components/sidebar/MPSidebar.d.ts +20 -1
  199. package/dist/components/sidebar/MPSidebar.js +1 -1
  200. package/dist/components/sparkline/MPSparkline.d.ts +85 -0
  201. package/dist/components/sparkline/MPSparkline.js +2 -0
  202. package/dist/components/sparkline/index.d.ts +2 -0
  203. package/dist/components/sparkline/index.js +1 -0
  204. package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
  205. package/dist/components/spoiler/MPSpoiler.js +1 -1
  206. package/dist/components/stack/MPStack.d.ts +198 -0
  207. package/dist/components/stack/MPStack.js +2 -0
  208. package/dist/components/stack/index.d.ts +2 -0
  209. package/dist/components/stack/index.js +1 -0
  210. package/dist/components/statistic/MPStatistic.d.ts +104 -0
  211. package/dist/components/statistic/MPStatistic.js +2 -0
  212. package/dist/components/statistic/index.d.ts +2 -0
  213. package/dist/components/statistic/index.js +1 -0
  214. package/dist/components/stepper/MPStepper.js +1 -1
  215. package/dist/components/table/MPTable.d.ts +25 -3
  216. package/dist/components/table/MPTable.js +1 -1
  217. package/dist/components/tabs/MPTabs.d.ts +12 -0
  218. package/dist/components/tabs/MPTabs.js +1 -1
  219. package/dist/components/timeline/MPTimeline.js +1 -1
  220. package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
  221. package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
  222. package/dist/components/timeline-chart/index.d.ts +2 -0
  223. package/dist/components/timeline-chart/index.js +1 -0
  224. package/dist/components/toggle/MPToggle.js +1 -1
  225. package/dist/components/toolbar/MPToolbar.d.ts +106 -0
  226. package/dist/components/toolbar/MPToolbar.js +2 -0
  227. package/dist/components/toolbar/index.d.ts +2 -0
  228. package/dist/components/toolbar/index.js +1 -0
  229. package/dist/components/tooltip/MPTooltip.js +1 -1
  230. package/dist/components/tour/MPTour.d.ts +120 -0
  231. package/dist/components/tour/MPTour.js +2 -0
  232. package/dist/components/tour/index.d.ts +2 -0
  233. package/dist/components/tour/index.js +1 -0
  234. package/dist/components/transfer/MPTransfer.js +1 -1
  235. package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
  236. package/dist/components/tree-select/MPTreeSelect.js +2 -0
  237. package/dist/components/tree-select/index.d.ts +2 -0
  238. package/dist/components/tree-select/index.js +1 -0
  239. package/dist/components/tree-view/MPTreeView.d.ts +153 -0
  240. package/dist/components/tree-view/MPTreeView.js +2 -0
  241. package/dist/components/tree-view/index.d.ts +2 -0
  242. package/dist/components/tree-view/index.js +1 -0
  243. package/dist/components/typography/MPTypography.d.ts +10 -1
  244. package/dist/components/typography/MPTypography.js +2 -1
  245. package/dist/constants/glyphs.d.ts +33 -31
  246. package/dist/constants/glyphs.js +1 -1
  247. package/dist/constants/icons.d.ts +32 -31
  248. package/dist/constants/icons.js +1 -1
  249. package/dist/hooks/index.d.ts +22 -5
  250. package/dist/hooks/index.js +1 -1
  251. package/dist/hooks/useMPColorScheme.js +1 -0
  252. package/dist/hooks/useMPDisclosure.d.ts +58 -0
  253. package/dist/hooks/useMPDisclosure.js +2 -0
  254. package/dist/hooks/useMPElementSize.d.ts +55 -0
  255. package/dist/hooks/useMPElementSize.js +2 -0
  256. package/dist/hooks/useMPMediaQuery.d.ts +40 -0
  257. package/dist/hooks/useMPMediaQuery.js +2 -0
  258. package/dist/hooks/useMPOnScreen.d.ts +58 -0
  259. package/dist/hooks/useMPOnScreen.js +2 -0
  260. package/dist/hooks/useMPReducedMotion.js +1 -0
  261. package/dist/hooks/useMPWindowClass.d.ts +7 -0
  262. package/dist/hooks/useMPWindowClass.js +1 -0
  263. package/dist/index.d.ts +35 -1
  264. package/dist/index.js +1 -1
  265. package/dist/internal/Calendar.js +1 -1
  266. package/dist/internal/ChartChrome.d.ts +199 -0
  267. package/dist/internal/ChartChrome.js +2 -0
  268. package/dist/internal/ChartFrame.d.ts +197 -0
  269. package/dist/internal/ChartFrame.js +2 -0
  270. package/dist/internal/FieldOutline.d.ts +14 -5
  271. package/dist/internal/FieldOutline.js +1 -1
  272. package/dist/internal/Picker.js +1 -1
  273. package/dist/internal/PopupArrow.d.ts +60 -0
  274. package/dist/internal/PopupArrow.js +2 -0
  275. package/dist/internal/SupportingText.d.ts +24 -0
  276. package/dist/internal/SupportingText.js +1 -1
  277. package/dist/internal/animate-core.d.ts +121 -0
  278. package/dist/internal/animate-core.js +1 -0
  279. package/dist/internal/animate.d.ts +75 -55
  280. package/dist/internal/animate.js +1 -1
  281. package/dist/internal/bottom-navigation.d.ts +58 -0
  282. package/dist/internal/bottom-navigation.js +2 -0
  283. package/dist/internal/chart.d.ts +461 -0
  284. package/dist/internal/chart.js +1 -0
  285. package/dist/internal/color-scheme.d.ts +0 -9
  286. package/dist/internal/color-scheme.js +1 -1
  287. package/dist/internal/config.d.ts +24 -5
  288. package/dist/internal/config.js +1 -1
  289. package/dist/internal/data-table.d.ts +195 -0
  290. package/dist/internal/data-table.js +1 -0
  291. package/dist/internal/date.d.ts +22 -18
  292. package/dist/internal/date.js +1 -1
  293. package/dist/internal/density.d.ts +9 -0
  294. package/dist/internal/density.js +1 -0
  295. package/dist/internal/elevation.d.ts +26 -0
  296. package/dist/internal/elevation.js +1 -0
  297. package/dist/internal/highlight.d.ts +96 -0
  298. package/dist/internal/highlight.js +1 -0
  299. package/dist/internal/i18n.d.ts +180 -0
  300. package/dist/internal/initials.d.ts +28 -0
  301. package/dist/internal/initials.js +1 -0
  302. package/dist/internal/intl.d.ts +64 -0
  303. package/dist/internal/intl.js +1 -0
  304. package/dist/internal/mark.d.ts +52 -0
  305. package/dist/internal/mark.js +1 -0
  306. package/dist/internal/measure.d.ts +31 -0
  307. package/dist/internal/measure.js +1 -0
  308. package/dist/internal/messages/anchor.d.ts +3 -0
  309. package/dist/internal/messages/anchor.js +1 -0
  310. package/dist/internal/messages/chart.d.ts +3 -0
  311. package/dist/internal/messages/chart.js +1 -0
  312. package/dist/internal/messages/code.d.ts +3 -0
  313. package/dist/internal/messages/code.js +1 -0
  314. package/dist/internal/messages/data-table.d.ts +3 -0
  315. package/dist/internal/messages/data-table.js +1 -0
  316. package/dist/internal/messages/scroll.d.ts +3 -0
  317. package/dist/internal/messages/scroll.js +1 -0
  318. package/dist/internal/messages/sparkline.d.ts +3 -0
  319. package/dist/internal/messages/sparkline.js +1 -0
  320. package/dist/internal/messages/tour.d.ts +3 -0
  321. package/dist/internal/messages/tour.js +1 -0
  322. package/dist/internal/messages/transfer.d.ts +1 -1
  323. package/dist/internal/messages/transfer.js +1 -1
  324. package/dist/internal/mockup.d.ts +174 -0
  325. package/dist/internal/mockup.js +2 -0
  326. package/dist/internal/page-layout.d.ts +24 -5
  327. package/dist/internal/page-layout.js +1 -1
  328. package/dist/internal/responsive.d.ts +55 -0
  329. package/dist/internal/responsive.js +1 -0
  330. package/dist/internal/scale.d.ts +0 -17
  331. package/dist/internal/scale.js +1 -1
  332. package/dist/internal/step.d.ts +15 -0
  333. package/dist/internal/step.js +1 -1
  334. package/dist/internal/table.d.ts +53 -0
  335. package/dist/internal/table.js +1 -0
  336. package/dist/internal/text.d.ts +57 -0
  337. package/dist/internal/text.js +1 -0
  338. package/dist/internal/threshold.d.ts +19 -0
  339. package/dist/internal/threshold.js +1 -0
  340. package/dist/internal/time-scale.d.ts +44 -0
  341. package/dist/internal/time-scale.js +1 -0
  342. package/dist/internal/transition.d.ts +33 -0
  343. package/dist/internal/transition.js +1 -0
  344. package/dist/internal/visibility.d.ts +48 -0
  345. package/dist/internal/visibility.js +1 -0
  346. package/dist/internal/window-class.d.ts +29 -2
  347. package/dist/internal/window-class.js +1 -1
  348. package/dist/locales/ar.js +1 -1
  349. package/dist/locales/de.js +1 -1
  350. package/dist/locales/es.js +1 -1
  351. package/dist/locales/fr.js +1 -1
  352. package/dist/locales/hi.js +1 -1
  353. package/dist/locales/id.js +1 -1
  354. package/dist/locales/it.js +1 -1
  355. package/dist/locales/ja.js +1 -1
  356. package/dist/locales/ko.js +1 -1
  357. package/dist/locales/nl.js +1 -1
  358. package/dist/locales/pl.js +1 -1
  359. package/dist/locales/pt.js +1 -1
  360. package/dist/locales/ru.js +1 -1
  361. package/dist/locales/th.js +1 -1
  362. package/dist/locales/tr.js +1 -1
  363. package/dist/locales/vi.js +1 -1
  364. package/dist/locales/zh-hans.js +1 -1
  365. package/dist/locales/zh-hant.js +1 -1
  366. package/dist/styles/accordion.css +1 -1
  367. package/dist/styles/alert.css +1 -1
  368. package/dist/styles/anchor.css +2 -0
  369. package/dist/styles/animate-appear.css +1 -1
  370. package/dist/styles/animate-blink.css +1 -1
  371. package/dist/styles/animate-counter.css +2 -0
  372. package/dist/styles/animate-fade.css +1 -1
  373. package/dist/styles/animate-float.css +2 -0
  374. package/dist/styles/animate-grow.css +1 -1
  375. package/dist/styles/animate-headline.css +1 -1
  376. package/dist/styles/animate-lighting.css +1 -1
  377. package/dist/styles/animate-marquee.css +1 -1
  378. package/dist/styles/animate-reveal.css +2 -0
  379. package/dist/styles/animate-rotate.css +1 -1
  380. package/dist/styles/animate-scramble.css +2 -0
  381. package/dist/styles/animate-shake.css +2 -0
  382. package/dist/styles/animate-slide.css +1 -1
  383. package/dist/styles/animate-split.css +2 -0
  384. package/dist/styles/animate-typing.css +1 -1
  385. package/dist/styles/animate-zoom.css +1 -1
  386. package/dist/styles/app-logo.css +2 -0
  387. package/dist/styles/area-chart.css +2 -0
  388. package/dist/styles/aspect-ratio.css +1 -1
  389. package/dist/styles/avatar.css +1 -1
  390. package/dist/styles/badge.css +1 -1
  391. package/dist/styles/bar-chart.css +2 -0
  392. package/dist/styles/blockquote.css +1 -1
  393. package/dist/styles/bottom-navigation.css +1 -1
  394. package/dist/styles/box.css +1 -1
  395. package/dist/styles/breadcrumb.css +1 -1
  396. package/dist/styles/button.css +1 -1
  397. package/dist/styles/calendar.css +1 -1
  398. package/dist/styles/card.css +1 -1
  399. package/dist/styles/carousel.css +1 -1
  400. package/dist/styles/chat-bubble.css +1 -1
  401. package/dist/styles/checkbox.css +1 -1
  402. package/dist/styles/chip.css +1 -1
  403. package/dist/styles/code-block.css +2 -0
  404. package/dist/styles/collapsible.css +1 -1
  405. package/dist/styles/color-picker.css +1 -1
  406. package/dist/styles/combobox.css +1 -1
  407. package/dist/styles/command-palette.css +1 -1
  408. package/dist/styles/config.css +1 -1
  409. package/dist/styles/confirm.css +1 -1
  410. package/dist/styles/container.css +1 -1
  411. package/dist/styles/data-list.css +2 -0
  412. package/dist/styles/data-table.css +2 -0
  413. package/dist/styles/date-picker.css +1 -1
  414. package/dist/styles/date-range-picker.css +1 -1
  415. package/dist/styles/date-time-picker.css +1 -1
  416. package/dist/styles/dialog.css +1 -1
  417. package/dist/styles/divider.css +1 -1
  418. package/dist/styles/drawer.css +1 -1
  419. package/dist/styles/empty.css +1 -1
  420. package/dist/styles/fieldset.css +1 -1
  421. package/dist/styles/file-picker.css +1 -1
  422. package/dist/styles/flex.css +2 -0
  423. package/dist/styles/floating-action-button.css +1 -1
  424. package/dist/styles/floating-bottom-navigation.css +2 -0
  425. package/dist/styles/footer.css +1 -1
  426. package/dist/styles/form.css +1 -1
  427. package/dist/styles/gauge-chart.css +2 -0
  428. package/dist/styles/grid.css +1 -1
  429. package/dist/styles/header.css +1 -1
  430. package/dist/styles/heatmap-chart.css +2 -0
  431. package/dist/styles/highlight.css +1 -1
  432. package/dist/styles/hover-card.css +2 -0
  433. package/dist/styles/icon-button.css +1 -1
  434. package/dist/styles/icon.css +1 -1
  435. package/dist/styles/image.css +1 -1
  436. package/dist/styles/line-chart.css +2 -0
  437. package/dist/styles/list.css +1 -1
  438. package/dist/styles/locale.css +1 -1
  439. package/dist/styles/menu.css +1 -1
  440. package/dist/styles/menubar.css +1 -1
  441. package/dist/styles/meter.css +2 -0
  442. package/dist/styles/mockup.css +2 -0
  443. package/dist/styles/navigation-menu.css +1 -1
  444. package/dist/styles/number-field.css +1 -1
  445. package/dist/styles/otp-field.css +1 -1
  446. package/dist/styles/overlay.css +1 -1
  447. package/dist/styles/page-layout.css +1 -1
  448. package/dist/styles/pagination.css +1 -1
  449. package/dist/styles/pie-chart.css +2 -0
  450. package/dist/styles/pill.css +1 -1
  451. package/dist/styles/popconfirm.css +1 -1
  452. package/dist/styles/popover.css +1 -1
  453. package/dist/styles/portal.css +2 -0
  454. package/dist/styles/progress-box.css +1 -1
  455. package/dist/styles/progress-circular.css +1 -1
  456. package/dist/styles/progress-linear.css +1 -1
  457. package/dist/styles/radio-group.css +1 -1
  458. package/dist/styles/rating.css +1 -1
  459. package/dist/styles/scatter-chart.css +2 -0
  460. package/dist/styles/scroll-area.css +2 -0
  461. package/dist/styles/scroll-zone.css +2 -0
  462. package/dist/styles/segmented-button.css +1 -1
  463. package/dist/styles/select.css +1 -1
  464. package/dist/styles/show.css +2 -0
  465. package/dist/styles/sidebar.css +1 -1
  466. package/dist/styles/skeleton.css +1 -1
  467. package/dist/styles/slider.css +1 -1
  468. package/dist/styles/snackbar.css +1 -1
  469. package/dist/styles/sparkline.css +2 -0
  470. package/dist/styles/spoiler.css +1 -1
  471. package/dist/styles/stack.css +2 -0
  472. package/dist/styles/statistic.css +2 -0
  473. package/dist/styles/stepper.css +1 -1
  474. package/dist/styles/switch.css +1 -1
  475. package/dist/styles/table.css +1 -1
  476. package/dist/styles/tabs.css +1 -1
  477. package/dist/styles/text-field.css +1 -1
  478. package/dist/styles/text-link.css +1 -1
  479. package/dist/styles/time-picker.css +1 -1
  480. package/dist/styles/timeline-chart.css +2 -0
  481. package/dist/styles/timeline.css +1 -1
  482. package/dist/styles/toggle.css +1 -1
  483. package/dist/styles/tokens.css +1 -1
  484. package/dist/styles/toolbar.css +2 -0
  485. package/dist/styles/tour.css +2 -0
  486. package/dist/styles/transfer.css +1 -1
  487. package/dist/styles/tree-select.css +2 -0
  488. package/dist/styles/tree-view.css +2 -0
  489. package/dist/styles/typography.css +1 -1
  490. package/dist/styles.css +1 -1
  491. package/dist/tailwind.css +2606 -185
  492. package/dist/types.d.ts +566 -5
  493. package/package.json +26 -25
  494. package/.fix.py +0 -92
  495. package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
  496. package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
  497. package/dist/components/avatar-group/index.d.ts +0 -2
  498. package/dist/components/avatar-group/index.js +0 -1
  499. package/dist/internal/avatar-group.d.ts +0 -22
  500. package/dist/internal/avatar-group.js +0 -2
  501. package/dist/styles/avatar-group.css +0 -2
@@ -0,0 +1,78 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPSize, MPThreshold } from '../../types.js';
3
+ export interface MPGaugeChartProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
4
+ /** The reading. */
5
+ value: number;
6
+ /** @default 0 */
7
+ min?: number;
8
+ /** @default 100 */
9
+ max?: number;
10
+ /**
11
+ * How far round the dial goes, in degrees, centred on twelve o'clock.
12
+ *
13
+ * `180` is a half dial sitting on its base; `240` is the classic gauge, open
14
+ * at the bottom. Past about 300 the two ends meet and the reader can no
15
+ * longer tell the start from the finish.
16
+ * @default 240
17
+ */
18
+ sweep?: number;
19
+ /** What the reading is called, under the figure. */
20
+ label?: React.ReactNode;
21
+ /**
22
+ * Where the reading changes colour. The last threshold it has reached wins,
23
+ * so they are listed smallest first.
24
+ */
25
+ thresholds?: readonly MPThreshold[];
26
+ /**
27
+ * Paints the **track** in threshold bands as well as the fill, so a reader
28
+ * sees where the trouble starts before the needle gets there.
29
+ * @default false
30
+ */
31
+ bands?: boolean;
32
+ /** The family the dial carries before any threshold is reached. @default 'primary' */
33
+ color?: MPColor;
34
+ /** How the figure in the middle is written. */
35
+ format?: Intl.NumberFormatOptions;
36
+ /** Which language that figure is written in. */
37
+ locale?: string;
38
+ /** How tall the drawing is. Defaults to the `size` ladder. */
39
+ height?: number | string;
40
+ /** @default 'md' */
41
+ size?: MPSize;
42
+ }
43
+ /**
44
+ * One reading on a dial.
45
+ *
46
+ * ```tsx
47
+ * <MPGaugeChart value={72} label="CPU" thresholds={[{ from: 80, color: 'error' }]} />
48
+ * ```
49
+ *
50
+ * ## Consider not using one
51
+ *
52
+ * A gauge spends a whole panel on a single number, and the arc adds nothing a
53
+ * reader could not get from the figure and a bar: an angle is judged less
54
+ * accurately than a length, and a dial's ends are the two places the eye is
55
+ * worst at. [MPStatistic](statistic) with an [MPMeter](../feedback/meter) under
56
+ * it says the same thing in a third of the room and reads better.
57
+ *
58
+ * What a gauge is genuinely good for is a **thresholded** reading somebody
59
+ * watches — a dial where the amber band is drawn on the face, so the question
60
+ * "how close is this to trouble" is answered by where the needle sits rather
61
+ * than by arithmetic. That is what `bands` is for, and it is the case worth
62
+ * reaching for this shape over the other two.
63
+ *
64
+ * ## It is a meter, in the markup
65
+ *
66
+ * `role="meter"` with the value, the minimum and the maximum on it — the same
67
+ * semantics [MPMeter](../feedback/meter) carries, because they are the same
68
+ * quantity in two shapes. There is no table behind it and no hover layer: a
69
+ * chart of one number has nothing a reader could uncover that the figure in the
70
+ * middle is not already saying.
71
+ *
72
+ * ## Thresholds name roles
73
+ *
74
+ * `{ from: 80, color: 'error' }` and never a hex, so a dial and a bar on the
75
+ * same page cannot disagree about where the amber starts. Both read the same
76
+ * resolver.
77
+ */
78
+ export declare function MPGaugeChart({ value, min, max, sweep, label, thresholds, bands, color: colorProp, format, locale: localeProp, height, size: sizeProp, className, style, ...props }: MPGaugeChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Meter as l}from"@base-ui/react/meter";import{useMPElementSize as r}from"../../hooks/useMPElementSize.js";import{useMPColor as o,useMPSize as m}from"../../internal/config.js";import{useMPLocale as i}from"../../internal/locale.js";import{accentSlots as s}from"../../internal/accent.js";import{thresholdColor as n}from"../../internal/threshold.js";import{progressFraction as c}from"../../internal/progress.js";import{CHART_FONT_SIZE as h,PLOT_HEIGHT as p,arcPath as f,formatStatistic as u}from"../../internal/chart.js";import{cssLength as d}from"../../internal/length.js";import{META_TEXT as x}from"../../internal/scale.js";const g={xs:"text-mp-title-medium",sm:"text-mp-title-large",md:"text-mp-headline-small",lg:"text-mp-headline-medium",xl:"text-mp-display-small"};export function MPGaugeChart({value:v,min:j=0,max:M=100,sweep:_=240,label:b,thresholds:y,bands:w=!1,color:N,format:P,locale:$,height:z,size:I,className:k,style:B,...R}){const C=m(I),E=o(N),G=i($),L=a.useRef(null),S=r(L),V=c(v,j,M)??0,W=n(v,E,y),q=h[C],A=S.width,D="number"==typeof z?z:void 0===z?p[C]:S.height,F=Math.min(300,Math.max(30,_))*Math.PI/180,H=F/2,J=H>Math.PI/2?Math.cos(Math.PI-H):0,K=Math.min(A/2,D/(1+J)),O=Math.max(0,K-2),Q=.78*O,T=A/2,U=O+2,X=-H,Y=H,Z=X+V*F,ee=a.useMemo(()=>{if(!w||!y||0===y.length)return[{from:0,to:1,color:E}];const e=[...y.map(e=>({at:c(e.from,j,M)??0,color:e.color})).filter(e=>e.at>0&&e.at<1).sort((e,t)=>e.at-t.at)],t=[];let a=0,l=E;for(const r of e)t.push({from:a,to:r.at,color:l}),a=r.at,l=r.color;return t.push({from:a,to:1,color:l}),t},[w,y,E,j,M]),te=u(v,G,P,!1);return t(l.Root,{value:v,min:j,max:M,format:P,"data-mp-size":C,className:["mp-gauge-chart flex min-w-0 flex-col items-center",k??""].filter(Boolean).join(" "),style:{...s(W),...B},...R,children:[t("div",{ref:L,className:"mp-gauge-chart__dial relative w-full",style:{height:d(z)??p[C]},children:[A>0&&O>0?t("svg",{width:A,height:D,viewBox:`0 0 ${A} ${D}`,"aria-hidden":"true",className:"block overflow-visible",children:[ee.map((t,a)=>e("path",{d:f(T,U,O,Q,X+t.from*F,X+t.to*F),fill:w?`var(--_mp-color-${t.color})`:"var(--_mp-color-on-surface)",opacity:w?.22:.12},a)),e("path",{d:f(T,U,O,Q,X,Z),fill:"var(--_mp-accent)"}),e("path",{d:f(T,U,O,Q,X,X+.004*F),fill:"var(--_mp-color-outline)"}),e("path",{d:f(T,U,O,Q,Y-.004*F,Y),fill:"var(--_mp-color-outline)"})]}):null,t("div",{className:"pointer-events-none absolute inset-x-0 flex flex-col items-center",style:{top:U-.45*Q},children:[e(l.Value,{className:`mp-gauge-chart__value text-mp-on-surface font-medium tabular-nums ${g[C]}`,children:e=>P?e:te}),b?e(l.Label,{className:`mp-gauge-chart__label text-mp-on-surface-variant ${x}`,style:{maxWidth:1.8*Q},children:b}):null]})]}),J>0?e("span",{"aria-hidden":"true",style:{height:q/2}}):null]})}
@@ -0,0 +1,2 @@
1
+ export { MPGaugeChart } from './MPGaugeChart.js';
2
+ export type { MPGaugeChartProps } from './MPGaugeChart.js';
@@ -0,0 +1 @@
1
+ export{MPGaugeChart}from"./MPGaugeChart.js";
@@ -15,19 +15,28 @@ export type MPGridAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
15
15
  /** The same, for one item overriding the row it is in. */
16
16
  export type MPGridAlignSelf = MPGridAlign | 'auto';
17
17
  /**
18
- * How wide one item is: a number of the grid's columns, or `'grow'`.
18
+ * How wide one item is: a number of the grid's columns, `'grow'` or `'auto'`.
19
19
  *
20
- * `'grow'` is the one value that is not a measurement. It is "whatever the row
21
- * has left after everybody else has taken theirs", which is the width a
22
- * thumbnail's neighbour wants and the one thing a twelve-column arithmetic
23
- * cannot express — the remainder is only known once the other items in *that*
24
- * row have been laid out, and no `span` a caller writes down knows what else is
25
- * in the row.
20
+ * Neither word is a measurement, and they are the two ends of the same question
21
+ * a column count cannot answer. `'grow'` is "whatever the row has left after
22
+ * everybody else has taken theirs" — the width a thumbnail's neighbour wants,
23
+ * and one the arithmetic cannot reach because the remainder is only known once
24
+ * the other items in *that* row have been laid out. `'auto'` is "exactly what is
25
+ * inside me", which the arithmetic cannot reach either: what is inside an item
26
+ * is measured by the browser, and a share of twelve columns has to be written
27
+ * down in advance.
28
+ *
29
+ * They pair. A control bar whose left half is a set of transport buttons and
30
+ * whose right half is however many icon buttons the page turned out to need is
31
+ * `span="grow"` and `span="auto"`, and neither side has a number in it — which
32
+ * matters because the number would be wrong: four 32px buttons in `span={2}` of
33
+ * a 768px bar is 128px against 128px, and the pixel that sub-pixel rounding
34
+ * takes off wraps the last button onto a second row.
26
35
  *
27
36
  * Two growing items in a row split the remainder equally rather than by their
28
37
  * contents, which is the useful half of what makes it predictable.
29
38
  */
30
- export type MPGridSpan = number | 'grow';
39
+ export type MPGridSpan = number | 'grow' | 'auto';
31
40
  export interface MPGridProps extends React.ComponentPropsWithoutRef<'div'> {
32
41
  /**
33
42
  * How many columns a row is divided into. Every `span` and every `offset`
@@ -96,6 +105,14 @@ export interface MPGridItemProps extends React.ComponentPropsWithoutRef<'div'> {
96
105
  * when the picture's column count changes. It is responsive like any other
97
106
  * value: `span={{ compact: 12, medium: 'grow' }}` stacks on a phone and fills
98
107
  * the rest of the row from 600dp.
108
+ *
109
+ * `span="auto"` is the other end of that: exactly the width of what is inside
110
+ * the item, however much that turns out to be. It is the span for a group
111
+ * whose size is a runtime question — a row of icon buttons where how many
112
+ * there are depends on what the page can do — and it pairs with `'grow'`, one
113
+ * item taking what it needs and the other taking the rest. An `'auto'` item
114
+ * does not shrink, so contents wider than the row overflow rather than
115
+ * squeezing what is beside them.
99
116
  * @default the grid's full width
100
117
  */
101
118
  span?: MPResponsive<MPGridSpan>;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";import{WINDOW_CLASSES as n}from"../../internal/window-class.js";function r(e){return null==e?{}:"object"==typeof e?e:{compact:e}}function o(e,t,o){const s=r(t),a={};for(const t of n){const n=s[t];void 0!==n&&(a[`--_mp-${e}-${t}`]=o(n))}return a}function s(e,t){return null==e?t:"object"==typeof e?{compact:t,...e}:e}function a(e){return String(Math.max(1,Math.round(e)))}function c(e){return String(Math.max(1,Math.round(e)))}function i(e){const t=r(e),o=Object.values(t).some(e=>"grow"===e),s={};for(const e of n){const n=t[e];void 0!==n&&("grow"!==n&&(s[`--_mp-span-${e}`]=c(n)),o&&(s[`--_mp-grow-${e}`]="grow"===n?"1":"0"))}return s}function f(e){return String(Math.max(0,Math.round(e)))}function l(e){const t=.25*Math.max(0,e);return`${Number(t.toFixed(5))}rem`}const u={start:"justify-start",center:"justify-center",end:"justify-end","space-between":"justify-between","space-around":"justify-around","space-evenly":"justify-evenly"},p={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},m={start:"content-start",center:"content-center",end:"content-end","space-between":"content-between","space-around":"content-around","space-evenly":"content-evenly",stretch:"content-stretch"},d={auto:"self-auto",start:"self-start",center:"self-center",end:"self-end",stretch:"self-stretch",baseline:"self-baseline"};export const MPGrid=/*@__PURE__*/e.forwardRef(function({columns:e,spacing:n,rowSpacing:r,columnSpacing:c,justifyContent:i,alignItems:f,alignContent:d,wrap:g=!0,render:y,className:h,style:w,children:b,...j},x){return t({render:y,ref:x,props:{className:["mp-grid flex",g?"flex-wrap":"flex-nowrap","gap-x-(--_mp-gap-x) gap-y-(--_mp-gap-y)",i?u[i]:"",f?p[f]:"",d?m[d]:"",h??""].filter(Boolean).join(" "),style:{...o("cols",s(e,12),a),...o("gap-x",s(c??n,4),l),...o("gap-y",s(r??n,4),l),...w},children:b,...j}})});export const MPGridItem=/*@__PURE__*/e.forwardRef(function({span:e,offset:n,alignSelf:r,render:s,className:a,style:c,children:l,...u},p){return t({render:s,ref:p,props:{className:["mp-grid-item",r?d[r]:"",a??""].filter(Boolean).join(" "),style:{...i(e),...o("offset",n,f),...c},children:l,...u}})});
2
+ import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";import{classMap as n,responsiveSlots as r,withBaseline as s}from"../../internal/responsive.js";import{WINDOW_CLASSES as a}from"../../internal/window-class.js";function o(e){return String(Math.max(1,Math.round(e)))}function c(e){return String(Math.max(1,Math.round(e)))}function i(e){const t=n(e),r=Object.values(t),s=r.some(e=>"grow"===e),o=r.some(e=>"auto"===e),i={};for(const e of a){const n=t[e];void 0!==n&&("grow"!==n&&"auto"!==n&&(i[`--_mp-span-${e}`]=c(n)),s&&(i[`--_mp-grow-${e}`]="grow"===n?"1":"0"),o&&(i[`--_mp-width-${e}`]="auto"===n?"auto":"var(--_mp-span-width)"))}return i}function l(e){return String(Math.max(0,Math.round(e)))}function f(e){const t=.25*Math.max(0,e);return`${Number(t.toFixed(5))}rem`}const p={start:"justify-start",center:"justify-center",end:"justify-end","space-between":"justify-between","space-around":"justify-around","space-evenly":"justify-evenly"},u={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},m={start:"content-start",center:"content-center",end:"content-end","space-between":"content-between","space-around":"content-around","space-evenly":"content-evenly",stretch:"content-stretch"},d={auto:"self-auto",start:"self-start",center:"self-center",end:"self-end",stretch:"self-stretch",baseline:"self-baseline"};export const MPGrid=/*@__PURE__*/e.forwardRef(function({columns:e,spacing:n,rowSpacing:a,columnSpacing:c,justifyContent:i,alignItems:l,alignContent:d,wrap:g=!0,render:h,className:w,style:y,children:x,...j},b){return t({render:h,ref:b,props:{className:["mp-grid flex",g?"flex-wrap":"flex-nowrap","gap-x-(--_mp-gap-x) gap-y-(--_mp-gap-y)",i?p[i]:"",l?u[l]:"",d?m[d]:"",w??""].filter(Boolean).join(" "),style:{...r("cols",s(e,12),o),...r("gap-x",s(c??n,4),f),...r("gap-y",s(a??n,4),f),...y},children:x,...j}})});export const MPGridItem=/*@__PURE__*/e.forwardRef(function({span:e,offset:n,alignSelf:s,render:a,className:o,style:c,children:f,...p},u){return t({render:a,ref:u,props:{className:["mp-grid-item",s?d[s]:"",o??""].filter(Boolean).join(" "),"data-mp-offset":null==n?void 0:"",style:{...i(e),...r("offset",n,l),...c},children:f,...p}})});
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
- import type { MPAlign, MPPosition, MPSize, MPVariant } from '../../types.js';
3
+ import type { MPAlign, MPDensity, MPMeasure, MPPosition, MPResponsive, MPSize, MPElevation, MPVariant } from '../../types.js';
4
4
  export interface MPHeaderProps extends Omit<React.ComponentPropsWithoutRef<'header'>, 'title'> {
5
5
  /**
6
6
  * The leading slot: the mark, the product's name, the thing that is the same
@@ -50,6 +50,16 @@ export interface MPHeaderProps extends Omit<React.ComponentPropsWithoutRef<'head
50
50
  * @default 'tonal'
51
51
  */
52
52
  variant?: MPVariant;
53
+ /**
54
+ * How far off the page the bar is lifted, on MD3's own scale.
55
+ *
56
+ * It moves the tone as well as the shadow — see `MPElevation`. A bar's
57
+ * `elevated` is level 2 rather than 1, because a bar sits over the page's
58
+ * content rather than in it; an explicit level says exactly what it says.
59
+ *
60
+ * Left unset, `variant` decides.
61
+ */
62
+ elevation?: MPElevation;
53
63
  /**
54
64
  * The bar's height floor, its gutter and the air between its slots.
55
65
  *
@@ -59,13 +69,25 @@ export interface MPHeaderProps extends Omit<React.ComponentPropsWithoutRef<'head
59
69
  * @default 'md'
60
70
  */
61
71
  size?: MPSize;
72
+ /**
73
+ * Takes room out of the bar's gutter.
74
+ *
75
+ * The height floor is `size`'s and stays where it is: a top app bar that a
76
+ * dense page shrank would move every fixed thing under it, and the bar is the
77
+ * one part of a screen a reader locates by position. What tightens is the
78
+ * room at its edges.
79
+ * @default 0
80
+ */
81
+ density?: MPDensity;
62
82
  /**
63
83
  * Holds the row of slots to a measure and centres it while the sheet itself
64
- * still spans the window. The same ladder [MPContainer](./container)'s
65
- * `maxWidth` uses, so a header and the container under it line up on one edge.
84
+ * still spans the window. The same prop [MPContainer](./container)'s
85
+ * `maxWidth` is — a rung of the size ladder, a CSS length of your own, or a
86
+ * map keyed by window size class — so a header and the container under it line
87
+ * up on one edge by being given the same value.
66
88
  * @default 'none'
67
89
  */
68
- maxWidth?: MPSize | 'none';
90
+ maxWidth?: MPResponsive<MPMeasure>;
69
91
  /**
70
92
  * The gutter down each side of the row.
71
93
  * @default true
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as i}from"@base-ui/react/use-render";import{BAR_SURFACE as n,MPPageLayoutContext as r}from"../../internal/page-layout.js";import{hasContent as s,MEASURE as l,SHEET_PAD_X as m}from"../../internal/scale.js";import{useMPSize as d}from"../../internal/config.js";const o={xs:"min-h-12",sm:"min-h-14",md:"min-h-16",lg:"min-h-20",xl:"min-h-24"},c={xs:"text-mp-title-small",sm:"text-mp-title-medium",md:"text-mp-title-large",lg:"text-mp-headline-small",xl:"text-mp-headline-medium"},p={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},x={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},f={static:"",absolute:"absolute inset-x-0 top-0 z-30",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},u={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},h={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const MPHeader=/*@__PURE__*/a.forwardRef(function({brand:g,actions:b,align:j="start",position:v="sticky",variant:w="tonal",size:y,maxWidth:N="none",padded:k=!0,label:_,render:z,className:$,children:B,...C},H){const M=d(y),{register:P}=a.useContext(r),R=a.useCallback(e=>{P("header",e),"function"==typeof H?H(e):H&&(H.current=e)},[P,H]);return i({render:z??e("header",{}),ref:R,props:{"aria-label":_,"data-mp-size":M,"data-mp-variant":w,className:["mp-header text-mp-on-surface box-border w-full min-w-0",n[w],"outlined"===w?"border-mp-outline-variant border-b":"",f[v],$??""].filter(Boolean).join(" "),children:t("div",{className:["flex w-full items-center",o[M],x[M],k?m[M]:"","none"===N?"":`${l[N]} mx-auto`].filter(Boolean).join(" "),children:[s(g)?e("div",{className:["mp-header__brand flex min-w-0 items-center",u[j],p[M],c[M]].join(" "),children:g}):"center"===j?e("div",{"aria-hidden":"true",className:u[j]}):null,s(B)?e("div",{className:`mp-header__middle ${h[j]} ${p[M]}`,children:B}):null,s(b)?e("div",{className:["mp-header__actions flex min-w-0 items-center justify-end",u[j],p[M]].join(" "),children:b}):"center"===j?e("div",{"aria-hidden":"true",className:u[j]}):null]}),...C}})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as i from"react";import{useRender as n}from"@base-ui/react/use-render";import{barSurface as r,MPPageLayoutContext as a}from"../../internal/page-layout.js";import{hasContent as s}from"../../internal/scale.js";import{sheetPadX as l}from"../../internal/density.js";import{measureValue as m}from"../../internal/measure.js";import{useWindowMins as o}from"../../internal/window-class.js";import{responsiveSlots as d,withBaseline as c}from"../../internal/responsive.js";import{useMPDensity as p,useMPSize as f}from"../../internal/config.js";const x={xs:"min-h-12",sm:"min-h-14",md:"min-h-16",lg:"min-h-20",xl:"min-h-24"},u={xs:"text-mp-title-small",sm:"text-mp-title-medium",md:"text-mp-title-large",lg:"text-mp-headline-small",xl:"text-mp-headline-medium"},h={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},g={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},j={static:"",absolute:"absolute inset-x-0 top-0 z-30",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},b={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},v={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const MPHeader=/*@__PURE__*/i.forwardRef(function({brand:y,actions:w,align:N="start",position:k="sticky",variant:_="tonal",elevation:z,size:B,density:C,maxWidth:$="none",padded:H=!0,label:M,render:P,className:R,children:W,...q},A){const D=f(B),E=p(C),F=o(),{register:G}=i.useContext(a),I=i.useCallback(e=>{G("header",e),"function"==typeof A?A(e):A&&(A.current=e)},[G,A]);return n({render:P??e("header",{}),ref:I,props:{"aria-label":M,"data-mp-size":D,"data-mp-variant":_,className:["mp-header text-mp-on-surface box-border w-full min-w-0",r(_,z),"outlined"===_?"border-mp-outline-variant border-b":"",j[k],R??""].filter(Boolean).join(" "),children:t("div",{className:["flex w-full items-center",x[D],g[D],H?l(D,E):"","none"===$?"":"mp-measure mx-auto"].filter(Boolean).join(" "),style:"none"===$?void 0:d("measure",c($,"none"),e=>m(e,F)),children:[s(y)?e("div",{className:["mp-header__brand flex min-w-0 items-center",b[N],h[D],u[D]].join(" "),children:y}):"center"===N?e("div",{"aria-hidden":"true",className:b[N]}):null,s(W)?e("div",{className:`mp-header__middle ${v[N]} ${h[D]}`,children:W}):null,s(w)?e("div",{className:["mp-header__actions flex min-w-0 items-center justify-end",b[N],h[D]].join(" "),children:w}):"center"===N?e("div",{"aria-hidden":"true",className:b[N]}):null]}),...q}})});
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ import { type ChartBaseProps } from '../../internal/ChartChrome.js';
3
+ import type { MPChartAxis, MPChartCategory, MPChartSeries } from '../../types.js';
4
+ export interface MPHeatmapChartProps extends ChartBaseProps {
5
+ /**
6
+ * The rows. Each series is one row and its `data` are that row's cells, in
7
+ * the order `categories` names the columns.
8
+ */
9
+ series: readonly MPChartSeries[];
10
+ /** The column headings. */
11
+ categories?: readonly MPChartCategory[];
12
+ /** The column axis. Only `label`, `hidden` and `tickFormat` mean anything here. */
13
+ xAxis?: MPChartAxis;
14
+ /** The row axis, same three. */
15
+ yAxis?: MPChartAxis;
16
+ /**
17
+ * Where the colour scale starts and ends. Taken from the data otherwise.
18
+ *
19
+ * Worth pinning when two heatmaps are meant to be compared: without it each
20
+ * one scales to its own range, and the darkest cell of a quiet week looks
21
+ * exactly like the darkest cell of a bad one.
22
+ */
23
+ min?: number;
24
+ max?: number;
25
+ /**
26
+ * Writes each cell's value in it, where the cell is big enough to hold the
27
+ * text. One that does not fit is dropped rather than clipped.
28
+ * @default false
29
+ */
30
+ valueLabels?: boolean;
31
+ }
32
+ /**
33
+ * A grid of cells, coloured by how much.
34
+ *
35
+ * ```tsx
36
+ * <MPHeatmapChart
37
+ * categories={['Mon', 'Tue', 'Wed']}
38
+ * series={[
39
+ * { name: '09:00', data: [4, 9, 2] },
40
+ * { name: '10:00', data: [7, 12, 5] }
41
+ * ]}
42
+ * />
43
+ * ```
44
+ *
45
+ * Two categorical axes and a magnitude in the cells. It is the shape for a
46
+ * pattern across two dimensions — a week by hour, a cohort by month — where
47
+ * what a reader is looking for is *where* the dense part is rather than what
48
+ * any one cell holds.
49
+ *
50
+ * ## Its colour is a ramp, not the palette
51
+ *
52
+ * The eight chart slots are an **identity** channel: they say which series, and
53
+ * nobody can tell whether slot 6 is more than slot 3. A cell's colour here has
54
+ * to say how much, so it comes from a sequential ramp instead — one hue, five
55
+ * steps, running pale to deep on a light page and deep to bright on a dark one,
56
+ * because "more" has to be further from the page in both.
57
+ *
58
+ * That also sidesteps the cap the palette runs into: every cell touches its
59
+ * neighbours, and colour separates only three touching series. A ramp is not
60
+ * being asked to separate anything — it is being asked to be ordered.
61
+ *
62
+ * ## Steps rather than a gradient
63
+ *
64
+ * A smooth fill looks better and reads worse. Given a gradient a reader can say
65
+ * "darker" and nothing else; given five steps they can match a cell to a band
66
+ * in the legend and come away with a number.
67
+ *
68
+ * ## Pin the scale to compare two of them
69
+ *
70
+ * By default each heatmap scales to its own range, so two side by side say
71
+ * nothing to each other — the darkest cell of a quiet week looks exactly like
72
+ * the darkest cell of a bad one. Give both the same `min` and `max` when the
73
+ * comparison is the point.
74
+ */
75
+ export declare function MPHeatmapChart({ series, categories, xAxis, yAxis, min, max, valueLabels, height, format, locale: localeProp, label, legend, tooltip, empty, size: sizeProp, className, style, ...rest }: MPHeatmapChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useMPElementSize as n}from"../../hooks/useMPElementSize.js";import{useMPLocale as a,useMPMessages as r}from"../../internal/locale.js";import{useMPSize as o}from"../../internal/config.js";import{CHART as i}from"../../internal/messages/chart.js";import{TABLE as m}from"../../internal/messages/table.js";import{ChartShell as s,ChartTable as c,ChartTooltipPanel as h}from"../../internal/ChartChrome.js";import{CHART_FONT_SIZE as u,MARK_GAP as d,PLOT_HEIGHT as f,RAMP_STEPS as p,formatCategory as x,formatStatistic as g,rampFill as v,rampInk as y,rampStep as w,textWidth as b,toValues as k,truncate as M}from"../../internal/chart.js";export function MPHeatmapChart({series:j,categories:A,xAxis:N,yAxis:S,min:$,max:_,valueLabels:z=!1,height:B,format:C,locale:P,label:D,legend:R,tooltip:L,empty:E,size:F,className:I,style:W,...H}){const K=o(F),U=a(P),X=r(i,U),Y=r(m,U),q=t.useRef(null),G=n(q),J=t.useId(),[O,Q]=t.useState(null),T=t.useMemo(()=>k(j),[j]),V=T.reduce((e,l)=>Math.max(e,l.length),0),Z=t.useCallback(e=>g(e,U,C,!0),[C,U]),ee=j.map((e,l)=>e.name??String(l+1)),le=Array.from({length:V},(e,l)=>N?.tickFormat?String(N.tickFormat(A?.[l]??l,l)):x(A?.[l]??l,U)),te=T.flat().filter(e=>null!==e.value),ne=$??(te.length>0?Math.min(...te.map(e=>e.value)):0),ae=_??(te.length>0?Math.max(...te.map(e=>e.value)):0),re=ae-ne||1,oe=u[K],ie=G.width,me="number"==typeof B?B:void 0===B?f[K]:G.height,se=ee.reduce((e,l)=>Math.max(e,b(l,oe)),0),ce=S?.hidden?0:S?.thickness??Math.min(140,se+10),he=N?.hidden?0:N?.thickness??oe+12,ue=ce,de=0,fe=Math.max(0,ie-ce),pe=Math.max(0,me-he),xe=V>0?fe/V:0,ge=T.length>0?pe/T.length:0,ve=(e,l)=>{Q(t=>{const n=t??{row:0,column:0};return{row:Math.min(T.length-1,Math.max(0,n.row+(t?e:0))),column:Math.min(V-1,Math.max(0,n.column+(t?l:0)))}})},ye=O?T[O.row]?.[O.column]??null:null,we=O&&ye&&null!==ye.value?[{seriesIndex:O.row,name:ee[O.row],color:v(w((ye.value-ne)/re)),value:ye.value,formatted:Z(ye.value),label:ye.label}]:[],be=!1===L?{mode:"none"}:!0===L||void 0===L?{}:L,ke=!1!==R&&te.length>0,Me=0===V||0===T.length||0===te.length,je=Array.from({length:V},(e,l)=>T.map(e=>e[l]??{value:null}));return e(s,{...H,size:K,className:["mp-heatmap-chart",I??""].filter(Boolean).join(" "),style:W,plotRef:q,name:D??X.label,describedBy:Me?void 0:J,interactive:!Me,height:B,legendSide:"bottom",plotProps:{onPointerMove:Me||"none"===be.mode?void 0:e=>Q(((e,l)=>{const t=q.current;if(!t||xe<=0||ge<=0)return null;const n=t.getBoundingClientRect(),a=Math.floor((e-n.left-ue)/xe),r=Math.floor((l-n.top-de)/ge);return a<0||a>=V||r<0||r>=T.length?null:{row:r,column:a}})(e.clientX,e.clientY)),onPointerLeave:()=>Q(null),onKeyDown:Me||"none"===be.mode?void 0:e=>{if("ArrowRight"===e.key)ve(0,1);else if("ArrowLeft"===e.key)ve(0,-1);else if("ArrowDown"===e.key)ve(1,0);else if("ArrowUp"===e.key)ve(-1,0);else{if("Escape"!==e.key)return;Q(null)}e.preventDefault()},onBlur:()=>Q(null)},tooltip:O&&we.length>0&&"none"!==be.mode?e(h,{heading:`${ee[O.row]} · ${le[O.column]}`,items:we,x:ue+(O.column+.5)*xe,y:de+(O.row+.5)*ge,flip:O.column>V/2,size:K}):null,legend:ke?l("div",{className:"mp-chart__legend flex items-center justify-center gap-2",children:[e("span",{className:"text-mp-on-surface-variant text-mp-label-small tabular-nums",children:Z(ne)}),e("span",{className:"flex","aria-hidden":"true",children:Array.from({length:p},(l,t)=>e("span",{className:"block h-3 w-6 first:rounded-s-mp-xs last:rounded-e-mp-xs",style:{background:v(t)}},t))}),e("span",{className:"text-mp-on-surface-variant text-mp-label-small tabular-nums",children:Z(ae)})]}):null,status:{heading:O?`${ee[O.row]} · ${le[O.column]}`:void 0,items:we},table:Me?null:e(c,{id:J,caption:D??X.table,corner:S?.label??X.category,categories:ee,names:le,values:je,format:Z,locale:U,empty:Y.empty}),children:Me?e("div",{className:"text-mp-on-surface-variant text-mp-body-small flex h-full items-center justify-center",children:E??Y.empty}):ie>0&&me>0?l("svg",{width:ie,height:me,viewBox:`0 0 ${ie} ${me}`,"aria-hidden":"true",className:"block overflow-visible",children:[e("g",{className:"mp-heatmap-chart__cells",children:T.map((t,n)=>Array.from({length:V},(a,r)=>{const o=t[r],i=O?.row===n&&O?.column===r,m=ue+r*xe,s=de+n*ge,c=Math.max(0,xe-d),h=Math.max(0,ge-d);if(!o||null===o.value)return e("rect",{x:m+d/2,y:s+d/2,width:c,height:h,fill:"none",stroke:"var(--_mp-color-outline-variant)",strokeWidth:1,strokeDasharray:"2 2",rx:2},r);const u=w((o.value-ne)/re);return l("g",{children:[e("rect",{x:m+d/2,y:s+d/2,width:c,height:h,fill:o.color??v(u),rx:2,stroke:i?"var(--_mp-color-on-surface)":"none",strokeWidth:i?2:0}),z&&c>b(Z(o.value),oe)+8&&h>oe+4?e("text",{x:m+xe/2,y:s+ge/2,textAnchor:"middle",dominantBaseline:"central",fill:y(u),fontSize:oe,children:Z(o.value)}):null]},r)}))}),S?.hidden?null:ee.map((l,t)=>e("text",{x:ue-8,y:de+(t+.5)*ge,textAnchor:"end",dominantBaseline:"central",fill:"var(--_mp-color-on-surface-variant)",fontSize:oe,children:M(l,ce-10,oe)},`r${t}`)),N?.hidden?null:le.map((l,t)=>e("text",{x:ue+(t+.5)*xe,y:de+pe+oe+4,textAnchor:"middle",fill:"var(--_mp-color-on-surface-variant)",fontSize:oe,children:M(l,xe-2,oe)},`c${t}`))]}):null})}
@@ -0,0 +1,2 @@
1
+ export { MPHeatmapChart } from './MPHeatmapChart.js';
2
+ export type { MPHeatmapChartProps } from './MPHeatmapChart.js';
@@ -0,0 +1 @@
1
+ export{MPHeatmapChart}from"./MPHeatmapChart.js";
@@ -0,0 +1,101 @@
1
+ import * as React from 'react';
2
+ import type { MPAlign, MPDensity, MPSide, MPSize } from '../../types.js';
3
+ /**
4
+ * The same axes an `MPPopover` takes, and for the same reasons.
5
+ *
6
+ * No `variant`, because the five weights answer "how much does this surface
7
+ * assert itself against the page" and a card that arrives uninvited has already
8
+ * been answered for. No `color`, because MD3's answer for a small sheet
9
+ * anchored to something is `surface-container`, neutral — and a card that could
10
+ * be dyed would dye whatever preview somebody put in it. No `elevation`,
11
+ * because a card floating over the page is the whole idea and a prop that could
12
+ * sit it flat would undo it.
13
+ */
14
+ export interface MPHoverCardProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'children'> {
15
+ /**
16
+ * What the card hangs off. Exactly one element, which must accept a ref and
17
+ * spread props — every Material Plus component does.
18
+ *
19
+ * Usually an `MPTextLink` or an `MPAvatar`: the two things a reader wants to
20
+ * know more about without leaving the sentence they are in.
21
+ */
22
+ trigger: React.ReactElement;
23
+ /** The heading, rendered as the element that names the card. */
24
+ title?: React.ReactNode;
25
+ /** A line under it, and the card's accessible description. */
26
+ description?: React.ReactNode;
27
+ /** The body. */
28
+ children?: React.ReactNode;
29
+ /**
30
+ * Which edge of the trigger it appears on. Flips when there is no room.
31
+ * @default 'bottom'
32
+ */
33
+ side?: MPSide;
34
+ /** Where it sits along that edge. @default 'center' */
35
+ align?: MPAlign;
36
+ /** Distance from the trigger, in pixels. @default 8 */
37
+ sideOffset?: number;
38
+ /** Shift along that edge, in pixels. @default 0 */
39
+ alignOffset?: number;
40
+ /**
41
+ * Draws the wedge pointing at the trigger.
42
+ *
43
+ * Off by default, as on `MPPopover`: a sheet eight pixels from what opened it
44
+ * does not need to say what it belongs to.
45
+ * @default false
46
+ */
47
+ arrow?: boolean;
48
+ /** Whether the card is open. Use with `onOpenChange` for a controlled one. */
49
+ open?: boolean;
50
+ /** Whether it starts open, for an uncontrolled one. */
51
+ defaultOpen?: boolean;
52
+ onOpenChange?: (open: boolean) => void;
53
+ /**
54
+ * How long the pointer has to rest on the trigger before the card opens, in
55
+ * milliseconds. Base UI's own default is long enough that crossing a
56
+ * paragraph of links does not open four of them.
57
+ */
58
+ delay?: number;
59
+ /**
60
+ * How long the card stays after the pointer has left, in milliseconds. This
61
+ * is what makes the gap between the trigger and the card crossable.
62
+ */
63
+ closeDelay?: number;
64
+ /** A hard cap on the card's width, overriding the one `size` implies. */
65
+ width?: number | string;
66
+ /** The type scale and the room inside. @default 'md' */
67
+ size?: MPSize;
68
+ /** Takes room out of that padding, two pixels a face per step. @default 0 */
69
+ density?: MPDensity;
70
+ }
71
+ /** The wedge, at roughly a third of the sheet's corner per step. */
72
+ /**
73
+ * A card that opens when the pointer rests on something, holding a preview of
74
+ * what is on the other side of it.
75
+ *
76
+ * ```tsx
77
+ * <MPHoverCard trigger={<MPTextLink href="/people/priya">Priya Raman</MPTextLink>} title="Priya Raman">
78
+ * Platform team. Joined 2023.
79
+ * </MPHoverCard>
80
+ * ```
81
+ *
82
+ * ## Where it sits between the other two popups
83
+ *
84
+ * A tooltip is a **label**: one line, no interaction, and the pointer never
85
+ * reaches it. A popover is a panel that was **asked for** by a press, so it can
86
+ * hold a form. This one is uninvited like a tooltip and reachable like a
87
+ * popover — the pointer can cross into it, and a link inside it can be
88
+ * followed.
89
+ *
90
+ * ## Because it is uninvited, it is never the only way to anything
91
+ *
92
+ * A keyboard with no hover, a touchscreen with no pointer, and a screen reader
93
+ * all arrive by the trigger's own route instead. So whatever is in here has to
94
+ * exist on the page the trigger leads to as well. Treat it as a shortcut for
95
+ * the reader who has a pointer, never as the place a fact lives.
96
+ *
97
+ * That is also why there is no keyboard equivalent bolted on. A card that
98
+ * opened on focus would interrupt every keyboard reader tabbing through a
99
+ * paragraph of links, which is a worse answer than not opening at all.
100
+ */
101
+ export declare function MPHoverCard({ trigger, title, description, children, side, align, sideOffset, alignOffset, arrow, open, defaultOpen, onOpenChange, delay, closeDelay, width, size: sizeProp, density: densityProp, className, style, ...props }: MPHoverCardProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{POPUP_ARROW_SIZE as a,POPUP_ARROW_TURN as l,PopupArrow as n}from"../../internal/PopupArrow.js";import{PreviewCard as o}from"@base-ui/react/preview-card";import{cssLength as s}from"../../internal/length.js";import{sheetPad as t}from"../../internal/density.js";import{hasContent as d,META_TEXT as m,PROSE_TEXT as c,SHEET_GAP as p,SHEET_TITLE as f}from"../../internal/scale.js";import{FADE as u,PORTAL_LAYER as x}from"../../internal/surface.js";import{useMPDensity as h,useMPSize as v}from"../../internal/config.js";const g={xs:"max-w-64",sm:"max-w-72",md:"max-w-96",lg:"max-w-md",xl:"max-w-xl"};export function MPHoverCard({trigger:w,title:j,description:y,children:b,side:N="bottom",align:O="center",sideOffset:P=8,alignOffset:_=0,arrow:$=!1,open:z,defaultOpen:C,onOpenChange:A,delay:D,closeDelay:B,width:H,size:I,density:M,className:R,style:T,...W}){const k=v(I),q=h(M),E=d(j)||d(y),F=a[k],G=i.useId(),J=`${G}-title`,K=`${G}-description`;return r(o.Root,{open:z,defaultOpen:C,onOpenChange:e=>A?.(e),children:[e(o.Trigger,{render:w,delay:D,closeDelay:B}),e(o.Portal,{children:e(o.Positioner,{className:x,side:N,align:O,sideOffset:P,alignOffset:_,children:r(o.Popup,{"data-mp-size":k,"aria-labelledby":d(j)?J:void 0,"aria-describedby":d(y)?K:void 0,className:["mp-hover-card rounded-mp-md relative flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-2","box-border",t(k,q),p[k],c[k],void 0===H?g[k]:"",u,R??""].filter(Boolean).join(" "),style:{...void 0===H?null:{maxWidth:s(H)},...T},...W,children:[$?e(o.Arrow,{className:l,children:e(n,{size:F,fill:"var(--_mp-color-surface-container)"})}):null,E?r("div",{className:"flex min-w-0 flex-col",children:[d(j)?e("div",{id:J,className:`mp-hover-card__title m-0 ${f[k]}`,children:j}):null,d(y)?e("div",{id:K,className:`mp-hover-card__description text-mp-on-surface-variant m-0 ${m}`,children:y}):null]}):null,d(b)?e("div",{className:"min-w-0",children:b}):null]})})})]})}
@@ -0,0 +1,2 @@
1
+ export { MPHoverCard } from './MPHoverCard.js';
2
+ export type { MPHoverCardProps } from './MPHoverCard.js';
@@ -0,0 +1 @@
1
+ export{MPHoverCard}from"./MPHoverCard.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e}from"react/jsx-runtime";import*as i from"react";function o(e){return!i.isValidElement(e)}export const MPIcon=/*@__PURE__*/i.forwardRef(function({icon:r,size:t,color:l,strokeWidth:n,center:s=!1,label:c,className:a,style:d,...f},m){const u=["mp-icon inline-flex shrink-0 items-center justify-center align-middle",void 0===t?"":"[&>svg]:block [&>svg]:size-full [&>img]:block [&>img]:size-full",s?"justify-self-center":"",a??""].filter(Boolean).join(" ");return e("span",{ref:m,className:u,style:{...void 0===t?{}:{width:t,height:t,fontSize:t},...void 0===l?{}:{color:l},...d},role:c?"img":void 0,"aria-label":c,"aria-hidden":!c||void 0,...f,children:o(r)?i.createElement(r,{size:t,color:void 0===l?"currentColor":l,strokeWidth:n}):r})});
2
+ import{jsx as e}from"react/jsx-runtime";import*as i from"react";function o(e){return!i.isValidElement(e)}export const MPIcon=/*@__PURE__*/i.forwardRef(function({icon:r,size:t,color:n,strokeWidth:l,center:s=!1,label:c,className:a,style:d,...m},f){const h=["mp-icon inline-flex shrink-0 items-center justify-center align-middle","[&>svg]:shrink-0 [&>img]:shrink-0",void 0===t?"":"[&>svg]:block [&>svg]:size-full [&>img]:block [&>img]:size-full",s?"justify-self-center":"",a??""].filter(Boolean).join(" ");return e("span",{ref:f,className:h,style:{...void 0===t?{}:{width:t,height:t,fontSize:t},...void 0===n?{}:{color:n},...d},role:c?"img":void 0,"aria-label":c,"aria-hidden":!c||void 0,...m,children:o(r)?i.createElement(r,{size:t,color:void 0===n?"currentColor":n,strokeWidth:l}):r})});
@@ -1,9 +1,35 @@
1
1
  import * as React from 'react';
2
2
  import type { MPSize } from '../../types.js';
3
- /** How the picture is fitted into the box it was given. CSS's own four. */
4
- export type MPImageFit = 'cover' | 'contain' | 'fill' | 'none';
3
+ /** How the picture is fitted into the box it was given. CSS's own words. */
4
+ export type MPImageFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
5
5
  /** What the picture is doing right now. */
6
6
  export type MPImageState = 'loading' | 'loaded' | 'error';
7
+ /** A picture that stands in while the real one arrives. */
8
+ export interface MPImagePlaceholder {
9
+ /**
10
+ * A URL, a data URI, or a `Blob` such as a file the reader has just picked.
11
+ *
12
+ * A `Blob` is drawn through an object URL made for it, so keep the same Blob
13
+ * from one render to the next: a new one on every render makes a new URL on
14
+ * every render, and each of those renders again.
15
+ */
16
+ src: string | Blob;
17
+ /**
18
+ * Blurs the stand-in. `true` is a 20px radius, and a number is a radius in
19
+ * pixels.
20
+ * @default false
21
+ */
22
+ blur?: boolean | number;
23
+ }
24
+ /** A turn in degrees, clockwise, a quarter at a time. */
25
+ export type MPImageRotate = 0 | 90 | 180 | 270;
26
+ /** Which way the picture is mirrored, along the axes it is shown on. */
27
+ export type MPImageFlip = 'none' | 'horizontal' | 'vertical' | 'both';
28
+ /**
29
+ * The part of the picture a crop keeps, in `object-position`'s words: the
30
+ * centre, a side, a corner, or two percentages across and down.
31
+ */
32
+ export type MPImagePosition = 'center' | 'top' | 'right' | 'bottom' | 'left' | 'top left' | 'top right' | 'bottom left' | 'bottom right' | `${number}% ${number}%`;
7
33
  export interface MPImageProps extends Omit<React.ComponentPropsWithoutRef<'img'>, 'onError'> {
8
34
  /** Where the picture is. */
9
35
  src?: string;
@@ -26,18 +52,44 @@ export interface MPImageProps extends Omit<React.ComponentPropsWithoutRef<'img'>
26
52
  */
27
53
  ratio?: number | string;
28
54
  /**
29
- * How the picture is fitted into that box.
55
+ * How the picture is fitted into that box. `scale-down` is `contain` that
56
+ * never enlarges a file smaller than the box.
30
57
  * @default 'cover'
31
58
  */
32
59
  fit?: MPImageFit;
60
+ /**
61
+ * The width of the file, or of the box when it is given without `height`.
62
+ *
63
+ * With `height` as well, the two are the file's size in pixels, as on an
64
+ * `<img>`, and they reserve its proportion. Alone, it makes the box that wide,
65
+ * no wider than its container, and as tall as the picture or `ratio` makes
66
+ * it. A number or a string of digits is pixels, and any other string is a CSS
67
+ * length.
68
+ */
69
+ width?: number | string;
70
+ /**
71
+ * The height of the file, or of the box when it is given without `width`.
72
+ *
73
+ * With `width` as well, the two are the file's size in pixels. Alone, it makes
74
+ * the box that tall and as wide as its container, or as wide as `ratio` makes
75
+ * it when there is one. A number or a string of digits is pixels, and any
76
+ * other string is a CSS length.
77
+ */
78
+ height?: number | string;
33
79
  /**
34
80
  * Drawn while the picture is on its way.
35
81
  *
36
82
  * A shimmer by default, on the surface the box sits on. `false` draws nothing,
37
83
  * which is what a picture inside something that already has its own loading
38
84
  * treatment wants.
85
+ *
86
+ * `{ src, blur }` draws a picture instead: a small copy of the file, a data
87
+ * URI or a `Blob`, fitted, placed, turned and mirrored like the picture, and
88
+ * blurred if `blur` says so. It gives way once the picture has faded in over
89
+ * it. Like the shimmer, it fills the box, so the box needs a reserved size: a
90
+ * `ratio`, or both `width` and `height`.
39
91
  */
40
- placeholder?: React.ReactNode | false;
92
+ placeholder?: React.ReactNode | false | MPImagePlaceholder;
41
93
  /**
42
94
  * Drawn instead of the picture when it does not arrive.
43
95
  *
@@ -64,8 +116,73 @@ export interface MPImageProps extends Omit<React.ComponentPropsWithoutRef<'img'>
64
116
  previewSrc?: string;
65
117
  /** The label on the button `preview` turns the box into. */
66
118
  previewLabel?: string;
67
- /** Called when the state changes, for a caller that wants to know. */
119
+ /**
120
+ * Called when the state changes, for a caller that wants to know.
121
+ *
122
+ * **This is the signal to use, not `onLoad`.** `onLoad` is the `<img>`'s own
123
+ * event and is passed straight through, so it does not fire for a picture the
124
+ * browser already has: the load has been and gone before React attached
125
+ * anything, which is the whole reason this component exists. `onStateChange`
126
+ * is reported from the `complete` check as well as from the event, so it
127
+ * arrives either way.
128
+ */
68
129
  onStateChange?: (state: MPImageState) => void;
130
+ /**
131
+ * Turns the picture clockwise, in quarter turns.
132
+ *
133
+ * Only quarters, because a picture turned by any other angle stops covering
134
+ * its box, and filling the corners would mean enlarging it by an amount the
135
+ * caller would then want to tune. A quarter turn swaps the box's proportion:
136
+ * `width` and `height`, when both are given, are read as the file's size and
137
+ * reserve the turned shape, and without them the shape is read from the file
138
+ * once it arrives. An explicit `ratio` is the layout's shape and is kept.
139
+ *
140
+ * Drawn with the `rotate` property rather than `transform`, so a `transform`
141
+ * of your own, such as a hover zoom, still applies on top.
142
+ * @default 0
143
+ */
144
+ rotate?: MPImageRotate;
145
+ /**
146
+ * Mirrors the picture along the axes it is shown on.
147
+ *
148
+ * `horizontal` swaps left and right on the screen whether or not the picture
149
+ * is turned. Drawn with the `scale` property, so it leaves `transform` free as
150
+ * `rotate` does, and `preview` opens the picture mirrored.
151
+ * @default 'none'
152
+ */
153
+ flip?: MPImageFlip;
154
+ /**
155
+ * Which part of the picture a `cover` crop keeps, and where `contain`, `none`
156
+ * and `scale-down` leave their empty space.
157
+ *
158
+ * Read on the picture as it is shown, so `top` keeps the top of a picture
159
+ * that has been turned or mirrored. Physical rather than logical: the subject
160
+ * of a photograph does not move to the other side on a right-to-left page. A
161
+ * value in any other form reaches `object-position` as written.
162
+ * @default 'center'
163
+ */
164
+ position?: MPImagePosition;
165
+ /**
166
+ * What fills the room `fit` leaves around the picture.
167
+ *
168
+ * `blur` draws the same picture behind itself, covering the box and blurred,
169
+ * the way a video player fills the sides of a portrait clip. It reuses the
170
+ * picture's request, and it is drawn only for a `fit` that can leave room:
171
+ * `contain`, `none` and `scale-down`. Any other string is a CSS `background`
172
+ * painted behind the picture: a colour, a custom property or a gradient.
173
+ * @default 'none'
174
+ */
175
+ letterbox?: 'none' | 'blur' | (string & {});
176
+ /**
177
+ * Loads this picture first: the one a page is judged by, which is usually its
178
+ * Largest Contentful Paint.
179
+ *
180
+ * Sets `loading="eager"` and a high fetch priority. A `loading` or
181
+ * `fetchPriority` of your own still wins. Give it to one picture per page: a
182
+ * high priority on every picture raises none of them above the others.
183
+ * @default false
184
+ */
185
+ priority?: boolean;
69
186
  /** The corner and type scale of the placeholder and the fallback. @default 'md' */
70
187
  size?: MPSize;
71
188
  }