material-plus-ui 1.5.0 → 1.7.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 (549) hide show
  1. package/README.md +2 -2
  2. package/dist/components/accordion/MPAccordion.d.ts +21 -1
  3. package/dist/components/accordion/MPAccordion.js +1 -1
  4. package/dist/components/alert/MPAlert.d.ts +33 -2
  5. package/dist/components/alert/MPAlert.js +1 -1
  6. package/dist/components/anchor/MPAnchor.d.ts +107 -0
  7. package/dist/components/anchor/MPAnchor.js +2 -0
  8. package/dist/components/anchor/index.d.ts +2 -0
  9. package/dist/components/anchor/index.js +1 -0
  10. package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
  11. package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
  12. package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
  13. package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
  14. package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
  15. package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
  16. package/dist/components/animate-counter/index.d.ts +2 -0
  17. package/dist/components/animate-counter/index.js +1 -0
  18. package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
  19. package/dist/components/animate-fade/MPAnimateFade.js +2 -1
  20. package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
  21. package/dist/components/animate-float/MPAnimateFloat.js +2 -0
  22. package/dist/components/animate-float/index.d.ts +2 -0
  23. package/dist/components/animate-float/index.js +1 -0
  24. package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
  25. package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
  26. package/dist/components/animate-lighting/MPAnimateLighting.js +2 -1
  27. package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
  28. package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
  29. package/dist/components/animate-reveal/index.d.ts +2 -0
  30. package/dist/components/animate-reveal/index.js +1 -0
  31. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
  32. package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
  33. package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
  34. package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
  35. package/dist/components/animate-scramble/index.d.ts +2 -0
  36. package/dist/components/animate-scramble/index.js +1 -0
  37. package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
  38. package/dist/components/animate-shake/MPAnimateShake.js +2 -0
  39. package/dist/components/animate-shake/index.d.ts +2 -0
  40. package/dist/components/animate-shake/index.js +1 -0
  41. package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
  42. package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
  43. package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
  44. package/dist/components/animate-split/MPAnimateSplit.js +2 -0
  45. package/dist/components/animate-split/index.d.ts +2 -0
  46. package/dist/components/animate-split/index.js +1 -0
  47. package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
  48. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
  49. package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
  50. package/dist/components/app-logo/MPAppLogo.d.ts +156 -0
  51. package/dist/components/app-logo/MPAppLogo.js +2 -0
  52. package/dist/components/app-logo/index.d.ts +2 -0
  53. package/dist/components/app-logo/index.js +1 -0
  54. package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
  55. package/dist/components/area-chart/MPAreaChart.js +2 -0
  56. package/dist/components/area-chart/index.d.ts +2 -0
  57. package/dist/components/area-chart/index.js +1 -0
  58. package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
  59. package/dist/components/avatar/MPAvatar.d.ts +10 -1
  60. package/dist/components/avatar/MPAvatar.js +1 -1
  61. package/dist/components/badge/MPBadge.js +1 -1
  62. package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
  63. package/dist/components/bar-chart/MPBarChart.js +2 -0
  64. package/dist/components/bar-chart/index.d.ts +2 -0
  65. package/dist/components/bar-chart/index.js +1 -0
  66. package/dist/components/blockquote/MPBlockquote.d.ts +10 -1
  67. package/dist/components/blockquote/MPBlockquote.js +1 -1
  68. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +19 -18
  69. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
  70. package/dist/components/box/MPBox.d.ts +43 -8
  71. package/dist/components/box/MPBox.js +2 -1
  72. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  73. package/dist/components/button/MPButton.d.ts +49 -3
  74. package/dist/components/button/MPButton.js +1 -1
  75. package/dist/components/calendar/MPCalendar.d.ts +160 -0
  76. package/dist/components/calendar/MPCalendar.js +2 -0
  77. package/dist/components/calendar/index.d.ts +2 -0
  78. package/dist/components/calendar/index.js +1 -0
  79. package/dist/components/card/MPCard.js +1 -1
  80. package/dist/components/carousel/MPCarousel.js +1 -1
  81. package/dist/components/chat-bubble/MPChatBubble.js +1 -1
  82. package/dist/components/checkbox/MPCheckbox.js +1 -1
  83. package/dist/components/chip/MPChip.d.ts +31 -7
  84. package/dist/components/chip/MPChip.js +1 -1
  85. package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
  86. package/dist/components/code-block/MPCodeBlock.js +2 -0
  87. package/dist/components/code-block/index.d.ts +2 -0
  88. package/dist/components/code-block/index.js +1 -0
  89. package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
  90. package/dist/components/collapsible/MPCollapsible.js +1 -1
  91. package/dist/components/color-picker/MPColorPicker.js +1 -1
  92. package/dist/components/combobox/MPCombobox.d.ts +71 -5
  93. package/dist/components/combobox/MPCombobox.js +1 -1
  94. package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
  95. package/dist/components/command-palette/MPCommandPalette.js +1 -1
  96. package/dist/components/config/MPConfigProvider.d.ts +166 -0
  97. package/dist/components/config/MPConfigProvider.js +2 -0
  98. package/dist/components/config/index.d.ts +2 -0
  99. package/dist/components/config/index.js +1 -0
  100. package/dist/components/confirm/MPConfirmProvider.d.ts +143 -0
  101. package/dist/components/confirm/MPConfirmProvider.js +2 -0
  102. package/dist/components/confirm/index.d.ts +2 -0
  103. package/dist/components/confirm/index.js +1 -0
  104. package/dist/components/container/MPContainer.d.ts +9 -2
  105. package/dist/components/container/MPContainer.js +2 -1
  106. package/dist/components/data-list/MPDataList.d.ts +82 -0
  107. package/dist/components/data-list/MPDataList.js +2 -0
  108. package/dist/components/data-list/index.d.ts +2 -0
  109. package/dist/components/data-list/index.js +1 -0
  110. package/dist/components/data-table/MPDataTable.d.ts +295 -0
  111. package/dist/components/data-table/MPDataTable.js +2 -0
  112. package/dist/components/data-table/index.d.ts +2 -0
  113. package/dist/components/data-table/index.js +1 -0
  114. package/dist/components/date-picker/MPDatePicker.d.ts +53 -2
  115. package/dist/components/date-picker/MPDatePicker.js +1 -1
  116. package/dist/components/date-picker/index.d.ts +1 -1
  117. package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
  118. package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
  119. package/dist/components/dialog/MPDialog.d.ts +24 -3
  120. package/dist/components/dialog/MPDialog.js +1 -1
  121. package/dist/components/divider/MPDivider.js +1 -1
  122. package/dist/components/drawer/MPDrawer.d.ts +8 -2
  123. package/dist/components/drawer/MPDrawer.js +1 -1
  124. package/dist/components/empty/MPEmpty.d.ts +10 -1
  125. package/dist/components/empty/MPEmpty.js +1 -1
  126. package/dist/components/fieldset/MPFieldset.js +1 -1
  127. package/dist/components/file-picker/MPFilePicker.js +1 -1
  128. package/dist/components/flex/MPFlex.d.ts +95 -0
  129. package/dist/components/flex/MPFlex.js +2 -0
  130. package/dist/components/flex/index.d.ts +2 -0
  131. package/dist/components/flex/index.js +1 -0
  132. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  133. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
  134. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
  135. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  136. package/dist/components/floating-bottom-navigation/index.js +1 -0
  137. package/dist/components/footer/MPFooter.d.ts +24 -4
  138. package/dist/components/footer/MPFooter.js +1 -1
  139. package/dist/components/form/MPForm.js +1 -1
  140. package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
  141. package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
  142. package/dist/components/gauge-chart/index.d.ts +2 -0
  143. package/dist/components/gauge-chart/index.js +1 -0
  144. package/dist/components/grid/MPGrid.d.ts +23 -1
  145. package/dist/components/grid/MPGrid.js +1 -1
  146. package/dist/components/header/MPHeader.d.ts +26 -4
  147. package/dist/components/header/MPHeader.js +1 -1
  148. package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
  149. package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
  150. package/dist/components/heatmap-chart/index.d.ts +2 -0
  151. package/dist/components/heatmap-chart/index.js +1 -0
  152. package/dist/components/hover-card/MPHoverCard.d.ts +100 -0
  153. package/dist/components/hover-card/MPHoverCard.js +2 -0
  154. package/dist/components/hover-card/index.d.ts +2 -0
  155. package/dist/components/hover-card/index.js +1 -0
  156. package/dist/components/image/MPImage.d.ts +121 -0
  157. package/dist/components/image/MPImage.js +2 -0
  158. package/dist/components/image/index.d.ts +2 -0
  159. package/dist/components/image/index.js +1 -0
  160. package/dist/components/line-chart/MPLineChart.d.ts +66 -0
  161. package/dist/components/line-chart/MPLineChart.js +2 -0
  162. package/dist/components/line-chart/index.d.ts +2 -0
  163. package/dist/components/line-chart/index.js +1 -0
  164. package/dist/components/list/MPList.d.ts +51 -1
  165. package/dist/components/list/MPList.js +1 -1
  166. package/dist/components/menu/MPMenu.d.ts +21 -2
  167. package/dist/components/menu/MPMenu.js +1 -1
  168. package/dist/components/menubar/MPMenubar.js +1 -1
  169. package/dist/components/meter/MPMeter.d.ts +87 -0
  170. package/dist/components/meter/MPMeter.js +2 -0
  171. package/dist/components/meter/index.d.ts +2 -0
  172. package/dist/components/meter/index.js +1 -0
  173. package/dist/components/mockup/MPMockup.d.ts +143 -0
  174. package/dist/components/mockup/MPMockup.js +2 -0
  175. package/dist/components/mockup/index.d.ts +2 -0
  176. package/dist/components/mockup/index.js +1 -0
  177. package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
  178. package/dist/components/number-field/MPNumberField.d.ts +3 -3
  179. package/dist/components/number-field/MPNumberField.js +1 -1
  180. package/dist/components/otp-field/MPOtpField.js +1 -1
  181. package/dist/components/overlay/MPOverlay.d.ts +1 -1
  182. package/dist/components/overlay/MPOverlay.js +1 -1
  183. package/dist/components/pagination/MPPagination.js +1 -1
  184. package/dist/components/panes/MPPanes.js +1 -1
  185. package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
  186. package/dist/components/pie-chart/MPPieChart.js +2 -0
  187. package/dist/components/pie-chart/index.d.ts +2 -0
  188. package/dist/components/pie-chart/index.js +1 -0
  189. package/dist/components/pill/MPPill.js +1 -1
  190. package/dist/components/popconfirm/MPPopconfirm.d.ts +92 -0
  191. package/dist/components/popconfirm/MPPopconfirm.js +2 -0
  192. package/dist/components/popconfirm/index.d.ts +2 -0
  193. package/dist/components/popconfirm/index.js +1 -0
  194. package/dist/components/popover/MPPopover.d.ts +1 -1
  195. package/dist/components/popover/MPPopover.js +1 -1
  196. package/dist/components/portal/MPPortal.d.ts +75 -0
  197. package/dist/components/portal/MPPortal.js +2 -0
  198. package/dist/components/portal/index.d.ts +2 -0
  199. package/dist/components/portal/index.js +1 -0
  200. package/dist/components/progress-box/MPProgressBox.js +1 -1
  201. package/dist/components/progress-circular/MPProgressCircular.js +1 -1
  202. package/dist/components/progress-linear/MPProgressLinear.js +1 -1
  203. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  204. package/dist/components/rating/MPRating.js +1 -1
  205. package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
  206. package/dist/components/scatter-chart/MPScatterChart.js +2 -0
  207. package/dist/components/scatter-chart/index.d.ts +2 -0
  208. package/dist/components/scatter-chart/index.js +1 -0
  209. package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
  210. package/dist/components/scroll-area/MPScrollArea.js +2 -0
  211. package/dist/components/scroll-area/index.d.ts +2 -0
  212. package/dist/components/scroll-area/index.js +1 -0
  213. package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
  214. package/dist/components/scroll-zone/MPScrollZone.js +2 -0
  215. package/dist/components/scroll-zone/index.d.ts +2 -0
  216. package/dist/components/scroll-zone/index.js +1 -0
  217. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  218. package/dist/components/select/MPSelect.d.ts +28 -5
  219. package/dist/components/select/MPSelect.js +1 -1
  220. package/dist/components/shortcut/MPShortcut.js +1 -1
  221. package/dist/components/show/MPShow.d.ts +78 -0
  222. package/dist/components/show/MPShow.js +2 -0
  223. package/dist/components/show/index.d.ts +2 -0
  224. package/dist/components/show/index.js +1 -0
  225. package/dist/components/sidebar/MPSidebar.d.ts +20 -1
  226. package/dist/components/sidebar/MPSidebar.js +1 -1
  227. package/dist/components/skeleton/MPSkeleton.js +1 -1
  228. package/dist/components/slider/MPSlider.d.ts +27 -0
  229. package/dist/components/slider/MPSlider.js +1 -1
  230. package/dist/components/snackbar/MPSnackbar.d.ts +20 -1
  231. package/dist/components/snackbar/MPSnackbar.js +1 -1
  232. package/dist/components/sparkline/MPSparkline.d.ts +85 -0
  233. package/dist/components/sparkline/MPSparkline.js +2 -0
  234. package/dist/components/sparkline/index.d.ts +2 -0
  235. package/dist/components/sparkline/index.js +1 -0
  236. package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
  237. package/dist/components/spoiler/MPSpoiler.js +1 -1
  238. package/dist/components/stack/MPStack.d.ts +198 -0
  239. package/dist/components/stack/MPStack.js +2 -0
  240. package/dist/components/stack/index.d.ts +2 -0
  241. package/dist/components/stack/index.js +1 -0
  242. package/dist/components/statistic/MPStatistic.d.ts +104 -0
  243. package/dist/components/statistic/MPStatistic.js +2 -0
  244. package/dist/components/statistic/index.d.ts +2 -0
  245. package/dist/components/statistic/index.js +1 -0
  246. package/dist/components/stepper/MPStepper.d.ts +153 -0
  247. package/dist/components/stepper/MPStepper.js +2 -0
  248. package/dist/components/stepper/index.d.ts +2 -0
  249. package/dist/components/stepper/index.js +1 -0
  250. package/dist/components/switch/MPSwitch.js +1 -1
  251. package/dist/components/table/MPTable.d.ts +24 -2
  252. package/dist/components/table/MPTable.js +1 -1
  253. package/dist/components/tabs/MPTabs.d.ts +12 -0
  254. package/dist/components/tabs/MPTabs.js +1 -1
  255. package/dist/components/text-field/MPTextField.d.ts +38 -14
  256. package/dist/components/text-field/MPTextField.js +1 -1
  257. package/dist/components/time-picker/MPTimePicker.js +1 -1
  258. package/dist/components/timeline/MPTimeline.d.ts +10 -2
  259. package/dist/components/timeline/MPTimeline.js +1 -1
  260. package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
  261. package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
  262. package/dist/components/timeline-chart/index.d.ts +2 -0
  263. package/dist/components/timeline-chart/index.js +1 -0
  264. package/dist/components/toggle/MPToggle.js +1 -1
  265. package/dist/components/toolbar/MPToolbar.d.ts +106 -0
  266. package/dist/components/toolbar/MPToolbar.js +2 -0
  267. package/dist/components/toolbar/index.d.ts +2 -0
  268. package/dist/components/toolbar/index.js +1 -0
  269. package/dist/components/tour/MPTour.d.ts +120 -0
  270. package/dist/components/tour/MPTour.js +2 -0
  271. package/dist/components/tour/index.d.ts +2 -0
  272. package/dist/components/tour/index.js +1 -0
  273. package/dist/components/transfer/MPTransfer.js +1 -1
  274. package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
  275. package/dist/components/tree-select/MPTreeSelect.js +2 -0
  276. package/dist/components/tree-select/index.d.ts +2 -0
  277. package/dist/components/tree-select/index.js +1 -0
  278. package/dist/components/tree-view/MPTreeView.d.ts +153 -0
  279. package/dist/components/tree-view/MPTreeView.js +2 -0
  280. package/dist/components/tree-view/index.d.ts +2 -0
  281. package/dist/components/tree-view/index.js +1 -0
  282. package/dist/components/typography/MPTypography.d.ts +17 -1
  283. package/dist/components/typography/MPTypography.js +1 -1
  284. package/dist/components/visually-hidden/MPVisuallyHidden.d.ts +60 -0
  285. package/dist/components/visually-hidden/MPVisuallyHidden.js +2 -0
  286. package/dist/components/visually-hidden/index.d.ts +2 -0
  287. package/dist/components/visually-hidden/index.js +1 -0
  288. package/dist/constants/glyphs.d.ts +4 -0
  289. package/dist/constants/glyphs.js +1 -1
  290. package/dist/constants/icons.d.ts +2 -0
  291. package/dist/constants/icons.js +1 -1
  292. package/dist/hooks/index.d.ts +40 -0
  293. package/dist/hooks/index.js +1 -0
  294. package/dist/hooks/useMPColorScheme.d.ts +135 -0
  295. package/dist/hooks/useMPColorScheme.js +2 -0
  296. package/dist/hooks/useMPDisclosure.d.ts +58 -0
  297. package/dist/hooks/useMPDisclosure.js +2 -0
  298. package/dist/hooks/useMPElementSize.d.ts +55 -0
  299. package/dist/hooks/useMPElementSize.js +2 -0
  300. package/dist/hooks/useMPMediaQuery.d.ts +40 -0
  301. package/dist/hooks/useMPMediaQuery.js +2 -0
  302. package/dist/hooks/useMPOnScreen.d.ts +58 -0
  303. package/dist/hooks/useMPOnScreen.js +2 -0
  304. package/dist/hooks/useMPReducedMotion.d.ts +32 -0
  305. package/dist/hooks/useMPReducedMotion.js +2 -0
  306. package/dist/hooks/useMPShortcut.d.ts +105 -0
  307. package/dist/hooks/useMPShortcut.js +2 -0
  308. package/dist/hooks/useMPWindowClass.d.ts +55 -0
  309. package/dist/hooks/useMPWindowClass.js +2 -0
  310. package/dist/index.d.ts +43 -1
  311. package/dist/index.js +1 -1
  312. package/dist/internal/Calendar.d.ts +19 -4
  313. package/dist/internal/Calendar.js +1 -1
  314. package/dist/internal/ChartChrome.d.ts +205 -0
  315. package/dist/internal/ChartChrome.js +2 -0
  316. package/dist/internal/ChartFrame.d.ts +197 -0
  317. package/dist/internal/ChartFrame.js +2 -0
  318. package/dist/internal/FieldOutline.d.ts +14 -5
  319. package/dist/internal/FieldOutline.js +1 -1
  320. package/dist/internal/Picker.d.ts +15 -3
  321. package/dist/internal/Picker.js +1 -1
  322. package/dist/internal/SupportingText.d.ts +24 -0
  323. package/dist/internal/SupportingText.js +1 -1
  324. package/dist/internal/animate-core.d.ts +121 -0
  325. package/dist/internal/animate-core.js +1 -0
  326. package/dist/internal/animate.d.ts +75 -55
  327. package/dist/internal/animate.js +1 -1
  328. package/dist/internal/bottom-navigation.d.ts +58 -0
  329. package/dist/internal/bottom-navigation.js +2 -0
  330. package/dist/internal/chart.d.ts +471 -0
  331. package/dist/internal/chart.js +1 -0
  332. package/dist/internal/color-scheme.d.ts +28 -0
  333. package/dist/internal/color-scheme.js +2 -0
  334. package/dist/internal/config.d.ts +62 -0
  335. package/dist/internal/config.js +2 -0
  336. package/dist/internal/data-table.d.ts +162 -0
  337. package/dist/internal/data-table.js +1 -0
  338. package/dist/internal/date.d.ts +50 -3
  339. package/dist/internal/date.js +1 -1
  340. package/dist/internal/density.d.ts +9 -0
  341. package/dist/internal/density.js +1 -0
  342. package/dist/internal/elevation.d.ts +26 -0
  343. package/dist/internal/elevation.js +1 -0
  344. package/dist/internal/highlight.d.ts +96 -0
  345. package/dist/internal/highlight.js +1 -0
  346. package/dist/internal/i18n.d.ts +196 -1
  347. package/dist/internal/initials.d.ts +28 -0
  348. package/dist/internal/initials.js +1 -0
  349. package/dist/internal/mark.d.ts +52 -0
  350. package/dist/internal/mark.js +1 -0
  351. package/dist/internal/measure.d.ts +31 -0
  352. package/dist/internal/measure.js +1 -0
  353. package/dist/internal/messages/anchor.d.ts +3 -0
  354. package/dist/internal/messages/anchor.js +1 -0
  355. package/dist/internal/messages/chart.d.ts +3 -0
  356. package/dist/internal/messages/chart.js +1 -0
  357. package/dist/internal/messages/code.d.ts +3 -0
  358. package/dist/internal/messages/code.js +1 -0
  359. package/dist/internal/messages/confirm.d.ts +3 -0
  360. package/dist/internal/messages/confirm.js +1 -0
  361. package/dist/internal/messages/data-table.d.ts +3 -0
  362. package/dist/internal/messages/data-table.js +1 -0
  363. package/dist/internal/messages/picker.js +1 -1
  364. package/dist/internal/messages/scroll.d.ts +3 -0
  365. package/dist/internal/messages/scroll.js +1 -0
  366. package/dist/internal/messages/sparkline.d.ts +3 -0
  367. package/dist/internal/messages/sparkline.js +1 -0
  368. package/dist/internal/messages/tour.d.ts +3 -0
  369. package/dist/internal/messages/tour.js +1 -0
  370. package/dist/internal/mockup.d.ts +174 -0
  371. package/dist/internal/mockup.js +2 -0
  372. package/dist/internal/page-layout.d.ts +24 -5
  373. package/dist/internal/page-layout.js +1 -1
  374. package/dist/internal/progress.d.ts +14 -0
  375. package/dist/internal/responsive.d.ts +55 -0
  376. package/dist/internal/responsive.js +1 -0
  377. package/dist/internal/scale.d.ts +0 -17
  378. package/dist/internal/scale.js +1 -1
  379. package/dist/internal/step.d.ts +86 -0
  380. package/dist/internal/step.js +1 -0
  381. package/dist/internal/table.d.ts +53 -0
  382. package/dist/internal/table.js +1 -0
  383. package/dist/internal/text.d.ts +57 -0
  384. package/dist/internal/text.js +1 -0
  385. package/dist/internal/threshold.d.ts +19 -0
  386. package/dist/internal/threshold.js +1 -0
  387. package/dist/internal/time-scale.d.ts +44 -0
  388. package/dist/internal/time-scale.js +1 -0
  389. package/dist/internal/transition.d.ts +33 -0
  390. package/dist/internal/transition.js +1 -0
  391. package/dist/internal/visibility.d.ts +48 -0
  392. package/dist/internal/visibility.js +1 -0
  393. package/dist/internal/window-class.d.ts +48 -0
  394. package/dist/internal/window-class.js +2 -0
  395. package/dist/locales/ar.js +1 -1
  396. package/dist/locales/de.js +1 -1
  397. package/dist/locales/es.js +1 -1
  398. package/dist/locales/fr.js +1 -1
  399. package/dist/locales/hi.js +1 -1
  400. package/dist/locales/id.js +1 -1
  401. package/dist/locales/it.js +1 -1
  402. package/dist/locales/ja.js +1 -1
  403. package/dist/locales/ko.js +1 -1
  404. package/dist/locales/nl.js +1 -1
  405. package/dist/locales/pl.js +1 -1
  406. package/dist/locales/pt.js +1 -1
  407. package/dist/locales/ru.js +1 -1
  408. package/dist/locales/th.js +1 -1
  409. package/dist/locales/tr.js +1 -1
  410. package/dist/locales/vi.js +1 -1
  411. package/dist/locales/zh-hans.js +1 -1
  412. package/dist/locales/zh-hant.js +1 -1
  413. package/dist/styles/accordion.css +1 -1
  414. package/dist/styles/alert.css +1 -1
  415. package/dist/styles/anchor.css +2 -0
  416. package/dist/styles/animate-appear.css +1 -1
  417. package/dist/styles/animate-blink.css +1 -1
  418. package/dist/styles/animate-counter.css +2 -0
  419. package/dist/styles/animate-fade.css +1 -1
  420. package/dist/styles/animate-float.css +2 -0
  421. package/dist/styles/animate-grow.css +1 -1
  422. package/dist/styles/animate-headline.css +1 -1
  423. package/dist/styles/animate-lighting.css +1 -1
  424. package/dist/styles/animate-marquee.css +1 -1
  425. package/dist/styles/animate-reveal.css +2 -0
  426. package/dist/styles/animate-rotate.css +1 -1
  427. package/dist/styles/animate-scramble.css +2 -0
  428. package/dist/styles/animate-shake.css +2 -0
  429. package/dist/styles/animate-slide.css +1 -1
  430. package/dist/styles/animate-split.css +2 -0
  431. package/dist/styles/animate-typing.css +1 -1
  432. package/dist/styles/animate-zoom.css +1 -1
  433. package/dist/styles/app-logo.css +2 -0
  434. package/dist/styles/area-chart.css +2 -0
  435. package/dist/styles/aspect-ratio.css +1 -1
  436. package/dist/styles/avatar.css +1 -1
  437. package/dist/styles/badge.css +1 -1
  438. package/dist/styles/bar-chart.css +2 -0
  439. package/dist/styles/blockquote.css +1 -1
  440. package/dist/styles/bottom-navigation.css +1 -1
  441. package/dist/styles/box.css +1 -1
  442. package/dist/styles/breadcrumb.css +1 -1
  443. package/dist/styles/button.css +1 -1
  444. package/dist/styles/calendar.css +2 -0
  445. package/dist/styles/card.css +1 -1
  446. package/dist/styles/carousel.css +1 -1
  447. package/dist/styles/chat-bubble.css +1 -1
  448. package/dist/styles/checkbox.css +1 -1
  449. package/dist/styles/chip.css +1 -1
  450. package/dist/styles/code-block.css +2 -0
  451. package/dist/styles/collapsible.css +1 -1
  452. package/dist/styles/color-picker.css +1 -1
  453. package/dist/styles/combobox.css +1 -1
  454. package/dist/styles/command-palette.css +1 -1
  455. package/dist/styles/config.css +2 -0
  456. package/dist/styles/confirm.css +2 -0
  457. package/dist/styles/container.css +1 -1
  458. package/dist/styles/data-list.css +2 -0
  459. package/dist/styles/data-table.css +2 -0
  460. package/dist/styles/date-picker.css +1 -1
  461. package/dist/styles/date-range-picker.css +1 -1
  462. package/dist/styles/date-time-picker.css +1 -1
  463. package/dist/styles/dialog.css +1 -1
  464. package/dist/styles/divider.css +1 -1
  465. package/dist/styles/drawer.css +1 -1
  466. package/dist/styles/empty.css +1 -1
  467. package/dist/styles/fieldset.css +1 -1
  468. package/dist/styles/file-picker.css +1 -1
  469. package/dist/styles/flex.css +2 -0
  470. package/dist/styles/floating-action-button.css +1 -1
  471. package/dist/styles/floating-bottom-navigation.css +2 -0
  472. package/dist/styles/footer.css +1 -1
  473. package/dist/styles/form.css +1 -1
  474. package/dist/styles/gauge-chart.css +2 -0
  475. package/dist/styles/grid.css +1 -1
  476. package/dist/styles/header.css +1 -1
  477. package/dist/styles/heatmap-chart.css +2 -0
  478. package/dist/styles/highlight.css +1 -1
  479. package/dist/styles/hover-card.css +2 -0
  480. package/dist/styles/icon-button.css +1 -1
  481. package/dist/styles/image.css +2 -0
  482. package/dist/styles/line-chart.css +2 -0
  483. package/dist/styles/list.css +1 -1
  484. package/dist/styles/locale.css +1 -1
  485. package/dist/styles/menu.css +1 -1
  486. package/dist/styles/menubar.css +1 -1
  487. package/dist/styles/meter.css +2 -0
  488. package/dist/styles/mockup.css +2 -0
  489. package/dist/styles/navigation-menu.css +1 -1
  490. package/dist/styles/number-field.css +1 -1
  491. package/dist/styles/otp-field.css +1 -1
  492. package/dist/styles/overlay.css +1 -1
  493. package/dist/styles/page-layout.css +1 -1
  494. package/dist/styles/pagination.css +1 -1
  495. package/dist/styles/panes.css +1 -1
  496. package/dist/styles/pie-chart.css +2 -0
  497. package/dist/styles/pill.css +1 -1
  498. package/dist/styles/popconfirm.css +2 -0
  499. package/dist/styles/popover.css +1 -1
  500. package/dist/styles/portal.css +2 -0
  501. package/dist/styles/progress-box.css +1 -1
  502. package/dist/styles/progress-circular.css +1 -1
  503. package/dist/styles/progress-linear.css +1 -1
  504. package/dist/styles/radio-group.css +1 -1
  505. package/dist/styles/rating.css +1 -1
  506. package/dist/styles/scatter-chart.css +2 -0
  507. package/dist/styles/scroll-area.css +2 -0
  508. package/dist/styles/scroll-zone.css +2 -0
  509. package/dist/styles/segmented-button.css +1 -1
  510. package/dist/styles/select.css +1 -1
  511. package/dist/styles/shortcut.css +1 -1
  512. package/dist/styles/show.css +2 -0
  513. package/dist/styles/sidebar.css +1 -1
  514. package/dist/styles/skeleton.css +1 -1
  515. package/dist/styles/slider.css +1 -1
  516. package/dist/styles/snackbar.css +1 -1
  517. package/dist/styles/sparkline.css +2 -0
  518. package/dist/styles/spoiler.css +1 -1
  519. package/dist/styles/stack.css +2 -0
  520. package/dist/styles/statistic.css +2 -0
  521. package/dist/styles/stepper.css +2 -0
  522. package/dist/styles/switch.css +1 -1
  523. package/dist/styles/table.css +1 -1
  524. package/dist/styles/tabs.css +1 -1
  525. package/dist/styles/text-field.css +1 -1
  526. package/dist/styles/text-link.css +1 -1
  527. package/dist/styles/time-picker.css +1 -1
  528. package/dist/styles/timeline-chart.css +2 -0
  529. package/dist/styles/timeline.css +1 -1
  530. package/dist/styles/toggle.css +1 -1
  531. package/dist/styles/tokens.css +1 -1
  532. package/dist/styles/toolbar.css +2 -0
  533. package/dist/styles/tour.css +2 -0
  534. package/dist/styles/transfer.css +1 -1
  535. package/dist/styles/tree-select.css +2 -0
  536. package/dist/styles/tree-view.css +2 -0
  537. package/dist/styles/typography.css +1 -1
  538. package/dist/styles/visually-hidden.css +2 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/tailwind.css +1423 -114
  541. package/dist/types.d.ts +628 -3
  542. package/package.json +8 -2
  543. package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
  544. package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
  545. package/dist/components/avatar-group/index.d.ts +0 -2
  546. package/dist/components/avatar-group/index.js +0 -1
  547. package/dist/internal/avatar-group.d.ts +0 -22
  548. package/dist/internal/avatar-group.js +0 -2
  549. package/dist/styles/avatar-group.css +0 -2
@@ -0,0 +1,471 @@
1
+ import type * as React from 'react';
2
+ import type { MPChartCategory, MPChartCurve, MPChartDatum, MPChartSeries, MPSize } from '../types.js';
3
+ /**
4
+ * The arithmetic and the vocabulary the charts share.
5
+ *
6
+ * Nothing in here draws anything and nothing in here is a class name. It is the
7
+ * palette a series is handed, the numbers a value is written as, and — as the
8
+ * plotted charts arrive — the scales and the ticks under them. Kept apart for
9
+ * the reason `internal/data-table.ts` is: a component whose interesting fifty
10
+ * lines are buried in machinery is a component nobody can read.
11
+ */
12
+ /**
13
+ * How many colours a chart can hand out before it starts repeating.
14
+ *
15
+ * Eight, and a chart that reaches the ninth should not have: a ninth hue is
16
+ * indistinguishable from one of the first eight under colour-vision deficiency
17
+ * whichever one is chosen. Fold the tail into one "other" series, or draw a
18
+ * second chart.
19
+ */
20
+ export declare const CHART_SLOTS = 8;
21
+ /**
22
+ * How many series may be told apart when **any two marks can touch** — a
23
+ * scatter, a bubble chart, a heatmap.
24
+ *
25
+ * Three. The eight slots are separable pair-by-pair only that far, and no
26
+ * ordering of eight does better; it is a property of the colour space rather
27
+ * than of this palette. The stylesheet's note on `--_mp-chart-1` has the
28
+ * measurements.
29
+ */
30
+ export declare const CHART_TOUCHING_SLOTS = 3;
31
+ /**
32
+ * What colour a mark is, in the fixed order the palette is handed out in.
33
+ *
34
+ * `index` is the series' place in the array it was passed in, **not** its place
35
+ * among the ones currently visible. That is the whole point: filtering a legend
36
+ * must not repaint the survivors, because a reader who learned that Europe is
37
+ * blue has learned something a re-render is not allowed to take back.
38
+ *
39
+ * A series that names its own colour gets it. An `MPColor` resolves to that
40
+ * accent role; anything else is passed through as CSS, so a brand hex or a
41
+ * custom property of the caller's both work.
42
+ */
43
+ export declare function seriesColor(index: number, explicit?: string): string;
44
+ /** Where a figure stops being read and starts being counted. */
45
+ export declare const COMPACT_FROM = 10000;
46
+ /**
47
+ * A number as the reader should see it, compacted once it stops being readable
48
+ * in full.
49
+ *
50
+ * Four digits stay and five do not. `1,284` is a figure anybody takes in at a
51
+ * glance, and `1.3K` has thrown away two of them to save two characters; at
52
+ * `12,900` the digits have stopped being read and started being counted, so
53
+ * `12.9K` loses nothing. Past that it is the only honest picture: nobody
54
+ * compares `1,284,003` with `1,911,220` by reading them, and `1.3M` against
55
+ * `1.9M` is what they were going to conclude anyway.
56
+ *
57
+ * `format` overrides all of it, because a caller who has said
58
+ * `{ style: 'currency', currency: 'USD' }` has said what they want and a
59
+ * component that compacted it anyway would be arguing.
60
+ */
61
+ export declare function formatStatistic(value: number, locale: string | undefined, format: Intl.NumberFormatOptions | undefined, compact: boolean): string;
62
+ /** Which way a figure has moved, and whether that is the good direction. */
63
+ export interface MPStatisticDelta {
64
+ /** The change, in the value's own units. */
65
+ absolute: number;
66
+ /** And as a share of where it started. `null` when it started at nothing. */
67
+ percent: number | null;
68
+ /** `0` when it has not moved at all, which is a third state rather than "up". */
69
+ direction: -1 | 0 | 1;
70
+ /** Whether the direction is the one the caller says is good. */
71
+ good: boolean;
72
+ }
73
+ /**
74
+ * The move from one figure to another.
75
+ *
76
+ * A percentage of zero is `null` rather than `Infinity` or `100%`. Something
77
+ * that was nothing and is now something has not grown by an amount — it has
78
+ * started — and every one of the numbers that could be printed there is a lie a
79
+ * reader would take at face value.
80
+ */
81
+ export declare function deltaOf(value: number, previous: number, betterWhen: 'up' | 'down'): MPStatisticDelta;
82
+ /**
83
+ * A point in **plot pixels**, or `null` where the series has a gap.
84
+ *
85
+ * Deliberately not `MPChartPoint`, which is the caller's datum. Everything past
86
+ * this line works in pixels: a builder that could still see a value would be a
87
+ * builder that has to know which way round the axes are.
88
+ */
89
+ export type PlotPoint = {
90
+ x: number;
91
+ y: number;
92
+ } | null;
93
+ /**
94
+ * A series as one `d`, broken wherever it has a gap.
95
+ *
96
+ * The break is the point. A `null` is a month nothing was measured in, and a
97
+ * path that joined the two sides of it would draw a straight line through a
98
+ * value nobody has — which is the one thing a reader would never guess was
99
+ * invented, because it looks exactly like data.
100
+ */
101
+ export declare function linePath(points: readonly PlotPoint[], curve: MPChartCurve): string;
102
+ /**
103
+ * The ribbon between two runs of points.
104
+ *
105
+ * Built run by run, so a gap is a gap in the fill as well — and a gap in
106
+ * *either* edge is a gap in the band, because a ribbon with only one side is
107
+ * not a shape. An area that closed across a missing month would fill in a value
108
+ * that was never measured: the same lie the bridged line tells, painted over a
109
+ * larger part of the chart.
110
+ *
111
+ * The underside is drawn with the **same** curve and its opening `M` turned
112
+ * into an `L`. Both halves matter: a smoothed top over a straight bottom
113
+ * disagrees with itself about where the band is between two points, and a
114
+ * second `moveto` inside the path lifts the pen and leaves the fill with no
115
+ * side.
116
+ */
117
+ export declare function bandPath(top: readonly PlotPoint[], bottom: readonly PlotPoint[], curve: MPChartCurve): string;
118
+ /**
119
+ * The same path closed down to a flat baseline, for an area standing on the
120
+ * axis rather than on another band.
121
+ */
122
+ export declare function areaPath(points: readonly PlotPoint[], baseline: number, curve: MPChartCurve): string;
123
+ /**
124
+ * Which edge of a bar is its data end — the one the value is at.
125
+ *
126
+ * `none` is the inner segment of a stack, whose two faces are both boundaries
127
+ * between shares rather than the end of anything, and so are both left square.
128
+ *
129
+ * `both` is a **span**: a stretch with two ends, neither of which is more the
130
+ * value than the other. A bar grows from a baseline and has one data end; a
131
+ * timeline's bar has no baseline at all.
132
+ */
133
+ export type BarEnd = 'top' | 'bottom' | 'left' | 'right' | 'none' | 'both';
134
+ /**
135
+ * A rectangle with the two corners at its **data end** cut off.
136
+ *
137
+ * Rounded at the end and square at the baseline, and that is not a stylistic
138
+ * split. A bar rounded where it meets the axis has lost the exact point it
139
+ * starts from, and a row of them turns the baseline into a scalloped edge. The
140
+ * end is where the value is, and that is the end worth softening.
141
+ *
142
+ * Which end that is comes from the caller rather than from the geometry,
143
+ * because it is the *sign* and the orientation together that decide: a negative
144
+ * bar hangs below the axis and a horizontal one grows sideways, and in both the
145
+ * corners to soften are the ones furthest from zero.
146
+ *
147
+ * The radius shrinks to fit rather than clipping, so a bar two pixels tall is a
148
+ * bar and not a dome.
149
+ */
150
+ export declare function barPath(x: number, y: number, width: number, height: number, radius: number, end: BarEnd): string;
151
+ /** The lowest and highest a series reaches, with the caller's overrides applied. */
152
+ export declare function extentOf(values: readonly (number | null)[], min?: number, max?: number): {
153
+ min: number;
154
+ max: number;
155
+ };
156
+ /**
157
+ * The lowest and highest a set of series reaches.
158
+ *
159
+ * Stacked is a different question rather than a variation on the same one: what
160
+ * a stacked chart's axis has to hold is the tallest *column*, and the tallest
161
+ * column is not made of the largest values. Positives and negatives accumulate
162
+ * separately, because a column of +8 and −3 is eleven units tall and reaches
163
+ * from −3 to 8, not from 0 to 5.
164
+ *
165
+ * `null` when nothing was measured at all, which is a different answer from
166
+ * `{ min: 0, max: 0 }` — one is an empty chart and the other is a chart of
167
+ * zeroes.
168
+ */
169
+ export declare function seriesExtent(values: readonly (readonly ChartValue[])[], stacked: boolean): {
170
+ min: number;
171
+ max: number;
172
+ } | null;
173
+ /** A value axis: where it starts, where it ends, and what it ticks at. */
174
+ export interface ValueScale {
175
+ min: number;
176
+ max: number;
177
+ ticks: number[];
178
+ /** A value as a fraction of the plot — `0` at `min`, `1` at `max`. */
179
+ fraction: (value: number) => number;
180
+ }
181
+ /**
182
+ * The scale a value axis runs on, rounded out to numbers.
183
+ *
184
+ * Rounding **outward** is the part that matters. A maximum of 4,830 becomes
185
+ * 5,000, so the top tick is a round number and the tallest mark stops short of
186
+ * the ceiling; a scale whose last bar touches the frame reads as clipped even
187
+ * when it is exactly right.
188
+ *
189
+ * Zero stays in range unless the caller says otherwise, because a bar's length
190
+ * is proportional to its value only from a zero baseline. A line chart of a
191
+ * quantity that never goes near zero is the case for passing `min` — and it is
192
+ * a case the caller makes, not one the chart makes for them.
193
+ */
194
+ export declare function valueScale(extent: {
195
+ min: number;
196
+ max: number;
197
+ } | null, options?: {
198
+ min?: number;
199
+ max?: number;
200
+ tickCount?: number;
201
+ /** Keeps zero in range. Off for an axis the caller pinned. */
202
+ includeZero?: boolean;
203
+ }): ValueScale;
204
+ /** The plot's box inside the chart, once the axes have taken their bands. */
205
+ export interface PlotBox {
206
+ left: number;
207
+ top: number;
208
+ width: number;
209
+ height: number;
210
+ }
211
+ /** A band scale: one slot per category, with the marks centred in it. */
212
+ export interface BandScale {
213
+ /** The centre of category `index`, in pixels along the axis. */
214
+ centre: (index: number) => number;
215
+ /** How wide one slot is. */
216
+ step: number;
217
+ /** How much of a slot the marks in it may take, together. */
218
+ band: number;
219
+ }
220
+ export declare function bandScale(count: number, length: number, ratio: number): BandScale;
221
+ /**
222
+ * Roughly how wide a string renders at a given font size.
223
+ *
224
+ * An estimate on purpose. The exact answer is a canvas measurement per label
225
+ * per render, on a path that runs again on every resize — and what the number
226
+ * is used for is deciding how much room to reserve, where a few pixels of
227
+ * generosity cost nothing and a reflow costs a frame.
228
+ *
229
+ * 0.6em is about the advance of a digit in the sans-serifs a UI runs in.
230
+ * Anything CJK is close to a full em, so the wider characters are counted as
231
+ * one: a Korean axis reserving 60% of the room it needs is an axis that
232
+ * overlaps itself.
233
+ */
234
+ export declare function textWidth(text: string, fontSize: number): number;
235
+ /**
236
+ * A label cut to the room it has.
237
+ *
238
+ * The alternative, when a category name is wider than its slot, is to drop
239
+ * labels until the survivors fit — and on five categories called things like
240
+ * "Onboarding flow" that leaves exactly one. An axis with one label is not a
241
+ * shorter axis, it is an unlabelled one. So cut instead: the first few
242
+ * characters tell five words apart, and the hover layer and the table both
243
+ * still carry the whole of it.
244
+ */
245
+ export declare function truncate(text: string, maxWidth: number, fontSize: number): string;
246
+ /**
247
+ * How many labels an axis can show before they collide — every nth.
248
+ *
249
+ * Every nth rather than rotating them. A rotated axis is unreadable at a
250
+ * glance, and it takes a band of the plot to be unreadable in.
251
+ */
252
+ export declare function tickStride(count: number, available: number, labelWidth: number): number;
253
+ /**
254
+ * Whether the label at `index` survives the stride.
255
+ *
256
+ * Every nth, and — where it fits — the last one, which is the part a plain
257
+ * modulo gets wrong: a fourteen-day axis at a stride of two ends at day
258
+ * thirteen, and a percentage axis ends at 80%. The end of a scale is the number
259
+ * a reader looks for first, and dropping it to keep the arithmetic tidy is the
260
+ * wrong trade.
261
+ *
262
+ * `roomForLast` is measured rather than assumed — see `fitsLast`. Forcing a
263
+ * label that does not fit turns a missing "Jun" into an overlapping "MayJun".
264
+ */
265
+ export declare function showsTick(index: number, count: number, stride: number, roomForLast: boolean): boolean;
266
+ /**
267
+ * Whether the last label clears the last one the stride kept.
268
+ *
269
+ * The two sit `(count - 1) % stride` steps apart, and they need half of each
270
+ * label plus a little air: labels are centred on their tick, so only the inner
271
+ * halves can meet.
272
+ */
273
+ export declare function fitsLast(count: number, stride: number, step: number, labelWidth: number): boolean;
274
+ /** One datum, unpacked into the parts the frame reads. */
275
+ export interface ChartValue {
276
+ value: number | null;
277
+ x?: MPChartCategory;
278
+ z?: number;
279
+ color?: string;
280
+ label?: React.ReactNode;
281
+ }
282
+ /**
283
+ * A datum in the one shape everything downstream reads.
284
+ *
285
+ * Every way of being absent collapses to `value: null` here — `null` itself, a
286
+ * missing entry, a `NaN`, an `Infinity`. They mean the same thing to a reader
287
+ * and they must mean the same thing to the path builder, because a `NaN` that
288
+ * survives this far reaches the scale and leaves the letters `NaN` in the `d`
289
+ * attribute, where it silently draws nothing at all.
290
+ */
291
+ export declare function toValue(datum: MPChartDatum): ChartValue;
292
+ /** Every series unpacked, in the order it was given. */
293
+ export declare function toValues(series: readonly MPChartSeries[]): ChartValue[][];
294
+ /**
295
+ * A category as a number, for an axis that is really a second value axis.
296
+ *
297
+ * A `Date` is its epoch milliseconds, which is what makes a scatter of
298
+ * timestamps work at all. A string is not a place on a number line, so it comes
299
+ * back `null` rather than `NaN` — the same rule `toValue` follows, for the same
300
+ * reason.
301
+ */
302
+ export declare function toNumber(value: MPChartCategory | undefined): number | null;
303
+ /** How many categories there are: the longest series decides. */
304
+ export declare function categoryCount(series: readonly MPChartSeries[]): number;
305
+ /**
306
+ * What category `index` is called, from the three places it can come from.
307
+ *
308
+ * The chart's own `categories` first, then whatever a point said its `x` was,
309
+ * then the index. A chart given neither still has an axis — it is numbered, and
310
+ * a numbered axis is a great deal better than a blank one.
311
+ */
312
+ export declare function categoryAt(index: number, categories: readonly MPChartCategory[] | undefined, values: readonly (readonly ChartValue[])[]): MPChartCategory;
313
+ /**
314
+ * A category as the axis writes it.
315
+ *
316
+ * A `Date` gets a short day rather than a full one: an axis is a row of labels
317
+ * that have to fit beside each other, and "Mar 4" carries what "March 4, 2026"
318
+ * carries in a third of the room. The year is the caller's to add with
319
+ * `tickFormat` when a chart spans one.
320
+ */
321
+ export declare function formatCategory(value: MPChartCategory, locale: string | undefined): string;
322
+ /**
323
+ * How tall the drawing is, before the caller says otherwise.
324
+ *
325
+ * Not the control ladder. A chart is a figure on a page rather than a control
326
+ * in a row, so the rungs are set against what a plot needs to be readable: `md`
327
+ * at 220 gives five gridlines about forty pixels apart, which is roughly where
328
+ * a reader stops being able to place a value between two of them.
329
+ */
330
+ export declare const PLOT_HEIGHT: Record<MPSize, number>;
331
+ /**
332
+ * What the axis labels are set in, in pixels.
333
+ *
334
+ * Pixels and not a type role, because these are drawn inside an `<svg>` where a
335
+ * class does not reach and the number is needed for the arithmetic anyway —
336
+ * every band an axis reserves is measured from its own font size.
337
+ */
338
+ export declare const CHART_FONT_SIZE: Record<MPSize, number>;
339
+ /** How heavy a line is. Two pixels at `md`, which is the chart line weight. */
340
+ export declare const LINE_WIDTH: Record<MPSize, number>;
341
+ /**
342
+ * How big a marker is.
343
+ *
344
+ * `md` at 4 makes an 8px dot, which is the floor for a mark a pointer is
345
+ * expected to land on. Below that the hit target is doing all the work and the
346
+ * mark is only telling the reader where to aim.
347
+ */
348
+ export declare const MARKER_RADIUS: Record<MPSize, number>;
349
+ /**
350
+ * The gap of surface between two marks that would otherwise touch.
351
+ *
352
+ * Two pixels, and it is structural rather than decorative: where two fills meet
353
+ * with no gap the eye reads one shape, and the boundary between them is exactly
354
+ * the thing the chart is drawing.
355
+ */
356
+ export declare const MARK_GAP = 2;
357
+ /** How much a bar's data end is rounded. */
358
+ export declare const BAR_RADIUS = 4;
359
+ /**
360
+ * How thick a bar is allowed to get.
361
+ *
362
+ * A cap rather than a size: bars are sized by their band, and two categories in
363
+ * a wide chart would otherwise be two slabs half the plot across. Past about
364
+ * this width a bar stops reading as a measured length and starts reading as a
365
+ * block of colour, and the axis it is measured against gets no easier to use.
366
+ */
367
+ export declare const BAR_MAX_THICKNESS: Record<MPSize, number>;
368
+ /**
369
+ * How much of its slot a band of bars takes, leaving the rest as air.
370
+ *
371
+ * Bars need the gap and lines do not, which is the whole reason the frame takes
372
+ * a ratio at all: a row of bars with no space between them is a histogram, and
373
+ * a histogram means something else — that the categories are contiguous
374
+ * intervals rather than separate things.
375
+ */
376
+ export declare const BAR_BAND_RATIO = 0.72;
377
+ /**
378
+ * A point on a circle, in the convention the round charts use: **zero is twelve
379
+ * o'clock and the angle grows clockwise**.
380
+ *
381
+ * Not the mathematical convention, where zero is three o'clock and the angle
382
+ * grows the other way. A chart of parts is read the way a clock is read, and
383
+ * every angle a caller passes — `startAngle`, a gauge's sweep — is easier to
384
+ * reason about in the one they already have.
385
+ */
386
+ export declare function polarPoint(cx: number, cy: number, radius: number, angle: number): {
387
+ x: number;
388
+ y: number;
389
+ };
390
+ /**
391
+ * A ring segment, or a pie slice when the inner radius is nothing.
392
+ *
393
+ * A full turn is drawn as **two** arcs rather than one, and that is not a
394
+ * flourish: an SVG arc is defined by its two endpoints, so a sweep of exactly
395
+ * 360° starts and ends at the same point and the renderer draws nothing at all.
396
+ * A single-category pie is a real chart, and it would come out blank.
397
+ */
398
+ export declare function arcPath(cx: number, cy: number, outer: number, inner: number, from: number, to: number): string;
399
+ /**
400
+ * The extent of the **category** values, for an axis that runs on numbers.
401
+ *
402
+ * Only points that have a `y` count. A point with no value is not on the plot,
403
+ * so letting its `x` stretch the axis would leave a margin of empty plot
404
+ * standing in for data that was never drawn.
405
+ */
406
+ export declare function categoryExtent(values: readonly (readonly ChartValue[])[], categories: readonly MPChartCategory[] | undefined): {
407
+ min: number;
408
+ max: number;
409
+ } | null;
410
+ /** The shapes a mark can take, in the order they are handed out. */
411
+ export type MPChartMarkShape = 'circle' | 'square' | 'triangle' | 'diamond' | 'cross';
412
+ /**
413
+ * The five, in an order chosen for how quickly one is told from the next.
414
+ *
415
+ * A circle first because it is the mark a scatter is expected to use, then the
416
+ * two that differ from it most — a square by its corners, a triangle by having
417
+ * three of them — before the two that are refinements of those.
418
+ *
419
+ * They exist because the palette runs out sooner here than anywhere else.
420
+ * Colour alone separates **three** series where any two marks can touch, and a
421
+ * scatter is exactly that case; a shape is the second channel that carries the
422
+ * rest, and it survives greyscale, print and forced colours as well.
423
+ */
424
+ export declare const MARK_SHAPES: readonly MPChartMarkShape[];
425
+ /** One mark, centred on a point. */
426
+ export declare function markPath(shape: MPChartMarkShape, cx: number, cy: number, radius: number): string;
427
+ /**
428
+ * Where one point sits along a category axis that runs on numbers.
429
+ *
430
+ * The same three sources `categoryAt` reads, in the same order — but per
431
+ * **point** rather than per column, because on a scatter each series has its
432
+ * own x at every index and there is no column for them to share.
433
+ */
434
+ export declare function pointX(value: ChartValue, index: number, categories: readonly MPChartCategory[] | undefined): number | null;
435
+ /**
436
+ * How big a bubble is, for a magnitude carried by its **area**.
437
+ *
438
+ * The radius goes as the square root, and that is the whole of it: area grows
439
+ * as the square of the radius, so a bubble drawn with its radius proportional
440
+ * to the value shows four times the ink for twice the number. Every reader
441
+ * judges the blob and not the line across it, which makes the naive version a
442
+ * chart that doubles its own data.
443
+ *
444
+ * `min` is a floor rather than zero, because a bubble of no radius is a point
445
+ * that has been removed from the chart.
446
+ */
447
+ export declare function bubbleRadius(z: number, maxZ: number, max: number, min: number): number;
448
+ /** How many steps the sequential ramp has. */
449
+ export declare const RAMP_STEPS = 5;
450
+ /**
451
+ * Which step of the ramp a fraction of the range lands on.
452
+ *
453
+ * **Steps rather than a gradient**, and that is the decision worth stating. A
454
+ * continuous fill looks better and is read worse: a reader given a smooth ramp
455
+ * can say "darker" and nothing else, where five steps let them match a cell to
456
+ * a band in the legend and come away with a number. Five is about the most
457
+ * anybody tells apart in one hue.
458
+ */
459
+ export declare function rampStep(fraction: number): number;
460
+ /** The colour of one step, by its index from the low end. */
461
+ export declare function rampFill(step: number): string;
462
+ /**
463
+ * The ink a label sits in **on** a ramp step.
464
+ *
465
+ * The two darkest steps take the light ink and the rest take the dark one. It
466
+ * is a threshold rather than a computation because the ramp is five fixed
467
+ * colours: a contrast calculation here would be arithmetic performed on every
468
+ * cell, every render, to arrive at an answer that was settled when the ramp was
469
+ * fitted.
470
+ */
471
+ export declare function rampInk(step: number): string;
@@ -0,0 +1 @@
1
+ export const CHART_SLOTS=8;export const CHART_TOUCHING_SLOTS=3;const t=new Set(["primary","secondary","tertiary","error"]);export function seriesColor(n,o){return o?t.has(o)?`var(--_mp-color-${o})`:o:`var(--_mp-chart-${n%8+1})`}export const COMPACT_FROM=1e4;export function formatStatistic(t,n,o,r){return Number.isFinite(t)?o?new Intl.NumberFormat(n,o).format(t):r&&Math.abs(t)>=1e4?new Intl.NumberFormat(n,{notation:"compact",maximumFractionDigits:1}).format(t):new Intl.NumberFormat(n).format(t):""}export function deltaOf(t,n,o){const r=t-n,e=r>0?1:r<0?-1:0;return{absolute:r,percent:0===n?null:r/Math.abs(n)*100,direction:e,good:0!==e&&1===e==("up"===o)}}function n(t,n){if(0===t.length)return"";if(1===t.length)return`M${t[0].x} ${t[0].y}h0`;const o=`M${t[0].x} ${t[0].y}`;if("smooth"===n)return o+function(t){const n=t.length,o=[];for(let r=0;r<n-1;r+=1){const n=t[r+1].x-t[r].x;o.push(0===n?0:(t[r+1].y-t[r].y)/n)}const r=[o[0]??0];for(let t=1;t<n-1;t+=1){const n=o[t-1],e=o[t];r.push(n*e<=0?0:2*n*e/(n+e))}r.push(o[n-2]??0);const e=[];for(let o=0;o<n-1;o+=1){const n=(t[o+1].x-t[o].x)/3;e.push(`C${t[o].x+n} ${t[o].y+r[o]*n} ${t[o+1].x-n} ${t[o+1].y-r[o+1]*n} ${t[o+1].x} ${t[o+1].y}`)}return e.join("")}(t);const r=[];for(let o=1;o<t.length;o+=1)if("step"===n){const n=(t[o-1].x+t[o].x)/2;r.push(`H${n}V${t[o].y}H${t[o].x}`)}else r.push(`L${t[o].x} ${t[o].y}`);return o+r.join("")}export function linePath(t,o){return function(t){const n=[];let o=[];for(const r of t)null===r?(o.length>0&&n.push(o),o=[]):o.push(r);return o.length>0&&n.push(o),n}(t).map(t=>n(t,o)).join("")}export function bandPath(t,o,r){const e=[];let a=[],u=[];const i=()=>{a.length>0&&e.push(`${n(a,r)}${n([...u].reverse(),r).replace(/^M/,"L")}Z`),a=[],u=[]};return t.forEach((t,n)=>{const r=o[n];null!==t&&null!=r?(a.push(t),u.push(r)):i()}),i(),e.join("")}export function areaPath(t,n,o){return bandPath(t,t.map(t=>null===t?null:{x:t.x,y:n}),o)}export function barPath(t,n,o,r,e,a){const u=Math.abs(o),i=Math.abs(r);if(0===u||0===i)return"";const l=Math.max(0,Math.min(e,u/2,i/2)),c="both"===a,s={tl:c||"top"===a||"left"===a?l:0,tr:c||"top"===a||"right"===a?l:0,br:c||"bottom"===a||"right"===a?l:0,bl:c||"bottom"===a||"left"===a?l:0},x=(t,n,o)=>t>0?`a${t} ${t} 0 0 1 ${n} ${o}`:"";return`M${t+s.tl} ${n}h`+(u-s.tl-s.tr)+x(s.tr,s.tr,s.tr)+"v"+(i-s.tr-s.br)+x(s.br,-s.br,s.br)+"h"+-(u-s.bl-s.br)+x(s.bl,-s.bl,-s.bl)+"v"+-(i-s.tl-s.bl)+x(s.tl,s.tl,-s.tl)+"Z"}export function extentOf(t,n,o){const r=t.filter(t=>null!==t&&Number.isFinite(t)),e=n??(r.length>0?Math.min(...r):0),a=o??(r.length>0?Math.max(...r):0);return e===a?{min:e-.5,max:a+.5}:{min:e,max:a}}export function seriesExtent(t,n){let o=1/0,r=-1/0,e=!1;if(n){const n=t.reduce((t,n)=>Math.max(t,n.length),0);for(let a=0;a<n;a+=1){let n=0,u=0;for(const o of t){const t=o[a]?.value;null!=t&&(e=!0,t>=0?n+=t:u+=t)}o=Math.min(o,u),r=Math.max(r,n)}}else for(const n of t)for(const{value:t}of n)null!==t&&(e=!0,o=Math.min(o,t),r=Math.max(r,t));return e?{min:o,max:r}:null}function o(t){const n=10**Math.floor(Math.log10(t)),o=t/n;return o<=1?n:o<=2?2*n:o<=5?5*n:10*n}export function valueScale(t,n={}){const{tickCount:r=5,includeZero:e=!0}=n;let a=n.min??t?.min??0,u=n.max??t?.max??1;if(e&&void 0===n.min&&(a=Math.min(a,0)),e&&void 0===n.max&&(u=Math.max(u,0)),u===a){const t=Math.abs(u)>0?.5*Math.abs(u):1;a-=t,u+=t}const i=void 0!==n.min&&void 0!==n.max?function(t,n){const r=10**Math.floor(Math.log10(t/Math.max(1,n)));let e=o(t/Math.max(1,n)),a=1/0;for(const o of[.1,1,10])for(const u of[1,2,2.5,5]){const i=u*o*r,l=t/i,c=Math.round(l);if(c<1||Math.abs(l-c)>1e-9)continue;const s=Math.abs(c-n);s<a&&(a=s,e=i)}return e}(u-a,r):o((u-a)/Math.max(1,r)),l=void 0!==n.min?a:Math.floor(a/i)*i,c=void 0!==n.max?u:Math.ceil(u/i)*i,s=c-l||1,x=[];for(let t=l;t<=c+1e-9*i;t+=i)x.push(Number(t.toFixed(12)));return{min:l,max:c,ticks:x,fraction:t=>(t-l)/s}}export function bandScale(t,n,o){const r=t>0?n/t:n;return{step:r,band:r*o,centre:t=>r*(t+.5)}}export function textWidth(t,n){let o=0;for(const n of t)o+=/[ᄀ-ᇿ⺀-꓏가-퟿豈-﫿︰-﹏]/.test(n)?1:.6;return o*n}export function truncate(t,n,o){if(n<=0||textWidth(t,o)<=n)return t;const r=n-textWidth("…",o);let e="",a=0;for(const n of t){const t=a+textWidth(n,o);if(t>r)break;a=t,e+=n}return e.length>0?`${e.trimEnd()}…`:"…"}export function tickStride(t,n,o){return t<=1||n<=0?1:Math.max(1,Math.ceil(t/Math.max(1,Math.floor(n/Math.max(1,o)))))}export function showsTick(t,n,o,r){return t%o===0||r&&t===n-1}export function fitsLast(t,n,o,r){const e=(t-1)%n;return e>0&&e*o>=r+8}export function toValue(t){return null==t?{value:null}:"number"==typeof t?{value:Number.isFinite(t)?t:null}:"object"==typeof t&&"y"in t?{value:null!==t.y&&Number.isFinite(t.y)?t.y:null,x:t.x,z:t.z,color:t.color?seriesColor(0,t.color):void 0,label:t.label}:{value:null}}export function toValues(t){return t.map(t=>t.data.map(toValue))}export function toNumber(t){return t instanceof Date?Number.isFinite(t.getTime())?t.getTime():null:"number"==typeof t&&Number.isFinite(t)?t:null}export function categoryCount(t){return t.reduce((t,n)=>Math.max(t,n.data.length),0)}export function categoryAt(t,n,o){if(n&&t<n.length)return n[t];for(const n of o){const o=n[t]?.x;if(void 0!==o)return o}return t}export function formatCategory(t,n){return t instanceof Date?new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(t):"number"==typeof t?new Intl.NumberFormat(n).format(t):t}export const PLOT_HEIGHT={xs:120,sm:160,md:220,lg:280,xl:360};export const CHART_FONT_SIZE={xs:10,sm:11,md:12,lg:13,xl:14};export const LINE_WIDTH={xs:1.5,sm:1.75,md:2,lg:2.5,xl:3};export const MARKER_RADIUS={xs:3,sm:3.5,md:4,lg:4.5,xl:5};export const MARK_GAP=2;export const BAR_RADIUS=4;export const BAR_MAX_THICKNESS={xs:24,sm:32,md:40,lg:48,xl:56};export const BAR_BAND_RATIO=.72;export function polarPoint(t,n,o,r){return{x:t+o*Math.sin(r),y:n-o*Math.cos(r)}}export function arcPath(t,n,o,r,e,a){const u=a-e;if(Math.abs(u)<1e-9||o<=0)return"";const i=Math.abs(u)>=2*Math.PI-1e-9,l=i?e+2*Math.PI*Math.sign(u||1):a,c=e+(l-e)/2,s=Math.abs(l-e)>Math.PI?1:0,x=l>e?1:0,m=x?0:1,h=polarPoint(t,n,o,e),$=polarPoint(t,n,o,c),f=polarPoint(t,n,o,l),p=i?`A${o} ${o} 0 0 ${x} ${$.x} ${$.y}A${o} ${o} 0 0 ${x} ${f.x} ${f.y}`:`A${o} ${o} 0 ${s} ${x} ${f.x} ${f.y}`;if(r<=0)return i?`M${h.x} ${h.y}${p}Z`:`M${t} ${n}L${h.x} ${h.y}${p}Z`;const M=polarPoint(t,n,r,l),b=polarPoint(t,n,r,c),d=polarPoint(t,n,r,e),y=i?`A${r} ${r} 0 0 ${m} ${b.x} ${b.y}A${r} ${r} 0 0 ${m} ${d.x} ${d.y}`:`A${r} ${r} 0 ${s} ${m} ${d.x} ${d.y}`;return`M${h.x} ${h.y}${p}L${M.x} ${M.y}${y}Z`}export function categoryExtent(t,n){let o=1/0,r=-1/0,e=!1;return t.forEach(t=>{t.forEach((t,a)=>{if(null===t.value)return;const u=toNumber(t.x??n?.[a]??a);null!==u&&(e=!0,o=Math.min(o,u),r=Math.max(r,u))})}),e?{min:o,max:r}:null}export const MARK_SHAPES=["circle","square","triangle","diamond","cross"];const r={circle:1,square:.886,triangle:1.35,diamond:1.25,cross:1.1};export function markPath(t,n,o,e){const a=e*r[t];switch(t){case"square":return`M${n-a} ${o-a}h${2*a}v${2*a}h${2*-a}Z`;case"triangle":return`M${n} ${o-a}L${n+.866*a} ${o+.5*a}L${n-.866*a} ${o+.5*a}Z`;case"diamond":return`M${n} ${o-a}L${n+a} ${o}L${n} ${o+a}L${n-a} ${o}Z`;case"cross":return`M${n-a} ${o-a}L${n+a} ${o+a}M${n+a} ${o-a}L${n-a} ${o+a}`;default:return`M${n-a} ${o}a${a} ${a} 0 1 0 ${2*a} 0a${a} ${a} 0 1 0 ${2*-a} 0Z`}}export function pointX(t,n,o){return toNumber(t.x??o?.[n]??n)}export function bubbleRadius(t,n,o,r){return n<=0||t<=0?r:r+(o-r)*Math.sqrt(Math.min(1,t/n))}export const RAMP_STEPS=5;export function rampStep(t){return Number.isFinite(t)?Math.min(4,Math.max(0,Math.floor(5*t))):0}export function rampFill(t){return`var(--_mp-chart-scale-${Math.min(5,Math.max(1,t+1))})`}export function rampInk(t){return t>=3?"var(--_mp-color-surface)":"var(--_mp-color-on-surface)"}
@@ -0,0 +1,28 @@
1
+ /** What a page can be set to. `'system'` is the absence of a choice. */
2
+ export type MPColorScheme = 'light' | 'dark' | 'system';
3
+ /** What is actually painted, once `'system'` has been resolved. */
4
+ export type MPResolvedColorScheme = 'light' | 'dark';
5
+ export declare const SCHEME_ATTRIBUTE = "data-mp-scheme";
6
+ export declare const DEFAULT_STORAGE_KEY = "mp-color-scheme";
7
+ /**
8
+ * Puts the choice on the document element, or takes it off.
9
+ *
10
+ * `'system'` **removes** the attribute rather than writing it, which is the
11
+ * whole of how the media query gets its say back: the dark block is reached
12
+ * either by `prefers-color-scheme` on a root that is not forced light, or by the
13
+ * attribute. An attribute spelling out `system` would match neither.
14
+ */
15
+ export declare function applyScheme(scheme: MPColorScheme): void;
16
+ export declare function setScheme(storageKey: string, scheme: MPColorScheme): void;
17
+ export declare function useChosenScheme(storageKey: string): MPColorScheme;
18
+ /**
19
+ * What the operating system is asking for, followed live.
20
+ *
21
+ * Subscribed to even while a page has chosen `'light'` or `'dark'`, which costs
22
+ * one listener and buys the thing a toggle is usually for: switching back to
23
+ * `'system'` reports the right answer immediately rather than on the next
24
+ * change.
25
+ */
26
+ export declare function useSystemScheme(): MPResolvedColorScheme;
27
+ /** Test seam: forgets the page's choice so a suite can start from nothing. */
28
+ export declare function resetScheme(): void;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";export const SCHEME_ATTRIBUTE="data-mp-scheme";export const DEFAULT_STORAGE_KEY="mp-color-scheme";const t="(prefers-color-scheme: dark)";function n(e){return"light"===e||"dark"===e||"system"===e}let o;const r=new Set;function c(){for(const e of r)e()}export function applyScheme(e){if("undefined"==typeof document)return;const t=document.documentElement;"system"===e?t.removeAttribute("data-mp-scheme"):t.setAttribute("data-mp-scheme",e)}export function setScheme(e,t){o=t,function(e,t){try{"system"===t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}(e,t),applyScheme(t),c()}function s(e){return r.add(e),()=>{r.delete(e)}}function u(e){return o??=function(){if("undefined"==typeof document)return;const e=document.documentElement.getAttribute("data-mp-scheme");return n(e)&&"system"!==e?e:void 0}()??function(e){try{if("undefined"==typeof localStorage)return"system";const t=localStorage.getItem(e);return n(t)?t:"system"}catch{return"system"}}(e),o}export function useChosenScheme(t){const n=e.useCallback(()=>u(t),[t]);return e.useSyncExternalStore(s,n,()=>"system")}function m(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const n=window.matchMedia(t);return n.addEventListener("change",e),()=>n.removeEventListener("change",e)}function i(){return"undefined"!=typeof window&&window.matchMedia?.(t).matches?"dark":"light"}export function useSystemScheme(){return e.useSyncExternalStore(m,i,()=>"light")}export function resetScheme(){o=void 0,c()}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The prop defaults an application can move for the whole page.
3
+ *
4
+ * `size`, `color` and `density` are the only axes where every component that has
5
+ * them starts from the *same* answer — `md`, `primary` and `0` — which is what
6
+ * makes a single app-wide default meaningful for them and meaningless for
7
+ * anything else.
8
+ * A `variant` default is per component by design (`MPAccordion` is `outlined`,
9
+ * `MPAlert` is `tonal`, `MPBadge` is `filled`), so one global value would be
10
+ * overwriting six considered decisions with one arbitrary one.
11
+ *
12
+ * The same rule decides which components read this at all: a component that was
13
+ * taking the library's default takes the configured one instead, and a component
14
+ * that had chosen its own keeps it. `MPBadge` stays `error`, `MPTooltip` stays
15
+ * `sm`, `MPDialog`, `MPPill` and `MPShortcut` stay `secondary` — those are not
16
+ * unfilled defaults, they are answers.
17
+ *
18
+ * ## Why this needs context at all
19
+ *
20
+ * Which is the question `MPLocaleProvider` answers for itself, and the answer
21
+ * here is the same shape. Everything a theme normally carries — the colour
22
+ * roles, the type scale, the corners, the motion — is a CSS custom property and
23
+ * reaches a component through the cascade. `size` cannot: it resolves to literal
24
+ * Tailwind class strings (`h-14`, `text-mp-body-large`), because Tailwind finds
25
+ * classes by scanning source text and an interpolated `h-${n}` generates no rule
26
+ * at all. See `internal/scale.ts`. A value that cannot be a custom property and
27
+ * has to reach every call site is exactly what context is for.
28
+ */
29
+ import * as React from 'react';
30
+ import type { MPColor, MPDensity, MPSize, MPWindowClass } from '../types.js';
31
+ /** What an `MPConfigProvider` can set. Anything unset is inherited, then default. */
32
+ export interface MPConfigValue {
33
+ size?: MPSize;
34
+ color?: MPColor;
35
+ density?: MPDensity;
36
+ /**
37
+ * Where the window size classes begin, for the JavaScript half of the library.
38
+ *
39
+ * Partial and merged over MD3's own, in CSS pixels. See `MPConfigProvider` for
40
+ * what this does and does not reach — the stylesheet is not downstream of it,
41
+ * and cannot be.
42
+ */
43
+ breakpoints?: Partial<Record<MPWindowClass, number>>;
44
+ }
45
+ export declare const MPConfigContext: React.Context<MPConfigValue>;
46
+ /** The configuration in force at this point in the tree. */
47
+ export declare function useMPConfig(): MPConfigValue;
48
+ /**
49
+ * `prop ?? config ?? the library's own`, which is the order of specificity: what
50
+ * this call site said, then what the application said, then what Material says.
51
+ */
52
+ export declare function useMPSize(size: MPSize | undefined): MPSize;
53
+ export declare function useMPColor(color: MPColor | undefined): MPColor;
54
+ /**
55
+ * The third axis with an app-wide default, and the one most likely to be set
56
+ * once and never again: a product decides how dense it is at the top, not per
57
+ * table.
58
+ *
59
+ * Only the components that hold things read it, so a page set to `-2` tightens
60
+ * its lists and leaves its buttons at the height they have to be.
61
+ */
62
+ export declare function useMPDensity(density: MPDensity | undefined): MPDensity;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as t from"react";const e=Object.freeze({});export const MPConfigContext=/*@__PURE__*/t.createContext(e);export function useMPConfig(){return t.useContext(MPConfigContext)}export function useMPSize(e){const o=t.useContext(MPConfigContext);return e??o.size??"md"}export function useMPColor(e){const o=t.useContext(MPConfigContext);return e??o.color??"primary"}export function useMPDensity(e){const o=t.useContext(MPConfigContext);return e??o.density??0}