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,198 @@
1
+ import * as React from 'react';
2
+ import type { MPAnimateTimeline, MPAnimateTrigger, MPAnimation, MPEasing, MPSize } from '../../types.js';
3
+ /**
4
+ * Which way the pile grows.
5
+ *
6
+ * `diagonal` is a **horizontal** flow with a per-item vertical offset, not a
7
+ * flow of its own: see the note on `drop` for why the second axis cannot be
8
+ * left to the layout.
9
+ */
10
+ export type MPStackDirection = 'horizontal' | 'vertical' | 'diagonal';
11
+ /** Which end of the pile is nearest the reader. */
12
+ export type MPStackFront = 'first' | 'last';
13
+ export interface MPStackProps extends React.ComponentPropsWithoutRef<'div'> {
14
+ /**
15
+ * Which way the pile grows.
16
+ * @default 'horizontal'
17
+ */
18
+ direction?: MPStackDirection;
19
+ /**
20
+ * How far each item sits under the one before it, along the axis the pile
21
+ * flows on — a number in pixels, or any CSS length. Left out it is a fraction
22
+ * of `size`.
23
+ */
24
+ overlap?: number | string;
25
+ /**
26
+ * How far each item sits below the one before it on `diagonal`, which is the
27
+ * axis the flow is **not** on. Defaults to `overlap`, which is a shallow fan.
28
+ *
29
+ * It is a prop rather than an angle because a true 45° would need the items'
30
+ * own width, and a library does not have it: the horizontal advance is
31
+ * `width − overlap`, and `width` is whatever the caller put in. Nothing here
32
+ * pretends otherwise.
33
+ */
34
+ drop?: number | string;
35
+ /**
36
+ * Sets the default `overlap`, and nothing else. It is not passed to the
37
+ * items — a `Stack` does not know what they are.
38
+ * @default 'md'
39
+ */
40
+ size?: MPSize;
41
+ /** How many items are drawn before the rest become an `overflow`. */
42
+ max?: number;
43
+ /**
44
+ * How many there are altogether, when the stack was handed only the first few.
45
+ * Without it the count is worked out from the children, which is right only
46
+ * when all of them were passed.
47
+ */
48
+ total?: number;
49
+ /**
50
+ * The last item in the pile, built from the number that did not fit.
51
+ *
52
+ * A **function** rather than a node, because the count is the whole of what
53
+ * that item has to say: `(hidden) => <MPAvatar initials={`+${hidden}`} />`.
54
+ * Left out, nothing is drawn for the remainder.
55
+ */
56
+ overflow?: (hidden: number) => React.ReactNode;
57
+ /**
58
+ * Which end of the pile is nearest the reader.
59
+ * @default 'first'
60
+ */
61
+ front?: MPStackFront;
62
+ /**
63
+ * What each item is scaled by relative to the one in front of it. `1` is no
64
+ * change; `0.94` puts the fifth card at about three quarters.
65
+ *
66
+ * It changes what is drawn and not what is measured, so the spacing of the
67
+ * pile is the same either way — a scaled card does not pull the ones behind
68
+ * it closer.
69
+ * @default 1
70
+ */
71
+ scaleStep?: number;
72
+ /**
73
+ * The same, for opacity. `0.85` fades a deck into the page behind it.
74
+ * @default 1
75
+ */
76
+ opacityStep?: number;
77
+ /**
78
+ * Draws a hairline of the page's own `surface` around each item, so two
79
+ * shapes of similar tone have an edge between them.
80
+ *
81
+ * On the **item** rather than on the wrapper around it, because a ring has to
82
+ * follow the shape it is tracing and a square ring around a circular avatar
83
+ * is worse than none. That is a fixed-depth selector, so it reaches a child
84
+ * this stack put there and not one wrapped in something else — see the
85
+ * component's documentation.
86
+ * @default false
87
+ */
88
+ ring?: boolean;
89
+ /**
90
+ * An entrance for each item, from the same six the `MPAnimate*` components
91
+ * run. Left out, nothing is animated.
92
+ */
93
+ transition?: MPAnimation;
94
+ /** How long one item's entrance takes, in milliseconds. */
95
+ duration?: number;
96
+ /** How long before the first one starts, in milliseconds. */
97
+ delay?: number;
98
+ /** Which Material easing curve the entrance runs on. */
99
+ easing?: MPEasing;
100
+ /**
101
+ * How long after one item the next one starts, in milliseconds.
102
+ * @default 60
103
+ */
104
+ stagger?: number;
105
+ /** How much longer each item takes than the one before it, in milliseconds. */
106
+ durationStep?: number;
107
+ /** Deals the pile from the back. */
108
+ reverse?: boolean;
109
+ /**
110
+ * What starts the entrance.
111
+ * @default 'mount'
112
+ */
113
+ trigger?: MPAnimateTrigger;
114
+ /** Runs it, when `trigger` is `manual`. */
115
+ play?: boolean;
116
+ /**
117
+ * With `trigger="visible"`, whether it runs only the first time.
118
+ * @default true
119
+ */
120
+ once?: boolean;
121
+ /**
122
+ * With `trigger="visible"`, how much has to be on screen to count.
123
+ * @default 0.2
124
+ */
125
+ threshold?: number;
126
+ /** Holds the entrance where it is. */
127
+ paused?: boolean;
128
+ /** Hands the entrance to the reader's scrolling. */
129
+ timeline?: MPAnimateTimeline;
130
+ /** Which part of the travel through the scrollport the entrance covers. */
131
+ range?: string;
132
+ /** The things in the pile. */
133
+ children?: React.ReactNode;
134
+ }
135
+ /**
136
+ * Things laid over each other in a pile.
137
+ *
138
+ * A stack of avatars, a deck of cards, a heap of documents, a run of overlapped
139
+ * thumbnails: one component, because "several of these, overlapping" is one
140
+ * idea and the things being overlapped are not this component's business.
141
+ *
142
+ * ## Why the overlap is a margin and not a `translate`
143
+ *
144
+ * This is the detail nearly every implementation of this gets wrong. Move the
145
+ * items with `translate` and each one still **occupies its full width**: the
146
+ * box stays the size of one item plus the full width of all the others, the
147
+ * pile is drawn outside it, and everything after the stack on the page is laid
148
+ * out against a measurement that is wrong. It cannot go in a sentence.
149
+ *
150
+ * A negative margin takes the space back, so the box is exactly the size of
151
+ * what is drawn. At 32px items with a 10px overlap, five of them come to
152
+ * 120×32 horizontally, 32×120 vertically and 120×72 on the diagonal — the box
153
+ * fits the content in all three.
154
+ *
155
+ * The margin is **logical**, so a horizontal pile overlaps the other way under
156
+ * RTL without being asked to.
157
+ *
158
+ * ## Why `diagonal` is a horizontal flow
159
+ *
160
+ * Because a flow only overlaps items on the axis it flows along. The other axis
161
+ * has to be written per item, as a margin multiplied by the item's index — a
162
+ * fixed `margin-block-start` in a row does not accumulate, it puts every item
163
+ * at the same offset and the fan does not happen.
164
+ *
165
+ * ## What it does not do
166
+ *
167
+ * It does not know what the items **are**, which is the price of being general.
168
+ * There is no `variant`, no `color` and no `shape` to set once for the pile:
169
+ * `size` here picks the default overlap and is not passed on. Set the ones your
170
+ * items share on [MPConfigProvider](../../guide/config), and the rest per item.
171
+ *
172
+ * ## Two layers per item, and why
173
+ *
174
+ * Each item is wrapped twice. The outer span carries the offset, the `z-index`
175
+ * and the entrance; the inner one carries the static `scale` and `opacity` that
176
+ * make depth. They are separate because the `grow` and `zoom` keyframes
177
+ * animate the individual `scale` property — an animation and a resting depth on
178
+ * the same element means the keyframe wins and the depth is gone the moment
179
+ * something is animated.
180
+ *
181
+ * The wrappers are also what keeps this off the children. Cloning them to add a
182
+ * `className` would require every child to accept one, and a face wrapped in a
183
+ * router's link or a tooltip trigger has no obligation to.
184
+ *
185
+ * `ring` is the one exception, and it is honest about the cost: it is a
186
+ * fixed-depth descendant selector, so it lands on the element this stack
187
+ * wrapped. A child that is itself a wrapper gets the ring on the wrapper.
188
+ *
189
+ * ## What `transition` costs
190
+ *
191
+ * 2.1 kB gzipped against the 0.9 kB the layout alone would come to, because it
192
+ * reads the same effect tables `MPAnimateFade` does. It is here rather than
193
+ * composed from outside because the items are inside wrappers this component
194
+ * builds and nothing outside can reach them — but a stack of four faces with no
195
+ * `transition` is paying for six effects it will never run, and that is written
196
+ * into the documentation rather than left to be found.
197
+ */
198
+ export declare const MPStack: React.ForwardRefExoticComponent<MPStackProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{ANIMATION_CLASS as a,ANIM_BASE as r,animationSlots as i,useAnimationRun as n}from"../../internal/animate.js";import{lengthValue as l}from"../../internal/animate.js";import{useMPSize as o}from"../../internal/config.js";const s={xs:"0.625rem",sm:"0.75rem",md:"1.125rem",lg:"1.25rem",xl:"1.5rem"};export const MPStack=/*@__PURE__*/t.forwardRef(function({direction:c="horizontal",overlap:m,drop:d,size:p,max:f,total:g,overflow:h,front:u="first",scaleStep:v=1,opacityStep:y=1,ring:x=!1,transition:S,duration:k,delay:j=0,easing:$,stagger:w=60,durationStep:z=0,reverse:N=!1,trigger:B="mount",play:M,once:_=!0,threshold:I=.2,paused:b,timeline:A,range:C,className:E,style:O,children:P,...R},V){const q=o(p),D=n({trigger:B,play:M,once:_,threshold:I,paused:b,infinite:!1}),F="view"===A?b?"paused":"running":D.state,G=t.Children.toArray(P),H=void 0===f?G:G.slice(0,Math.max(0,f)),J=g??G.length,K=Math.max(0,J-H.length),L=h&&K>0?h(K):null,Q=null===L?H:[...H,L],T=void 0===m?s[q]:l(m),U=void 0===d?T:l(d),W="vertical"===c?"flex-col":"flex-row",X=S?`${r} ${a[S]}`:"";return e("div",{ref:e=>{D.ref(e),"function"==typeof V?V(e):V&&(V.current=e)},"data-mp-size":q,"data-mp-direction":c,className:["mp-stack isolate inline-flex align-middle",W,"diagonal"===c?"items-start":"items-center",x?"ring-mp-surface [&>*>*>*]:ring-2":"",E??""].filter(Boolean).join(" "),style:{"--_mp-anim-state":F,...O},...D.handlers,...R,children:Q.map((a,r)=>{const n=N?Q.length-1-r:r,l="first"===u?r:Q.length-1-r;return e("span",{className:X,style:{zIndex:"first"===u?Q.length-r:r+1,...r>0&&"vertical"===c?{marginBlockStart:`calc(${T} * -1)`}:{},...r>0&&"vertical"!==c?{marginInlineStart:`calc(${T} * -1)`}:{},..."diagonal"===c?{marginBlockStart:`calc(${U} * ${r})`}:{},...S?i({effect:S,duration:k,delay:j+n*w,easing:$,repeat:1,durationOffset:n*z,timeline:A,range:C}):{}},children:e("span",{className:"mp-stack__item block",style:{scale:1===v?void 0:String(v**l),opacity:1===y?void 0:y**l},children:a})},t.isValidElement(a)?a.key??r:r)})})});
@@ -0,0 +1,2 @@
1
+ export { MPStack } from './MPStack.js';
2
+ export type { MPStackDirection, MPStackFront, MPStackProps } from './MPStack.js';
@@ -0,0 +1 @@
1
+ export{MPStack}from"./MPStack.js";
@@ -0,0 +1,104 @@
1
+ import * as React from 'react';
2
+ import type { MPAlign, MPSize, MPSlots } from '../../types.js';
3
+ /** How the move from `previousValue` is written. */
4
+ export type MPStatisticDeltaFormat = 'percent' | 'absolute' | 'both' | 'none';
5
+ /** The parts an `MPStatistic` draws that a `className` cannot reach. */
6
+ export type MPStatisticSlot = 'label' | 'value' | 'delta' | 'caption' | 'trend';
7
+ export interface MPStatisticProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'prefix' | 'color'> {
8
+ /** What the figure is. Sentence case, and no trailing colon. */
9
+ label?: React.ReactNode;
10
+ /**
11
+ * The figure.
12
+ *
13
+ * A number is written by `locale` and `format`; anything else is drawn as it
14
+ * is, for a value that is already a string — `"2h 14m"`, `"A+"` — or a piece
15
+ * of markup.
16
+ */
17
+ value: React.ReactNode;
18
+ /**
19
+ * How a numeric `value` is written. An `Intl.NumberFormat` options object, and
20
+ * giving one turns `compact` off: a caller who has asked for a currency has
21
+ * said what they want.
22
+ */
23
+ format?: Intl.NumberFormatOptions;
24
+ /**
25
+ * Shortens a number of five digits or more — `12.9K`, `4.2M`.
26
+ *
27
+ * Four digits stay: `1,284` is a figure anybody takes in at a glance, and
28
+ * `1.3K` has thrown away two of them to save two characters.
29
+ * @default true
30
+ */
31
+ compact?: boolean;
32
+ /** Which language the figure and the move are written in. */
33
+ locale?: string;
34
+ /** Placed before the figure, on the same line — a currency mark, an icon. */
35
+ prefix?: React.ReactNode;
36
+ /** Placed after it, one step smaller — a unit, a denominator. */
37
+ unit?: React.ReactNode;
38
+ /** What the figure was, so the move from it can be drawn. */
39
+ previousValue?: number;
40
+ /**
41
+ * How that move is written.
42
+ * @default 'percent'
43
+ */
44
+ delta?: MPStatisticDeltaFormat;
45
+ /**
46
+ * Which direction is the good one.
47
+ *
48
+ * It is a prop and not an assumption because half the figures on a dashboard
49
+ * are the other way round: churn, latency, cost and error rate are all better
50
+ * when they fall, and a component that painted every fall red would be lying
51
+ * about four tiles in eight.
52
+ * @default 'up'
53
+ */
54
+ betterWhen?: 'up' | 'down';
55
+ /** What the move is measured against — "vs last week". Read out with it. */
56
+ period?: React.ReactNode;
57
+ /** A line under the figure, for the thing that does not fit anywhere else. */
58
+ caption?: React.ReactNode;
59
+ /**
60
+ * Room under the figure for a picture of it — a sparkline, usually.
61
+ *
62
+ * A slot rather than a chart of its own: a statistic that owned a sparkline
63
+ * would be a statistic that had opinions about a second component's data
64
+ * shape, and the two are separable.
65
+ */
66
+ trend?: React.ReactNode;
67
+ /** @default 'start' */
68
+ align?: MPAlign;
69
+ /** @default 'md' */
70
+ size?: MPSize;
71
+ classNames?: MPSlots<MPStatisticSlot>;
72
+ }
73
+ /**
74
+ * One figure, said once and read from across a desk.
75
+ *
76
+ * ```tsx
77
+ * <MPStatistic label="Active installs" value={128400} previousValue={119200} />
78
+ * ```
79
+ *
80
+ * It is the chart you draw when there is nothing to plot. A single number has no
81
+ * shape, no order and no second dimension, and putting it on a pair of axes to
82
+ * make it look like data is the most common way a dashboard wastes a panel. What
83
+ * a reader wants from one figure is the figure, what it is, and whether it is
84
+ * going the right way.
85
+ *
86
+ * ## The direction is the caller's to say
87
+ *
88
+ * `betterWhen` exists because half the figures on any dashboard are the other
89
+ * way round — churn, latency, cost and error rate are all better when they fall.
90
+ * A component that painted every fall red would be wrong about four tiles in
91
+ * eight, and it would be wrong *confidently*, in the one colour a reader trusts
92
+ * without checking.
93
+ *
94
+ * Flat is a third state rather than a quiet "up". It takes the muted ink and a
95
+ * dash, because a figure that has not moved has not done anything good either.
96
+ *
97
+ * ## The figure does not wear the direction's colour
98
+ *
99
+ * Only the move does. The number itself is `on-surface` at every size, in every
100
+ * state: it is the thing being reported, and a reported value that changes
101
+ * colour with its own trend is a value the reader has to decode before they can
102
+ * read it.
103
+ */
104
+ export declare function MPStatistic({ label, value, format, compact, locale: localeProp, prefix, unit, previousValue, delta, betterWhen, period, caption, trend, align, size: sizeProp, className, classNames, ...props }: MPStatisticProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{MPIcon as a}from"../icon/MPIcon.js";import{ArrowDownIcon as l,ArrowUpIcon as n,RemoveIcon as i}from"../../constants/icons.js";import{useMPLocale as s}from"../../internal/locale.js";import{useMPSize as r}from"../../internal/config.js";import{COMPACT_FROM as m,deltaOf as c,formatStatistic as o}from"../../internal/chart.js";import{numberFormatter as p}from"../../internal/intl.js";import{META_TEXT as u,hasContent as d}from"../../internal/scale.js";const x={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"},f={xs:"text-mp-label-small",sm:"text-mp-label-medium",md:"text-mp-label-large",lg:"text-mp-title-small",xl:"text-mp-title-medium"},h={style:"percent",maximumFractionDigits:1,signDisplay:"exceptZero"},b={start:"items-start text-start",center:"items-center text-center",end:"items-end text-end"};export function MPStatistic({label:g,value:j,format:N,compact:v=!0,locale:_,prefix:y,unit:w,previousValue:D,delta:z="percent",betterWhen:M="up",period:k,caption:B,trend:F,align:P="start",size:Z,className:I,classNames:S,...V}){const W=r(Z),$=s(_),q="number"==typeof j?o(j,$,N,v):j,A="number"==typeof j&&"number"==typeof D&&"none"!==z?c(j,D,M):null,C=null===A?.percent||null===A?null:p($,h).format(A.percent/100),E=null===A?null:p($,{...N??{},signDisplay:"exceptZero",...N?{}:v&&Math.abs(A.absolute)>=m?{notation:"compact",maximumFractionDigits:1}:{}}).format(A.absolute),G="absolute"===z?E:"both"===z?[E,C].filter(Boolean).join(" · "):C??E,H=(...t)=>t.filter(Boolean).join(" ");return e("div",{"data-mp-size":W,className:H("mp-statistic flex min-w-0 flex-col gap-1",b[P],I),...V,children:[d(g)?t("span",{className:H("mp-statistic__label text-mp-on-surface-variant",f[W],S?.label),children:g}):null,e("span",{className:H("mp-statistic__value text-mp-on-surface flex items-baseline gap-1 font-medium",x[W],S?.value),children:[d(y)?t("span",{className:"shrink-0",children:y}):null,t("span",{className:"min-w-0 truncate",children:q}),d(w)?t("span",{className:`text-mp-on-surface-variant shrink-0 ${f[W]}`,children:w}):null]}),A&&G?e("span",{className:H("mp-statistic__delta flex items-center gap-0.5",u,0===A.direction?"text-mp-on-surface-variant":A.good?"text-mp-tertiary":"text-mp-error",S?.delta),"data-mp-direction":0===A.direction?"flat":1===A.direction?"up":"down",children:[t(a,{icon:0===A.direction?i:1===A.direction?n:l,size:14}),t("span",{children:G}),d(k)?t("span",{className:"text-mp-on-surface-variant",children:k}):null]}):null,d(B)?t("span",{className:H("mp-statistic__caption text-mp-on-surface-variant",u,S?.caption),children:B}):null,d(F)?t("div",{className:H("mp-statistic__trend w-full",S?.trend),children:F}):null]})}
@@ -0,0 +1,2 @@
1
+ export { MPStatistic } from './MPStatistic.js';
2
+ export type { MPStatisticDeltaFormat, MPStatisticProps, MPStatisticSlot } from './MPStatistic.js';
@@ -0,0 +1 @@
1
+ export{MPStatistic}from"./MPStatistic.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import*as n from"react";import{MPIcon as r}from"../icon/MPIcon.js";import{CheckIcon as o,ErrorIcon as a}from"../../constants/icons.js";import{accentSlots as i}from"../../internal/accent.js";import{hasContent as s,META_TEXT as c,SHEET_TITLE as p}from"../../internal/scale.js";import{BORDER_STYLE as m,BULLET as u,BULLET_GAP as d,BULLET_SIZE as f,CONNECTOR_COLOR as x,ITEM_GAP as h,ITEM_GAP_X as v,TITLE_COLOR as b}from"../../internal/step.js";import{useMPColor as _,useMPSize as j}from"../../internal/config.js";const N=/*@__PURE__*/n.createContext(null),g=/*@__PURE__*/n.createContext(0);export const MPStepper=/*@__PURE__*/n.forwardRef(function({active:l,defaultActive:r=0,onActiveChange:o,linear:a=!0,orientation:s="horizontal",size:c,color:p,className:m,style:u,children:d,...x},h){const v=j(c),b=_(p),[y,z]=n.useState(r),C=l??y,[S,$]=n.useState(C);C>S&&$(C);const P=n.Children.toArray(d).filter(n.isValidElement),k=P.length,M=n.useCallback(e=>{void 0===l&&z(e),o?.(e)},[l,o]),A=n.useMemo(()=>({size:v,color:b,orientation:s,active:C,onSelect:o||void 0===l?M:null,linear:a,count:k,furthest:S}),[v,b,s,C,o,l,M,a,k,S]),B="horizontal"===s;return e(N.Provider,{value:A,children:t("div",{...x,ref:h,"data-mp-size":v,className:["mp-stepper flex flex-col",m??""].filter(Boolean).join(" "),style:{...i(b),...u},children:[e("ol",{className:["mp-stepper__rail flex list-none p-0",B?"flex-row items-start":"flex-col"].join(" "),style:{"--_mp-bullet":f[v]},children:P.map((t,l)=>e(g.Provider,{value:l,children:t},l))}),e(w,{steps:P,active:C})]})})});function w({steps:t,active:l}){const n=t[l],r=n?.props.children;return s(r)?e("div",{className:"mp-stepper__panel mt-4",role:"group","aria-label":void 0,children:r}):null}export const MPStep=/*@__PURE__*/n.forwardRef(function({label:f,description:_,bullet:j,error:w=!1,optional:y,disabled:z=!1,connector:C="solid",color:S,className:$,style:P,children:k,...M},A){const B=n.useContext(N),R=n.useContext(g),E=B?.size??"md",F=B?.orientation??"horizontal",I=B?.active??0,V=B?.count??1,q=B?.furthest??0,D=B?.linear??!0,G=R<I?"complete":R===I?"current":"upcoming",H=S??(w?"error":B?.color??"primary"),J="horizontal"===F,K=R===V-1,L="none"!==C&&!K,O=!z&&(!D||R<=q),Q=null!=B?.onSelect&&O,T=j??("complete"!==G||w?w?e(r,{icon:a}):R+1:e(r,{icon:o})),U=e("span",{"aria-hidden":"true",className:["rounded-mp-full relative z-10 flex shrink-0 items-center justify-center","size-(--_mp-bullet) text-[calc(var(--_mp-bullet)*0.5)] leading-none font-medium","tabular-nums [&>svg]:size-[0.6em]",u[G],"transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)"].join(" "),children:T}),W=L?e("span",{"aria-hidden":"true",className:["pointer-events-none absolute",J?"start-(--_mp-bullet) top-[calc(var(--_mp-bullet)/2_-_1px)] end-0 border-t-2":"top-(--_mp-bullet) start-[calc(var(--_mp-bullet)/2_-_1px)] bottom-0 border-s-2",m[C],x[G]].filter(Boolean).join(" ")}):null,X=t("span",{className:"flex min-w-0 flex-col gap-0.5 text-start "+(J?"mt-2":""),children:[s(f)?e("span",{className:`${p[E]} ${w?"text-mp-error":b[G]}`,children:f}):null,s(y)?e("span",{className:`text-mp-on-surface-variant ${c}`,children:y}):null,s(_)?e("span",{className:`text-mp-on-surface-variant ${c}`,children:_}):null]}),Y=t(l,{children:[W,t("span",{className:`flex min-w-0 ${J?"flex-col items-start":"flex-row"} ${J?"":d[E]}`,children:[U,X]})]});return e("li",{...M,ref:A,"aria-current":"current"===G?"step":void 0,className:["mp-stepper__step relative min-w-0",J?`flex-1 ${K?"":v[E]}`:K?"":h[E],$??""].filter(Boolean).join(" "),style:{...S||w?i(H):null,...P},children:Q?e("button",{type:"button",className:["group relative flex w-full min-w-0 cursor-pointer appearance-none bg-transparent p-0 text-start","outline-mp-secondary rounded-mp-xs focus-visible:outline-2 focus-visible:outline-offset-2","outline-none"].join(" "),onClick:()=>B?.onSelect?.(R),children:Y}):e("span",{className:"relative flex w-full min-w-0","aria-disabled":!(!B?.onSelect||O)||void 0,children:Y})})});
2
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{MPIcon as l}from"../icon/MPIcon.js";import{CheckIcon as o,ErrorIcon as a}from"../../constants/icons.js";import{accentSlots as i}from"../../internal/accent.js";import{hasContent as s,META_TEXT as c,SHEET_TITLE as p}from"../../internal/scale.js";import{BORDER_STYLE as m,BULLET as d,BULLET_GAP as u,BULLET_SIZE as f,CONNECTOR_COLOR as h,ITEM_GAP as v,ITEM_GAP_X as x,STEP_MOTION as b,TITLE_COLOR as _}from"../../internal/step.js";import{useMPColor as j,useMPSize as N}from"../../internal/config.js";function g(e,t){return`${e}-label-${t}`}function w(e){return`${e}-panel`}const y=/*@__PURE__*/n.createContext(null),z=/*@__PURE__*/n.createContext(0);export const MPStepper=/*@__PURE__*/n.forwardRef(function({active:r,defaultActive:l=0,onActiveChange:o,linear:a=!0,orientation:c="horizontal",size:p,color:m,className:d,style:u,children:h,...v},x){const b=N(p),_=j(m),[g,w]=n.useState(l),C=r??g,[P,S]=n.useState(C);C>P&&S(C);const $=n.Children.toArray(h).filter(n.isValidElement),k=$.length,M=n.useId(),A=s($[C]?.props.children),I=n.useCallback(e=>{void 0===r&&w(e),o?.(e)},[r,o]),R=n.useMemo(()=>({size:b,color:_,orientation:c,active:C,onSelect:o||void 0===r?I:null,linear:a,count:k,furthest:P,idBase:M,hasPanel:A}),[b,_,c,C,o,r,I,a,k,P,M,A]),E="horizontal"===c;return e(y.Provider,{value:R,children:t("div",{...v,ref:x,"data-mp-size":b,className:["mp-stepper flex flex-col",d??""].filter(Boolean).join(" "),style:{...i(_),...u},children:[e("ol",{className:["mp-stepper__rail m-0 flex list-none p-0",E?"flex-row items-start":"flex-col"].join(" "),style:{"--_mp-bullet":f[b]},children:$.map((t,r)=>e(z.Provider,{value:r,children:t},r))}),e(B,{steps:$,active:C,idBase:M})]})})});function B({steps:t,active:r,idBase:n}){const l=t[r],o=l?.props.children;if(!s(o))return null;const a=s(l?.props.label);return e("div",{id:w(n),role:"group","aria-labelledby":a?g(n,r):void 0,className:"mp-stepper__panel mt-4",children:o})}export const MPStep=/*@__PURE__*/n.forwardRef(function({label:f,description:j,bullet:N,error:B=!1,optional:C,disabled:P=!1,connector:S="solid",color:$,className:k,style:M,children:A,...I},R){const E=n.useContext(y),F=n.useContext(z),V=E?.size??"md",q=E?.orientation??"horizontal",D=E?.active??0,G=E?.count??1,H=E?.furthest??0,J=E?.linear??!0,K=F<D?"complete":F===D?"current":"upcoming",L=$??(B?"error":E?.color??"primary"),O="horizontal"===q,Q=F===G-1,T="none"!==S&&!Q,U=!P&&(!J||F<=H),W=null!=E?.onSelect&&U,X=N??("complete"!==K||B?B?e(l,{icon:a}):F+1:e(l,{icon:o})),Y=e("span",{"aria-hidden":"true",className:["mp-stepper__bullet rounded-mp-full relative z-10 flex shrink-0","items-center justify-center","size-(--_mp-bullet) text-[calc(var(--_mp-bullet)*0.5)] leading-none font-medium","tabular-nums [&>svg]:size-[0.6em]",d[K],"transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard"].join(" "),children:X}),Z=T?e("span",{"aria-hidden":"true",className:["mp-stepper__connector pointer-events-none absolute",O?"start-(--_mp-bullet) top-[calc(var(--_mp-bullet)/2_-_1px)] end-0 border-t-2":"top-(--_mp-bullet) start-[calc(var(--_mp-bullet)/2_-_1px)] bottom-0 border-s-2",m[S],h[K],b].filter(Boolean).join(" ")}):null,ee=t("span",{className:"flex min-w-0 flex-col gap-0.5 text-start "+(O?"mt-2":""),children:[s(f)?e("span",{id:E?g(E.idBase,F):void 0,className:["mp-stepper__label",p[V],B?"text-mp-error":_[K],b].join(" "),children:f}):null,s(C)?e("span",{className:`text-mp-on-surface-variant ${c}`,children:C}):null,s(j)?e("span",{className:`text-mp-on-surface-variant ${c}`,children:j}):null]}),te=t(r,{children:[Z,t("span",{className:`flex min-w-0 ${O?"flex-col items-start":"flex-row"} ${O?"":u[V]}`,children:[Y,ee]})]});return e("li",{...I,ref:R,"aria-current":"current"===K?"step":void 0,className:["mp-stepper__step relative min-w-0",O?`flex-1 ${Q?"":x[V]}`:Q?"":v[V],k??""].filter(Boolean).join(" "),style:{...$||B?i(L):null,...M},children:W?e("button",{type:"button","aria-controls":E?.hasPanel?w(E.idBase):void 0,"aria-expanded":E?.hasPanel?"current"===K:void 0,className:["group relative flex w-full min-w-0 cursor-pointer appearance-none border-0 bg-transparent p-0 text-start","outline-mp-secondary rounded-mp-xs focus-visible:outline-2 focus-visible:outline-offset-2","outline-none"].join(" "),onClick:()=>E?.onSelect?.(F),children:te}):e("span",{className:"relative flex w-full min-w-0","aria-disabled":!(!E?.onSelect||U)||void 0,children:te})})});
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { MPAlign, MPColor, MPSize, MPVariant } from '../../types.js';
2
+ import type { MPAlign, MPColor, MPDensity, MPSize, MPElevation, MPVariant } from '../../types.js';
3
3
  /** Which edge the text in a column lines up against. */
4
4
  export type MPTableAlign = MPAlign;
5
5
  /**
@@ -98,7 +98,7 @@ export interface MPTableProps<Row> extends Omit<React.ComponentPropsWithoutRef<'
98
98
  * A row that answers a press has to answer a keyboard too, so each one joins
99
99
  * the tab order and takes Enter and Space. That is the honest minimum for a
100
100
  * `<tr>` — a row cannot be wrapped in a `<button>` the way an
101
- * [MPListItem](../layout/list) is, because a `<button>` is not something a
101
+ * [MPListItem](./list) is, because a `<button>` is not something a
102
102
  * `<tbody>` may contain.
103
103
  *
104
104
  * It is also worth knowing what it costs: a table of two hundred rows becomes
@@ -112,6 +112,17 @@ export interface MPTableProps<Row> extends Omit<React.ComponentPropsWithoutRef<'
112
112
  * @default 'outlined'
113
113
  */
114
114
  variant?: MPVariant;
115
+ /**
116
+ * How far off the page the sheet is lifted, on MD3's own scale.
117
+ *
118
+ * It moves the **tone** as well as the shadow, because Material pairs the two:
119
+ * a level-2 surface is `surface-container` under a level-2 shadow, and a prop
120
+ * that only cast a shadow would raise this into a surface the specification
121
+ * has no name for. Given a level, `variant` is left holding only its hairline.
122
+ *
123
+ * Left unset, `variant` decides — and `variant="elevated"` is this at `1`.
124
+ */
125
+ elevation?: MPElevation;
115
126
  /**
116
127
  * @default 'md'
117
128
  */
@@ -122,6 +133,17 @@ export interface MPTableProps<Row> extends Omit<React.ComponentPropsWithoutRef<'
122
133
  * @default 'primary'
123
134
  */
124
135
  color?: MPColor;
136
+ /**
137
+ * Takes room out of every cell without changing what it is set in.
138
+ *
139
+ * The axis a table is most often asked for: the reason to make one denser is
140
+ * to see more rows at once, and shrinking the type to get there makes the
141
+ * figures harder to read at exactly the moment there are more of them. Each
142
+ * step is MD3's four pixels off the row — `md` goes 52, 48, 44, 40 — and the
143
+ * text stays where it was.
144
+ * @default 0
145
+ */
146
+ density?: MPDensity;
125
147
  }
126
148
  /**
127
149
  * A grid of data.
@@ -139,4 +161,4 @@ export interface MPTableProps<Row> extends Omit<React.ComponentPropsWithoutRef<'
139
161
  * than a ref on the scroll container is worth — and a caller who needs one can
140
162
  * put it on a `<div>` of their own around this.
141
163
  */
142
- export declare function MPTable<Row>({ headers, items, getRowKey, caption, empty, locale: localeProp, striped, hoverable, stickyHeader, onRowClick, variant, size: sizeProp, color: colorProp, className, style, ...props }: MPTableProps<Row>): React.JSX.Element;
164
+ export declare function MPTable<Row>({ headers, items, getRowKey, caption, empty, locale: localeProp, striped, hoverable, stickyHeader, onRowClick, variant, elevation, size: sizeProp, color: colorProp, density: densityProp, className, style, ...props }: MPTableProps<Row>): React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{accentSlots as l}from"../../internal/accent.js";import{useMPLocale as o,useMPMessages as n}from"../../internal/locale.js";import{TABLE as a}from"../../internal/messages/table.js";import{cssLength as i}from"../../internal/length.js";import{META_TEXT as m}from"../../internal/scale.js";import{CONTAINER_SURFACE as s}from"../../internal/surface.js";import{useMPColor as c,useMPSize as d}from"../../internal/config.js";const p={xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},u={xs:"0.375rem",sm:"0.625rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},x={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-medium",xl:"text-mp-body-large"},f={xs:"text-mp-label-medium",sm:"text-mp-label-medium",md:"text-mp-title-small",lg:"text-mp-title-small",xl:"text-mp-title-medium"},y=/*@__PURE__*/["[--_mp-row:transparent]","transition-[background-color] duration-(--mp-sys-motion-duration-short4)"].join(" ");function g(e){if(null==e)return null;const t=typeof e;return"string"===t||"number"===t||"bigint"===t||"boolean"===t||r.isValidElement(e)?e:null}export function MPTable({headers:r,items:b,getRowKey:h,caption:v,empty:j,locale:w,striped:k=!1,hoverable:N=!1,stickyHeader:_=!1,onRowClick:C,variant:$="outlined",size:A,color:B,className:z,style:T,...D}){const E=d(A),K=c(B),R=n(a,o(w)),H=p[E],I=u[E],M=Boolean(C),P=N||M,S={padding:`${I} ${H}`},V={...S,backgroundColor:"var(--_mp-color-surface-container)"},q={borderTop:"1px solid var(--_mp-color-outline-variant)",backgroundColor:"var(--_mp-row)"};return e("div",{"data-mp-size":E,"data-mp-variant":$,className:["mp-table rounded-mp-md overflow-x-auto",s[$],z??""].filter(Boolean).join(" "),style:{...l(K),...T},...D,children:t("table",{className:`text-mp-on-surface w-full text-start ${x[E]}`,style:{borderCollapse:"collapse"},children:[v?e("caption",{className:`text-mp-on-surface-variant ${m}`,style:{...S,textAlign:"start"},children:v}):null,e("colgroup",{children:r.map(t=>e("col",{style:void 0===t.width?void 0:{width:i(t.width)}},t.key))}),e("thead",{children:e("tr",{children:r.map(t=>e("th",{scope:"col",className:["text-mp-on-surface-variant whitespace-nowrap",f[E],_?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...V,textAlign:t.align??"start"},children:t.label??t.key},t.key))})}),e("tbody",{children:0===b.length?e("tr",{className:y,style:q,children:e("td",{colSpan:r.length,className:"text-mp-on-surface-variant",style:{padding:`2rem ${H}`,textAlign:"center"},children:j??R.empty})}):b.map((t,l)=>e("tr",{className:[y,k&&l%2==1?"[--_mp-row:var(--_mp-color-surface-container-low)]":"",P?"hover:[--_mp-row:var(--_mp-color-surface-container)]":"",M?["cursor-pointer","outline-mp-secondary focus-visible:outline-2","focus-visible:-outline-offset-2 focus-visible:outline-solid outline-none"].join(" "):""].filter(Boolean).join(" "),style:q,tabIndex:M?0:void 0,onClick:C?()=>C(t,l):void 0,onKeyDown:C?e=>{"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),C(t,l))}:void 0,children:r.map(r=>e("td",{style:{...S,textAlign:r.align??"start"},children:r.render?r.render(t,l):g(t[r.key])},r.key))},h?h(t,l):l))})]})})}
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{accentSlots as o}from"../../internal/accent.js";import{useMPLocale as r,useMPMessages as a}from"../../internal/locale.js";import{TABLE as l}from"../../internal/messages/table.js";import{cssLength as n}from"../../internal/length.js";import{META_TEXT as i}from"../../internal/scale.js";import{containerSurface as s}from"../../internal/elevation.js";import{CELL_TEXT as c,HEAD_TEXT as m,ROW as d,cellPadX as p,cellPadY as u,drawableCell as f}from"../../internal/table.js";import{useMPColor as v,useMPDensity as y,useMPSize as h}from"../../internal/config.js";export function MPTable({headers:g,items:b,getRowKey:x,caption:j,empty:w,locale:k,striped:N=!1,hoverable:_=!1,stickyHeader:C=!1,onRowClick:$,variant:A="outlined",elevation:B,size:z,color:T,density:D,className:K,style:R,...E}){const H=h(z),I=v(T),M=y(D),P=a(l,r(k)),S=p(H,M),q=u(H,M),F=Boolean($),G=_||F,J={padding:`${q} ${S}`},L={...J,backgroundColor:"var(--_mp-color-surface-container)"},O={borderTop:"1px solid var(--_mp-color-outline-variant)",backgroundColor:"var(--_mp-row)"};return e("div",{"data-mp-size":H,"data-mp-variant":A,className:["mp-table rounded-mp-md overflow-x-auto",s(A,B),K??""].filter(Boolean).join(" "),style:{...o(I),...R},...E,children:t("table",{className:`text-mp-on-surface w-full text-start ${c[H]}`,style:{borderCollapse:"collapse"},children:[j?e("caption",{className:`text-mp-on-surface-variant ${i}`,style:{...J,textAlign:"start"},children:j}):null,e("colgroup",{children:g.map(t=>e("col",{style:void 0===t.width?void 0:{width:n(t.width)}},t.key))}),e("thead",{children:e("tr",{children:g.map(t=>e("th",{scope:"col",className:["text-mp-on-surface-variant whitespace-nowrap",m[H],C?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...L,textAlign:t.align??"start"},children:t.label??t.key},t.key))})}),e("tbody",{children:0===b.length?e("tr",{className:d,style:O,children:e("td",{colSpan:g.length,className:"text-mp-on-surface-variant",style:{padding:`2rem ${S}`,textAlign:"center"},children:w??P.empty})}):b.map((t,o)=>e("tr",{className:[d,N&&o%2==1?"[--_mp-row:var(--_mp-color-surface-container-low)]":"",G?"hover:[--_mp-row:var(--_mp-color-surface-container)]":"",F?["cursor-pointer","outline-mp-secondary focus-visible:outline-2","focus-visible:-outline-offset-2 focus-visible:outline-solid outline-none"].join(" "):""].filter(Boolean).join(" "),style:O,tabIndex:F?0:void 0,onClick:$?()=>$(t,o):void 0,onKeyDown:$?e=>{"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),$(t,o))}:void 0,children:g.map(r=>e("td",{style:{...J,textAlign:r.align??"start"},children:r.render?r.render(t,o):f(t[r.key])},r.key))},x?x(t,o):o))})]})})}
@@ -125,6 +125,18 @@ export interface MPTabPanelProps extends React.ComponentPropsWithoutRef<'div'> {
125
125
  * A bar with more tabs than room scrolls rather than wrapping, which is MD3's
126
126
  * scrollable tabs: a tab bar on two lines has stopped being a bar, and the
127
127
  * indicator has nowhere sensible to sit.
128
+ *
129
+ * ## Saying that it scrolls
130
+ *
131
+ * It always did. What it had no way of saying was so — macOS draws an overlay
132
+ * scrollbar that does not exist until it is used, so a bar with four tabs off
133
+ * the edge and a bar with none were the same picture, and Windows drew a real
134
+ * one that is a signal and also fifteen pixels of furniture under the tabs.
135
+ *
136
+ * The scrollbar is hidden on both and the ends are faded instead, on the side
137
+ * that has more bar past it. The overflow is **measured** — it depends on the
138
+ * room the bar was given, which nothing here knows — and written out as
139
+ * `data-mp-overflow` for the stylesheet to read.
128
140
  */
129
141
  export declare const MPTabs: React.ForwardRefExoticComponent<MPTabsProps & React.RefAttributes<HTMLDivElement>>;
130
142
  /**
@@ -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{Tabs as i}from"@base-ui/react/tabs";import{accentSlots as o}from"../../internal/accent.js";import{MPStateLayer as n}from"../../internal/StateLayer.js";import{CONTROL_GAP as r,hasContent as l,SHEET_GAP as s}from"../../internal/scale.js";import{useMPColor as c,useMPSize as m}from"../../internal/config.js";const u=/*@__PURE__*/a.createContext({variant:"primary",size:"md",iconPosition:"top",fullWidth:!1}),p={xs:"h-8",sm:"h-10",md:"h-12",lg:"h-14",xl:"h-16"},d={xs:"h-11",sm:"h-13",md:"h-16",lg:"h-18",xl:"h-20"},f={xs:"text-mp-label-medium",sm:"text-mp-label-large",md:"text-mp-title-small",lg:"text-mp-title-small",xl:"text-mp-title-medium"},h={xs:"px-3",sm:"px-3.5",md:"px-4",lg:"px-5",xl:"px-6"},x={xs:12,sm:14,md:16,lg:20,xl:24},v={xs:18,sm:20,md:24,lg:24,xl:28};function b(e,t,i,o=""){a.Children.toArray(e).forEach(e=>{if(!a.isValidElement(e))return void(l(e)&&t.push(e));if(e.type===a.Fragment)return void b(e.props.children,t,i,`${o}${String(e.key)}/`);const n=o?a.cloneElement(e,{key:`${o}${String(e.key)}`}):e;e.type===MPTabPanel?i.push(n):t.push(n)})}export const MPTabs=/*@__PURE__*/a.forwardRef(function({variant:n="primary",color:r,size:l,value:p,defaultValue:d,onValueChange:f,iconPosition:h,activateOnFocus:v=!1,loopFocus:y=!0,divider:g=!0,fullWidth:_=!1,className:w,style:j,children:P,"aria-label":N,...k},M){const $=c(r),z=m(l),C=h??("primary"===n?"top":"start"),F=a.useMemo(()=>({variant:n,size:z,iconPosition:C,fullWidth:_}),[n,z,C,_]),T=[],V=[];return b(P,T,V),e(u.Provider,{value:F,children:t(i.Root,{ref:M,value:p,defaultValue:d,onValueChange:e=>f?.(e),"data-mp-size":z,"data-mp-variant":n,className:["mp-tabs flex min-w-0 flex-col",s[z],w??""].filter(Boolean).join(" "),style:{...o($),"--_mp-tab-inset":`${x[z]}px`,...j},...k,children:[t(i.List,{"aria-label":N,activateOnFocus:v,loopFocus:y,className:["mp-tabs__list relative flex shrink-0",g?"border-mp-outline-variant border-b":"",_?"w-full":"","overflow-x-auto overflow-y-hidden"].filter(Boolean).join(" "),children:[T,e(i.Indicator,{className:["mp-tabs__indicator pointer-events-none absolute bottom-0","bg-(--_mp-accent)","primary"===n?["h-0.75 rounded-t-full","left-[calc(var(--active-tab-left)_+_var(--_mp-tab-inset))]","w-[calc(var(--active-tab-width)_-_2_*_var(--_mp-tab-inset))]"].join(" "):"left-(--active-tab-left) h-0.5 w-(--active-tab-width)","[transition-property:left,width]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard"].join(" ")})]}),V]})})});export const MPTab=/*@__PURE__*/a.forwardRef(function({value:o,icon:s,disabled:c=!1,className:m,children:x,...b},y){const{variant:g,size:_,iconPosition:w,fullWidth:j}=a.useContext(u),P="top"===w&&l(s);return t(i.Tab,{ref:y,value:o,disabled:c,className:["mp-tabs__tab group relative flex shrink-0 items-center justify-center","box-border appearance-none bg-transparent font-[inherit] whitespace-nowrap select-none","overflow-hidden outline-none","transition-[color] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",P?`flex-col gap-1 ${d[_]}`:`flex-row ${p[_]}`,P?"":r[_],f[_],h[_],c?"text-mp-on-surface/38 cursor-default":["text-mp-on-surface-variant cursor-pointer","primary"===g?"data-active:text-(--_mp-accent)":"data-active:text-mp-on-surface"].join(" "),"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid",j?"flex-1":"",m??""].filter(Boolean).join(" "),...b,children:[c?null:e(n,{}),l(s)?e("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:v[_],height:v[_]},children:s}):null,l(x)?e("span",{className:"relative truncate",children:x}):null]})});export const MPTabPanel=/*@__PURE__*/a.forwardRef(function({value:t,keepMounted:a=!1,className:o,children:n,...r},l){return e(i.Panel,{ref:l,value:t,keepMounted:a,className:["mp-tabs__panel text-mp-on-surface min-w-0 flex-1","rounded-mp-xs outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none","transition-opacity duration-(--mp-sys-motion-duration-short4) ease-mp-standard","data-starting-style:opacity-0",o??""].filter(Boolean).join(" "),...r,children:n})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Tabs as i}from"@base-ui/react/tabs";import{accentSlots as n}from"../../internal/accent.js";import{MPStateLayer as o}from"../../internal/StateLayer.js";import{CONTROL_GAP as r,hasContent as l,SHEET_GAP as s}from"../../internal/scale.js";import{useMPColor as c,useMPSize as u}from"../../internal/config.js";const d=/*@__PURE__*/a.createContext({variant:"primary",size:"md",iconPosition:"top",fullWidth:!1}),m={xs:"h-8",sm:"h-10",md:"h-12",lg:"h-14",xl:"h-16"},p={xs:"h-11",sm:"h-13",md:"h-16",lg:"h-18",xl:"h-20"},f={xs:"text-mp-label-medium",sm:"text-mp-label-large",md:"text-mp-title-small",lg:"text-mp-title-small",xl:"text-mp-title-medium"},h={xs:"px-3",sm:"px-3.5",md:"px-4",lg:"px-5",xl:"px-6"},b={xs:12,sm:14,md:16,lg:20,xl:24},v={xs:18,sm:20,md:24,lg:24,xl:28};function x(e,t,i,n=""){a.Children.toArray(e).forEach(e=>{if(!a.isValidElement(e))return void(l(e)&&t.push(e));if(e.type===a.Fragment)return void x(e.props.children,t,i,`${n}${String(e.key)}/`);const o=n?a.cloneElement(e,{key:`${n}${String(e.key)}`}):e;e.type===MPTabPanel?i.push(o):t.push(o)})}export const MPTabs=/*@__PURE__*/a.forwardRef(function({variant:o="primary",color:r,size:l,value:m,defaultValue:p,onValueChange:f,iconPosition:h,activateOnFocus:v=!1,loopFocus:y=!0,divider:w=!0,fullWidth:g=!1,className:_,style:j,children:P,"aria-label":k,...N},M){const z=c(r),C=u(l),R=h??("primary"===o?"top":"start"),$=a.useMemo(()=>({variant:o,size:C,iconPosition:R,fullWidth:g}),[o,C,R,g]),S=a.useRef(null),[W,E]=a.useState(null),F=a.useCallback(()=>{const e=S.current;if(!e)return;const t=e.scrollWidth-e.clientWidth,a=Math.abs(e.scrollLeft),i=t-a,n="rtl"===getComputedStyle(e).direction,o=(n?i:a)>1,r=(n?a:i)>1;E(o&&r?"both":o?"left":r?"right":null)},[]);a.useEffect(F),a.useEffect(()=>{const e=S.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(F);return t.observe(e),()=>t.disconnect()},[F]);const T=[],V=[];return x(P,T,V),e(d.Provider,{value:$,children:t(i.Root,{ref:M,value:m,defaultValue:p,onValueChange:e=>f?.(e),"data-mp-size":C,"data-mp-variant":o,className:["mp-tabs flex min-w-0 flex-col",s[C],_??""].filter(Boolean).join(" "),style:{...n(z),"--_mp-tab-inset":`${b[C]}px`,...j},...N,children:[t(i.List,{ref:S,"aria-label":k,activateOnFocus:v,loopFocus:y,"data-mp-overflow":W??void 0,onScroll:F,className:["mp-tabs__list relative flex shrink-0",w?"border-mp-outline-variant border-b":"",g?"w-full":"","overflow-x-auto overflow-y-hidden","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"].filter(Boolean).join(" "),children:[T,e(i.Indicator,{className:["mp-tabs__indicator pointer-events-none absolute bottom-0","bg-(--_mp-accent)","primary"===o?["h-0.75 rounded-t-full","left-[calc(var(--active-tab-left)_+_var(--_mp-tab-inset))]","w-[calc(var(--active-tab-width)_-_2_*_var(--_mp-tab-inset))]"].join(" "):"left-(--active-tab-left) h-0.5 w-(--active-tab-width)","[transition-property:left,width]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard"].join(" ")})]}),V]})})});export const MPTab=/*@__PURE__*/a.forwardRef(function({value:n,icon:s,disabled:c=!1,className:u,children:b,...x},y){const{variant:w,size:g,iconPosition:_,fullWidth:j}=a.useContext(d),P="top"===_&&l(s);return t(i.Tab,{ref:y,value:n,disabled:c,className:["mp-tabs__tab group relative flex shrink-0 items-center justify-center","box-border appearance-none border-0 bg-transparent font-[inherit] whitespace-nowrap select-none","overflow-hidden outline-none","transition-[color] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",P?`flex-col gap-1 ${p[g]}`:`flex-row ${m[g]}`,P?"":r[g],f[g],h[g],c?"text-mp-on-surface/38 cursor-default":["text-mp-on-surface-variant cursor-pointer","primary"===w?"data-active:text-(--_mp-accent)":"data-active:text-mp-on-surface"].join(" "),"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid",j?"flex-1":"",u??""].filter(Boolean).join(" "),...x,children:[c?null:e(o,{}),l(s)?e("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:v[g],height:v[g]},children:s}):null,l(b)?e("span",{className:"relative truncate",children:b}):null]})});export const MPTabPanel=/*@__PURE__*/a.forwardRef(function({value:t,keepMounted:a=!1,className:n,children:o,...r},l){return e(i.Panel,{ref:l,value:t,keepMounted:a,className:["mp-tabs__panel text-mp-on-surface min-w-0 flex-1","rounded-mp-xs outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none","transition-opacity duration-(--mp-sys-motion-duration-short4) ease-mp-standard","data-starting-style:opacity-0",n??""].filter(Boolean).join(" "),...r,children:o})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useRender as r}from"@base-ui/react/use-render";import{accentSlots as n}from"../../internal/accent.js";import{hasContent as o,META_TEXT as a,PROSE_TEXT as i,SHEET_TITLE as s}from"../../internal/scale.js";import{useMPColor as c,useMPSize as m}from"../../internal/config.js";import{BORDER_STYLE as u,BULLET as d,BULLET_GAP as p,BULLET_SIZE as f,CONNECTOR_COLOR as x,ITEM_GAP as h,ITEM_GAP_X as v,TITLE_COLOR as b}from"../../internal/step.js";const j=/*@__PURE__*/l.createContext(null),N=/*@__PURE__*/l.createContext({index:0,last:!1});export const MPTimelineItem=/*@__PURE__*/l.forwardRef(function({title:r,meta:c,bullet:m,status:_,color:g,connector:y="solid",className:z,style:w,children:$,...C},M){const P=l.useContext(j),{index:B,last:k}=l.useContext(N),A=P?.size??"md",R=P?.orientation??"vertical",T=g??P?.color??"primary",I=P?.active??null,q=_??(null===I?"upcoming":B<I?"complete":B===I?"current":"upcoming"),D="horizontal"===R,E="none"!==y&&!k,F=e("span",{"aria-hidden":"true",className:["rounded-mp-full relative z-10 flex shrink-0 items-center justify-center","size-(--_mp-bullet) text-[calc(var(--_mp-bullet)*0.5)] leading-none font-medium","tabular-nums [&>svg]:size-[0.6em]",d[q],"transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)"].join(" "),children:m}),G=E?e("span",{"aria-hidden":"true",className:["pointer-events-none absolute",D?"start-(--_mp-bullet) top-[calc(var(--_mp-bullet)/2_-_1px)] end-0 border-t-2":"top-(--_mp-bullet) start-[calc(var(--_mp-bullet)/2_-_1px)] bottom-0 border-s-2",u[y],x[q]].filter(Boolean).join(" ")}):null,H=t("div",{className:"flex min-w-0 flex-col gap-0.5 "+(D?"mt-2":""),children:[o(r)||o(c)?t("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[o(r)?e("span",{className:`${s[A]} ${b[q]}`,children:r}):null,o(c)?e("span",{className:`text-mp-on-surface-variant ${a}`,children:c}):null]}):null,o($)?e("div",{className:`text-mp-on-surface-variant ${i[A]}`,children:$}):null]});return t("li",{ref:M,"aria-current":"current"===q?"step":void 0,"data-status":q,className:["relative",D?`flex min-w-0 flex-1 flex-col ${k?"":v[A]}`:`flex ${p[A]} ${k?"":h[A]}`,z??""].filter(Boolean).join(" "),style:{"--_mp-bullet":f[A],...n(T),...w},...C,children:[G,F,H]})});export const MPTimeline=/*@__PURE__*/l.forwardRef(function({active:t,size:n,color:o,orientation:a="vertical",render:i,className:s,style:u,children:d,...p},f){const x=m(n),h=c(o),v=l.Children.toArray(d),b=v.length,_=l.useMemo(()=>({size:x,orientation:a,color:h,active:t??null}),[x,a,h,t]),g=l.useMemo(()=>Array.from({length:b},(e,t)=>({index:t,last:t===b-1})),[b]),y=r({render:i??e("ol",{}),ref:f,props:{role:"list","data-mp-size":x,className:["mp-timeline flex","horizontal"===a?"flex-row":"flex-col",s??""].filter(Boolean).join(" "),style:u,children:v.map((t,l)=>e(N.Provider,{value:g[l],children:t},l)),...p}});return e(j.Provider,{value:_,children:y})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useRender as r}from"@base-ui/react/use-render";import{accentSlots as n}from"../../internal/accent.js";import{hasContent as i,META_TEXT as o,PROSE_TEXT as a,SHEET_TITLE as s}from"../../internal/scale.js";import{useMPColor as c,useMPSize as m}from"../../internal/config.js";import{BORDER_STYLE as u,BULLET as d,BULLET_GAP as p,BULLET_SIZE as f,CONNECTOR_COLOR as x,ITEM_GAP as h,ITEM_GAP_X as v,STEP_MOTION as b,TITLE_COLOR as _}from"../../internal/step.js";const j=/*@__PURE__*/l.createContext(null),N=/*@__PURE__*/l.createContext({index:0,last:!1});export const MPTimelineItem=/*@__PURE__*/l.forwardRef(function({title:r,meta:c,bullet:m,status:g,color:y,connector:z="solid",className:w,style:C,children:$,...M},P){const B=l.useContext(j),{index:k,last:A}=l.useContext(N),R=B?.size??"md",T=B?.orientation??"vertical",I=y??B?.color??"primary",q=B?.active??null,D=g??(null===q?"upcoming":k<q?"complete":k===q?"current":"upcoming"),E="horizontal"===T,F="none"!==z&&!A,G=e("span",{"aria-hidden":"true",className:["mp-timeline__bullet rounded-mp-full relative z-10 flex shrink-0","items-center justify-center","size-(--_mp-bullet) text-[calc(var(--_mp-bullet)*0.5)] leading-none font-medium","tabular-nums [&>svg]:size-[0.6em]",d[D],"transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard"].join(" "),children:m}),H=F?e("span",{"aria-hidden":"true",className:["mp-timeline__connector pointer-events-none absolute",E?"start-(--_mp-bullet) top-[calc(var(--_mp-bullet)/2_-_1px)] end-0 border-t-2":"top-(--_mp-bullet) start-[calc(var(--_mp-bullet)/2_-_1px)] bottom-0 border-s-2",u[z],x[D],b].filter(Boolean).join(" ")}):null,J=t("div",{className:"flex min-w-0 flex-col gap-0.5 "+(E?"mt-2":""),children:[i(r)||i(c)?t("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[i(r)?e("span",{className:["mp-timeline__title",s[R],_[D],b].join(" "),children:r}):null,i(c)?e("span",{className:`text-mp-on-surface-variant ${o}`,children:c}):null]}):null,i($)?e("div",{className:`text-mp-on-surface-variant ${a[R]}`,children:$}):null]});return t("li",{ref:P,"aria-current":"current"===D?"step":void 0,"data-status":D,className:["mp-timeline__item relative",E?`flex min-w-0 flex-1 flex-col ${A?"":v[R]}`:`flex ${p[R]} ${A?"":h[R]}`,w??""].filter(Boolean).join(" "),style:{"--_mp-bullet":f[R],...n(I),...C},...M,children:[H,G,J]})});export const MPTimeline=/*@__PURE__*/l.forwardRef(function({active:t,size:n,color:i,orientation:o="vertical",render:a,className:s,style:u,children:d,...p},f){const x=m(n),h=c(i),v=l.Children.toArray(d),b=v.length,_=l.useMemo(()=>({size:x,orientation:o,color:h,active:t??null}),[x,o,h,t]),g=l.useMemo(()=>Array.from({length:b},(e,t)=>({index:t,last:t===b-1})),[b]),y=r({render:a??e("ol",{}),ref:f,props:{role:"list","data-mp-size":x,className:["mp-timeline m-0 flex list-none p-0","horizontal"===o?"flex-row":"flex-col",s??""].filter(Boolean).join(" "),style:u,children:v.map((t,l)=>e(N.Provider,{value:g[l],children:t},l)),...p}});return e(j.Provider,{value:_,children:y})});
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+ import { type ChartBaseProps } from '../../internal/ChartChrome.js';
3
+ import type { MPChartAxis, MPTimelineSeries } from '../../types.js';
4
+ /** No `legend`: the rows are the axis, so there is nothing for one to identify. */
5
+ export interface MPTimelineChartProps extends Omit<ChartBaseProps, 'legend'> {
6
+ /** The rows, top to bottom. Each carries its own spans. */
7
+ series: readonly MPTimelineSeries[];
8
+ /** The row axis. */
9
+ yAxis?: MPChartAxis;
10
+ /** The time axis. */
11
+ xAxis?: MPChartAxis;
12
+ /**
13
+ * Writes each span's label inside it, where the span is wide enough to hold
14
+ * the text. One that does not fit is dropped rather than clipped.
15
+ * @default true
16
+ */
17
+ spanLabels?: boolean;
18
+ }
19
+ /**
20
+ * What ran when, one row per thing.
21
+ *
22
+ * ```tsx
23
+ * <MPTimelineChart
24
+ * series={[
25
+ * { name: 'Build', data: [{ start: new Date('2026-03-02'), end: new Date('2026-03-05') }] },
26
+ * { name: 'Test', data: [{ start: new Date('2026-03-05'), end: new Date('2026-03-09') }] }
27
+ * ]}
28
+ * />
29
+ * ```
30
+ *
31
+ * A Gantt: rows down the side, time along the bottom, and a bar for every
32
+ * stretch. What it encodes is a **duration and its place**, which is the one
33
+ * question the other charts cannot be asked — every one of them has a mark at a
34
+ * single point on the value axis, and a span has two ends.
35
+ *
36
+ * ## The axis is a calendar, not a number line
37
+ *
38
+ * The 1-2-5-10 steps every other chart's value axis uses are exactly wrong for
39
+ * an instant. Run on epoch milliseconds they put a tick every 200,000,000 ms,
40
+ * which lands at 14:53:20 on an arbitrary Tuesday. Time is not decimal below
41
+ * the year — sixty, sixty, twenty-four, seven, twelve — so this axis steps in
42
+ * seconds, minutes, hours, days, weeks, months and years, and the ticks are
43
+ * walked with real calendar arithmetic: a month step lands on the first of the
44
+ * month whatever its length, and a day step survives the clocks going back.
45
+ *
46
+ * Ticks are also **aligned**, so a three-hour axis reads 00:00, 03:00, 06:00
47
+ * rather than 01:00, 04:00, 07:00. Evenly spaced ticks that land on nothing a
48
+ * reader recognises give up most of the value of using a calendar at all.
49
+ *
50
+ * ## There is no legend
51
+ *
52
+ * The rows **are** the category axis and they are already named down the side.
53
+ * A legend restating twenty row names is not a filter anybody wants, and it
54
+ * would be the only legend here that identified nothing new.
55
+ *
56
+ * ## The pointer is tested against the whole bar
57
+ *
58
+ * A span can be two hundred pixels of bar whose centre a pointer never goes
59
+ * near, so hit-testing to the centre would hand a short bar on the next row a
60
+ * hover the reader is plainly not making. The frame measures to the mark's
61
+ * **body** instead.
62
+ */
63
+ export declare function MPTimelineChart({ series, yAxis, xAxis, spanLabels, ...frame }: MPTimelineChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as a,jsxs as e}from"react/jsx-runtime";import*as t from"react";import{CartesianFrame as r}from"../../internal/ChartFrame.js";import{ChartTable as n}from"../../internal/ChartChrome.js";import{useMPLocale as o,useMPMessages as l}from"../../internal/locale.js";import{CHART as s}from"../../internal/messages/chart.js";import{TABLE as i}from"../../internal/messages/table.js";import{formatTimeTick as m,timeScale as p}from"../../internal/time-scale.js";import{BAR_RADIUS as c,CHART_FONT_SIZE as u,MARK_GAP as f,barPath as x,seriesColor as d,textWidth as h,toNumber as b}from"../../internal/chart.js";function g(a,e,t){return null!=a&&!1!==a&&""!==a&&("string"!=typeof a&&"number"!=typeof a||e>=h(String(a),t)+16)}export function MPTimelineChart({series:h,yAxis:y,xAxis:M,spanLabels:j=!0,...k}){const v=o(k.locale),$=l(s,v),C=l(i,v),P=t.useMemo(()=>h.map(a=>a.data.map(a=>{const e=b(a.start),t=b(a.end);return null===e||null===t?null:{from:Math.min(e,t),to:Math.max(e,t),span:a}}).filter(a=>null!==a)),[h]),S=P.flat(),A=S.length>0?{min:Math.min(...S.map(a=>a.from)),max:Math.max(...S.map(a=>a.to))}:null,_=p(A,{min:M?.min,max:M?.max,tickCount:M?.tickCount}),z=t.useCallback(a=>m(a,_.unit,v),[_.unit,v]),F=t.useMemo(()=>[{data:h.map(()=>0)}],[h]),N=h.map((a,e)=>a.name??String(e+1)),T=h.map((a,e)=>d(e,a.color));return a(r,{...k,series:F,categories:N,horizontal:!0,inset:!1,bandRatio:.62,scale:_,includeZero:!1,legend:!1,xAxis:y,yAxis:{...M,tickFormat:M?.tickFormat??(a=>z(Number(a)))},marks:({plot:a,band:e,valuePx:t,categoryPx:r})=>P.flatMap((n,o)=>n.map((n,l)=>{const s=t(n.from),i=t(n.to),m=a.top+r(o);return{series:o,index:l,x:(s+i)/2,y:m,r:e.band/2,rx:Math.max(1,Math.abs(i-s)/2),ry:e.band/2}})),markTooltip:a=>{const e=P[a.series]?.[a.index];return e?{heading:void 0===e.span.label||null===e.span.label?N[a.series]:`${N[a.series]} · ${String(e.span.label)}`,items:[{seriesIndex:a.series,color:e.span.color?d(0,e.span.color):T[a.series],value:e.to-e.from,formatted:`${z(e.from)} – ${z(e.to)}`}]}:null},table:e=>a(n,{id:e,caption:k.label??$.table,corner:y?.label??$.category,categories:N,names:[$.table],values:[P.map(a=>({value:a.length,label:a.map(a=>`${z(a.from)} – ${z(a.to)}`).join("; ")}))],format:a=>String(a),locale:v,empty:C.empty}),children:({plot:t,band:r,valuePx:n,categoryPx:o,activeMark:l,size:s})=>{const i=u[s]-1;return a("g",{className:"mp-timeline-chart__spans",children:P.map((s,m)=>s.map((s,p)=>{const u=n(s.from),h=n(s.to),b=Math.max(2,r.band-f),y=t.top+o(m)-b/2,M=Math.max(1,h-u),k=l?.series===m&&l?.index===p,v=s.span.color?d(0,s.span.color):T[m];return e("g",{children:[a("path",{d:x(u,y,M,b,c,"both"),fill:v,opacity:k?1:.85,stroke:k?"var(--_mp-color-on-surface)":"none",strokeWidth:k?1.5:0}),j&&g(s.span.label,M,i)?a("text",{x:u+8,y:t.top+o(m),dominantBaseline:"central",fill:"var(--_mp-color-surface)",fontSize:i,children:s.span.label}):null]},`${m}-${p}`)}))})}})}
@@ -0,0 +1,2 @@
1
+ export { MPTimelineChart } from './MPTimelineChart.js';
2
+ export type { MPTimelineChartProps } from './MPTimelineChart.js';
@@ -0,0 +1 @@
1
+ export{MPTimelineChart}from"./MPTimelineChart.js";