material-plus-ui 1.6.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 (462) 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 +1 -0
  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 +1 -0
  59. package/dist/components/avatar/MPAvatar.d.ts +10 -1
  60. package/dist/components/avatar/MPAvatar.js +1 -1
  61. package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
  62. package/dist/components/bar-chart/MPBarChart.js +2 -0
  63. package/dist/components/bar-chart/index.d.ts +2 -0
  64. package/dist/components/bar-chart/index.js +1 -0
  65. package/dist/components/blockquote/MPBlockquote.d.ts +10 -1
  66. package/dist/components/blockquote/MPBlockquote.js +1 -1
  67. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +2 -18
  68. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
  69. package/dist/components/box/MPBox.d.ts +43 -8
  70. package/dist/components/box/MPBox.js +2 -1
  71. package/dist/components/card/MPCard.js +1 -1
  72. package/dist/components/checkbox/MPCheckbox.js +1 -1
  73. package/dist/components/chip/MPChip.d.ts +10 -1
  74. package/dist/components/chip/MPChip.js +1 -1
  75. package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
  76. package/dist/components/code-block/MPCodeBlock.js +2 -0
  77. package/dist/components/code-block/index.d.ts +2 -0
  78. package/dist/components/code-block/index.js +1 -0
  79. package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
  80. package/dist/components/collapsible/MPCollapsible.js +1 -1
  81. package/dist/components/combobox/MPCombobox.d.ts +21 -4
  82. package/dist/components/combobox/MPCombobox.js +1 -1
  83. package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
  84. package/dist/components/command-palette/MPCommandPalette.js +1 -1
  85. package/dist/components/config/MPConfigProvider.d.ts +49 -7
  86. package/dist/components/config/MPConfigProvider.js +1 -1
  87. package/dist/components/container/MPContainer.d.ts +9 -2
  88. package/dist/components/container/MPContainer.js +2 -1
  89. package/dist/components/data-list/MPDataList.d.ts +82 -0
  90. package/dist/components/data-list/MPDataList.js +2 -0
  91. package/dist/components/data-list/index.d.ts +2 -0
  92. package/dist/components/data-list/index.js +1 -0
  93. package/dist/components/data-table/MPDataTable.d.ts +295 -0
  94. package/dist/components/data-table/MPDataTable.js +2 -0
  95. package/dist/components/data-table/index.d.ts +2 -0
  96. package/dist/components/data-table/index.js +1 -0
  97. package/dist/components/dialog/MPDialog.d.ts +10 -2
  98. package/dist/components/dialog/MPDialog.js +1 -1
  99. package/dist/components/drawer/MPDrawer.d.ts +8 -2
  100. package/dist/components/drawer/MPDrawer.js +1 -1
  101. package/dist/components/empty/MPEmpty.d.ts +10 -1
  102. package/dist/components/empty/MPEmpty.js +1 -1
  103. package/dist/components/fieldset/MPFieldset.js +1 -1
  104. package/dist/components/file-picker/MPFilePicker.js +1 -1
  105. package/dist/components/flex/MPFlex.d.ts +95 -0
  106. package/dist/components/flex/MPFlex.js +2 -0
  107. package/dist/components/flex/index.d.ts +2 -0
  108. package/dist/components/flex/index.js +1 -0
  109. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
  110. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
  111. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  112. package/dist/components/floating-bottom-navigation/index.js +1 -0
  113. package/dist/components/footer/MPFooter.d.ts +24 -4
  114. package/dist/components/footer/MPFooter.js +1 -1
  115. package/dist/components/form/MPForm.js +1 -1
  116. package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
  117. package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
  118. package/dist/components/gauge-chart/index.d.ts +2 -0
  119. package/dist/components/gauge-chart/index.js +1 -0
  120. package/dist/components/grid/MPGrid.js +1 -1
  121. package/dist/components/header/MPHeader.d.ts +26 -4
  122. package/dist/components/header/MPHeader.js +1 -1
  123. package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
  124. package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
  125. package/dist/components/heatmap-chart/index.d.ts +2 -0
  126. package/dist/components/heatmap-chart/index.js +1 -0
  127. package/dist/components/hover-card/MPHoverCard.d.ts +100 -0
  128. package/dist/components/hover-card/MPHoverCard.js +2 -0
  129. package/dist/components/hover-card/index.d.ts +2 -0
  130. package/dist/components/hover-card/index.js +1 -0
  131. package/dist/components/image/MPImage.d.ts +10 -1
  132. package/dist/components/line-chart/MPLineChart.d.ts +66 -0
  133. package/dist/components/line-chart/MPLineChart.js +2 -0
  134. package/dist/components/line-chart/index.d.ts +2 -0
  135. package/dist/components/line-chart/index.js +1 -0
  136. package/dist/components/list/MPList.d.ts +23 -1
  137. package/dist/components/list/MPList.js +1 -1
  138. package/dist/components/menu/MPMenu.js +1 -1
  139. package/dist/components/meter/MPMeter.d.ts +87 -0
  140. package/dist/components/meter/MPMeter.js +2 -0
  141. package/dist/components/meter/index.d.ts +2 -0
  142. package/dist/components/meter/index.js +1 -0
  143. package/dist/components/mockup/MPMockup.d.ts +143 -0
  144. package/dist/components/mockup/MPMockup.js +2 -0
  145. package/dist/components/mockup/index.d.ts +2 -0
  146. package/dist/components/mockup/index.js +1 -0
  147. package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
  148. package/dist/components/pie-chart/MPPieChart.js +2 -0
  149. package/dist/components/pie-chart/index.d.ts +2 -0
  150. package/dist/components/pie-chart/index.js +1 -0
  151. package/dist/components/portal/MPPortal.d.ts +75 -0
  152. package/dist/components/portal/MPPortal.js +2 -0
  153. package/dist/components/portal/index.d.ts +2 -0
  154. package/dist/components/portal/index.js +1 -0
  155. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  156. package/dist/components/rating/MPRating.js +1 -1
  157. package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
  158. package/dist/components/scatter-chart/MPScatterChart.js +2 -0
  159. package/dist/components/scatter-chart/index.d.ts +2 -0
  160. package/dist/components/scatter-chart/index.js +1 -0
  161. package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
  162. package/dist/components/scroll-area/MPScrollArea.js +2 -0
  163. package/dist/components/scroll-area/index.d.ts +2 -0
  164. package/dist/components/scroll-area/index.js +1 -0
  165. package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
  166. package/dist/components/scroll-zone/MPScrollZone.js +2 -0
  167. package/dist/components/scroll-zone/index.d.ts +2 -0
  168. package/dist/components/scroll-zone/index.js +1 -0
  169. package/dist/components/select/MPSelect.d.ts +27 -4
  170. package/dist/components/select/MPSelect.js +1 -1
  171. package/dist/components/show/MPShow.d.ts +78 -0
  172. package/dist/components/show/MPShow.js +2 -0
  173. package/dist/components/show/index.d.ts +2 -0
  174. package/dist/components/show/index.js +1 -0
  175. package/dist/components/sidebar/MPSidebar.d.ts +20 -1
  176. package/dist/components/sidebar/MPSidebar.js +1 -1
  177. package/dist/components/sparkline/MPSparkline.d.ts +85 -0
  178. package/dist/components/sparkline/MPSparkline.js +2 -0
  179. package/dist/components/sparkline/index.d.ts +2 -0
  180. package/dist/components/sparkline/index.js +1 -0
  181. package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
  182. package/dist/components/spoiler/MPSpoiler.js +1 -1
  183. package/dist/components/stack/MPStack.d.ts +198 -0
  184. package/dist/components/stack/MPStack.js +2 -0
  185. package/dist/components/stack/index.d.ts +2 -0
  186. package/dist/components/stack/index.js +1 -0
  187. package/dist/components/statistic/MPStatistic.d.ts +104 -0
  188. package/dist/components/statistic/MPStatistic.js +2 -0
  189. package/dist/components/statistic/index.d.ts +2 -0
  190. package/dist/components/statistic/index.js +1 -0
  191. package/dist/components/stepper/MPStepper.js +1 -1
  192. package/dist/components/table/MPTable.d.ts +24 -2
  193. package/dist/components/table/MPTable.js +1 -1
  194. package/dist/components/tabs/MPTabs.d.ts +12 -0
  195. package/dist/components/tabs/MPTabs.js +1 -1
  196. package/dist/components/timeline/MPTimeline.js +1 -1
  197. package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
  198. package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
  199. package/dist/components/timeline-chart/index.d.ts +2 -0
  200. package/dist/components/timeline-chart/index.js +1 -0
  201. package/dist/components/toolbar/MPToolbar.d.ts +106 -0
  202. package/dist/components/toolbar/MPToolbar.js +2 -0
  203. package/dist/components/toolbar/index.d.ts +2 -0
  204. package/dist/components/toolbar/index.js +1 -0
  205. package/dist/components/tour/MPTour.d.ts +120 -0
  206. package/dist/components/tour/MPTour.js +2 -0
  207. package/dist/components/tour/index.d.ts +2 -0
  208. package/dist/components/tour/index.js +1 -0
  209. package/dist/components/transfer/MPTransfer.js +1 -1
  210. package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
  211. package/dist/components/tree-select/MPTreeSelect.js +2 -0
  212. package/dist/components/tree-select/index.d.ts +2 -0
  213. package/dist/components/tree-select/index.js +1 -0
  214. package/dist/components/tree-view/MPTreeView.d.ts +153 -0
  215. package/dist/components/tree-view/MPTreeView.js +2 -0
  216. package/dist/components/tree-view/index.d.ts +2 -0
  217. package/dist/components/tree-view/index.js +1 -0
  218. package/dist/components/typography/MPTypography.d.ts +10 -1
  219. package/dist/components/typography/MPTypography.js +2 -1
  220. package/dist/constants/glyphs.d.ts +2 -0
  221. package/dist/constants/glyphs.js +1 -1
  222. package/dist/constants/icons.d.ts +1 -0
  223. package/dist/constants/icons.js +1 -1
  224. package/dist/hooks/index.d.ts +22 -5
  225. package/dist/hooks/index.js +1 -1
  226. package/dist/hooks/useMPColorScheme.js +1 -0
  227. package/dist/hooks/useMPDisclosure.d.ts +58 -0
  228. package/dist/hooks/useMPDisclosure.js +2 -0
  229. package/dist/hooks/useMPElementSize.d.ts +55 -0
  230. package/dist/hooks/useMPElementSize.js +2 -0
  231. package/dist/hooks/useMPMediaQuery.d.ts +40 -0
  232. package/dist/hooks/useMPMediaQuery.js +2 -0
  233. package/dist/hooks/useMPOnScreen.d.ts +58 -0
  234. package/dist/hooks/useMPOnScreen.js +2 -0
  235. package/dist/hooks/useMPReducedMotion.js +1 -0
  236. package/dist/hooks/useMPWindowClass.d.ts +7 -0
  237. package/dist/hooks/useMPWindowClass.js +1 -0
  238. package/dist/index.d.ts +35 -1
  239. package/dist/index.js +1 -1
  240. package/dist/internal/Calendar.js +1 -1
  241. package/dist/internal/ChartChrome.d.ts +205 -0
  242. package/dist/internal/ChartChrome.js +2 -0
  243. package/dist/internal/ChartFrame.d.ts +197 -0
  244. package/dist/internal/ChartFrame.js +2 -0
  245. package/dist/internal/FieldOutline.d.ts +14 -5
  246. package/dist/internal/FieldOutline.js +1 -1
  247. package/dist/internal/SupportingText.d.ts +24 -0
  248. package/dist/internal/SupportingText.js +1 -1
  249. package/dist/internal/animate-core.d.ts +121 -0
  250. package/dist/internal/animate-core.js +1 -0
  251. package/dist/internal/animate.d.ts +75 -55
  252. package/dist/internal/animate.js +1 -1
  253. package/dist/internal/bottom-navigation.d.ts +58 -0
  254. package/dist/internal/bottom-navigation.js +2 -0
  255. package/dist/internal/chart.d.ts +471 -0
  256. package/dist/internal/chart.js +1 -0
  257. package/dist/internal/config.d.ts +24 -5
  258. package/dist/internal/config.js +1 -1
  259. package/dist/internal/data-table.d.ts +162 -0
  260. package/dist/internal/data-table.js +1 -0
  261. package/dist/internal/density.d.ts +9 -0
  262. package/dist/internal/density.js +1 -0
  263. package/dist/internal/elevation.d.ts +26 -0
  264. package/dist/internal/elevation.js +1 -0
  265. package/dist/internal/highlight.d.ts +96 -0
  266. package/dist/internal/highlight.js +1 -0
  267. package/dist/internal/i18n.d.ts +170 -0
  268. package/dist/internal/initials.d.ts +28 -0
  269. package/dist/internal/initials.js +1 -0
  270. package/dist/internal/mark.d.ts +52 -0
  271. package/dist/internal/mark.js +1 -0
  272. package/dist/internal/measure.d.ts +31 -0
  273. package/dist/internal/measure.js +1 -0
  274. package/dist/internal/messages/anchor.d.ts +3 -0
  275. package/dist/internal/messages/anchor.js +1 -0
  276. package/dist/internal/messages/chart.d.ts +3 -0
  277. package/dist/internal/messages/chart.js +1 -0
  278. package/dist/internal/messages/code.d.ts +3 -0
  279. package/dist/internal/messages/code.js +1 -0
  280. package/dist/internal/messages/data-table.d.ts +3 -0
  281. package/dist/internal/messages/data-table.js +1 -0
  282. package/dist/internal/messages/scroll.d.ts +3 -0
  283. package/dist/internal/messages/scroll.js +1 -0
  284. package/dist/internal/messages/sparkline.d.ts +3 -0
  285. package/dist/internal/messages/sparkline.js +1 -0
  286. package/dist/internal/messages/tour.d.ts +3 -0
  287. package/dist/internal/messages/tour.js +1 -0
  288. package/dist/internal/mockup.d.ts +174 -0
  289. package/dist/internal/mockup.js +2 -0
  290. package/dist/internal/page-layout.d.ts +24 -5
  291. package/dist/internal/page-layout.js +1 -1
  292. package/dist/internal/responsive.d.ts +55 -0
  293. package/dist/internal/responsive.js +1 -0
  294. package/dist/internal/scale.d.ts +0 -17
  295. package/dist/internal/scale.js +1 -1
  296. package/dist/internal/step.d.ts +15 -0
  297. package/dist/internal/step.js +1 -1
  298. package/dist/internal/table.d.ts +53 -0
  299. package/dist/internal/table.js +1 -0
  300. package/dist/internal/text.d.ts +57 -0
  301. package/dist/internal/text.js +1 -0
  302. package/dist/internal/threshold.d.ts +19 -0
  303. package/dist/internal/threshold.js +1 -0
  304. package/dist/internal/time-scale.d.ts +44 -0
  305. package/dist/internal/time-scale.js +1 -0
  306. package/dist/internal/transition.d.ts +33 -0
  307. package/dist/internal/transition.js +1 -0
  308. package/dist/internal/visibility.d.ts +48 -0
  309. package/dist/internal/visibility.js +1 -0
  310. package/dist/internal/window-class.d.ts +29 -2
  311. package/dist/internal/window-class.js +1 -1
  312. package/dist/locales/ar.js +1 -1
  313. package/dist/locales/de.js +1 -1
  314. package/dist/locales/es.js +1 -1
  315. package/dist/locales/fr.js +1 -1
  316. package/dist/locales/hi.js +1 -1
  317. package/dist/locales/id.js +1 -1
  318. package/dist/locales/it.js +1 -1
  319. package/dist/locales/ja.js +1 -1
  320. package/dist/locales/ko.js +1 -1
  321. package/dist/locales/nl.js +1 -1
  322. package/dist/locales/pl.js +1 -1
  323. package/dist/locales/pt.js +1 -1
  324. package/dist/locales/ru.js +1 -1
  325. package/dist/locales/th.js +1 -1
  326. package/dist/locales/tr.js +1 -1
  327. package/dist/locales/vi.js +1 -1
  328. package/dist/locales/zh-hans.js +1 -1
  329. package/dist/locales/zh-hant.js +1 -1
  330. package/dist/styles/accordion.css +1 -1
  331. package/dist/styles/alert.css +1 -1
  332. package/dist/styles/anchor.css +2 -0
  333. package/dist/styles/animate-appear.css +1 -1
  334. package/dist/styles/animate-blink.css +1 -1
  335. package/dist/styles/animate-counter.css +2 -0
  336. package/dist/styles/animate-fade.css +1 -1
  337. package/dist/styles/animate-float.css +2 -0
  338. package/dist/styles/animate-grow.css +1 -1
  339. package/dist/styles/animate-headline.css +1 -1
  340. package/dist/styles/animate-lighting.css +1 -1
  341. package/dist/styles/animate-marquee.css +1 -1
  342. package/dist/styles/animate-reveal.css +2 -0
  343. package/dist/styles/animate-rotate.css +1 -1
  344. package/dist/styles/animate-scramble.css +2 -0
  345. package/dist/styles/animate-shake.css +2 -0
  346. package/dist/styles/animate-slide.css +1 -1
  347. package/dist/styles/animate-split.css +2 -0
  348. package/dist/styles/animate-typing.css +1 -1
  349. package/dist/styles/animate-zoom.css +1 -1
  350. package/dist/styles/app-logo.css +2 -0
  351. package/dist/styles/area-chart.css +2 -0
  352. package/dist/styles/avatar.css +1 -1
  353. package/dist/styles/badge.css +1 -1
  354. package/dist/styles/bar-chart.css +2 -0
  355. package/dist/styles/blockquote.css +1 -1
  356. package/dist/styles/bottom-navigation.css +1 -1
  357. package/dist/styles/box.css +1 -1
  358. package/dist/styles/breadcrumb.css +1 -1
  359. package/dist/styles/button.css +1 -1
  360. package/dist/styles/calendar.css +1 -1
  361. package/dist/styles/card.css +1 -1
  362. package/dist/styles/carousel.css +1 -1
  363. package/dist/styles/chat-bubble.css +1 -1
  364. package/dist/styles/checkbox.css +1 -1
  365. package/dist/styles/chip.css +1 -1
  366. package/dist/styles/code-block.css +2 -0
  367. package/dist/styles/collapsible.css +1 -1
  368. package/dist/styles/color-picker.css +1 -1
  369. package/dist/styles/combobox.css +1 -1
  370. package/dist/styles/command-palette.css +1 -1
  371. package/dist/styles/config.css +1 -1
  372. package/dist/styles/confirm.css +1 -1
  373. package/dist/styles/container.css +1 -1
  374. package/dist/styles/data-list.css +2 -0
  375. package/dist/styles/data-table.css +2 -0
  376. package/dist/styles/date-picker.css +1 -1
  377. package/dist/styles/date-range-picker.css +1 -1
  378. package/dist/styles/date-time-picker.css +1 -1
  379. package/dist/styles/dialog.css +1 -1
  380. package/dist/styles/divider.css +1 -1
  381. package/dist/styles/drawer.css +1 -1
  382. package/dist/styles/empty.css +1 -1
  383. package/dist/styles/fieldset.css +1 -1
  384. package/dist/styles/file-picker.css +1 -1
  385. package/dist/styles/flex.css +2 -0
  386. package/dist/styles/floating-action-button.css +1 -1
  387. package/dist/styles/floating-bottom-navigation.css +2 -0
  388. package/dist/styles/footer.css +1 -1
  389. package/dist/styles/form.css +1 -1
  390. package/dist/styles/gauge-chart.css +2 -0
  391. package/dist/styles/grid.css +1 -1
  392. package/dist/styles/header.css +1 -1
  393. package/dist/styles/heatmap-chart.css +2 -0
  394. package/dist/styles/highlight.css +1 -1
  395. package/dist/styles/hover-card.css +2 -0
  396. package/dist/styles/icon-button.css +1 -1
  397. package/dist/styles/image.css +1 -1
  398. package/dist/styles/line-chart.css +2 -0
  399. package/dist/styles/list.css +1 -1
  400. package/dist/styles/locale.css +1 -1
  401. package/dist/styles/menu.css +1 -1
  402. package/dist/styles/menubar.css +1 -1
  403. package/dist/styles/meter.css +2 -0
  404. package/dist/styles/mockup.css +2 -0
  405. package/dist/styles/navigation-menu.css +1 -1
  406. package/dist/styles/number-field.css +1 -1
  407. package/dist/styles/otp-field.css +1 -1
  408. package/dist/styles/overlay.css +1 -1
  409. package/dist/styles/page-layout.css +1 -1
  410. package/dist/styles/pagination.css +1 -1
  411. package/dist/styles/pie-chart.css +2 -0
  412. package/dist/styles/pill.css +1 -1
  413. package/dist/styles/popconfirm.css +1 -1
  414. package/dist/styles/popover.css +1 -1
  415. package/dist/styles/portal.css +2 -0
  416. package/dist/styles/progress-box.css +1 -1
  417. package/dist/styles/progress-circular.css +1 -1
  418. package/dist/styles/progress-linear.css +1 -1
  419. package/dist/styles/radio-group.css +1 -1
  420. package/dist/styles/rating.css +1 -1
  421. package/dist/styles/scatter-chart.css +2 -0
  422. package/dist/styles/scroll-area.css +2 -0
  423. package/dist/styles/scroll-zone.css +2 -0
  424. package/dist/styles/segmented-button.css +1 -1
  425. package/dist/styles/select.css +1 -1
  426. package/dist/styles/show.css +2 -0
  427. package/dist/styles/sidebar.css +1 -1
  428. package/dist/styles/skeleton.css +1 -1
  429. package/dist/styles/slider.css +1 -1
  430. package/dist/styles/snackbar.css +1 -1
  431. package/dist/styles/sparkline.css +2 -0
  432. package/dist/styles/spoiler.css +1 -1
  433. package/dist/styles/stack.css +2 -0
  434. package/dist/styles/statistic.css +2 -0
  435. package/dist/styles/stepper.css +1 -1
  436. package/dist/styles/switch.css +1 -1
  437. package/dist/styles/table.css +1 -1
  438. package/dist/styles/tabs.css +1 -1
  439. package/dist/styles/text-field.css +1 -1
  440. package/dist/styles/text-link.css +1 -1
  441. package/dist/styles/time-picker.css +1 -1
  442. package/dist/styles/timeline-chart.css +2 -0
  443. package/dist/styles/timeline.css +1 -1
  444. package/dist/styles/toggle.css +1 -1
  445. package/dist/styles/tokens.css +1 -1
  446. package/dist/styles/toolbar.css +2 -0
  447. package/dist/styles/tour.css +2 -0
  448. package/dist/styles/transfer.css +1 -1
  449. package/dist/styles/tree-select.css +2 -0
  450. package/dist/styles/tree-view.css +2 -0
  451. package/dist/styles/typography.css +1 -1
  452. package/dist/styles.css +1 -1
  453. package/dist/tailwind.css +1356 -133
  454. package/dist/types.d.ts +564 -3
  455. package/package.json +3 -2
  456. package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
  457. package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
  458. package/dist/components/avatar-group/index.d.ts +0 -2
  459. package/dist/components/avatar-group/index.js +0 -1
  460. package/dist/internal/avatar-group.d.ts +0 -22
  461. package/dist/internal/avatar-group.js +0 -2
  462. package/dist/styles/avatar-group.css +0 -2
@@ -0,0 +1,74 @@
1
+ import * as React from 'react';
2
+ import { type CartesianChartProps } from '../../internal/ChartFrame.js';
3
+ import type { MPChartValueLabels } from '../../types.js';
4
+ export interface MPBarChartProps extends CartesianChartProps {
5
+ /**
6
+ * Stacks the series into one bar per category instead of standing them side
7
+ * by side.
8
+ *
9
+ * Grouped compares the parts with each other; stacked compares the totals and
10
+ * shows what makes them up. Both cannot be true at once, and picking the
11
+ * wrong one is the most common way a bar chart answers a question nobody
12
+ * asked.
13
+ * @default false
14
+ */
15
+ stacked?: boolean;
16
+ /**
17
+ * Turns the chart on its side, so the bars run left to right.
18
+ *
19
+ * The prop that long category names want: a horizontal bar gives each name a
20
+ * whole row rather than a slot the width of one bar, so nothing has to be cut
21
+ * or turned on its side to fit. `xAxis` is still the category axis and
22
+ * `yAxis` is still the value axis — the orientation changes the drawing, not
23
+ * what the data means.
24
+ * @default false
25
+ */
26
+ horizontal?: boolean;
27
+ /**
28
+ * Which values are written onto the bars.
29
+ * @default 'none'
30
+ */
31
+ valueLabels?: MPChartValueLabels;
32
+ }
33
+ /**
34
+ * A measured length per category — how much, next to how much else.
35
+ *
36
+ * ```tsx
37
+ * <MPBarChart
38
+ * categories={['Search', 'Direct', 'Social', 'Mail']}
39
+ * series={[{ name: 'Sessions', data: [4820, 3110, 1940, 860] }]}
40
+ * />
41
+ * ```
42
+ *
43
+ * It is the shape for a magnitude compared across a handful of named things.
44
+ * What a bar encodes is **length**, and length is the one visual channel a
45
+ * reader judges accurately, which is why a bar chart beats a pie for almost
46
+ * every comparison somebody actually has to make.
47
+ *
48
+ * ## The axis starts at zero and there is no prop to stop it
49
+ *
50
+ * A bar's length is proportional to its value only from a zero baseline. Crop
51
+ * the axis and a bar twice the height of its neighbour stands for a value five
52
+ * percent larger — which is not a smaller lie for being a common one, and it is
53
+ * told in the shape a reader trusts most.
54
+ *
55
+ * `yAxis={{ min }}` still moves the scale, because a caller who has said so has
56
+ * said so. It is the wrong tool for a set of values that are close together;
57
+ * the right one is [MPLineChart](line-chart), whose marks claim nothing about
58
+ * proportion.
59
+ *
60
+ * ## Grouped or stacked, never both
61
+ *
62
+ * Side by side compares the parts with each other. Stacked compares the totals
63
+ * and shows what makes them up. A stack's inner segments sit on a wobbly floor
64
+ * and cannot be compared by eye, so reach for it when the total is the point
65
+ * and for grouping when it is not.
66
+ *
67
+ * ## Turn it sideways for long names
68
+ *
69
+ * `horizontal` gives every category a row of its own, which is what a set of
70
+ * names like "Onboarding flow" needs. The alternative is labels cut to a slot
71
+ * the width of one bar, or an axis of words rotated forty-five degrees, which
72
+ * is unreadable at a glance and takes a band of the plot to be unreadable in.
73
+ */
74
+ export declare function MPBarChart({ stacked, horizontal, valueLabels, ...frame }: MPBarChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{CartesianFrame as r}from"../../internal/ChartFrame.js";import{useMPLocale as n}from"../../internal/locale.js";import{useMPSize as a}from"../../internal/config.js";import{BAR_BAND_RATIO as o,BAR_MAX_THICKNESS as i,BAR_RADIUS as u,CHART_FONT_SIZE as s,MARK_GAP as m,barPath as c,formatStatistic as h,textWidth as f,toValues as d}from"../../internal/chart.js";export function MPBarChart({stacked:x=!1,horizontal:p=!1,valueLabels:v="none",...b}){const y=a(b.size),M=n(b.locale),g=l.useMemo(()=>{const t=s[y];if("none"===v||x)return 0;if(!p)return t+8;return d(b.series).flat().reduce((e,l)=>null===l.value?e:Math.max(e,f(String(l.label??h(l.value,M,b.format,!0)),t)),0)+10},[v,x,p,y,M,b.series,b.format]);return t(r,{...b,inset:!1,stacked:x,horizontal:p,bandRatio:o,includeZero:!0,headroom:g,children:({plot:l,values:r,visible:n,colors:a,band:o,valuePx:h,categoryPx:f,zeroPx:d,hovered:b,activeIndex:M,format:g})=>{const j=r.reduce((t,e)=>Math.max(t,e.length),0),k=r.map((t,e)=>e).filter(t=>n[t]),z=x?o.band:o.band/Math.max(1,k.length),_=Math.max(1,Math.min(z-(x?0:m),i[y]));return e("g",{className:"mp-bar-chart__marks",children:[r.map((i,d)=>{if(!n[d])return null;const w=a[d],P=null!==b&&b!==d,A=k.indexOf(d);return e("g",{opacity:P?.25:1,children:[Array.from({length:j},(e,n)=>{const a=i[n]?.value??null;if(null===a)return null;let s=0,v=d;if(x){let t=0,e=0;for(const l of k){const o=r[l][n]?.value??null;null!==o&&(l===d&&(s=o>=0?t:e),o>=0?t+=o:e+=o,o>=0==a>=0&&(v=l))}}const b=h(s),y=h(a+(x?s:0)),g=x&&0!==s?b+(y>b?m:-m):b,j=Math.abs(y-g);if(j<=0||y>b!=y>g)return null;const P=(p?l.top:l.left)+f(n)-o.band/2+(x?0:A*z)+(z-_)/2,B=d!==v?"none":p?a>=0?"right":"left":a>=0?"top":"bottom",C=p?{x:Math.min(g,y),y:P,w:j,h:_}:{x:P,y:Math.min(g,y),w:_,h:j},S=M===n;return t("path",{d:c(C.x,C.y,C.w,C.h,u,B),fill:w,opacity:null===M||S?1:.55},n)}),"none"===v||x?null:i.map((e,r)=>{if(null===e.value)return null;const n=i.map(t=>t.value).filter(t=>null!==t);if(!("all"===v||"last"===v&&r===j-1||"extremes"===v&&(e.value===Math.min(...n)||e.value===Math.max(...n))))return null;const a=h(e.value),u=(p?l.top:l.left)+f(r)-o.band/2+A*z+z/2,m=e.value>=0?-6:6;return t("text",{x:p?a-m:u,y:p?u:a+m,textAnchor:p?e.value>=0?"start":"end":"middle",dominantBaseline:p?"central":"auto",fill:"var(--_mp-color-on-surface)",fontSize:s[y]-1,children:e.label??g(e.value)},r)})]},d)}),t("line",p?{x1:d,x2:d,y1:l.top,y2:l.top+l.height,stroke:"var(--_mp-color-outline)",strokeWidth:1}:{x1:l.left,x2:l.left+l.width,y1:d,y2:d,stroke:"var(--_mp-color-outline)",strokeWidth:1})]})}})}
@@ -0,0 +1,2 @@
1
+ export { MPBarChart } from './MPBarChart.js';
2
+ export type { MPBarChartProps } from './MPBarChart.js';
@@ -0,0 +1 @@
1
+ export{MPBarChart}from"./MPBarChart.js";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { MPColor, MPSize, MPVariant } from '../../types.js';
2
+ import type { MPColor, MPSize, MPTransition, MPVariant } from '../../types.js';
3
3
  /**
4
4
  * The props are a `<figure>`'s rather than a `<blockquote>`'s, which is a
5
5
  * consequence of where the drawing happens: everything a caller passes lands on
@@ -48,6 +48,15 @@ export interface MPBlockquoteProps extends Omit<React.ComponentPropsWithoutRef<'
48
48
  icon?: React.ReactNode | false;
49
49
  /** What was said. */
50
50
  children?: React.ReactNode;
51
+ /**
52
+ * An entrance, run once as it mounts.
53
+ *
54
+ * `transition="fade"` is the whole of what most callers want; the object form
55
+ * takes a duration, an edge to come from, or a scale to start at. Anything
56
+ * that has to run again — on scroll, on hover, under your own control — is an
57
+ * [MPAnimateFade](../motion/animate-fade) and its siblings.
58
+ */
59
+ transition?: MPTransition;
51
60
  }
52
61
  /**
53
62
  * Somebody else's words, set apart from your own.
@@ -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{accentSlots as n}from"../../internal/accent.js";import{hasContent as r,META_TEXT as i,SHEET_PAD as l}from"../../internal/scale.js";import{useMPColor as o,useMPSize as c}from"../../internal/config.js";const s={xs:"text-mp-body-medium",sm:"text-mp-body-large",md:"text-mp-title-large",lg:"text-mp-headline-small",xl:"text-mp-headline-medium"},m="border-s-2 [border-inline-start-color:var(--_mp-accent)]",d={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface",outlined:"border-mp-outline-variant border border-s-2 bg-transparent text-mp-on-surface",text:"bg-transparent text-mp-on-surface"};function p(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const MPBlockquote=/*@__PURE__*/a.forwardRef(function({variant:a="text",size:u,color:f,author:x,source:h,cite:b,icon:g,className:v,style:j,children:N,...y},w){const z=c(u),_=o(f),k=r(x)||r(h),q=void 0===g?e(p,{}):g,B="text"!==a,M=["mp-blockquote flex flex-col",s[z],m,B?"rounded-mp-md rounded-s-none":"",d[a],B?l[z]:"ps-4",v??""].filter(Boolean).join(" "),Z=t("blockquote",{cite:b,children:[r(q)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] opacity-38",children:q}):null,N]}),C={...n(_),...j};return k?t("figure",{ref:w,"data-mp-size":z,"data-mp-variant":a,className:M,style:C,...y,children:[Z,t("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5",B?"opacity-80":"text-mp-on-surface-variant",i].join(" "),children:[r(x)?t("span",{className:"font-medium",children:[e("span",{"aria-hidden":"true",children:"— "}),x]}):null,r(h)?e("cite",{className:"not-italic",children:h}):null]})]}):e("div",{ref:w,"data-mp-size":z,"data-mp-variant":a,className:M,style:C,...y,children:Z})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{accentSlots as n}from"../../internal/accent.js";import{transitionProps as r}from"../../internal/transition.js";import{hasContent as i,META_TEXT as l,SHEET_PAD as o}from"../../internal/scale.js";import{useMPColor as c,useMPSize as s}from"../../internal/config.js";const m={xs:"text-mp-body-medium",sm:"text-mp-body-large",md:"text-mp-title-large",lg:"text-mp-headline-small",xl:"text-mp-headline-medium"},d="border-s-2 [border-inline-start-color:var(--_mp-accent)]",p={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface",outlined:"border-mp-outline-variant border border-s-2 bg-transparent text-mp-on-surface",text:"bg-transparent text-mp-on-surface"};function u(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const MPBlockquote=/*@__PURE__*/a.forwardRef(function({variant:a="text",size:f,color:x,author:h,source:b,cite:g,icon:v,transition:j,className:N,style:y,children:w,...z},_){const k=s(f),q=c(x),B=i(h)||i(b),M=void 0===v?e(u,{}):v,Z="text"!==a,C=r(j),P=["mp-blockquote flex flex-col",m[k],d,Z?"rounded-mp-md rounded-s-none":"",p[a],Z?o[k]:"ps-4",C.className,N??""].filter(Boolean).join(" "),R=t("blockquote",{cite:g,children:[i(M)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] opacity-38",children:M}):null,w]}),A={...n(q),...C.style,...y};return B?t("figure",{ref:_,"data-mp-size":k,"data-mp-variant":a,className:P,style:A,...z,children:[R,t("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5",Z?"opacity-80":"text-mp-on-surface-variant",l].join(" "),children:[i(h)?t("span",{className:"font-medium",children:[e("span",{"aria-hidden":"true",children:"— "}),h]}):null,i(b)?e("cite",{className:"not-italic",children:b}):null]})]}):e("div",{ref:_,"data-mp-size":k,"data-mp-variant":a,className:P,style:A,...z,children:R})});
@@ -1,24 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
+ import { type MPBottomNavigationLabels, type MPBottomNavigationValue } from '../../internal/bottom-navigation.js';
3
4
  import type { MPPosition, MPSize } from '../../types.js';
4
- /** A destination's value. The same restraint `MPTabs` puts on a tab's. */
5
- export type MPBottomNavigationValue = string | number;
6
- /**
7
- * Which names are drawn.
8
- *
9
- * MD3's three label behaviours, and the order they lose information in:
10
- *
11
- * - `all` — every destination is named. The default, and the only one that works
12
- * for a reader who has not used the application before.
13
- * - `selected` — only the destination the reader is on. The bar keeps its height
14
- * either way.
15
- * - `none` — glyphs only.
16
- *
17
- * Undrawn is never unsaid: in both of the last two the names stay in the
18
- * document for a screen reader, because a glyph on its own has no accessible
19
- * name at all.
20
- */
21
- export type MPBottomNavigationLabels = 'all' | 'selected' | 'none';
5
+ export type { MPBottomNavigationLabels, MPBottomNavigationValue };
22
6
  export interface MPBottomNavigationProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'defaultValue' | 'onChange'> {
23
7
  /** The destination the reader is on. Use with `onValueChange` for a controlled bar. */
24
8
  value?: MPBottomNavigationValue | null;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{useRender as l}from"@base-ui/react/use-render";import{linkRel as r}from"../../internal/link.js";import{MPStateLayer as o}from"../../internal/StateLayer.js";import{hasContent as i}from"../../internal/scale.js";import{VISUALLY_HIDDEN as s}from"../../internal/visually-hidden.js";import{useMPSize as d}from"../../internal/config.js";const m=/*@__PURE__*/n.createContext({value:null,change:()=>{},size:"md",labels:"all",disabled:!1}),u={xs:"h-14",sm:"h-16",md:"h-20",lg:"h-22",xl:"h-24"},c={xs:{box:"h-6 w-12",open:"w-12",shut:"w-6"},sm:{box:"h-7 w-14",open:"w-14",shut:"w-7"},md:{box:"h-8 w-16",open:"w-16",shut:"w-8"},lg:{box:"h-9 w-18",open:"w-18",shut:"w-9"},xl:{box:"h-10 w-20",open:"w-20",shut:"w-10"}},p={xs:20,sm:22,md:24,lg:26,xl:28},f={xs:"text-mp-label-small",sm:"text-mp-label-small",md:"text-mp-label-medium",lg:"text-mp-label-medium",xl:"text-mp-label-large"},b={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"},x={static:"",absolute:"absolute inset-x-0 bottom-0 z-30",sticky:"sticky bottom-0 z-30",fixed:"fixed inset-x-0 bottom-0 z-40"};export const MPBottomNavigation=/*@__PURE__*/n.forwardRef(function({value:t,defaultValue:a=null,onValueChange:r,position:o="fixed",labels:i="all",size:s,divider:c=!1,safeArea:p=!0,disabled:f=!1,label:b,render:h,className:v,children:g,...w},y){const j=d(s),[z,N]=n.useState(a),k=void 0!==t,C=k?t:z,B=n.useCallback(e=>{k||N(e),r?.(e)},[k,r]),$=n.useMemo(()=>({value:C??null,change:B,size:j,labels:i,disabled:f}),[C,B,j,i,f]);return l({render:h??e("nav",{}),ref:y,props:{"aria-label":b,"data-mp-size":j,className:["mp-bottom-navigation bg-mp-surface-container text-mp-on-surface box-border w-full",c?"border-mp-outline-variant border-t":"",x[o],p?"pb-[env(safe-area-inset-bottom)]":"",v??""].filter(Boolean).join(" "),children:e(m.Provider,{value:$,children:e("div",{className:`flex w-full items-stretch ${u[j]}`,children:g})}),...w}})});export const MPBottomNavigationItem=/*@__PURE__*/n.forwardRef(function({value:l,icon:d,activeIcon:u,href:x,target:v,rel:g,render:w,disabled:y=!1,className:j,children:z,onClick:N,...k},C){const B=n.useContext(m),$=y||B.disabled,M=null!==B.value&&B.value===l,P="all"===B.labels||"selected"===B.labels&&M,I=["mp-bottom-navigation__item group flex min-w-0 flex-1 flex-col items-center justify-center","box-border appearance-none bg-transparent px-1 font-[inherit] no-underline select-none",b[B.size],"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none",$?"text-mp-on-surface/38 cursor-default":M?"text-mp-on-surface cursor-pointer":"text-mp-on-surface-variant cursor-pointer",j??""].filter(Boolean).join(" "),R=t(a,{children:[i(d)||i(u)?t("span",{className:["relative flex shrink-0 items-center justify-center overflow-hidden","rounded-mp-full","transition-[color] duration-(--mp-sys-motion-duration-short4)",c[B.size].box,M&&!$?"text-mp-on-secondary-container":""].filter(Boolean).join(" "),children:[$?null:e("span",{"aria-hidden":"true",className:["pointer-events-none absolute inset-y-0 left-1/2 -translate-x-1/2","rounded-mp-full bg-mp-secondary-container","transition-[width,opacity] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard",M?`${c[B.size].open} opacity-100`:`${c[B.size].shut} opacity-0`].join(" ")}),$?null:e(o,{}),e("span",{className:"relative flex items-center justify-center",style:{width:p[B.size],height:p[B.size]},children:M?u??d:d})]}):null,i(z)?e("span",{className:P?`max-w-full truncate ${f[B.size]}`:s,children:z}):null]}),S=e=>{$?e.preventDefault():(B.change(l),N?.(e))};return e(h,x?{render:w,props:{ref:C,href:$?void 0:x,target:v,rel:r(v,g),"aria-current":M?"page":void 0,"aria-disabled":$||void 0,className:I,onClick:S,children:R,...k}}:{render:w,props:{ref:C,type:w?void 0:"button",disabled:$,"aria-current":M?"page":void 0,className:I,onClick:S,children:R,...k}})});function h({render:t,props:a}){return l({render:t??(a.href?e("a",{}):e("button",{})),props:a})}
2
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{useRender as o}from"@base-ui/react/use-render";import{linkRel as r}from"../../internal/link.js";import{MPStateLayer as i}from"../../internal/StateLayer.js";import{hasContent as l}from"../../internal/scale.js";import{VISUALLY_HIDDEN as s}from"../../internal/visually-hidden.js";import{MPBottomNavigationContext as m}from"../../internal/bottom-navigation.js";import{useMPSize as d}from"../../internal/config.js";const u={xs:"h-14",sm:"h-16",md:"h-20",lg:"h-22",xl:"h-24"},c={xs:{box:"h-6 w-12",open:"w-12",shut:"w-6"},sm:{box:"h-7 w-14",open:"w-14",shut:"w-7"},md:{box:"h-8 w-16",open:"w-16",shut:"w-8"},lg:{box:"h-9 w-18",open:"w-18",shut:"w-9"},xl:{box:"h-10 w-20",open:"w-20",shut:"w-10"}},p={xs:20,sm:22,md:24,lg:26,xl:28},f={xs:"text-mp-label-small",sm:"text-mp-label-small",md:"text-mp-label-medium",lg:"text-mp-label-medium",xl:"text-mp-label-large"},b={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"},x={static:"",absolute:"absolute inset-x-0 bottom-0 z-30",sticky:"sticky bottom-0 z-30",fixed:"fixed inset-x-0 bottom-0 z-40"};export const MPBottomNavigation=/*@__PURE__*/a.forwardRef(function({value:t,defaultValue:n=null,onValueChange:r,position:i="fixed",labels:l="all",size:s,divider:c=!1,safeArea:p=!0,disabled:f=!1,label:b,render:h,className:v,children:g,...w},y){const j=d(s),[z,N]=a.useState(n),k=void 0!==t,C=k?t:z,B=a.useCallback(e=>{k||N(e),r?.(e)},[k,r]),$=a.useMemo(()=>({value:C??null,change:B,size:j,labels:l,disabled:f,floating:!1}),[C,B,j,l,f]);return o({render:h??e("nav",{}),ref:y,props:{"aria-label":b,"data-mp-size":j,className:["mp-bottom-navigation bg-mp-surface-container text-mp-on-surface box-border w-full",c?"border-mp-outline-variant border-t":"",x[i],p?"pb-[env(safe-area-inset-bottom)]":"",v??""].filter(Boolean).join(" "),children:e(m.Provider,{value:$,children:e("div",{className:`flex w-full items-stretch ${u[j]}`,children:g})}),...w}})});export const MPBottomNavigationItem=/*@__PURE__*/a.forwardRef(function({value:o,icon:d,activeIcon:u,href:x,target:v,rel:g,render:w,disabled:y=!1,className:j,children:z,onClick:N,...k},C){const B=a.useContext(m),$=y||B.disabled,M=null!==B.value&&B.value===o,P="all"===B.labels||"selected"===B.labels&&M,I=["mp-bottom-navigation__item group flex min-w-0 flex-col items-center justify-center",B.floating?"shrink-0":"flex-1","box-border appearance-none bg-transparent px-1 font-[inherit] no-underline select-none",b[B.size],"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none",$?"text-mp-on-surface/38 cursor-default":M?"text-mp-on-surface cursor-pointer":"text-mp-on-surface-variant cursor-pointer",j??""].filter(Boolean).join(" "),R=t(n,{children:[l(d)||l(u)?t("span",{className:["relative flex shrink-0 items-center justify-center overflow-hidden","rounded-mp-full","transition-[color] duration-(--mp-sys-motion-duration-short4)",c[B.size].box,M&&!$?"text-mp-on-secondary-container":""].filter(Boolean).join(" "),children:[$?null:e("span",{"aria-hidden":"true",className:["pointer-events-none absolute inset-y-0 left-1/2 -translate-x-1/2","rounded-mp-full bg-mp-secondary-container","transition-[width,opacity] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard",M?`${c[B.size].open} opacity-100`:`${c[B.size].shut} opacity-0`].join(" ")}),$?null:e(i,{}),e("span",{className:"relative flex items-center justify-center",style:{width:p[B.size],height:p[B.size]},children:M?u??d:d})]}):null,l(z)?e("span",{className:P?`max-w-full truncate ${f[B.size]}`:s,children:z}):null]}),S=e=>{$?e.preventDefault():(B.change(o),N?.(e))};return e(h,x?{render:w,props:{ref:C,href:$?void 0:x,target:v,rel:r(v,g),"aria-current":M?"page":void 0,"aria-disabled":$||void 0,className:I,onClick:S,children:R,...k}}:{render:w,props:{ref:C,type:w?void 0:"button",disabled:$,"aria-current":M?"page":void 0,className:I,onClick:S,children:R,...k}})});function h({render:t,props:n}){return o({render:t??(n.href?e("a",{}):e("button",{})),props:n})}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
- import type { MPSize, MPVariant } from '../../types.js';
3
+ import type { MPDensity, MPElevation, MPSize, MPTransition, MPVariant } from '../../types.js';
4
4
  export interface MPBoxProps extends React.ComponentPropsWithoutRef<'div'> {
5
5
  /**
6
6
  * How much surface the sheet paints.
@@ -11,6 +11,17 @@ export interface MPBoxProps extends React.ComponentPropsWithoutRef<'div'> {
11
11
  * @default 'outlined'
12
12
  */
13
13
  variant?: MPVariant;
14
+ /**
15
+ * How far off the page the sheet is lifted, on MD3's own scale.
16
+ *
17
+ * It moves the **tone** as well as the shadow, because Material pairs the two:
18
+ * a level-2 surface is `surface-container` under a level-2 shadow, and a prop
19
+ * that only cast a shadow would raise this into a surface the specification
20
+ * has no name for. Given a level, `variant` is left holding only its hairline.
21
+ *
22
+ * Left unset, `variant` decides — and `variant="elevated"` is this at `1`.
23
+ */
24
+ elevation?: MPElevation;
14
25
  /**
15
26
  * The room inside.
16
27
  *
@@ -27,6 +38,26 @@ export interface MPBoxProps extends React.ComponentPropsWithoutRef<'div'> {
27
38
  * @default 'md'
28
39
  */
29
40
  size?: MPSize;
41
+ /**
42
+ * Takes room out of the padding `size` chose, two pixels a face per step.
43
+ *
44
+ * On a box that is the whole of what density can mean, because padding is the
45
+ * whole of what `size` does here. It is the axis that matters when boxes are
46
+ * being repeated — a grid of tiles, a column of panels — where the room around
47
+ * each one is multiplied by however many there are.
48
+ * @default 0
49
+ */
50
+ density?: MPDensity;
51
+ /**
52
+ * An entrance, run once as the box mounts.
53
+ *
54
+ * `transition="fade"` is the whole of what most callers want; the object form
55
+ * takes a duration, an edge to come from, or a scale to start at. Anything
56
+ * that has to run again — on scroll, on hover, under your own control — is an
57
+ * [MPAnimateFade](../motion/animate-fade) and its siblings, and wrapping is
58
+ * the right answer there.
59
+ */
60
+ transition?: MPTransition;
30
61
  /**
31
62
  * Inner padding. Turn it off for full-bleed content — a picture, a table, a
32
63
  * list that draws its own rows.
@@ -66,13 +97,17 @@ export interface MPBoxProps extends React.ComponentPropsWithoutRef<'div'> {
66
97
  * that is [MPAlert](../feedback/alert) for a message, [MPChip](../display/chip)
67
98
  * for a token, [MPButton](../inputs/button) for an action.
68
99
  *
69
- * ## Why there is no `elevation`
100
+ * ## What `elevation` does, and why it took the shape it did
101
+ *
102
+ * MD3 does not treat height as a free axis: an elevated surface is
103
+ * `surface-container-low` **under** a level-1 shadow, and the tone and the
104
+ * shadow are one decision rather than two. A prop that only cast a shadow would
105
+ * raise a `filled` box into a surface the specification has no name for — a
106
+ * lifted object that is somehow still the flattest tone in the system.
70
107
  *
71
- * There is no `elevation` prop anywhere in this library, and a box is where the
72
- * absence is most tempting to fix. It stays absent because MD3 does not treat
73
- * height as a free axis: an elevated surface is `surface-container-low` under a
74
- * level-1 shadow, and the tone and the shadow are one decision. A prop that
75
- * raised a `filled` box would produce a surface the specification has no name
76
- * for. `variant="elevated"` is that decision, made once.
108
+ * So a level names both, and `variant="elevated"` is that decision made once, at
109
+ * level 1. The variant stays because it is the answer nearly every raised sheet
110
+ * wants and because the vocabulary is about *emphasis*; the prop is there for
111
+ * the sheet that has a reason to be somewhere else on the ladder.
77
112
  */
78
113
  export declare const MPBox: React.ForwardRefExoticComponent<MPBoxProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1,2 @@
1
- import*as r from"react";import{useRender as e}from"@base-ui/react/use-render";import{SHEET_PAD as a}from"../../internal/scale.js";import{CONTAINER_SURFACE as o}from"../../internal/surface.js";export const MPBox=/*@__PURE__*/r.forwardRef(function({variant:r="outlined",size:n="md",padded:t=!0,render:d,className:i,children:m,...s},p){return e({render:d,ref:p,props:{"data-mp-size":n,"data-mp-variant":r,className:["mp-box rounded-mp-md block","box-border",t?a[n]:"",o[r],"text-mp-on-surface",i??""].filter(Boolean).join(" "),children:m,...s}})});
1
+ "use client";
2
+ import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{sheetPad as t}from"../../internal/density.js";import{containerSurface as n}from"../../internal/elevation.js";import{useMPDensity as o,useMPSize as a}from"../../internal/config.js";import{transitionProps as i}from"../../internal/transition.js";export const MPBox=/*@__PURE__*/e.forwardRef(function({variant:e="outlined",elevation:s,size:m,density:d,transition:l,padded:p=!0,render:c,className:f,style:u,children:b,...j},x){const y=a(m),v=o(d),N=i(l);return r({render:c,ref:x,props:{"data-mp-size":y,"data-mp-variant":e,className:["mp-box rounded-mp-md block","box-border",p?t(y,v):"",n(e,s),"text-mp-on-surface",N.className,f??""].filter(Boolean).join(" "),style:{...N.style,...u},children:b,...j}})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as l,Fragment as a}from"react/jsx-runtime";import*as r from"react";import{MPBox as n}from"../box/MPBox.js";import{hasContent as i,META_TEXT as o,PROSE_TEXT as t,SHEET_GAP as s,SHEET_PAD_X as c,SHEET_PAD_Y as m,SHEET_TITLE as d}from"../../internal/scale.js";import{useMPSize as f}from"../../internal/config.js";export const MPCard=/*@__PURE__*/r.forwardRef(function({size:r,title:p,subtitle:u,headerAction:x,media:h,footer:_,dividers:v=!1,className:N,children:j,...w},b){const g=f(r),k=c[g],$=m[g],y=v?`${k} ${$}`:k,B=i(p)||i(u)||i(x),z=i(h),M=[B?{key:"header",className:"mp-card__header flex items-start gap-3",content:l(a,{children:[i(p)||i(u)?l("div",{className:"flex min-w-0 flex-1 flex-col",children:[i(p)?e("div",{className:`mp-card__title ${d[g]}`,children:p}):null,i(u)?e("div",{className:`text-mp-on-surface-variant ${o}`,children:u}):null]}):null,i(x)?e("div",{className:"ms-auto shrink-0",children:x}):null]})}:null,i(j)?{key:"content",className:`mp-card__body min-w-0 ${t[g]}`,content:j}:null,i(_)?{key:"footer",className:"mp-card__footer flex flex-wrap items-center gap-2",content:_}:null].filter(e=>null!==e);return l(n,{ref:b,size:g,padded:!1,className:["mp-card flex flex-col",z?"overflow-hidden":"",N??""].filter(Boolean).join(" "),...w,children:[z?e("div",{className:"mp-card__media [&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full",children:h}):null,M.length>0?e("div",{className:["flex min-w-0 flex-col",v?"":`${$} ${s[g]}`].filter(Boolean).join(" "),children:M.map((l,a)=>e("div",{className:[y,l.className,v&&a>0?"border-mp-outline-variant border-t":""].filter(Boolean).join(" "),children:l.content},l.key))}):null]})});
2
+ import{jsx as e,jsxs as l,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{MPBox as r}from"../box/MPBox.js";import{hasContent as i,META_TEXT as t,PROSE_TEXT as o,SHEET_GAP as s,SHEET_TITLE as c}from"../../internal/scale.js";import{sheetPadX as m,sheetPadY as d}from"../../internal/density.js";import{useMPDensity as f,useMPSize as p}from"../../internal/config.js";export const MPCard=/*@__PURE__*/n.forwardRef(function({size:n,density:u,title:x,subtitle:h,headerAction:_,media:v,footer:N,dividers:j=!1,className:w,children:y,...b},g){const k=p(n),$=f(u),B=m(k,$),z=d(k,$),M=j?`${B} ${z}`:B,P=i(x)||i(h)||i(_),A=i(v),C=[P?{key:"header",className:"mp-card__header flex items-start gap-3",content:l(a,{children:[i(x)||i(h)?l("div",{className:"flex min-w-0 flex-1 flex-col",children:[i(x)?e("div",{className:`mp-card__title ${c[k]}`,children:x}):null,i(h)?e("div",{className:`text-mp-on-surface-variant ${t}`,children:h}):null]}):null,i(_)?e("div",{className:"ms-auto shrink-0",children:_}):null]})}:null,i(y)?{key:"content",className:`mp-card__body min-w-0 ${o[k]}`,content:y}:null,i(N)?{key:"footer",className:"mp-card__footer flex flex-wrap items-center gap-2",content:N}:null].filter(e=>null!==e);return l(r,{ref:g,size:k,density:$,padded:!1,className:["mp-card flex flex-col",A?"overflow-hidden":"",w??""].filter(Boolean).join(" "),...b,children:[A?e("div",{className:"mp-card__media [&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full",children:v}):null,C.length>0?e("div",{className:["flex min-w-0 flex-col",j?"":`${z} ${s[k]}`].filter(Boolean).join(" "),children:C.map((l,a)=>e("div",{className:[M,l.className,j&&a>0?"border-mp-outline-variant border-t":""].filter(Boolean).join(" "),children:l.content},l.key))}):null]})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Checkbox as t}from"@base-ui/react/checkbox";import{Field as n}from"@base-ui/react/field";import{MPIcon as o}from"../icon/MPIcon.js";import{CheckIcon as i,RemoveIcon as s}from"../../constants/icons.js";import{accentSlots as c}from"../../internal/accent.js";import{MPStateLayer as l}from"../../internal/StateLayer.js";import{MPSupportingText as d}from"../../internal/SupportingText.js";import{PROSE_TEXT as m,hasContent as p}from"../../internal/scale.js";import{useMPColor as h,useMPSize as u}from"../../internal/config.js";const f={xs:{box:"size-3.5",halo:"size-8",glyph:12},sm:{box:"size-4",halo:"size-9",glyph:14},md:{box:"size-[18px]",halo:"size-10",glyph:16},lg:{box:"size-5",halo:"size-11",glyph:18},xl:{box:"size-[22px]",halo:"size-12",glyph:20}};export const MPCheckbox=/*@__PURE__*/r.forwardRef(function({checked:b,defaultChecked:g,onCheckedChange:x,indeterminate:y=!1,label:k,description:j,errorMessage:z,size:N,color:_,required:v=!1,disabled:C=!1,readOnly:M=!1,name:I,value:R,id:q,className:w,style:L},O){const P=u(N),S=h(_),B=p(z),F=B?"error":S,T=f[P],W=r.useId(),A=q??W;return e(n.Root,{className:["mp-checkbox inline-block align-top",w??""].filter(Boolean).join(" "),disabled:C,invalid:B,"data-mp-size":P,style:{...c(F),...L},children:a("div",{className:["flex items-start gap-3",m[P]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(t.Root,{ref:O,id:A,name:I,value:R,checked:b,defaultChecked:g,indeterminate:y,required:v,disabled:C,readOnly:M,onCheckedChange:e=>x?.(e),className:["mp-checkbox__tick group relative inline-flex shrink-0 items-center","box-border justify-center border-2 p-0","rounded-[calc(var(--mp-sys-shape-corner-extra-small)/2)]","appearance-none bg-transparent font-[inherit] outline-none","transition-[background-color,border-color]","duration-(--mp-sys-motion-duration-short4)",T.box,C?["border-mp-on-surface/38 cursor-default","data-checked:bg-mp-on-surface/38 data-checked:border-transparent","data-indeterminate:bg-mp-on-surface/38 data-indeterminate:border-transparent"].join(" "):[M?"cursor-default":"cursor-pointer",B?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-transparent data-checked:bg-(--_mp-accent)","data-checked:text-(--_mp-on-accent)","data-indeterminate:border-transparent data-indeterminate:bg-(--_mp-accent)","data-indeterminate:text-(--_mp-on-accent)"].join(" ")].join(" "),children:[C?null:e(l,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",T.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)","group-data-indeterminate:bg-(--_mp-accent)"].join(" ")}),e(t.Indicator,{className:["flex items-center justify-center","transition-[opacity,scale] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:scale-60 data-starting-style:opacity-0","data-ending-style:scale-60 data-ending-style:opacity-0"].join(" "),children:e(o,{icon:y?s:i,size:T.glyph,strokeWidth:3})})]})}),p(k)||p(j)||B?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(k)?a(n.Label,{htmlFor:A,className:["leading-[1.4]",C?"text-mp-on-surface/38 cursor-default":M?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:[k,v?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(d,{description:j,errorMessage:z})]}):null]})})});
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Checkbox as t}from"@base-ui/react/checkbox";import{Field as n}from"@base-ui/react/field";import{MPIcon as o}from"../icon/MPIcon.js";import{CheckIcon as i,RemoveIcon as s}from"../../constants/icons.js";import{accentSlots as c}from"../../internal/accent.js";import{MARK_MOTION as l}from"../../internal/mark.js";import{MPStateLayer as d}from"../../internal/StateLayer.js";import{MPSupportingText as m}from"../../internal/SupportingText.js";import{PROSE_TEXT as p,hasContent as h}from"../../internal/scale.js";import{useMPColor as u,useMPSize as f}from"../../internal/config.js";const b={xs:{box:"size-3.5",halo:"size-8",glyph:12},sm:{box:"size-4",halo:"size-9",glyph:14},md:{box:"size-[18px]",halo:"size-10",glyph:16},lg:{box:"size-5",halo:"size-11",glyph:18},xl:{box:"size-[22px]",halo:"size-12",glyph:20}};export const MPCheckbox=/*@__PURE__*/a.forwardRef(function({checked:x,defaultChecked:g,onCheckedChange:k,indeterminate:j=!1,label:y,description:z,errorMessage:N,size:_,color:v,required:C=!1,disabled:M=!1,readOnly:I=!1,name:R,value:q,id:w,className:L,style:O},P){const S=f(_),B=u(v),F=h(N),T=F?"error":B,W=b[S],$=a.useId(),A=w??$;return e(n.Root,{className:["mp-checkbox inline-block align-top",L??""].filter(Boolean).join(" "),disabled:M,invalid:F,"data-mp-size":S,style:{...c(T),...O},children:r("div",{className:["flex items-start gap-3",p[S]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:r(t.Root,{ref:P,id:A,name:R,value:q,checked:x,defaultChecked:g,indeterminate:j,required:C,disabled:M,readOnly:I,onCheckedChange:e=>k?.(e),className:["mp-checkbox__tick group relative inline-flex shrink-0 items-center","box-border justify-center border-2 p-0","rounded-[calc(var(--mp-sys-shape-corner-extra-small)/2)]","appearance-none bg-transparent font-[inherit] outline-none","transition-[background-color,border-color]","duration-(--mp-sys-motion-duration-short4)",W.box,M?["border-mp-on-surface/38 cursor-default","data-checked:bg-mp-on-surface/38 data-checked:border-transparent","data-indeterminate:bg-mp-on-surface/38 data-indeterminate:border-transparent"].join(" "):[I?"cursor-default":"cursor-pointer",F?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-transparent data-checked:bg-(--_mp-accent)","data-checked:text-(--_mp-on-accent)","data-indeterminate:border-transparent data-indeterminate:bg-(--_mp-accent)","data-indeterminate:text-(--_mp-on-accent)"].join(" ")].join(" "),children:[M?null:e(d,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",W.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)","group-data-indeterminate:bg-(--_mp-accent)"].join(" ")}),e(t.Indicator,{className:`flex items-center justify-center ${l}`,children:e(o,{icon:j?s:i,size:W.glyph,strokeWidth:3})})]})}),h(y)||h(z)||F?r("span",{className:"flex min-w-0 flex-col gap-0.5",children:[h(y)?r(n.Label,{htmlFor:A,className:["leading-[1.4]",M?"text-mp-on-surface/38 cursor-default":I?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:[y,C?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(m,{description:z,errorMessage:N})]}):null]})})});
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { MPColor, MPSize, MPVariant } from '../../types.js';
2
+ import type { MPColor, MPSize, MPTransition, MPVariant } from '../../types.js';
3
3
  export interface MPChipProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
4
4
  /**
5
5
  * How much surface the chip paints.
@@ -57,6 +57,15 @@ export interface MPChipProps extends Omit<React.ComponentPropsWithoutRef<'span'>
57
57
  /** Unavailable. Drops the accent family, as everywhere else in the library. */
58
58
  disabled?: boolean;
59
59
  children?: React.ReactNode;
60
+ /**
61
+ * An entrance, run once as it mounts.
62
+ *
63
+ * `transition="fade"` is the whole of what most callers want; the object form
64
+ * takes a duration, an edge to come from, or a scale to start at. Anything
65
+ * that has to run again — on scroll, on hover, under your own control — is an
66
+ * [MPAnimateFade](../motion/animate-fade) and its siblings.
67
+ */
68
+ transition?: MPTransition;
60
69
  }
61
70
  /**
62
71
  * A compact token: a tag, a filter, a status, an entity plucked out of a list.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{MPIcon as a}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{accentSlots as r}from"../../internal/accent.js";import{useMPLocale as s,useMPMessages as l}from"../../internal/locale.js";import{COMMON as c}from"../../internal/messages/common.js";import{hasContent as m}from"../../internal/scale.js";import{MPStateLayer as p}from"../../internal/StateLayer.js";import{useMPColor as d,useMPSize as u}from"../../internal/config.js";const f={xs:"h-6",sm:"h-7",md:"h-8",lg:"h-10",xl:"h-12"},b={xs:"text-mp-label-medium",sm:"text-mp-label-medium",md:"text-mp-label-large",lg:"text-mp-label-large",xl:"text-mp-title-medium"},x={xs:"px-2",sm:"px-3",md:"px-4",lg:"px-5",xl:"px-6"},g={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2",xl:"gap-2.5"},h={xs:"rounded-mp-xs",sm:"rounded-mp-sm",md:"rounded-mp-sm",lg:"rounded-mp-sm",xl:"rounded-mp-md"},v={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface-variant",outlined:"border-mp-outline text-mp-on-surface-variant border bg-transparent",text:"text-mp-on-surface-variant bg-transparent"},y={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border-mp-outline bg-(--_mp-accent-container) text-(--_mp-on-accent-container) border",text:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)"},j={filled:"bg-mp-on-surface/12 text-mp-on-surface/38",tonal:"bg-mp-on-surface/12 text-mp-on-surface/38",elevated:"bg-mp-on-surface/12 text-mp-on-surface/38 shadow-none",outlined:"border-mp-on-surface/12 text-mp-on-surface/38 border bg-transparent",text:"bg-transparent text-mp-on-surface/38"},_=/*@__PURE__*/["ms-0.5 -me-1 inline-flex shrink-0 cursor-pointer items-center justify-center","rounded-mp-full size-[1.35em] opacity-70","transition-opacity duration-(--mp-sys-motion-duration-short4)","hover:opacity-100 focus-visible:opacity-100","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-1","focus-visible:outline-solid outline-none","disabled:cursor-default disabled:opacity-38"].join(" "),w=/*@__PURE__*/["group relative flex min-w-0 flex-1 cursor-pointer items-center justify-center","self-stretch rounded-[inherit] font-[inherit] text-[inherit]","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),k=/*@__PURE__*/["group cursor-pointer appearance-none font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" ");export const MPChip=/*@__PURE__*/o.forwardRef(function({variant:o="outlined",size:N,color:C,startIcon:z,endIcon:B,count:I,onDelete:$,deleteLabel:L,locale:M,selected:P,disabled:D=!1,className:F,style:R,children:S,onClick:q,...A},E){const G=u(N),H=d(C),J=s(M),K=l(c,J),O=Boolean(q)&&!D,Q=O&&Boolean($),T=O&&!$,U=["mp-chip relative inline-flex max-w-full shrink-0 items-center","box-border overflow-hidden align-middle leading-none whitespace-nowrap select-none","transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)",f[G],b[G],g[G],h[G],D?j[o]:P?y[o]:v[o],Q?"ps-0":x[G],$?"pe-2":"",T?k:"",F??""].filter(Boolean).join(" "),V=t(n,{children:[z,m(S)?e("span",{className:"min-w-0 truncate",children:S}):null,B,m(I)?e("span",{className:["rounded-mp-full ms-0.5 inline-flex shrink-0 items-center justify-center px-1.5 py-px","text-[0.85em] leading-none font-medium tabular-nums","filled"===o?"bg-(--_mp-on-accent)/20 text-(--_mp-on-accent)":"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)"].join(" "),children:I}):null]}),W={"data-mp-size":G,"data-mp-variant":o,"data-selected":P||void 0,className:U,style:{...r(H),...R},...A};return T?t("button",{ref:E,type:"button","aria-pressed":P,onClick:q,...W,children:[e(p,{}),V]}):t("span",{ref:E,"aria-disabled":!(!D||O)||void 0,...W,children:[Q?t("button",{type:"button","aria-pressed":P,className:`${w} ${g[G]} ${x[G]}`,onClick:q,children:[e(p,{}),V]}):V,$?e("button",{type:"button","aria-label":L??K.remove,disabled:D,className:_,onClick:$,children:e(a,{icon:i,size:"1em"})}):null]})});
2
+ import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{MPIcon as a}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{accentSlots as r}from"../../internal/accent.js";import{transitionProps as s}from"../../internal/transition.js";import{useMPLocale as l,useMPMessages as c}from"../../internal/locale.js";import{COMMON as m}from"../../internal/messages/common.js";import{hasContent as p}from"../../internal/scale.js";import{MPStateLayer as d}from"../../internal/StateLayer.js";import{useMPColor as u,useMPSize as f}from"../../internal/config.js";const b={xs:"h-6",sm:"h-7",md:"h-8",lg:"h-10",xl:"h-12"},x={xs:"text-mp-label-medium",sm:"text-mp-label-medium",md:"text-mp-label-large",lg:"text-mp-label-large",xl:"text-mp-title-medium"},g={xs:"px-2",sm:"px-3",md:"px-4",lg:"px-5",xl:"px-6"},h={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2",xl:"gap-2.5"},v={xs:"rounded-mp-xs",sm:"rounded-mp-sm",md:"rounded-mp-sm",lg:"rounded-mp-sm",xl:"rounded-mp-md"},y={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface-variant",outlined:"border-mp-outline text-mp-on-surface-variant border bg-transparent",text:"text-mp-on-surface-variant bg-transparent"},j={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border-mp-outline bg-(--_mp-accent-container) text-(--_mp-on-accent-container) border",text:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)"},_={filled:"bg-mp-on-surface/12 text-mp-on-surface/38",tonal:"bg-mp-on-surface/12 text-mp-on-surface/38",elevated:"bg-mp-on-surface/12 text-mp-on-surface/38 shadow-none",outlined:"border-mp-on-surface/12 text-mp-on-surface/38 border bg-transparent",text:"bg-transparent text-mp-on-surface/38"},w=/*@__PURE__*/["ms-0.5 -me-1 inline-flex shrink-0 cursor-pointer items-center justify-center","rounded-mp-full size-[1.35em] opacity-70","transition-opacity duration-(--mp-sys-motion-duration-short4)","hover:opacity-100 focus-visible:opacity-100","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-1","focus-visible:outline-solid outline-none","disabled:cursor-default disabled:opacity-38"].join(" "),k=/*@__PURE__*/["group relative flex min-w-0 flex-1 cursor-pointer items-center justify-center","self-stretch rounded-[inherit] font-[inherit] text-[inherit]","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),N=/*@__PURE__*/["group cursor-pointer appearance-none font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" ");export const MPChip=/*@__PURE__*/o.forwardRef(function({variant:o="outlined",size:$,color:C,startIcon:z,endIcon:B,count:I,onDelete:L,deleteLabel:M,locale:P,selected:D,disabled:F=!1,transition:R,className:S,style:q,children:A,onClick:E,...G},H){const J=s(R),K=f($),O=u(C),Q=l(P),T=c(m,Q),U=Boolean(E)&&!F,V=U&&Boolean(L),W=U&&!L,X=["mp-chip relative inline-flex max-w-full shrink-0 items-center","box-border overflow-hidden align-middle leading-none whitespace-nowrap select-none","transition-[background-color,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)",b[K],x[K],h[K],v[K],F?_[o]:D?j[o]:y[o],V?"ps-0":g[K],L?"pe-2":"",W?N:"",S??""].filter(Boolean).join(" "),Y=t(n,{children:[z,p(A)?e("span",{className:"min-w-0 truncate",children:A}):null,B,p(I)?e("span",{className:["rounded-mp-full ms-0.5 inline-flex shrink-0 items-center justify-center px-1.5 py-px","text-[0.85em] leading-none font-medium tabular-nums","filled"===o?"bg-(--_mp-on-accent)/20 text-(--_mp-on-accent)":"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)"].join(" "),children:I}):null]}),Z={"data-mp-size":K,"data-mp-variant":o,"data-selected":D||void 0,className:`${X}${J.className?` ${J.className}`:""}`,style:{...r(O),...J.style,...q},...G};return W?t("button",{ref:H,type:"button","aria-pressed":D,onClick:E,...Z,children:[e(d,{}),Y]}):t("span",{ref:H,"aria-disabled":!(!F||U)||void 0,...Z,children:[V?t("button",{type:"button","aria-pressed":D,className:`${k} ${h[K]} ${g[K]}`,onClick:E,children:[e(d,{}),Y]}):Y,L?e("button",{type:"button","aria-label":M??T.remove,disabled:F,className:w,onClick:L,children:e(a,{icon:i,size:"1em"})}):null]})});
@@ -0,0 +1,177 @@
1
+ import * as React from 'react';
2
+ import type { MPDensity, MPSize } from '../../types.js';
3
+ export { registerMPLanguage } from '../../internal/highlight.js';
4
+ /**
5
+ * Which palette the block wears.
6
+ *
7
+ * - `auto` — the page's own scheme, light on a light page and dark on a dark
8
+ * one. The default, because that is what every other surface in this library
9
+ * does and a reader who has chosen a scheme has chosen it for the whole page.
10
+ * - `dark` and `light` — pinned, whatever the page is doing. `dark` is what a
11
+ * documentation site usually wants: code has been read on a dark ground since
12
+ * terminals, and the choice is one prop.
13
+ * - `mono` — no hue at all. Structure carried by weight and by how far a run is
14
+ * muted, which is what a block printed on paper, or read by somebody who
15
+ * cannot separate the hues, is left with.
16
+ *
17
+ * The type is open on purpose. A theme is a set of `--mp-code-*` custom
18
+ * properties under a `[data-mp-code-theme]` selector and nothing else, so a
19
+ * consumer who writes one in their own stylesheet has a theme — with nothing to
20
+ * register, nothing to import, and no cost to anybody who did not.
21
+ *
22
+ * No third-party palettes ship here. One Dark, Dracula and the rest are other
23
+ * projects' published work under their own licences, and porting them into this
24
+ * package would be shipping somebody else's design; the open string is how to
25
+ * bring the one you read in all day.
26
+ */
27
+ export type MPCodeBlockTheme = 'auto' | 'dark' | 'light' | 'mono' | (string & {});
28
+ export interface MPCodeBlockProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'prefix' | 'children' | 'onCopy'> {
29
+ /**
30
+ * The code.
31
+ *
32
+ * Trailing whitespace is trimmed off the end of the block: a template literal
33
+ * is almost always written with a newline before its closing backtick, and
34
+ * that newline is a blank line at the bottom of every block. Nothing is
35
+ * trimmed off the front, because indentation is meaningful in half of the
36
+ * languages here.
37
+ */
38
+ code: string;
39
+ /**
40
+ * What it is written in — `ts`, `bash`, `yml`, `dockerfile`. The common
41
+ * spellings and file extensions are understood, so a value copied off a
42
+ * fenced code block works as it stands.
43
+ *
44
+ * A language nothing here knows is drawn plain rather than refused. Teach it
45
+ * one with `registerMPLanguage`.
46
+ */
47
+ language?: string;
48
+ /**
49
+ * The palette.
50
+ * @default 'auto'
51
+ */
52
+ theme?: MPCodeBlockTheme;
53
+ /** The type scale and the air around the code. @default 'md' */
54
+ size?: MPSize;
55
+ /** Tightens that air and nothing else. @default 0 */
56
+ density?: MPDensity;
57
+ /**
58
+ * Colours the code.
59
+ *
60
+ * Off, nothing is fetched at all — the grammar engine is behind a dynamic
61
+ * import, so a block that does not colour itself costs no more than the text
62
+ * in it. On, the block draws plain on the first frame and colours itself when
63
+ * the grammar lands: a few milliseconds, and never a blank space where the
64
+ * code should be.
65
+ * @default true
66
+ */
67
+ highlight?: boolean;
68
+ /**
69
+ * The bar over the code, and the master switch for it. With it off there is
70
+ * no bar, and none of `showLanguage`, `copyable` or `rawToggle` draws
71
+ * anything whatever they say.
72
+ * @default true
73
+ */
74
+ toolbar?: boolean;
75
+ /**
76
+ * A name at the start of the bar, usually a file path. Takes the place the
77
+ * language would otherwise have, and both can be shown at once.
78
+ */
79
+ title?: React.ReactNode;
80
+ /** Names the language at the start of the bar. @default true */
81
+ showLanguage?: boolean;
82
+ /** The button that puts the code on the clipboard. @default true */
83
+ copyable?: boolean;
84
+ /**
85
+ * The toggle that drops the colouring and shows the characters as they are.
86
+ *
87
+ * Off by default: it is a second control on a bar that usually wants one, and
88
+ * it means nothing at all when `highlight` is off.
89
+ * @default false
90
+ */
91
+ rawToggle?: boolean;
92
+ /**
93
+ * Lines to mark: a tinted row with a rule down its leading edge.
94
+ *
95
+ * A number is one line, a string is a list of lines and ranges — `'4'`,
96
+ * `'4-9'`, `'1,4-9,12'` — and an array is any mix of the two. They are
97
+ * counted the way the gutter counts, so with `startLine={286}` a
98
+ * `markLines={288}` marks the line the gutter calls 288.
99
+ */
100
+ markLines?: number | string | Array<number | string>;
101
+ /** Numbers down the side. @default false */
102
+ lineNumbers?: boolean;
103
+ /** What the first line is numbered. @default 1 */
104
+ startLine?: number;
105
+ /**
106
+ * A shell prompt in front of every line that has something on it — `$`, `#`,
107
+ * `>>>`.
108
+ *
109
+ * Drawn but never *present*: the symbol is generated content, so it cannot be
110
+ * selected, cannot be found by find-in-page, and is not what the copy button
111
+ * puts on the clipboard. A transcript stays a transcript and still pastes
112
+ * into a shell.
113
+ */
114
+ prompt?: string;
115
+ /** Wraps long lines instead of scrolling them sideways. @default false */
116
+ wrap?: boolean;
117
+ /**
118
+ * How tall the block may get before the code scrolls inside it. A number is
119
+ * pixels, a string is any CSS length. Left out, the block is as tall as the
120
+ * code.
121
+ */
122
+ maxHeight?: number | string;
123
+ /** The typeface. Defaults to the page's own monospace stack. */
124
+ fontFamily?: string;
125
+ /** Overrides the size the `size` ladder chose. A number is pixels. */
126
+ fontSize?: number | string;
127
+ /** Overrides the leading. A bare number is a ratio, as in CSS. */
128
+ lineHeight?: number | string;
129
+ /**
130
+ * Which language the block's own words are in. Falls back to the nearest
131
+ * `MPLocaleProvider`, then to English.
132
+ */
133
+ locale?: string;
134
+ /** The copy button's label. Defaults to the wording in `locale`. */
135
+ copyLabel?: string;
136
+ /** And what it says once the code is on the clipboard. */
137
+ copiedLabel?: string;
138
+ /** The raw toggle's label. */
139
+ rawLabel?: string;
140
+ /** Fires with the copied text once the clipboard has taken it. */
141
+ onCopy?: (code: string) => void;
142
+ }
143
+ /**
144
+ * A viewer for one line of code or a thousand.
145
+ *
146
+ * ```tsx
147
+ * <MPCodeBlock code={source} language="ts" title="src/index.ts" lineNumbers />
148
+ * ```
149
+ *
150
+ * Everything above the code is optional and off one prop each, because the same
151
+ * component has to be a snippet inside a sentence — no bar, no numbers, no
152
+ * chrome — and the full transcript at the top of a README. Those are the same
153
+ * block with different things turned on rather than two components.
154
+ *
155
+ * ## The colouring arrives separately
156
+ *
157
+ * highlight.js, reached through a dynamic import, which makes it the one thing
158
+ * in this library that is loaded rather than imported. The grammars are forty
159
+ * kilobytes and there are thirty-four of them, so they come as their own chunk,
160
+ * one language at a time, and only for a block that asked to be coloured. The
161
+ * block draws plain on the first frame and colours itself when the chunk lands;
162
+ * there is never a blank space where the code should be.
163
+ *
164
+ * ## It is drawn as lines, always
165
+ *
166
+ * Even with no numbers and no prompt. A line is what carries a number, a prompt
167
+ * and a place in the scroll, and a component that switched between two
168
+ * renderings would have two sets of wrapping behaviour to keep in step.
169
+ *
170
+ * ## The block does not take the page's accent
171
+ *
172
+ * It has a palette of its own, because code is read against a ground chosen for
173
+ * code and the twelve hues it needs are not the four MD3 has. `theme` picks
174
+ * which set fills the slots, and `auto` — the default — is the one that follows
175
+ * the page's light and dark the way every other surface here does.
176
+ */
177
+ export declare const MPCodeBlock: React.ForwardRefExoticComponent<MPCodeBlockProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{MPIcon as n}from"../icon/MPIcon.js";import{CheckIcon as r,CodeIcon as i,CopyIcon as l}from"../../constants/icons.js";import{canonicalLanguage as a,highlightCode as s,plainLines as c}from"../../internal/highlight.js";import{cssLength as m}from"../../internal/length.js";import{useMPLocale as d,useMPMessages as p}from"../../internal/locale.js";import{CODE as u}from"../../internal/messages/code.js";import{META_TEXT as f,hasContent as g}from"../../internal/scale.js";import{VISUALLY_HIDDEN as x}from"../../internal/visually-hidden.js";import{useMPDensity as h,useMPSize as b}from"../../internal/config.js";export{registerMPLanguage}from"../../internal/highlight.js";const y={xs:"text-[0.6875rem]/[1.55]",sm:"text-[0.75rem]/[1.6]",md:"text-[0.8125rem]/[1.65]",lg:"text-[0.875rem]/[1.7]",xl:"text-[1rem]/[1.7]"},v={xs:8,sm:12,md:14,lg:16,xl:20},w={xs:8,sm:12,md:14,lg:16,xl:20},j={xs:4,sm:4,md:6,lg:8,xl:8};function N(e,t,o){return Math.max(o,e+2*t)}export const MPCodeBlock=/*@__PURE__*/o.forwardRef(function({code:k,language:_,theme:M="auto",size:S,density:$,highlight:L=!0,toolbar:T=!0,title:z,showLanguage:C=!0,copyable:F=!0,rawToggle:R=!1,markLines:A,lineNumbers:H=!1,startLine:K=1,prompt:B,wrap:E=!1,maxHeight:P,fontFamily:D,fontSize:I,lineHeight:q,locale:G,copyLabel:J,copiedLabel:O,rawLabel:Q,onCopy:U,className:V,style:W,...X},Y){const Z=b(S),ee=h($),te=p(u,d(G)),oe=o.useMemo(()=>k.replace(/\r\n?/g,"\n").replace(/\s+$/,""),[k]),ne=a(_),[re,ie]=o.useState(!1),[le,ae]=o.useState(null),[se,ce]=o.useState(null),me=L&&!re&&null!==ne;o.useEffect(()=>{if(!me||!ne)return void ce(null);let e=!1;return s(oe,ne).then(t=>{e||ce(t)},()=>{e||ce(null)}),()=>{e=!0}},[oe,ne,me]);const de=o.useMemo(()=>me&&se?se:c(oe),[me,se,oe]),pe=o.useMemo(()=>function(e){const t=new Set;if(void 0===e)return t;for(const o of Array.isArray(e)?e:[e])if("number"!=typeof o)for(const e of o.split(",")){const o=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/.exec(e);if(!o)continue;const n=Number(o[1]),r=void 0===o[2]?n:Number(o[2]);for(let e=Math.min(n,r);e<=Math.max(n,r);e+=1)t.add(e)}else Number.isFinite(o)&&t.add(Math.trunc(o));return t}(A),[A]),ue=o.useRef(void 0);o.useEffect(()=>()=>clearTimeout(ue.current),[]);const fe=o.useRef(null),ge=J??te.copy,xe=O??te.copied,he=Q??te.raw,be=/*@__PURE__*/["mp-code__button inline-flex shrink-0 cursor-pointer items-center gap-1 border-0","rounded-mp-xs bg-transparent px-1.5 py-1","text-(--mp-code-dim) hover:text-(--mp-code-fg) hover:bg-(--mp-code-hover)",f,"transition-[color,background-color] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none","outline-(--mp-code-fg) focus-visible:outline-2 focus-visible:outline-offset-1","focus-visible:outline-solid outline-none"].join(" "),ye=g(z)?"string"==typeof z?z:void 0:ne??te.label,ve=T&&(C||F||R||g(z));return t("div",{ref:Y,"data-mp-size":Z,"data-mp-code-theme":M,"data-mp-code-wrap":E?"true":void 0,className:["mp-code rounded-mp-md flex min-w-0 flex-col overflow-hidden","border-(--mp-code-rule) bg-(--mp-code-bg) text-(--mp-code-fg) border",V??""].filter(Boolean).join(" "),style:{"--mp-code-gutter":`${String(K+Math.max(de.length-1,0)).length}ch`,"--mp-code-pad-x":`${N(w[Z],ee,6)}px`,"--mp-code-pad-y":`${N(v[Z],ee,4)}px`,"--mp-code-bar-pad-y":`${N(j[Z],ee,2)}px`,...D?{fontFamily:D}:null,...void 0===I?null:{fontSize:m(I)},...void 0===q?null:{lineHeight:q},...W},...X,children:[ve?t("div",{className:["mp-code__bar border-(--mp-code-rule) flex min-w-0 items-center gap-1 border-b","px-[calc(var(--mp-code-pad-x)+2px)] py-(--mp-code-bar-pad-y)"].join(" "),children:[g(z)?e("span",{className:`mp-code__title min-w-0 truncate font-mono ${f}`,children:z}):null,C&&ne?e("span",{className:["mp-code__language text-(--mp-code-dim) min-w-0 truncate font-mono","tracking-wide uppercase select-none",f].join(" "),children:ne}):null,e("span",{className:"flex-1"}),R&&L?e("button",{type:"button","aria-pressed":re,"aria-label":he,title:he,onClick:()=>ie(e=>!e),className:[be,re?"bg-(--mp-code-hover) text-(--mp-code-fg)":""].filter(Boolean).join(" "),children:e(n,{icon:i,size:"1.15em"})}):null,F?t("button",{type:"button",onClick:async()=>{const e=await async function(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.append(t),t.select();const o=document.execCommand("copy");return t.remove(),o}catch{return!1}}(oe);clearTimeout(ue.current),ae(e),ue.current=setTimeout(()=>ae(null),2e3),e&&U?.(oe)},className:be,children:[e(n,{icon:le?r:l,size:"1.15em"}),e("span",{children:null===le?ge:le?xe:te.copyFailed})]}):null]}):null,e("div",{className:`mp-code__body flex min-h-0 flex-col ${y[Z]}`,children:e("div",{role:"region","aria-label":ye,tabIndex:0,onKeyDown:e=>{if("a"!==e.key&&"A"!==e.key)return;if(!e.metaKey&&!e.ctrlKey||e.altKey)return;const t=fe.current,o="undefined"==typeof window?null:window.getSelection();if(!t||!o)return;e.preventDefault();const n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n)},className:["mp-code__scroller box-border min-h-0 overflow-auto py-(--mp-code-pad-y)","outline-(--mp-code-fg) focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),style:void 0===P?void 0:{maxHeight:m(P)},children:e("pre",{ref:fe,className:["m-0 bg-transparent p-0 font-mono",E?"w-full":"w-max min-w-full"].join(" "),children:de.map((t,n)=>{const r=K+n;return e("div",{className:"mp-code-line px-(--mp-code-pad-x)","data-line":H?r:void 0,"data-mark":pe.has(r)?"":void 0,"data-prompt":B&&t.length>0?B:void 0,children:e("code",{children:t.map((t,n)=>t.token?e("span",{className:t.token,children:t.text},n):e(o.Fragment,{children:t.text},n))})},n)})})})}),e("span",{"aria-live":"polite",className:x,children:null===le?"":le?xe:te.copyFailed})]})});
@@ -0,0 +1,2 @@
1
+ export { MPCodeBlock, registerMPLanguage } from './MPCodeBlock.js';
2
+ export type { MPCodeBlockProps, MPCodeBlockTheme } from './MPCodeBlock.js';
@@ -0,0 +1 @@
1
+ export{MPCodeBlock,registerMPLanguage}from"./MPCodeBlock.js";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { MPSize, MPVariant } from '../../types.js';
2
+ import type { MPSize, MPElevation, MPVariant } from '../../types.js';
3
3
  export interface MPCollapsibleProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title' | 'onChange'> {
4
4
  /** Whether the panel is showing. Use with `onOpenChange` for a controlled one. */
5
5
  open?: boolean;
@@ -51,6 +51,17 @@ export interface MPCollapsibleProps extends Omit<React.ComponentPropsWithoutRef<
51
51
  * @default 'outlined'
52
52
  */
53
53
  variant?: MPVariant;
54
+ /**
55
+ * How far off the page the sheet is lifted, on MD3's own scale.
56
+ *
57
+ * It moves the **tone** as well as the shadow, because Material pairs the two:
58
+ * a level-2 surface is `surface-container` under a level-2 shadow, and a prop
59
+ * that only cast a shadow would raise this into a surface the specification
60
+ * has no name for. Given a level, `variant` is left holding only its hairline.
61
+ *
62
+ * Left unset, `variant` decides — and `variant="elevated"` is this at `1`.
63
+ */
64
+ elevation?: MPElevation;
54
65
  /**
55
66
  * The room inside, and the type scale of the header and the body.
56
67
  * @default 'md'