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,77 @@
1
+ import * as React from 'react';
2
+ import { type ChartBaseProps } from '../../internal/ChartChrome.js';
3
+ import type { MPChartCategory, MPChartDatum } from '../../types.js';
4
+ /** How the ring is drawn. */
5
+ export type MPPieChartShape = 'pie' | 'donut' | 'semi';
6
+ export interface MPPieChartProps extends ChartBaseProps {
7
+ /**
8
+ * The slices. Numbers, or points carrying their own name and colour.
9
+ *
10
+ * One series and not an array of them, because that is what a pie **is**: the
11
+ * slices are the entities here, so each takes a palette slot of its own and
12
+ * the legend lists them rather than listing series.
13
+ */
14
+ data: readonly MPChartDatum[];
15
+ /** What each slice is called. Points may carry their own `x` instead. */
16
+ categories?: readonly MPChartCategory[];
17
+ /**
18
+ * - `pie` — a filled disc.
19
+ * - `donut` — a ring, with room in the middle for the total.
20
+ * - `semi` — half a ring, opened along the bottom, for a tile wider than it
21
+ * is tall.
22
+ * @default 'pie'
23
+ */
24
+ shape?: MPPieChartShape;
25
+ /**
26
+ * Where the first slice starts, in degrees clockwise from twelve o'clock.
27
+ * Ignored by `semi`, which is defined by where it opens.
28
+ * @default 0
29
+ */
30
+ startAngle?: number;
31
+ /**
32
+ * What goes in the hole. A ring with nothing in the middle is a pie with a
33
+ * bite taken out of it — the total, or the one figure the chart is about, is
34
+ * what the ring was drawn around.
35
+ */
36
+ center?: React.ReactNode;
37
+ /**
38
+ * Writes each slice's **share** on it, where the slice is wide enough to hold
39
+ * the text with room either side. One that does not fit is dropped rather
40
+ * than clipped; the hover panel and the table still have it.
41
+ *
42
+ * The share and not the value, because a share is what a pie is a picture of
43
+ * and the value is one hover away.
44
+ * @default 'none'
45
+ */
46
+ valueLabels?: 'none' | 'all';
47
+ }
48
+ /**
49
+ * Parts of a whole, at a glance.
50
+ *
51
+ * ```tsx
52
+ * <MPPieChart
53
+ * categories={['Search', 'Direct', 'Social']}
54
+ * data={[52, 31, 17]}
55
+ * />
56
+ * ```
57
+ *
58
+ * The narrowest chart here and the easiest one to misuse. An angle is a poor
59
+ * thing to compare: two slices within a few percent of each other are
60
+ * indistinguishable, and nobody can rank six of them by eye. So a pie answers
61
+ * exactly one question — **is one of these most of it?** Anything finer, and
62
+ * anything past about six slices, is [MPBarChart](bar-chart), where the reader
63
+ * is judging length instead.
64
+ *
65
+ * ## What it does with a negative
66
+ *
67
+ * Leaves it out, and says so in the table. A negative has no share of a whole,
68
+ * and every way of drawing one is a lie: as an absolute it claims the opposite
69
+ * of what it means, and as a signed sweep it overlaps the slice beside it.
70
+ *
71
+ * ## Colour follows the slice
72
+ *
73
+ * A slice takes its palette slot from its place in `data`, never from its size.
74
+ * A chart that is refiltered or resorted keeps every category the colour it had
75
+ * — which is the whole reason a legend is worth reading twice.
76
+ */
77
+ export declare function MPPieChart({ data, categories, shape, startAngle, center, valueLabels, height, format, locale: localeProp, label, legend, tooltip, empty, size: sizeProp, className, style, ...rest }: MPPieChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useMPElementSize as n}from"../../hooks/useMPElementSize.js";import{useMPLocale as o,useMPMessages as r}from"../../internal/locale.js";import{useMPSize as a}from"../../internal/config.js";import{CHART as i}from"../../internal/messages/chart.js";import{TABLE as s}from"../../internal/messages/table.js";import{ChartLegend as m,ChartShell as c,ChartTable as u,ChartTooltipPanel as h,useVisibility as d}from"../../internal/ChartChrome.js";import{CHART_FONT_SIZE as f,MARK_GAP as p,PLOT_HEIGHT as v,arcPath as g,categoryAt as y,formatCategory as x,formatStatistic as b,polarPoint as M,seriesColor as j,toValues as w}from"../../internal/chart.js";export function MPPieChart({data:P,categories:k,shape:I="pie",startAngle:N=0,center:z,valueLabels:A="none",height:B,format:C,locale:D,label:L,legend:R,tooltip:S,empty:$,size:_,className:E,style:F,...K}){const O=a(_),U=o(D),W=r(i,U),X=r(s,U),Y=l.useRef(null),q=n(Y),G=l.useId(),H=l.useMemo(()=>w([{data:P}])[0],[P]),J=d(l.useMemo(()=>H.map(()=>({})),[H])),[Q,T]=l.useState(null),V=l.useCallback(e=>b(e,U,C,!0),[C,U]),Z=l.useMemo(()=>H.map((e,t)=>x(y(t,k,[H]),U)),[H,k,U]),ee=l.useMemo(()=>H.map((e,t)=>e.color??j(t,void 0)),[H]),te=H.map((e,t)=>J.visible[t]&&null!==e.value&&e.value>0?e.value:0),le=te.reduce((e,t)=>e+t,0),ne=q.width,oe="number"==typeof B?B:void 0===B?v[O]:q.height,re=f[O],ae="semi"===I,ie=ne/2,se=ae?oe-re-4:oe/2,me=Math.max(0,ae?Math.min(ne/2,oe-re-8)-2:Math.min(ne,oe)/2-2),ce="pie"===I?0:.62*me,ue=ae?Math.PI:2*Math.PI;let he=ae?-Math.PI/2:N*Math.PI/180;const de=te.map(e=>{const t=he;return he+=le>0?e/le*ue:0,{from:t,to:he,share:e}}),fe=e=>{const t=de.map((e,t)=>e.share>0?t:-1).filter(e=>e>=0);if(0===t.length)return;const l=null===Q?e>0?-1:0:t.indexOf(Q);T(t[(l+e+t.length)%t.length])},pe=e=>le>0?new Intl.NumberFormat(U,{style:"percent",maximumFractionDigits:1}).format(e/le):"",ve=null===Q?null:de[Q],ge=ve&&ve.share>0?[{seriesIndex:Q,color:ee[Q],value:ve.share,formatted:`${V(ve.share)} · ${pe(ve.share)}`,label:H[Q]?.label}]:[],ye=ve&&ve.share>0?Z[Q]:void 0,xe=ve?M(ie,se,.75*me,(ve.from+ve.to)/2):null,be=!1===S?{mode:"none"}:!0===S||void 0===S?{}:S,Me=!1===R?{interactive:!1}:!0===R||void 0===R?{}:R,je=!1!==R&&H.length>1,we=le<=0,Pe=[H];return t(c,{...K,size:O,className:["mp-pie-chart",E??""].filter(Boolean).join(" "),style:F,plotRef:Y,name:L??W.label,describedBy:we?void 0:G,interactive:!we,height:B,legendSide:Me.side??"bottom",plotProps:{onPointerMove:we||"none"===be.mode?void 0:e=>T(((e,t)=>{const l=Y.current;if(!l||le<=0)return null;const n=l.getBoundingClientRect(),o=e-n.left-ie,r=t-n.top-se,a=Math.hypot(o,r);if(a>me+8||a<ce)return null;const i=Math.atan2(o,-r),s=de.findIndex(({from:e,to:t,share:l})=>!(l<=0)&&(i-e+4*Math.PI)%(2*Math.PI)<t-e);return-1===s?null:s})(e.clientX,e.clientY)),onPointerLeave:()=>T(null),onKeyDown:we||"none"===be.mode?void 0:e=>{if("ArrowRight"===e.key||"ArrowDown"===e.key)fe(1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)fe(-1);else{if("Escape"!==e.key)return;T(null)}e.preventDefault()},onBlur:()=>T(null)},tooltip:xe&&ge.length>0&&"none"!==be.mode?e(h,{heading:ye,items:ge,x:xe.x,y:xe.y,flip:xe.x>ie,size:O}):null,legend:je?e(m,{names:Z,colors:ee,options:Me,visibility:J,size:O}):null,status:{heading:ye,items:ge},table:we?null:e(u,{id:G,caption:L??W.table,corner:W.category,categories:Z,names:[L??W.table],values:Pe,format:V,locale:U,empty:X.empty}),children:[we?e("div",{className:"text-mp-on-surface-variant text-mp-body-small flex h-full items-center justify-center",children:$??X.empty}):ne>0&&oe>0?e("svg",{width:ne,height:oe,viewBox:`0 0 ${ne} ${oe}`,"aria-hidden":"true",className:"block overflow-visible",children:t("g",{className:"mp-pie-chart__slices",children:[de.map((t,l)=>{if(t.share<=0)return null;return e("path",{d:g(ie,se,Q===l?me+3:me,ce,t.from,t.to),fill:ee[l],stroke:"var(--_mp-color-surface)",strokeWidth:p,strokeLinejoin:"round",opacity:null===J.hovered||J.hovered===l?1:.35},l)}),"all"===A?de.map((t,l)=>{const n=pe(t.share),o=t.to-t.from,r=M(ie,se,ce>0?(me+ce)/2:.68*me,(t.from+t.to)/2),a=o*(ce>0?(me+ce)/2:.68*me);return t.share<=0||a<n.length*re*.6+8?null:e("text",{x:r.x,y:r.y,textAnchor:"middle",dominantBaseline:"central",fill:"var(--_mp-color-on-surface)",fontSize:re,children:n},l)}):null]})}):null,null==z||"pie"===I||we?null:e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:ie-ce,top:se-ce,width:2*ce,height:ae?ce:2*ce},children:z})]})}
@@ -0,0 +1,2 @@
1
+ export { MPPieChart } from './MPPieChart.js';
2
+ export type { MPPieChartProps, MPPieChartShape } from './MPPieChart.js';
@@ -0,0 +1 @@
1
+ export{MPPieChart}from"./MPPieChart.js";
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ export interface MPPortalProps {
3
+ /**
4
+ * Where to render. An element, a ref to one, or nothing for `document.body`.
5
+ *
6
+ * A ref is the useful form for a container this same page renders — it is
7
+ * `null` on the first render, and the portal waits rather than falling back to
8
+ * the body and moving afterwards.
9
+ */
10
+ container?: Element | React.RefObject<Element | null> | null;
11
+ /**
12
+ * Renders in place instead, as though the portal were not there.
13
+ *
14
+ * For the component that is portalled in one context and not in another — a
15
+ * panel that escapes a clipping ancestor on a page and belongs inline in a
16
+ * printed view.
17
+ *
18
+ * It saves the branch and not the state: React sees a portal and an inline
19
+ * subtree as different elements, so changing this **remounts** the children
20
+ * exactly as `{escape ? <MPPortal>{x}</MPPortal> : x}` would. Anything below
21
+ * it loses its state, its scroll position and the focus in it. Decide once,
22
+ * per mount, rather than toggling.
23
+ */
24
+ disabled?: boolean;
25
+ children?: React.ReactNode;
26
+ }
27
+ /**
28
+ * Children rendered somewhere else in the DOM, usually the end of `<body>`.
29
+ *
30
+ * For a subtree that has to escape a clipping or stacking context its own
31
+ * position would trap it in. Both of those are real and neither is obvious from
32
+ * looking at the markup: an `overflow: hidden` anywhere above an element clips
33
+ * it, and a `transform`, a `filter` or an `opacity` below 1 makes a new
34
+ * containing block that a `position: fixed` child is measured against rather
35
+ * than the viewport.
36
+ *
37
+ * ```tsx
38
+ * <MPPortal>
39
+ * <div className="fixed inset-x-0 bottom-0">…</div>
40
+ * </MPPortal>
41
+ * ```
42
+ *
43
+ * ## Most components here do not need it
44
+ *
45
+ * Every popup in this library already portals itself — a select's list, a
46
+ * dialog, a tooltip, a menu, a drawer's panel — because a component whose whole
47
+ * job is to sit over the page cannot leave that to a caller. This is for a
48
+ * caller's **own** overlay, in a page whose structure it does not control.
49
+ *
50
+ * ## Nothing on the first render, and never on a server
51
+ *
52
+ * A portal needs a real DOM node and there is none while the server renders, so
53
+ * this returns `null` there and again on the first client render. That is what
54
+ * keeps hydration honest: markup that appeared in one pass and not the other is
55
+ * exactly the mismatch React warns about, and the alternative — rendering to a
56
+ * placeholder and moving it — is a flash.
57
+ *
58
+ * The practical consequence is that a portal's content is never in the HTML a
59
+ * crawler reads. Anything that has to be indexed does not belong in one.
60
+ *
61
+ * ## It does not trap focus, and does not manage the stack
62
+ *
63
+ * A portal moves an element in the DOM and nothing else. Focus, Escape, an inert
64
+ * background, a scrim and a z-index are the *dialog's* concerns —
65
+ * [MPDialog](./dialog) and [MPDrawer](./drawer) are those, and a hand-built
66
+ * overlay in a portal has none of it. Reach for them before this.
67
+ *
68
+ * ## Events still bubble through React
69
+ *
70
+ * A click inside a portal reaches an `onClick` on the element that rendered it,
71
+ * even though the DOM says the two are unrelated. That is React's own behaviour
72
+ * rather than something added here, and it catches people both ways: a menu
73
+ * inside a portal inside a clickable card still opens the card.
74
+ */
75
+ export declare function MPPortal({ container, disabled, children }: MPPortalProps): React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as r}from"react/jsx-runtime";import*as t from"react";import{createPortal as n}from"react-dom";export function MPPortal({container:e,disabled:o=!1,children:u}){const[c,i]=t.useState(null);return t.useEffect(()=>{i(r=>{const t=function(r){if(!r)return"undefined"==typeof document?null:document.body;return"current"in r?r.current:r}(e);return t===r?r:t})}),o?r(t.Fragment,{children:u}):c?n(u,c):null}
@@ -0,0 +1,2 @@
1
+ export { MPPortal } from './MPPortal.js';
2
+ export type { MPPortalProps } from './MPPortal.js';
@@ -0,0 +1 @@
1
+ export{MPPortal}from"./MPPortal.js";
@@ -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{Radio as i}from"@base-ui/react/radio";import{RadioGroup as n}from"@base-ui/react/radio-group";import{Field as l}from"@base-ui/react/field";import{accentSlots as o}from"../../internal/accent.js";import{MPStateLayer as t}from"../../internal/StateLayer.js";import{MPSupportingText as s}from"../../internal/SupportingText.js";import{META_TEXT as d,PROSE_TEXT as c,hasContent as p}from"../../internal/scale.js";import{useMPColor as m,useMPSize as u}from"../../internal/config.js";const f={xs:{ring:"size-4",fill:"size-2",halo:"size-8"},sm:{ring:"size-[18px]",fill:"size-[9px]",halo:"size-9"},md:{ring:"size-5",fill:"size-2.5",halo:"size-10"},lg:{ring:"size-[22px]",fill:"size-[11px]",halo:"size-11"},xl:{ring:"size-6",fill:"size-3",halo:"size-12"}},g=/*@__PURE__*/r.createContext({size:"md",readOnly:!1,invalid:!1});export const MPRadio=/*@__PURE__*/r.forwardRef(function({value:n,label:o,description:s,disabled:m=!1,id:u,className:x,style:h},b){const y=r.useContext(g),z=f[y.size],j=r.useId(),v=u??j;return e(l.Root,{className:["mp-radio inline-block align-top",x??""].filter(Boolean).join(" "),style:h,disabled:m,"data-mp-value":n,children:a("div",{className:["flex items-start gap-3",c[y.size]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(i.Root,{ref:b,id:v,value:n,disabled:m,className:["mp-radio__dot group relative inline-flex shrink-0 items-center justify-center","box-border rounded-full border-2 p-0","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color] duration-(--mp-sys-motion-duration-short4)",z.ring,m?"border-mp-on-surface/38 cursor-default":[y.readOnly?"cursor-default":"cursor-pointer",y.invalid?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-(--_mp-accent)"].join(" ")].join(" "),children:[m?null:e(t,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",z.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)"].join(" ")}),e(i.Indicator,{className:["rounded-full",z.fill,"transition-[opacity,scale] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:scale-0 data-starting-style:opacity-0","data-ending-style:scale-0 data-ending-style:opacity-0",m?"bg-mp-on-surface/38":"bg-(--_mp-accent)"].join(" ")})]})}),p(o)||p(s)?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(o)?e(l.Label,{htmlFor:v,className:["leading-[1.4]",m?"text-mp-on-surface/38 cursor-default":y.readOnly?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:o}):null,p(s)?e(l.Description,{className:`${d} text-mp-on-surface-variant data-disabled:text-mp-on-surface/38`,children:s}):null]}):null]})})});export const MPRadioGroup=/*@__PURE__*/r.forwardRef(function({value:i,defaultValue:t,onValueChange:c,label:f,description:x,errorMessage:h,orientation:b="vertical",size:y,color:z,required:j=!1,disabled:v=!1,readOnly:N=!1,name:R,children:O,className:k,style:w},M){const _=u(y),C=m(z),V=p(h),I=V?"error":C,P=r.useId(),S=r.useMemo(()=>({size:_,readOnly:N,invalid:V}),[_,N,V]);return e(g.Provider,{value:S,children:a(l.Root,{className:["mp-radio-group flex flex-col gap-2",k??""].filter(Boolean).join(" "),disabled:v,invalid:V,"data-mp-size":_,"data-mp-orientation":b,style:{...o(I),...w},children:[p(f)?a("span",{id:P,className:[d,v?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:[f,j?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(n,{ref:M,"aria-labelledby":p(f)?P:void 0,value:i,defaultValue:t,onValueChange:e=>c?.(String(e??"")),disabled:v,readOnly:N,required:j,name:R,className:["flex","horizontal"===b?"flex-row flex-wrap gap-x-6 gap-y-2":"flex-col gap-2"].join(" "),children:O}),e(s,{description:x,errorMessage:h})]})})});
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Radio as i}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as n}from"@base-ui/react/field";import{accentSlots as o}from"../../internal/accent.js";import{DOT_MOTION as t}from"../../internal/mark.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{MPSupportingText as d}from"../../internal/SupportingText.js";import{META_TEXT as c,PROSE_TEXT as m,hasContent as p}from"../../internal/scale.js";import{useMPColor as u,useMPSize as f}from"../../internal/config.js";const x={xs:{ring:"size-4",fill:"size-2",halo:"size-8"},sm:{ring:"size-[18px]",fill:"size-[10px]",halo:"size-9"},md:{ring:"size-5",fill:"size-2.5",halo:"size-10"},lg:{ring:"size-[22px]",fill:"size-3",halo:"size-11"},xl:{ring:"size-6",fill:"size-3",halo:"size-12"}},h=/*@__PURE__*/a.createContext({size:"md",readOnly:!1,invalid:!1});export const MPRadio=/*@__PURE__*/a.forwardRef(function({value:l,label:o,description:d,disabled:u=!1,id:f,className:g,style:b},z){const j=a.useContext(h),v=x[j.size],y=a.useId(),N=f??y;return e(n.Root,{className:["mp-radio inline-block align-top",g??""].filter(Boolean).join(" "),style:b,disabled:u,"data-mp-value":l,children:r("div",{className:["flex items-start gap-3",m[j.size]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:r(i.Root,{ref:z,id:N,value:l,disabled:u,className:["mp-radio__dot group relative inline-flex shrink-0 items-center justify-center","box-border rounded-full border-2 p-0","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color] duration-(--mp-sys-motion-duration-short4)",v.ring,u?"border-mp-on-surface/38 cursor-default":[j.readOnly?"cursor-default":"cursor-pointer",j.invalid?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-(--_mp-accent)"].join(" ")].join(" "),children:[u?null:e(s,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",v.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)"].join(" ")}),e(i.Indicator,{className:["mp-radio__fill rounded-full",v.fill,t,u?"bg-mp-on-surface/38":"bg-(--_mp-accent)"].join(" ")})]})}),p(o)||p(d)?r("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(o)?e(n.Label,{htmlFor:N,className:["leading-[1.4]",u?"text-mp-on-surface/38 cursor-default":j.readOnly?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:o}):null,p(d)?e(n.Description,{className:`${c} text-mp-on-surface-variant data-disabled:text-mp-on-surface/38`,children:d}):null]}):null]})})});export const MPRadioGroup=/*@__PURE__*/a.forwardRef(function({value:i,defaultValue:t,onValueChange:s,label:m,description:x,errorMessage:g,orientation:b="vertical",size:z,color:j,required:v=!1,disabled:y=!1,readOnly:N=!1,name:R,children:_,className:k,style:O},w){const M=f(z),C=u(j),V=p(g),I=V?"error":C,P=a.useId(),S=a.useMemo(()=>({size:M,readOnly:N,invalid:V}),[M,N,V]);return e(h.Provider,{value:S,children:r(n.Root,{className:["mp-radio-group flex flex-col gap-2",k??""].filter(Boolean).join(" "),disabled:y,invalid:V,"data-mp-size":M,"data-mp-orientation":b,style:{...o(I),...O},children:[p(m)?r("span",{id:P,className:[c,y?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:[m,v?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(l,{ref:w,"aria-labelledby":p(m)?P:void 0,value:i,defaultValue:t,onValueChange:e=>s?.(String(e??"")),disabled:y,readOnly:N,required:v,name:R,className:["flex","horizontal"===b?"flex-row flex-wrap gap-x-6 gap-y-2":"flex-col gap-2"].join(" "),children:_}),e(d,{description:x,errorMessage:g})]})})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{MPIcon as i}from"../icon/MPIcon.js";import{StarIcon as a}from"../../constants/icons.js";import{accentSlots as r}from"../../internal/accent.js";import{fillMessage as o}from"../../internal/i18n.js";import{useMPLocale as s,useMPMessages as l}from"../../internal/locale.js";import{RATING as m}from"../../internal/messages/rating.js";import{VISUALLY_HIDDEN as c}from"../../internal/visually-hidden.js";import{useMPColor as d,useMPSize as u}from"../../internal/config.js";const p={xs:16,sm:20,md:24,lg:30,xl:36},h={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const MPRating=/*@__PURE__*/n.forwardRef(function({value:f,defaultValue:g=0,onValueChange:x,count:v=5,precision:y=1,icon:j,emptyIcon:b,clearable:M=!0,readOnly:N=!1,disabled:P=!1,name:w,required:S=!1,size:R,color:_,locale:z,labels:I,structuredData:k=!1,className:q,style:C,onPointerLeave:L,...V},A){const B=u(R),F=d(_),D=s(z),E=l(m,D,I),O=n.useId(),T=w??O,[G,H]=n.useState(g),J=void 0!==f,K=J?f:G,[Q,U]=n.useState(null),W=Math.max(1,Math.floor(v)),X=y>0&&y<=1?y:1,Y=Math.round(1/X),Z=Math.max(0,Math.min(W,Q??K)),$=e=>e<=0?E.empty:o(E.value,{value:String(e),max:String(W)}),ee=e=>{J||H(e),x?.(e)},te=t=>{const n=e(i,{icon:a,size:p[B],className:t?"[&>svg]:fill-current":""});return(t?j:b)??n},ne=Array.from({length:W},(n,i)=>{const a=Math.max(0,Math.min(1,Z-i));return t("span",{className:["mp-rating__star relative inline-flex shrink-0","rounded-mp-xs",N||P?"":["outline-mp-secondary has-[:focus-visible]:outline-2","has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-solid"].join(" ")].filter(Boolean).join(" "),style:{width:p[B],height:p[B]},children:[e("span",{className:["flex items-center justify-center",P?"text-mp-on-surface/38":"text-mp-outline"].join(" "),style:{width:p[B],height:p[B]},children:te(!1)}),e("span",{"aria-hidden":"true",className:"mp-rating__fill pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*a+"%"},children:e("span",{className:["flex items-center justify-center","transition-colors duration-(--mp-sys-motion-duration-short4)",P?"text-mp-on-surface/38":"text-(--_mp-accent)"].join(" "),style:{width:p[B],height:p[B]},children:te(!0)})}),N?null:Array.from({length:Y},(t,n)=>{const a=Number((i+(n+1)*X).toFixed(4));return e("label",{className:["absolute inset-y-0",P?"":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/Y+"%",width:100/Y+"%"},onPointerEnter:()=>{P||U(a)},children:e("input",{type:"radio",className:c,name:T,value:a,checked:K===a,disabled:P,required:S,"aria-label":$(a),onChange:()=>ee(a),onClick:()=>{M&&K===a&&ee(0)}})},a)})]},i)}),ie=["mp-rating inline-flex items-center align-middle",h[B],q??""].filter(Boolean).join(" "),ae={...r(F),...C};if(N){const i=Math.max(0,Math.min(W,K));return t("div",{ref:A,role:"img","data-mp-size":B,"aria-label":$(i),itemScope:k||void 0,itemType:k?"https://schema.org/Rating":void 0,className:ie,style:ae,onPointerLeave:L,...V,children:[k?t(n.Fragment,{children:[e("meta",{itemProp:"ratingValue",content:String(i)}),e("meta",{itemProp:"bestRating",content:String(W)}),e("meta",{itemProp:"worstRating",content:"0"})]}):null,ne]})}return e("div",{ref:A,role:"radiogroup","data-mp-size":B,"aria-label":E.label,"aria-disabled":P||void 0,"aria-required":S||void 0,className:ie,style:ae,onPointerLeave:e=>{U(null),L?.(e)},...V,children:ne})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{MPIcon as i}from"../icon/MPIcon.js";import{StarIcon as a}from"../../constants/icons.js";import{accentSlots as r}from"../../internal/accent.js";import{fillMessage as o}from"../../internal/i18n.js";import{useMPLocale as s,useMPMessages as l}from"../../internal/locale.js";import{RATING as m}from"../../internal/messages/rating.js";import{VISUALLY_HIDDEN as c}from"../../internal/visually-hidden.js";import{useMPColor as d,useMPSize as u}from"../../internal/config.js";const p={xs:16,sm:20,md:24,lg:30,xl:36},h={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const MPRating=/*@__PURE__*/n.forwardRef(function({value:f,defaultValue:g=0,onValueChange:x,count:y=5,precision:v=1,icon:j,emptyIcon:b,clearable:M=!0,readOnly:N=!1,disabled:w=!1,name:P,required:S=!1,size:R,color:_,locale:z,labels:I,structuredData:k=!1,className:q,style:C,onPointerLeave:L,...V},A){const B=u(R),F=d(_),D=s(z),E=l(m,D,I),O=n.useId(),T=P??O,[G,H]=n.useState(g),J=void 0!==f,K=J?f:G,[Q,U]=n.useState(null),W=Math.max(1,Math.floor(y)),X=v>0&&v<=1?v:1,Y=Math.round(1/X),Z=Math.max(0,Math.min(W,Q??K)),$=e=>e<=0?E.empty:o(E.value,{value:String(e),max:String(W)}),ee=e=>{J||H(e),x?.(e)},te=t=>{const n=e(i,{icon:a,size:p[B],className:t?"[&>svg]:fill-current":""});return(t?j:b)??n},ne=Array.from({length:W},(n,i)=>{const a=Math.max(0,Math.min(1,Z-i));return t("span",{className:["mp-rating__star relative inline-flex shrink-0","rounded-mp-xs",N||w?"":["outline-mp-secondary has-[:focus-visible]:outline-2","has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-solid"].join(" ")].filter(Boolean).join(" "),style:{width:p[B],height:p[B]},children:[e("span",{className:["flex items-center justify-center",w?"text-mp-on-surface/38":"text-mp-outline"].join(" "),style:{width:p[B],height:p[B]},children:te(!1)}),e("span",{"aria-hidden":"true",className:["mp-rating__fill pointer-events-none absolute inset-y-0 start-0 overflow-hidden","transition-[width] duration-(--mp-sys-motion-duration-short2) ease-mp-standard","motion-reduce:transition-none"].join(" "),style:{width:100*a+"%"},children:e("span",{className:["flex items-center justify-center","transition-colors duration-(--mp-sys-motion-duration-short4)",w?"text-mp-on-surface/38":"text-(--_mp-accent)"].join(" "),style:{width:p[B],height:p[B]},children:te(!0)})}),N?null:Array.from({length:Y},(t,n)=>{const a=Number((i+(n+1)*X).toFixed(4));return e("label",{className:["absolute inset-y-0",w?"":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/Y+"%",width:100/Y+"%"},onPointerEnter:()=>{w||U(a)},children:e("input",{type:"radio",className:c,name:T,value:a,checked:K===a,disabled:w,required:S,"aria-label":$(a),onChange:()=>ee(a),onClick:()=>{M&&K===a&&ee(0)}})},a)})]},i)}),ie=["mp-rating inline-flex items-center align-middle",h[B],q??""].filter(Boolean).join(" "),ae={...r(F),...C};if(N){const i=Math.max(0,Math.min(W,K));return t("div",{ref:A,role:"img","data-mp-size":B,"aria-label":$(i),itemScope:k||void 0,itemType:k?"https://schema.org/Rating":void 0,className:ie,style:ae,onPointerLeave:L,...V,children:[k?t(n.Fragment,{children:[e("meta",{itemProp:"ratingValue",content:String(i)}),e("meta",{itemProp:"bestRating",content:String(W)}),e("meta",{itemProp:"worstRating",content:"0"})]}):null,ne]})}return e("div",{ref:A,role:"radiogroup","data-mp-size":B,"aria-label":E.label,"aria-disabled":w||void 0,"aria-required":S||void 0,className:ie,style:ae,onPointerLeave:e=>{U(null),L?.(e)},...V,children:ne})});
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import { type CartesianChartProps } from '../../internal/ChartFrame.js';
3
+ export interface MPScatterChartProps extends CartesianChartProps {
4
+ /**
5
+ * Sizes each mark by its point's `z`, so a third number rides along.
6
+ *
7
+ * The **area** carries it and not the radius — a bubble drawn with its radius
8
+ * proportional to the value shows four times the ink for twice the number,
9
+ * and every reader judges the blob rather than the line across it.
10
+ * @default false
11
+ */
12
+ bubble?: boolean;
13
+ /** How big the largest bubble gets, in pixels. @default 22 */
14
+ maxRadius?: number;
15
+ /**
16
+ * Gives each series a mark of its own shape as well as its own colour.
17
+ *
18
+ * On by default, and it is not decoration. Colour separates **three** series
19
+ * where any two marks can touch, and a scatter is exactly that case — see the
20
+ * note on the component. A shape is the second channel that carries the rest,
21
+ * and it survives greyscale, print and forced colours too.
22
+ * @default true
23
+ */
24
+ shapes?: boolean;
25
+ }
26
+ /**
27
+ * Two measures against each other, one mark per observation.
28
+ *
29
+ * ```tsx
30
+ * <MPScatterChart
31
+ * series={[{ name: 'Runs', data: [{ x: 12, y: 4.2 }, { x: 19, y: 5.1 }] }]}
32
+ * />
33
+ * ```
34
+ *
35
+ * The only chart here with a value axis in **both** directions. Its question is
36
+ * whether two things move together, and its marks are observations rather than
37
+ * a sequence — so there is no order to walk along and nothing to join up.
38
+ *
39
+ * ## Neither axis starts at zero
40
+ *
41
+ * A position encodes a value and claims nothing about proportion, so cropping
42
+ * both scales moves every mark by the same amount and the relationship survives
43
+ * intact. Forcing zero onto two measures that live between 40 and 60 puts the
44
+ * whole picture in one corner, which is the one way to make a scatter say
45
+ * nothing at all.
46
+ *
47
+ * ## Three series is the cap on colour alone
48
+ *
49
+ * The palette's eight slots are separable pair by pair only to the third, and
50
+ * on a scatter **any two marks can sit side by side** — unlike a line or a bar,
51
+ * where only neighbours meet. That is a property of the colour space rather
52
+ * than of this palette, and no ordering of eight does better.
53
+ *
54
+ * So the marks take shapes as well: a circle, a square, a triangle, a diamond
55
+ * and a cross, each scaled to the same area so no series looks heavier than
56
+ * another. Past five series, facet the chart rather than reaching for a sixth
57
+ * shape.
58
+ *
59
+ * ## The grid runs both ways here and nowhere else
60
+ *
61
+ * A grid in both directions is graph paper, and on a chart of columns the
62
+ * vertical rules would be doing the job the crosshair already does. Here there
63
+ * is no column to be in and reading a mark's x off the picture is half of what
64
+ * the reader came for, so graph paper is exactly the point.
65
+ */
66
+ export declare function MPScatterChart({ bubble, maxRadius, shapes, ...frame }: MPScatterChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as r}from"react/jsx-runtime";import{CartesianFrame as e}from"../../internal/ChartFrame.js";import{MARKER_RADIUS as s,MARK_SHAPES as a,bubbleRadius as t,markPath as c,pointX as i}from"../../internal/chart.js";export function MPScatterChart({bubble:o=!1,maxRadius:l=22,shapes:n=!0,...u}){const h=r=>n?a[r%a.length]:"circle";return r(e,{...u,xScale:"value",includeZero:!1,markRadius:20,markInset:o?l+2:s.xl+2,marks:({values:r,visible:e,valuePx:a,categoryValuePx:c,categories:n,size:u})=>{const h=s[u],m=o?r.reduce((r,s,a)=>e[a]?s.reduce((r,e)=>Math.max(r,e.z??0),r):r,0):0;return r.flatMap((r,s)=>e[s]?r.flatMap((r,e)=>{const u=i(r,e,n);if(null===r.value||null===u)return[];const d=o?t(r.z??0,m,l,h):h+1;return[{series:s,index:e,x:c(u),y:a(r.value),r:d}]}):[])},swatch:(e,s)=>r("svg",{width:10,height:10,viewBox:"0 0 10 10","aria-hidden":"true",className:"block",children:r("path",{d:c(h(e),5,5,4),fill:"cross"===h(e)?"none":s,stroke:s,strokeWidth:"cross"===h(e)?1.5:0})}),children:({marks:e,colors:s,activeMark:a,hovered:t})=>r("g",{className:"mp-scatter-chart__marks",children:e.map((e,i)=>{const o=h(e.series),l=a===e,n=null!==t&&t!==e.series;return r("path",{d:c(o,e.x,e.y,l?e.r+1.5:e.r),fill:"cross"===o?"none":s[e.series],stroke:"cross"===o?s[e.series]:"var(--_mp-color-surface)",strokeWidth:"cross"===o?2:1.5,strokeLinecap:"round",opacity:n?.15:l?1:.85},i)})})})}
@@ -0,0 +1,2 @@
1
+ export { MPScatterChart } from './MPScatterChart.js';
2
+ export type { MPScatterChartProps } from './MPScatterChart.js';
@@ -0,0 +1 @@
1
+ export{MPScatterChart}from"./MPScatterChart.js";
@@ -0,0 +1,82 @@
1
+ import * as React from 'react';
2
+ import type { MPOrientation, MPSize } from '../../types.js';
3
+ /** Which way the content is allowed to scroll. */
4
+ export type MPScrollAxis = MPOrientation | 'both';
5
+ export interface MPScrollAreaProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
6
+ /**
7
+ * The scrollbar's thickness.
8
+ * @default 'md'
9
+ */
10
+ size?: MPSize;
11
+ /**
12
+ * Which way the content may scroll.
13
+ *
14
+ * `vertical` is the common case and the default. `both` is for content with a
15
+ * width of its own — a wide table, a diagram — where neither axis should be
16
+ * the one that wraps.
17
+ * @default 'vertical'
18
+ */
19
+ axis?: MPScrollAxis;
20
+ /**
21
+ * How tall the box is allowed to get before it starts scrolling. A number is
22
+ * pixels, a string is any CSS length.
23
+ *
24
+ * Something has to bound the box or there is nothing to scroll: a scroll area
25
+ * whose height is its content's height never overflows. This is the usual way
26
+ * to say that, and a `className` with a `max-h-*` or a flex parent that
27
+ * constrains it are the others.
28
+ */
29
+ maxHeight?: number | string;
30
+ /** A fixed height, for the box that should be its size whatever is in it. */
31
+ height?: number | string;
32
+ /**
33
+ * Keeps the scrollbar drawn instead of fading it out when the pointer leaves.
34
+ *
35
+ * Off, it behaves the way an overlay scrollbar does — visible while scrolling
36
+ * or hovered, gone otherwise. On is right for a panel whose scrollability is
37
+ * not obvious from its content, where a bar that appears only on hover is a
38
+ * bar a reader has to discover.
39
+ * @default false
40
+ */
41
+ persistent?: boolean;
42
+ children?: React.ReactNode;
43
+ }
44
+ /**
45
+ * A box with a scrollbar of its own.
46
+ *
47
+ * The browser's is drawn by the operating system: a different width on every
48
+ * machine, a different colour from the sheet it is cut into, and on Windows a
49
+ * 17px band of grey that no design accounts for. This one is an element, so it
50
+ * is the same everywhere and made of the library's own tokens.
51
+ *
52
+ * ```tsx
53
+ * <MPScrollArea maxHeight={320}>
54
+ * <MPList>…</MPList>
55
+ * </MPScrollArea>
56
+ * ```
57
+ *
58
+ * ## Something has to bound the box
59
+ *
60
+ * A scroll area whose height is its content's height never overflows and never
61
+ * shows a bar. `maxHeight` is the usual way to say what bounds it; a `className`
62
+ * carrying a `max-h-*`, or a flex parent that constrains it, are the others.
63
+ *
64
+ * ## The scrollbar overlays the content
65
+ *
66
+ * It takes no room in the layout, which is what makes it swappable for the
67
+ * browser's own on a page that has already been designed: adding one does not
68
+ * reflow anything. The trade is that content can pass underneath it, so a box
69
+ * whose content reaches the edge wants a little inline padding of its own.
70
+ *
71
+ * ## It is still a real scroll container
72
+ *
73
+ * The wheel, the trackpad, a touch drag, Page Up, Home and End, and a keyboard
74
+ * focus moving into something below the fold all work, because the viewport
75
+ * underneath is an ordinary `overflow: auto` element. This replaces how the bar
76
+ * is *drawn* and nothing about how scrolling behaves — including the browser's
77
+ * own scroll anchoring and its overscroll handling.
78
+ *
79
+ * The native bar is hidden rather than the scrolling being reimplemented, which
80
+ * is the difference between this and a library that listens for `wheel` events.
81
+ */
82
+ export declare const MPScrollArea: React.ForwardRefExoticComponent<MPScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as o from"react";import{ScrollArea as t}from"@base-ui/react/scroll-area";import{cssLength as a}from"../../internal/length.js";import{useMPSize as i}from"../../internal/config.js";const n={xs:"w-1.5",sm:"w-2",md:"w-2.5",lg:"w-3",xl:"w-3.5"},s={xs:"h-1.5",sm:"h-2",md:"h-2.5",lg:"h-3",xl:"h-3.5"};export const MPScrollArea=/*@__PURE__*/o.forwardRef(function({size:o,axis:n="vertical",maxHeight:s,height:c,persistent:m=!1,className:p,style:h,children:u,...f},d){const g=i(o),x="horizontal"!==n,v="vertical"!==n;return e(t.Root,{ref:d,"data-mp-size":g,className:["mp-scroll-area relative overflow-hidden",p??""].filter(Boolean).join(" "),style:h,...f,children:[r(t.Viewport,{className:"mp-scroll-area__viewport size-full overscroll-contain",style:{maxHeight:a(s),height:a(c)},children:r(t.Content,{className:"mp-scroll-area__content",children:u})}),x?r(l,{orientation:"vertical",size:g,persistent:m}):null,v?r(l,{orientation:"horizontal",size:g,persistent:m}):null,x&&v?r(t.Corner,{className:"mp-scroll-area__corner bg-mp-surface-container"}):null]})});function l({orientation:e,size:o,persistent:a}){return r(t.Scrollbar,{orientation:e,className:["mp-scroll-area__bar flex touch-none select-none p-0.5","vertical"===e?n[o]:s[o],"transition-opacity duration-(--mp-sys-motion-duration-short4)",a?"opacity-100":"opacity-0 data-hovering:opacity-100 data-scrolling:opacity-100"].join(" "),children:r(t.Thumb,{className:["mp-scroll-area__thumb rounded-mp-full flex-1","bg-mp-on-surface/38 hover:bg-mp-on-surface/56 active:bg-mp-on-surface/56","transition-[background-color] duration-(--mp-sys-motion-duration-short4)"].join(" ")})})}
@@ -0,0 +1,2 @@
1
+ export { MPScrollArea } from './MPScrollArea.js';
2
+ export type { MPScrollAreaProps, MPScrollAxis } from './MPScrollArea.js';
@@ -0,0 +1 @@
1
+ export{MPScrollArea}from"./MPScrollArea.js";
@@ -0,0 +1,165 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPOrientation, MPSize, MPVariant } from '../../types.js';
3
+ /**
4
+ * When the two scroll buttons are drawn.
5
+ *
6
+ * - `auto` — neither while everything fits, and at an end whichever costs less.
7
+ * An `overlay` button with nowhere to go is removed, an `inline` one is drawn
8
+ * `disabled`. The default.
9
+ * - `always` — both, from the first paint, `disabled` rather than gone at an
10
+ * end. What a strip whose content arrives from a fetch wants, so the buttons
11
+ * are not appearing under the pointer half a second in.
12
+ * - `none` — none at all. The wheel, a finger, a drag and the arrow keys are
13
+ * all still there; this is the strip that scrolls the way a phone scrolls.
14
+ */
15
+ export type MPScrollZoneButtons = 'auto' | 'always' | 'none';
16
+ /**
17
+ * Where those buttons sit, which is also where the strip ends.
18
+ *
19
+ * - `inline` — beside the strip, in the layout. The default. The scroller stops
20
+ * where the button starts, so an item is cut off at the button's edge rather
21
+ * than sliding under it: nothing is ever half-hidden behind a control.
22
+ * - `overlay` — over the ends of the strip, which keeps every pixel of the box
23
+ * for content. What a shelf of pictures wants, where the thing under the
24
+ * button is a picture that carries on.
25
+ *
26
+ * The lane an `inline` button sits in is held open even while that button has
27
+ * nowhere to go, or the strip would resize under the pointer each time it
28
+ * reached an end. That is also what decides what `buttons="auto"` does there:
29
+ * the lane is paid for either way, so an inline button stays and goes
30
+ * `disabled`, while an overlay one — whose absence is free — is removed.
31
+ */
32
+ export type MPScrollZoneButtonPlacement = 'inline' | 'overlay';
33
+ /**
34
+ * What pressing one does.
35
+ *
36
+ * - `item` — moves to the next child along, `step` of them at a time. The
37
+ * default, and the only one that lands on something rather than between two
38
+ * things.
39
+ * - `page` — moves by everything currently in view, the way Page Down does.
40
+ * - `hold` — travels for as long as the button is held, at `speed` pixels a
41
+ * second. A press too short to be a hold moves one item instead, so the
42
+ * button is never dead to a quick tap.
43
+ */
44
+ export type MPScrollZoneMode = 'item' | 'page' | 'hold';
45
+ export interface MPScrollZoneProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
46
+ /**
47
+ * Which way the children run, and so which way the zone scrolls.
48
+ * @default 'horizontal'
49
+ */
50
+ orientation?: MPOrientation;
51
+ /**
52
+ * How many rows a horizontal zone lays its children out in before it starts a
53
+ * new column, and how many columns a vertical one uses. `2` is the shelf that
54
+ * holds twice as much in the same width.
55
+ * @default 1
56
+ */
57
+ lines?: number;
58
+ /**
59
+ * The space between children. A number is pixels, a string is any CSS length.
60
+ * @default 8
61
+ */
62
+ gap?: number | string;
63
+ /** When the scroll buttons are drawn. @default 'auto' */
64
+ buttons?: MPScrollZoneButtons;
65
+ /**
66
+ * Whether they sit beside the strip or over it.
67
+ * @default 'inline'
68
+ */
69
+ buttonPlacement?: MPScrollZoneButtonPlacement;
70
+ /** What pressing one does. @default 'item' */
71
+ mode?: MPScrollZoneMode;
72
+ /** How many children one press moves, in `item` mode. @default 1 */
73
+ step?: number;
74
+ /** How fast a held button travels, in pixels a second. @default 900 */
75
+ speed?: number;
76
+ /**
77
+ * Snaps the nearest child to the leading edge when the scrolling stops. The
78
+ * wheel and a drag included, not only the buttons.
79
+ * @default false
80
+ */
81
+ snap?: boolean;
82
+ /**
83
+ * Lets a mouse or a pen drag the strip along, the way a finger already can.
84
+ *
85
+ * Touch is left to the browser, whose own scrolling beats anything a handler
86
+ * can imitate: momentum, rubber-banding and the scrollbar all come with it.
87
+ * @default true
88
+ */
89
+ drag?: boolean;
90
+ /**
91
+ * Turns a wheel rolled over the strip into travel along it — the one axis a
92
+ * mouse has, on a strip that does not run along it.
93
+ *
94
+ * Off by default, because a wheel taken from the page is the page's: a reader
95
+ * who meant to scroll past the shelf is held by it instead. What it does take
96
+ * it gives back at the ends, so a strip with nothing left ahead of it is
97
+ * something to scroll past rather than something to be caught in. A trackpad
98
+ * swiping sideways is left alone, and a vertical zone ignores the prop —
99
+ * there the wheel already points the way the strip runs.
100
+ * @default false
101
+ */
102
+ wheel?: boolean;
103
+ /** Shows the browser's own scrollbar under the strip. @default false */
104
+ scrollbar?: boolean;
105
+ /**
106
+ * How the scroll buttons are drawn.
107
+ * @default 'filled'
108
+ */
109
+ variant?: MPVariant;
110
+ /**
111
+ * The size of those buttons, and how far they sit from the strip. Not the
112
+ * size of a child, which is whatever the caller made it.
113
+ * @default 'md'
114
+ */
115
+ size?: MPSize;
116
+ /** Which accent family they read. @default 'primary' */
117
+ color?: MPColor;
118
+ /** What the strip is called: "Categories", "Recent files". */
119
+ label?: string;
120
+ /** Defaults to the wording in `locale`. */
121
+ previousLabel?: string;
122
+ /** The same. */
123
+ nextLabel?: string;
124
+ /**
125
+ * Which language the buttons name themselves in. Falls back to the nearest
126
+ * `MPLocaleProvider`, then to English.
127
+ */
128
+ locale?: string;
129
+ /** The strip. Every top-level child is one item of it. */
130
+ children?: React.ReactNode;
131
+ }
132
+ /**
133
+ * A strip of anything, laid out in one direction and scrolled in it.
134
+ *
135
+ * The mechanism is an ordinary scroll container, and everything the component
136
+ * offers is a way of driving one. Swiping on a phone, two-finger dragging on a
137
+ * trackpad, the arrow keys and the scrollbar are the browser's own and are never
138
+ * intercepted. What is added on top is a pair of buttons for the pointer that
139
+ * has neither a wheel nor a finger, a mouse drag for the strip that reads as
140
+ * something to pull, and — only where it is asked for — the wheel turned onto
141
+ * the axis the strip runs along.
142
+ *
143
+ * ```tsx
144
+ * <MPScrollZone label="Categories">
145
+ * <MPChip>Coffee</MPChip>
146
+ * <MPChip>Tea</MPChip>
147
+ * </MPScrollZone>
148
+ * ```
149
+ *
150
+ * ## Nothing is transformed
151
+ *
152
+ * A translated track would have to argue for an exception to the rule the rest
153
+ * of the library keeps; a scroll offset does not. It is also what makes the
154
+ * strip run the other way under RTL without being told, keeps the scrollbar
155
+ * honest, and lets the browser scroll a focused child into view on its own.
156
+ *
157
+ * ## What separates it from `MPCarousel`
158
+ *
159
+ * `lines`, and what it implies. A carousel is one thing at a time and knows
160
+ * which one — it has a `value`, an index, and a row of marks saying where the
161
+ * reader is. A scroll zone has none of those, because it is a shelf that
162
+ * happens to be longer than the room it is in: there is no current item to
163
+ * report, and two rows of thumbnails is a shape a carousel cannot hold.
164
+ */
165
+ export declare const MPScrollZone: React.ForwardRefExoticComponent<MPScrollZoneProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{MPIconButton as r}from"../icon-button/MPIconButton.js";import{MPIcon as o}from"../icon/MPIcon.js";import{ChevronLeftIcon as i,ChevronRightIcon as l,ChevronDownIcon as s}from"../../constants/icons.js";import{accentSlots as a}from"../../internal/accent.js";import{cssLength as c}from"../../internal/length.js";import{useMPLocale as u,useMPMessages as d}from"../../internal/locale.js";import{SCROLL as m}from"../../internal/messages/scroll.js";import{CONTROL_ICON as f}from"../../internal/scale.js";import{useMPColor as p,useMPSize as b}from"../../internal/config.js";const v={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},w={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const MPScrollZone=/*@__PURE__*/n.forwardRef(function({orientation:h="horizontal",lines:g=1,gap:y=8,buttons:x="auto",buttonPlacement:k="inline",mode:L="item",step:E=1,speed:j=900,snap:M=!1,drag:C=!0,wheel:P=!1,scrollbar:z=!1,variant:R="filled",size:N,color:T,label:A,previousLabel:B,nextLabel:D,locale:W,className:S,style:F,children:I,...Y},_){const H=b(N),X=p(T),q=d(m,u(W)),K="horizontal"===h,O=Math.max(1,Math.round(g)),$=Math.max(1,Math.round(E)),V="inline"===k,Z=n.useRef(null),G=n.useRef(null),[J,Q]=n.useState({back:!1,forward:!1}),U=n.useCallback(()=>{const e=Z.current;if(!e)return;const t=K?e.clientWidth:e.clientHeight,n=K?e.scrollWidth:e.scrollHeight,r=Math.abs(K?e.scrollLeft:e.scrollTop);Q(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[K]);n.useEffect(()=>{const e=Z.current,t=G.current;if(U(),!e||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(U);return n.observe(e),t&&n.observe(t),()=>n.disconnect()},[U]);const ee=n.useCallback(()=>{const e=Z.current;return e&&K&&"rtl"===getComputedStyle(e).direction?-1:1},[K]),te=n.useCallback((e,t)=>{const n=Z.current;if(!n)return;const r=t?"undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth":"auto";n.scrollBy(K?{left:e,behavior:r}:{top:e,behavior:r})},[K]),ne=n.useCallback(()=>{const e=Z.current,t=G.current;if(!e||!t)return[];const n=K&&"rtl"===getComputedStyle(e).direction,r=K?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],l=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);l.includes(t)||l.push(t)}return l.sort((e,t)=>e-t)},[K]),re=n.useCallback((e,t=L)=>{const n=Z.current;if(!n)return;const r=ee(),o=K?n.clientWidth:n.clientHeight;if("page"===t)return void te(o*(e?1:-1)*r,!0);const i=ne(),l=i.filter(e=>e>1),s=i.filter(e=>e<-1),a=e?l[$-1]:s[s.length-$];te(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[ee,K,ne,$,L,te]),oe=n.useRef(null);n.useEffect(()=>()=>oe.current?.(),[]);const ie=n.useCallback((e,t)=>{if(oe.current)return;const n=ee(),r=performance.now();let o=r,i=0;const l=t=>{const r=t-o;o=t,te(j*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(l)};i=requestAnimationFrame(l);const s=()=>{cancelAnimationFrame(i),oe.current=null,window.removeEventListener(t,s),window.removeEventListener("pointercancel",s),window.removeEventListener("blur",s),performance.now()-r<140&&re(e,"item")};oe.current=s,window.addEventListener(t,s),window.addEventListener("pointercancel",s),window.addEventListener("blur",s)},[re,ee,te,j]),le=n.useRef(null);function se(e){return"hold"!==L?{onClick:()=>re(e)}:{onPointerDown:t=>{0===t.button&&ie(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ie(e,"keyup"))}}}n.useEffect(()=>()=>le.current?.(),[]),n.useEffect(()=>{const e=Z.current;if(!e||!P||!K)return;const t=t=>{if(t.ctrlKey||Math.abs(t.deltaX)>Math.abs(t.deltaY))return;const n=1===t.deltaMode?16:2===t.deltaMode?e.clientWidth:1,r=t.deltaY*n;if(!r)return;const o=Math.abs(e.scrollLeft);(r>0?e.scrollWidth-e.clientWidth-o>1:o>1)&&(t.preventDefault(),te(r*ee(),!1))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[ee,K,te,P]);const ae="none"!==x&&("always"===x||J.back||J.forward);function ce(t){const n=t?J.forward:J.back;if("auto"===x&&!n&&!V)return e("span",{});const a=e(r,{variant:R,size:H,color:X,label:t?D??q.next:B??q.previous,disabled:!n,className:"pointer-events-auto",icon:e(o,{icon:K?t?l:i:s,size:f[H],className:K?"rtl:rotate-180":t?"":"rotate-180"}),...se(t)});return V?e("span",{className:"flex shrink-0 items-center justify-center",children:a}):a}return t("div",{ref:_,"data-mp-size":H,"data-mp-variant":R,className:["mp-scroll-zone relative flex min-w-0",V&&K?"flex-row items-stretch":"flex-col",V?w[H]:"",S??""].filter(Boolean).join(" "),style:{...a(X),...F},...Y,children:[ae&&V?ce(!1):null,e("div",{ref:Z,tabIndex:0,role:"group","aria-label":A??q.label,className:["mp-scroll-zone__scroller","min-h-0 min-w-0 grow",K?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden",M?K?"snap-x snap-mandatory":"snap-y snap-mandatory":"",z?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",C&&(J.back||J.forward)?"cursor-grab data-dragging:cursor-grabbing":"","outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].filter(Boolean).join(" "),onScroll:U,onPointerDown:function(e){if(!C||"touch"===e.pointerType||0!==e.button)return;le.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,i=t.scrollTop;let l=!1;const s=document.body.style.getPropertyValue("-webkit-user-select"),a=e=>{const s=e.clientX-n,a=e.clientY-r;if(!l){if(Math.abs(K?s:a)<4)return;l=!0;try{t.setPointerCapture(e.pointerId)}catch{}t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none")}K?t.scrollLeft=o-s:t.scrollTop=i-a},c=()=>{le.current=null,t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,s?document.body.style.setProperty("-webkit-user-select",s):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=l;if(c(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};le.current=c,t.addEventListener("pointermove",a),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:G,className:["mp-scroll-zone__track",M?"[&>*]:snap-start":""].filter(Boolean).join(" "),style:{display:"grid",gap:c(y),gridAutoFlow:K?"column":"row",...K?{width:"max-content",gridTemplateRows:`repeat(${O}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${O}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:I})}),ae&&V?ce(!0):null,ae&&!V?t("div",{className:["pointer-events-none absolute inset-0 flex justify-between",K?"items-center":"flex-col items-center",v[H]].join(" "),children:[ce(!1),ce(!0)]}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPScrollZone } from './MPScrollZone.js';
2
+ export type { MPScrollZoneButtonPlacement, MPScrollZoneButtons, MPScrollZoneMode, MPScrollZoneProps } from './MPScrollZone.js';
@@ -0,0 +1 @@
1
+ export{MPScrollZone}from"./MPScrollZone.js";