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,55 @@
1
+ import * as React from 'react';
2
+ /** What an element measures, in CSS pixels. */
3
+ export interface MPElementSize {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ /**
8
+ * How big an element is, kept up to date as it changes.
9
+ *
10
+ * The library measures elements in five places — a tab bar deciding whether it
11
+ * overflows, a field sizing its outline's notch, panes tracking a drag — and an
12
+ * application that wants the same answer had to write the `ResizeObserver`
13
+ * out again, including the two parts of it that are easy to get wrong.
14
+ *
15
+ * ```tsx
16
+ * const ref = React.useRef<HTMLDivElement>(null);
17
+ * const { width } = useMPElementSize(ref);
18
+ *
19
+ * <div ref={ref}>{width > 480 ? <Chart /> : <Figure />}</div>;
20
+ * ```
21
+ *
22
+ * This is the answer for **a component's own width**, which is what a container
23
+ * query asks and a media query cannot: a card in a sidebar and the same card in
24
+ * a main column are the same window and two different widths.
25
+ * [useMPMediaQuery](#usempmediaquery) is the other question.
26
+ *
27
+ * ## Zero until it has measured
28
+ *
29
+ * The first render has no element yet — a ref is filled in during the commit —
30
+ * so the first answer is `{ width: 0, height: 0 }` and the real one arrives on
31
+ * the render after it. Branch on a threshold rather than on the number itself,
32
+ * or a chart will mount, be told it is zero wide, and mount again.
33
+ *
34
+ * ## The two parts that are easy to get wrong
35
+ *
36
+ * It reads `getBoundingClientRect`, not the observer entry's `contentRect`.
37
+ * Those differ by the padding and the border — `contentRect` is the content box
38
+ * — and a caller comparing a measurement against a breakpoint means the box the
39
+ * element actually occupies.
40
+ *
41
+ * And it re-renders only when a number changes. A `ResizeObserver` fires for a
42
+ * subpixel reflow that rounds to the same integer, and a hook that set state on
43
+ * every callback would re-render a chart on every scroll of a page with a
44
+ * sticky header.
45
+ *
46
+ * ## Where there is no observer
47
+ *
48
+ * A browser without `ResizeObserver` measures once on mount and stays there,
49
+ * which is right more often than it is wrong: an element that never resizes is
50
+ * the common case, and the alternative is a `resize` listener that misses every
51
+ * change the window did not cause.
52
+ *
53
+ * @param ref a ref to the element to measure.
54
+ */
55
+ export declare function useMPElementSize(ref: React.RefObject<Element | null>): MPElementSize;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";export function useMPElementSize(t){const[n,i]=e.useState({width:0,height:0});return e.useEffect(()=>{const e=t.current;if(!e)return;const n=()=>{const t=e.getBoundingClientRect(),n={width:Math.round(t.width),height:Math.round(t.height)};i(e=>e.width===n.width&&e.height===n.height?e:n)};if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t]),n}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Whether a media query matches, and it re-renders when that changes.
3
+ *
4
+ * The general form of what this library already does four times over for the
5
+ * window size classes, and once each for `prefers-reduced-motion` and the
6
+ * colour scheme. A page has questions of its own — is this a coarse pointer, is
7
+ * the window tall enough for a two-row bar, is the reader in a high-contrast
8
+ * mode — and had to write the subscription out again to ask one.
9
+ *
10
+ * ```tsx
11
+ * const coarse = useMPMediaQuery('(pointer: coarse)');
12
+ *
13
+ * <MPTooltip disabled={coarse}>…</MPTooltip>;
14
+ * ```
15
+ *
16
+ * ## Reach for `useMPWindowClass` for a width
17
+ *
18
+ * A width query written here is a copy of a number the library also holds, and
19
+ * the two drift the moment an `MPConfigProvider` moves a boundary. Ask
20
+ * [useMPWindowClass](#usempwindowclass) instead — it reads the same ladder the
21
+ * grid and the sidebar do.
22
+ *
23
+ * ## On a server, and before hydration
24
+ *
25
+ * `onServer`, which defaults to `false`. There is no window to ask, and a
26
+ * default of "matches" would mean every server-rendered page claiming every
27
+ * preference at once.
28
+ *
29
+ * `useSyncExternalStore` is what makes the correction on hydration legitimate
30
+ * rather than a mismatch React warns about — but it is a second render, so
31
+ * anything that swaps a whole layout on this does so visibly on a first load.
32
+ * Where that matters the answer is CSS, which has no first render to be wrong.
33
+ *
34
+ * A browser without `matchMedia` gets the same `onServer` answer, for the same
35
+ * reason: there is no way to ask, and a guess is worse than the caller's own.
36
+ *
37
+ * @param query any CSS media query, without the `@media`.
38
+ * @param onServer what to answer where there is nothing to ask. @default false
39
+ */
40
+ export declare function useMPMediaQuery(query: string, onServer?: boolean): boolean;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";export function useMPMediaQuery(t,a=!1){const r=e.useMemo(()=>function(e){if("undefined"==typeof window||!window.matchMedia)return null;let t=n.get(e);t||(t=window.matchMedia(e),n.set(e,t));return t}(t),[t]),c=e.useCallback(e=>r?(r.addEventListener("change",e),()=>r.removeEventListener("change",e)):()=>{},[r]),o=e.useCallback(()=>r?r.matches:a,[r,a]),u=e.useCallback(()=>a,[a]);return e.useSyncExternalStore(c,o,u)}const n=new Map;
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ /** What to watch for. */
3
+ export interface MPOnScreenOptions {
4
+ /**
5
+ * How much of the element has to be showing before it counts, from `0` to `1`.
6
+ *
7
+ * The same default the `MPAnimate*` components take, so a page's own answer
8
+ * and the library's arrive at the same scroll position.
9
+ * @default 0.2
10
+ */
11
+ threshold?: number;
12
+ /**
13
+ * Whether it stops watching the first time. Off, it reports every entrance and
14
+ * every exit.
15
+ * @default true
16
+ */
17
+ once?: boolean;
18
+ /**
19
+ * A CSS `margin`-shaped string that grows or shrinks the region the element is
20
+ * tested against — `'200px 0px'` reports something 200px before it arrives.
21
+ * For loading a picture, or starting a request, ahead of the reader.
22
+ */
23
+ rootMargin?: string;
24
+ }
25
+ /**
26
+ * Whether an element is on screen.
27
+ *
28
+ * The `MPAnimate*` components already ask this — `trigger="visible"` is exactly
29
+ * it — and an application asks it for other reasons: loading an image, starting
30
+ * a request, marking a section read, pausing something expensive that has
31
+ * scrolled away.
32
+ *
33
+ * ```tsx
34
+ * const ref = React.useRef<HTMLDivElement>(null);
35
+ * const seen = useMPOnScreen(ref);
36
+ *
37
+ * <div ref={ref}>{seen ? <Chart data={data} /> : <MPSkeleton height={240} />}</div>;
38
+ * ```
39
+ *
40
+ * ## `once` is on, and that is the common case
41
+ *
42
+ * Most reasons to ask are one-way: something loads, or is marked read, and does
43
+ * not unload when it scrolls off. Turn it off for the ones that are not — a
44
+ * video that should pause, a poll that should stop.
45
+ *
46
+ * ## Where there is no observer
47
+ *
48
+ * `true`. A browser with no `IntersectionObserver` has no way to be asked, and
49
+ * showing content is the answer that fails safe: the alternative is a page
50
+ * whose every deferred section stays a skeleton forever.
51
+ *
52
+ * The same is true before the ref is filled in, which is why this starts at
53
+ * `false` and not at `true` — on the first render there is no element yet, and
54
+ * an element that has not been observed is not the same as one that cannot be.
55
+ *
56
+ * @param ref a ref to the element to watch.
57
+ */
58
+ export declare function useMPOnScreen(ref: React.RefObject<Element | null>, { threshold, once, rootMargin }?: MPOnScreenOptions): boolean;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";export function useMPOnScreen(r,{threshold:n=.2,once:t=!0,rootMargin:o}={}){const[s,c]=e.useState(!1);return e.useEffect(()=>{const e=r.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return void c(!0);const s=new IntersectionObserver(([e])=>{e.isIntersecting?(c(!0),t&&s.disconnect()):t||c(!1)},{threshold:n,rootMargin:o});return s.observe(e),()=>s.disconnect()},[r,n,t,o]),s}
@@ -1 +1,2 @@
1
+ "use client";
1
2
  import{usePrefersReducedMotion as e}from"../internal/animate.js";export function useMPReducedMotion(){return e()}
@@ -43,6 +43,13 @@ import type { MPWindowClass } from '../types.js';
43
43
  * responsive props and Tailwind's own variants are resolved by the browser
44
44
  * before anything paints.
45
45
  *
46
+ * ## Where the boundaries come from
47
+ *
48
+ * MD3's own, unless an `MPConfigProvider` above this moved them — its
49
+ * `breakpoints` prop is the JavaScript half of a page that has moved the
50
+ * stylesheet's too. See the provider for why moving one without the other is
51
+ * worse than moving neither.
52
+ *
46
53
  * @param onServer what to answer where there is no window. @default 'expanded'
47
54
  */
48
55
  export declare function useMPWindowClass(onServer?: MPWindowClass): MPWindowClass;
@@ -1 +1,2 @@
1
+ "use client";
1
2
  import{useWindowClass as n}from"../internal/window-class.js";export function useMPWindowClass(e="expanded"){return n(e)}
package/dist/index.d.ts CHANGED
@@ -4,21 +4,30 @@ export * from './constants/icons.js';
4
4
  export * from './hooks/index.js';
5
5
  export * from './components/accordion/index.js';
6
6
  export * from './components/alert/index.js';
7
+ export * from './components/anchor/index.js';
8
+ export * from './components/app-logo/index.js';
7
9
  export * from './components/animate-appear/index.js';
8
10
  export * from './components/animate-blink/index.js';
11
+ export * from './components/animate-counter/index.js';
9
12
  export * from './components/animate-fade/index.js';
13
+ export * from './components/animate-float/index.js';
10
14
  export * from './components/animate-grow/index.js';
11
15
  export * from './components/animate-headline/index.js';
12
16
  export * from './components/animate-lighting/index.js';
13
17
  export * from './components/animate-marquee/index.js';
18
+ export * from './components/animate-reveal/index.js';
14
19
  export * from './components/animate-rotate/index.js';
20
+ export * from './components/animate-scramble/index.js';
21
+ export * from './components/animate-shake/index.js';
15
22
  export * from './components/animate-slide/index.js';
23
+ export * from './components/animate-split/index.js';
16
24
  export * from './components/animate-typing/index.js';
17
25
  export * from './components/animate-zoom/index.js';
26
+ export * from './components/area-chart/index.js';
18
27
  export * from './components/aspect-ratio/index.js';
19
28
  export * from './components/avatar/index.js';
20
- export * from './components/avatar-group/index.js';
21
29
  export * from './components/badge/index.js';
30
+ export * from './components/bar-chart/index.js';
22
31
  export * from './components/blockquote/index.js';
23
32
  export * from './components/bottom-navigation/index.js';
24
33
  export * from './components/box/index.js';
@@ -31,6 +40,7 @@ export * from './components/carousel/index.js';
31
40
  export * from './components/chat-bubble/index.js';
32
41
  export * from './components/checkbox/index.js';
33
42
  export * from './components/chip/index.js';
43
+ export * from './components/code-block/index.js';
34
44
  export * from './components/collapsible/index.js';
35
45
  export * from './components/config/index.js';
36
46
  export * from './components/confirm/index.js';
@@ -38,6 +48,8 @@ export * from './components/color-picker/index.js';
38
48
  export * from './components/combobox/index.js';
39
49
  export * from './components/command-palette/index.js';
40
50
  export * from './components/container/index.js';
51
+ export * from './components/data-list/index.js';
52
+ export * from './components/data-table/index.js';
41
53
  export * from './components/date-picker/index.js';
42
54
  export * from './components/date-range-picker/index.js';
43
55
  export * from './components/date-time-picker/index.js';
@@ -47,19 +59,27 @@ export * from './components/drawer/index.js';
47
59
  export * from './components/empty/index.js';
48
60
  export * from './components/fieldset/index.js';
49
61
  export * from './components/file-picker/index.js';
62
+ export * from './components/flex/index.js';
50
63
  export * from './components/floating-action-button/index.js';
64
+ export * from './components/floating-bottom-navigation/index.js';
51
65
  export * from './components/footer/index.js';
52
66
  export * from './components/form/index.js';
67
+ export * from './components/gauge-chart/index.js';
53
68
  export * from './components/grid/index.js';
54
69
  export * from './components/header/index.js';
70
+ export * from './components/heatmap-chart/index.js';
55
71
  export * from './components/highlight/index.js';
72
+ export * from './components/hover-card/index.js';
56
73
  export * from './components/icon/index.js';
57
74
  export * from './components/icon-button/index.js';
58
75
  export * from './components/image/index.js';
76
+ export * from './components/line-chart/index.js';
59
77
  export * from './components/list/index.js';
60
78
  export * from './components/locale/index.js';
61
79
  export * from './components/menu/index.js';
62
80
  export * from './components/menubar/index.js';
81
+ export * from './components/meter/index.js';
82
+ export * from './components/mockup/index.js';
63
83
  export * from './components/navigation-menu/index.js';
64
84
  export * from './components/number-field/index.js';
65
85
  export * from './components/otp-field/index.js';
@@ -67,22 +87,31 @@ export * from './components/overlay/index.js';
67
87
  export * from './components/page-layout/index.js';
68
88
  export * from './components/pagination/index.js';
69
89
  export * from './components/panes/index.js';
90
+ export * from './components/pie-chart/index.js';
70
91
  export * from './components/pill/index.js';
71
92
  export * from './components/popconfirm/index.js';
72
93
  export * from './components/popover/index.js';
94
+ export * from './components/portal/index.js';
73
95
  export * from './components/progress-box/index.js';
74
96
  export * from './components/progress-circular/index.js';
75
97
  export * from './components/progress-linear/index.js';
76
98
  export * from './components/radio-group/index.js';
77
99
  export * from './components/rating/index.js';
100
+ export * from './components/scatter-chart/index.js';
101
+ export * from './components/scroll-area/index.js';
102
+ export * from './components/scroll-zone/index.js';
78
103
  export * from './components/segmented-button/index.js';
79
104
  export * from './components/select/index.js';
80
105
  export * from './components/shortcut/index.js';
106
+ export * from './components/show/index.js';
81
107
  export * from './components/sidebar/index.js';
82
108
  export * from './components/skeleton/index.js';
83
109
  export * from './components/slider/index.js';
84
110
  export * from './components/snackbar/index.js';
85
111
  export * from './components/spoiler/index.js';
112
+ export * from './components/sparkline/index.js';
113
+ export * from './components/stack/index.js';
114
+ export * from './components/statistic/index.js';
86
115
  export * from './components/stepper/index.js';
87
116
  export * from './components/switch/index.js';
88
117
  export * from './components/table/index.js';
@@ -91,9 +120,14 @@ export * from './components/text-field/index.js';
91
120
  export * from './components/text-link/index.js';
92
121
  export * from './components/time-picker/index.js';
93
122
  export * from './components/timeline/index.js';
123
+ export * from './components/timeline-chart/index.js';
94
124
  export * from './components/toggle/index.js';
95
125
  export * from './components/toggle-group/index.js';
126
+ export * from './components/toolbar/index.js';
96
127
  export * from './components/tooltip/index.js';
128
+ export * from './components/tour/index.js';
97
129
  export * from './components/transfer/index.js';
130
+ export * from './components/tree-select/index.js';
131
+ export * from './components/tree-view/index.js';
98
132
  export * from './components/typography/index.js';
99
133
  export * from './components/visually-hidden/index.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./types.js";export{registerMPMessages}from"./internal/i18n.js";export*from"./constants/icons.js";export*from"./hooks/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/avatar-group/index.js";export*from"./components/badge/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/collapsible/index.js";export*from"./components/config/index.js";export*from"./components/confirm/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/command-palette/index.js";export*from"./components/container/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/footer/index.js";export*from"./components/form/index.js";export*from"./components/grid/index.js";export*from"./components/header/index.js";export*from"./components/highlight/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/list/index.js";export*from"./components/locale/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/snackbar/index.js";export*from"./components/spoiler/index.js";export*from"./components/stepper/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/toggle/index.js";export*from"./components/toggle-group/index.js";export*from"./components/tooltip/index.js";export*from"./components/transfer/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";
1
+ export*from"./types.js";export{registerMPMessages}from"./internal/i18n.js";export*from"./constants/icons.js";export*from"./hooks/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/anchor/index.js";export*from"./components/app-logo/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-counter/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-float/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-reveal/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-scramble/index.js";export*from"./components/animate-shake/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-split/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/config/index.js";export*from"./components/confirm/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/command-palette/index.js";export*from"./components/container/index.js";export*from"./components/data-list/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/flex/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/form/index.js";export*from"./components/gauge-chart/index.js";export*from"./components/grid/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/hover-card/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/locale/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/meter/index.js";export*from"./components/mockup/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/portal/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-area/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/show/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/snackbar/index.js";export*from"./components/spoiler/index.js";export*from"./components/sparkline/index.js";export*from"./components/stack/index.js";export*from"./components/statistic/index.js";export*from"./components/stepper/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toggle/index.js";export*from"./components/toggle-group/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tour/index.js";export*from"./components/transfer/index.js";export*from"./components/tree-select/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{MPButton as r}from"../components/button/MPButton.js";import{MPIcon as l}from"../components/icon/MPIcon.js";import{MPIconButton as a}from"../components/icon-button/MPIconButton.js";import{ChevronDownIcon as s,ChevronLeftIcon as c,ChevronRightIcon as i}from"../constants/icons.js";import{MPStateLayer as u}from"./StateLayer.js";import{CONTROL_ICON as m,META_TEXT as d,PROSE_TEXT as h}from"./scale.js";import{VISUALLY_HIDDEN as p}from"./visually-hidden.js";import{addDays as f,addMonths as g,addYears as y,calendarWeeks as v,compareDay as w,dateFormatter as x,isDayOutside as b,isMonthBeforeYear as D,isSameDay as S,isSameMonth as M,isUnitOutside as N,isValidDate as P,makeDate as _,meridiemLabels as C,monthLabels as k,startOfDay as j,startOfMonth as z,today as A,weekdayLabels as E,withTime as T,YEAR_PAGE_SIZE as F,yearPageStart as Y}from"./date.js";const B={xs:"1.75rem",sm:"2rem",md:"2.5rem",lg:"2.75rem",xl:"3rem"},R={xs:"xs",sm:"xs",md:"sm",lg:"sm",xl:"md"},H=/*@__PURE__*/["group relative flex cursor-pointer items-center justify-center overflow-hidden","box-border appearance-none font-[inherit] tabular-nums select-none","transition-[background-color,border-color,color]","duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:z-10 focus-visible:outline-2","focus-visible:outline-offset-[-2px] focus-visible:outline-solid outline-none"].join(" "),$={day:0,month:1,year:2};function K({children:n,label:o,selected:r,inRange:l=!1,rangeEdge:a=null,current:s=!1,muted:c=!1,disabled:i=!1,focused:m=!1,className:d,onClick:h,onPointerEnter:p,onKeyDown:f}){return t("button",{type:"button",role:"gridcell","aria-label":o,"aria-selected":r,"aria-current":s?"date":void 0,"aria-disabled":i||void 0,tabIndex:m?0:-1,"data-focus-target":m?"true":void 0,className:[H,"start"===a?"rounded-s-mp-full":"end"===a?"rounded-e-mp-full":"middle"===a?"rounded-none":"rounded-mp-full",i?"bg-transparent cursor-default text-mp-on-surface/38":r?"bg-(--_mp-accent) text-(--_mp-on-accent)":l?"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)":s?"bg-transparent border border-(--_mp-accent) text-(--_mp-accent)":c?"bg-transparent text-mp-on-surface-variant":"bg-transparent text-mp-on-surface",d??""].filter(Boolean).join(" "),onClick:()=>{i||h()},onPointerEnter:p,onKeyDown:f,children:[i?null:e(u,{}),n]})}function L({size:o,color:u,view:d,month:p,locale:f,labels:g,showPreviousButton:y,showNextButton:v,onStep:w,onViewChange:x}){const b=k(f,"long")[p.getMonth()],S=String(p.getFullYear()),M=D(f),N=R[o],P="day"===d?[g.previousMonth,g.nextMonth]:"month"===d?[g.previousYear,g.nextYear]:[g.previousYears,g.nextYears],_=(t,n)=>n?e(a,{size:N,color:u,label:P[-1===t?0:1],icon:e(l,{icon:-1===t?c:i,size:m[N],className:"rtl:rotate-180"}),onClick:()=>w(t)}):e("span",{"aria-hidden":"true",className:"size-(--_mp-cell)"}),C=t=>e(l,{icon:s,size:m[N],className:["transition-transform duration-(--mp-sys-motion-duration-short4)",t?"rotate-180":""].filter(Boolean).join(" ")}),j=e(r,{variant:"text",size:N,color:u,"aria-label":g.chooseMonth,"aria-expanded":"month"===d,endIcon:C("month"===d),onClick:()=>x("month"===d?"day":"month"),children:b},"month"),z=e(r,{variant:"text",size:N,color:u,className:"tabular-nums","aria-label":g.chooseYear,"aria-expanded":"year"===d,endIcon:C("year"===d),onClick:()=>x("year"===d?"day":"year"),children:S},"year"),A=Y(p.getFullYear());return t("div",{className:"flex items-center justify-between gap-1",children:[_(-1,y),e("div",{className:"flex min-w-0 flex-1 items-center justify-center gap-1",children:"year"===d?e("span",{className:`text-mp-on-surface flex h-(--_mp-cell) items-center tabular-nums ${h[o]}`,children:`${A}–${A+F-1}`}):"month"===d?z:t(n,M?{children:[j,z]}:{children:[z,j]})}),_(1,v)]})}export function Calendar({size:n,color:r,locale:l,weekStartsOn:a,month:s,onMonthChange:c,selected:i,rangeStart:u=null,rangeEnd:m=null,onSelect:d,onPreviewChange:h,minDate:p,maxDate:f,shouldDisableDate:v,showOutsideDays:w=!0,autoFocus:x=!1,showPreviousButton:D=!0,showNextButton:S=!0,precision:N="day",labels:C}){const[k,E]=o.useState(N),T=$[k]<$[N]?N:k,Y=o.useMemo(()=>i.filter(P),[i]),[R,H]=o.useState(()=>{const e=Y.find(e=>M(e,s));return e?j(e):M(A(),s)?A():z(s)}),K=o.useRef(x),U=o.useRef(null);o.useEffect(()=>{H(e=>M(e,s)?e:z(s))},[s]),o.useLayoutEffect(()=>{K.current&&(K.current=!1,U.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const V=o.useCallback(e=>b(e,p,f)||(v?.(e)??!1),[p,f,v]),G=e=>{K.current=!0,E(e)},W=e=>{K.current=!0,c(e)};return t("div",{ref:U,className:"mp-calendar flex flex-col gap-1",style:{"--_mp-cell":B[n]},onPointerLeave:()=>h?.(null),children:[e(L,{size:n,color:r,view:T,month:s,locale:l,labels:C,showPreviousButton:D,showNextButton:S,onStep:e=>{c("day"===T?g(s,e):y(s,"month"===T?e:e*F))},onViewChange:G}),e("div",{className:"h-[calc(var(--_mp-cell)*7)] w-[calc(var(--_mp-cell)*7)]",children:"day"===T?e(I,{size:n,locale:l,weekStartsOn:a,month:s,chosen:Y,rangeStart:u,rangeEnd:m,focusedDate:R,showOutsideDays:w,isDisabled:V,onSelect:e=>{H(e),d(e)},onPreviewChange:h,onMoveFocus:e=>{K.current=!0,H(e),M(e,s)||c(z(e))}}):"month"===T?e(O,{size:n,locale:l,month:s,chosen:Y,minDate:p,maxDate:f,onMoveCursor:W,onPick:e=>{const t=_(s.getFullYear(),e,1);"month"!==N?(c(t),G("day")):d(t)}}):e(q,{size:n,month:s,chosen:Y,minDate:p,maxDate:f,onMoveCursor:W,onPick:e=>{"year"!==N?(c(_(e,s.getMonth(),1)),G("month")):d(_(e,0,1))}})})]})}function U(e){return"rtl"===getComputedStyle(e).direction?-1:1}function I({size:n,locale:r,weekStartsOn:l,month:a,chosen:s,rangeStart:c,rangeEnd:i,focusedDate:u,showOutsideDays:m,isDisabled:p,onSelect:y,onPreviewChange:b,onMoveFocus:D}){const N=E(r,l,"narrow"),_=E(r,l,"long"),C=(j=i,P(k=c)&&P(j)?w(k,j)<=0?[k,j]:[j,k]:null);var k,j;const z=A(),T=o.useMemo(()=>{const e=x(r,{dateStyle:"full"});return v(a,l).map(t=>t.map(t=>({date:t,label:e.format(t)})))},[a,l,r]),F=o.useRef(null),Y=o.useRef(a);o.useLayoutEffect(()=>{const e=F.current,t=Y.current;if(Y.current=a,!e||M(t,a))return;const n=t.getTime()<a.getTime(),o="rtl"===getComputedStyle(e).direction;e.style.setProperty("--_mp-calendar-from",String(n===o?-1:1)),e.dataset.mpPaged="true",e.style.animationName="none",e.offsetWidth,e.style.animationName=""},[a]);return t("div",{role:"grid","aria-label":x(r,{year:"numeric",month:"long"}).format(a),className:"flex h-full flex-col",children:[e("div",{role:"rowgroup",children:e("div",{role:"row",className:"grid grid-cols-7",children:N.map((t,n)=>e("span",{role:"columnheader","aria-label":_[n],className:`text-mp-on-surface-variant flex h-(--_mp-cell) items-center justify-center select-none ${d}`,children:t},n))})}),e("div",{ref:F,role:"rowgroup",className:"mp-calendar__page flex flex-1 flex-col",children:T.map((t,o)=>e("div",{role:"row",className:"grid grid-cols-7",children:t.map(({date:t,label:o})=>{const r=!M(t,a);if(r&&!m)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--_mp-cell)"},t.getTime());const c=s.some(e=>S(e,t)),i=null!==C&&w(t,C[0])>=0&&w(t,C[1])<=0,d=null!==C&&i&&S(t,C[0]),v=null!==C&&i&&S(t,C[1]);return e(K,{label:o,selected:c,inRange:i&&!c,rangeEdge:i?d&&v?"both":d?"start":v?"end":"middle":null,current:S(t,z)&&!c,muted:r,disabled:p(t),focused:S(t,u),className:`size-(--_mp-cell) ${h[n]}`,onClick:()=>y(t),onPointerEnter:()=>b?.(t),onKeyDown:e=>((e,t)=>{const n=(t.getDay()-l+7)%7,o=U(e.currentTarget),r={ArrowLeft:()=>f(t,-o),ArrowRight:()=>f(t,o),ArrowUp:()=>f(t,-7),ArrowDown:()=>f(t,7),Home:()=>f(t,-n),End:()=>f(t,6-n),PageUp:()=>g(t,e.shiftKey?-12:-1),PageDown:()=>g(t,e.shiftKey?12:1)}[e.key];r&&(e.preventDefault(),D(r()))})(e,t),children:t.getDate()},t.getTime())})},o))})]})}function O({size:t,locale:n,month:r,chosen:l,minDate:a,maxDate:s,onMoveCursor:c,onPick:i}){const u=k(n,"short"),m=r.getFullYear(),d=new Date,p=o.useMemo(()=>{const e=x(n,{year:"numeric",month:"long"});return Array.from({length:12},(t,n)=>e.format(_(m,n,1)))},[n,m]),f=e=>{const t=U(e.currentTarget),n={ArrowLeft:-t,ArrowRight:t,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==n&&(e.preventDefault(),c(g(z(r),n)))};return e("div",{role:"grid","aria-label":String(m),className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(n=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(o=>{const c=3*n+o;return e(K,{label:p[c],selected:l.some(e=>e.getFullYear()===m&&e.getMonth()===c),current:d.getFullYear()===m&&d.getMonth()===c,disabled:N(_(m,c,1),"month",a,s),focused:c===r.getMonth(),className:`h-(--_mp-cell) w-full ${h[t]}`,onClick:()=>i(c),onKeyDown:f,children:u[c]},c)})},n))})}function q({size:t,month:n,chosen:o,minDate:r,maxDate:l,onMoveCursor:a,onPick:s}){const c=Y(n.getFullYear()),i=(new Date).getFullYear(),u=e=>{const t=U(e.currentTarget),o={ArrowLeft:-t,ArrowRight:t,ArrowUp:-4,ArrowDown:4,PageUp:-F,PageDown:F}[e.key];void 0!==o&&(e.preventDefault(),a(y(z(n),o)))};return e("div",{role:"grid","aria-label":`${c}–${c+F-1}`,className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(a=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(m=>{const d=c+4*a+m;return e(K,{label:String(d),selected:o.some(e=>e.getFullYear()===d),current:d===i,disabled:N(_(d,0,1),"year",r,l),focused:d===n.getFullYear(),className:`h-(--_mp-cell) w-full ${h[t]}`,onClick:()=>s(d),onKeyDown:u,children:d},d)})},a))})}function V(e,t){return Number.isFinite(e)?Math.min(t,Math.max(1,Math.round(e))):1}function G(e){const t=e.parentElement;if(!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.top-o.top-t.clientTop+t.scrollTop,l=r+n.height;r<t.scrollTop?t.scrollTop=r:l>t.scrollTop+t.clientHeight&&(t.scrollTop=l-t.clientHeight)}export function MPTimeGrid({size:n,locale:r,value:l,referenceDate:a,onChange:s,hour12:c,showSeconds:i,hourStep:m,minuteStep:d,secondStep:f,shouldDisableTime:g,autoFocus:y=!1,labels:v}){const w=l??a,b=o.useRef(null),[D,S]=o.useMemo(()=>C(r),[r]);o.useEffect(()=>{const e=b.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(G),y){const t=e?.querySelector('[role="listbox"]');(t?.querySelector('[data-chosen="true"]')??t?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[y]);const M=o.useMemo(()=>{const e=c?12:24,t=V(m,e),n=Array.from({length:Math.ceil(e/t)},(e,n)=>n*t);return c?n.map(e=>0===e?12:e):n},[c,m]),N=o.useMemo(()=>{const e=V(d,60);return Array.from({length:Math.ceil(60/e)},(t,n)=>n*e)},[d]),P=o.useMemo(()=>{const e=V(f,60);return Array.from({length:Math.ceil(60/e)},(t,n)=>n*e)},[f]),_=e=>String(e).padStart(2,"0"),k=c?w.getHours()%12||12:w.getHours(),[j,z]=o.useState({}),A=(o,r,a,i,m)=>{const d=null===l?-1:a.findIndex(e=>i(e)),p=j[o]??(d>=0?d:0);return e("div",{role:"listbox","aria-label":r,className:["mp-time-grid__column flex flex-col gap-0.5 overflow-y-auto overscroll-contain","h-[calc(var(--_mp-cell)*7)] w-[calc(var(--_mp-cell)*1.75)]","scroll-py-0.5 [scrollbar-width:thin]"].join(" "),onKeyDown:e=>{const t={ArrowDown:1,ArrowUp:-1,PageDown:5,PageUp:-5}[e.key],n=void 0!==t?(e=>{const t=[...e.children].indexOf(document.activeElement);return t>=0?t:p})(e.currentTarget)+t:"Home"===e.key?0:"End"===e.key?a.length-1:null;null!==n&&(e.preventDefault(),((e,t)=>{const n=Math.min(a.length-1,Math.max(0,e)),r=t.children[n];z(e=>({...e,[o]:n})),r instanceof HTMLElement&&(r.focus({preventScroll:!0}),G(r))})(n,e.currentTarget))},children:a.map((r,a)=>{const d=((e,t)=>T(w,"hour"===e?{hours:c?t%12+(w.getHours()>=12?12:0):t}:"minute"===e?{minutes:t}:"second"===e?{seconds:t}:{hours:w.getHours()%12+12*t}))(o,r),f=null!==l&&i(r),y=g?.(d,o)??!1;return t("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":y||void 0,"data-chosen":f?"true":void 0,tabIndex:a===p?0:-1,className:[H,"rounded-mp-full h-(--_mp-cell) w-full shrink-0",h[n],y?"bg-transparent cursor-default text-mp-on-surface/38":f?"bg-(--_mp-accent) text-(--_mp-on-accent)":"bg-transparent text-mp-on-surface"].join(" "),onFocus:()=>z(e=>({...e,[o]:a})),onClick:()=>{y||s(d)},children:[y?null:e(u,{}),m(r)]},r)})},o)};return t("div",{ref:b,className:"mp-time-grid flex gap-1",style:{"--_mp-cell":B[n]},children:[A("hour",v.hour,M,e=>e===k,e=>c?String(e):_(e)),A("minute",v.minute,N,e=>e===w.getMinutes(),_),i?A("second",v.second,P,e=>e===w.getSeconds(),_):null,c?A("meridiem",v.meridiem,[0,1],e=>(w.getHours()>=12?1:0)===e,e=>0===e?D:S):null,e("span",{className:p,"aria-live":"polite",children:null===l?"":x(r,{hour:"numeric",minute:"2-digit",...i?{second:"2-digit"}:{}}).format(l)})]})}
2
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{MPButton as r}from"../components/button/MPButton.js";import{MPIcon as l}from"../components/icon/MPIcon.js";import{MPIconButton as a}from"../components/icon-button/MPIconButton.js";import{ChevronDownIcon as s,ChevronLeftIcon as c,ChevronRightIcon as i}from"../constants/icons.js";import{MPStateLayer as u}from"./StateLayer.js";import{CONTROL_ICON as m,META_TEXT as d,PROSE_TEXT as h}from"./scale.js";import{VISUALLY_HIDDEN as p}from"./visually-hidden.js";import{addDays as f,addMonths as g,addYears as y,calendarWeeks as v,compareDay as b,dateFormatter as w,isDayOutside as x,isMonthBeforeYear as D,isSameDay as S,isSameMonth as M,isUnitOutside as N,isValidDate as P,makeDate as _,meridiemLabels as C,monthLabels as k,startOfDay as j,startOfMonth as z,today as A,weekdayLabels as E,withTime as T,YEAR_PAGE_SIZE as F,yearPageStart as Y}from"./date.js";const B={xs:"1.75rem",sm:"2rem",md:"2.5rem",lg:"2.75rem",xl:"3rem"},R={xs:"xs",sm:"xs",md:"sm",lg:"sm",xl:"md"},H=/*@__PURE__*/["group relative flex cursor-pointer items-center justify-center overflow-hidden","box-border appearance-none font-[inherit] tabular-nums select-none","transition-[background-color,border-color,color]","duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:z-10 focus-visible:outline-2","focus-visible:outline-offset-[-2px] focus-visible:outline-solid outline-none"].join(" "),$={day:0,month:1,year:2};function K({children:n,label:o,selected:r,inRange:l=!1,rangeEdge:a=null,current:s=!1,muted:c=!1,disabled:i=!1,focused:m=!1,className:d,onClick:h,onPointerEnter:p,onKeyDown:f}){return t("button",{type:"button",role:"gridcell","aria-label":o,"aria-selected":r,"aria-current":s?"date":void 0,"aria-disabled":i||void 0,tabIndex:m?0:-1,"data-focus-target":m?"true":void 0,className:[H,"start"===a?"rounded-s-mp-full":"end"===a?"rounded-e-mp-full":"middle"===a?"rounded-none":"rounded-mp-full",i?"bg-transparent cursor-default text-mp-on-surface/38":r?"bg-(--_mp-accent) text-(--_mp-on-accent)":l?"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)":s?"bg-transparent border border-(--_mp-accent) text-(--_mp-accent)":c?"bg-transparent text-mp-on-surface-variant":"bg-transparent text-mp-on-surface",d??""].filter(Boolean).join(" "),onClick:()=>{i||h()},onPointerEnter:p,onKeyDown:f,children:[i?null:e(u,{}),n]})}function L({size:o,color:u,view:d,month:p,locale:f,labels:g,showPreviousButton:y,showNextButton:v,onStep:b,onViewChange:w}){const x=k(f,"long")[p.getMonth()],S=String(p.getFullYear()),M=D(f),N=R[o],P="day"===d?[g.previousMonth,g.nextMonth]:"month"===d?[g.previousYear,g.nextYear]:[g.previousYears,g.nextYears],_=(t,n)=>n?e(a,{size:N,color:u,label:P[-1===t?0:1],icon:e(l,{icon:-1===t?c:i,size:m[N],className:"rtl:rotate-180"}),onClick:()=>b(t)}):e("span",{"aria-hidden":"true",className:"size-(--_mp-cell)"}),C=t=>e(l,{icon:s,size:m[N],className:["transition-transform duration-(--mp-sys-motion-duration-short4)",t?"rotate-180":""].filter(Boolean).join(" ")}),j=e(r,{variant:"text",size:N,color:u,"aria-label":g.chooseMonth,"aria-expanded":"month"===d,endIcon:C("month"===d),onClick:()=>w("month"===d?"day":"month"),children:x},"month"),z=e(r,{variant:"text",size:N,color:u,className:"tabular-nums","aria-label":g.chooseYear,"aria-expanded":"year"===d,endIcon:C("year"===d),onClick:()=>w("year"===d?"day":"year"),children:S},"year"),A=Y(p.getFullYear());return t("div",{className:"flex items-center justify-between gap-1",children:[_(-1,y),e("div",{className:"flex min-w-0 flex-1 items-center justify-center gap-1",children:"year"===d?e("span",{className:`text-mp-on-surface flex h-(--_mp-cell) items-center tabular-nums ${h[o]}`,children:`${A}–${A+F-1}`}):"month"===d?z:t(n,M?{children:[j,z]}:{children:[z,j]})}),_(1,v)]})}export function Calendar({size:n,color:r,locale:l,weekStartsOn:a,month:s,onMonthChange:c,selected:i,rangeStart:u=null,rangeEnd:m=null,onSelect:d,onPreviewChange:h,minDate:p,maxDate:f,shouldDisableDate:v,showOutsideDays:b=!0,autoFocus:w=!1,showPreviousButton:D=!0,showNextButton:S=!0,precision:N="day",labels:C}){const[k,E]=o.useState(N),T=$[k]<$[N]?N:k,Y=o.useMemo(()=>i.filter(P),[i]),[R,H]=o.useState(()=>{const e=Y.find(e=>M(e,s));return e?j(e):M(A(),s)?A():z(s)}),K=o.useRef(w),U=o.useRef(null);o.useEffect(()=>{H(e=>M(e,s)?e:z(s))},[s]),o.useLayoutEffect(()=>{K.current&&(K.current=!1,U.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const V=o.useCallback(e=>x(e,p,f)||(v?.(e)??!1),[p,f,v]),G=e=>{K.current=!0,E(e)},W=e=>{K.current=!0,c(e)};return t("div",{ref:U,className:"mp-calendar flex flex-col gap-1",style:{"--_mp-cell":B[n]},onPointerLeave:()=>h?.(null),children:[e(L,{size:n,color:r,view:T,month:s,locale:l,labels:C,showPreviousButton:D,showNextButton:S,onStep:e=>{c("day"===T?g(s,e):y(s,"month"===T?e:e*F))},onViewChange:G}),e("div",{className:"h-[calc(var(--_mp-cell)*7)] w-[calc(var(--_mp-cell)*7)]",children:"day"===T?e(I,{size:n,locale:l,weekStartsOn:a,month:s,chosen:Y,rangeStart:u,rangeEnd:m,focusedDate:R,showOutsideDays:b,isDisabled:V,onSelect:e=>{H(e),d(e)},onPreviewChange:h,onMoveFocus:e=>{K.current=!0,H(e),M(e,s)||c(z(e))}}):"month"===T?e(O,{size:n,locale:l,month:s,chosen:Y,minDate:p,maxDate:f,onMoveCursor:W,onPick:e=>{const t=_(s.getFullYear(),e,1);"month"!==N?(c(t),G("day")):d(t)}}):e(q,{size:n,month:s,chosen:Y,minDate:p,maxDate:f,onMoveCursor:W,onPick:e=>{"year"!==N?(c(_(e,s.getMonth(),1)),G("month")):d(_(e,0,1))}})})]})}function U(e){return"rtl"===getComputedStyle(e).direction?-1:1}function I({size:n,locale:r,weekStartsOn:l,month:a,chosen:s,rangeStart:c,rangeEnd:i,focusedDate:u,showOutsideDays:m,isDisabled:p,onSelect:y,onPreviewChange:x,onMoveFocus:D}){const N=E(r,l,"narrow"),_=E(r,l,"long"),C=(j=i,P(k=c)&&P(j)?b(k,j)<=0?[k,j]:[j,k]:null);var k,j;const z=A(),T=o.useMemo(()=>{const e=w(r,{dateStyle:"full"});return v(a,l).map(t=>t.map(t=>({date:t,label:e.format(t)})))},[a,l,r]),F=o.useRef(null),Y=o.useRef(a);o.useLayoutEffect(()=>{const e=F.current,t=Y.current;if(Y.current=a,!e||M(t,a))return;const n=t.getTime()<a.getTime(),o="rtl"===getComputedStyle(e).direction;e.style.setProperty("--_mp-calendar-from",String(n===o?-1:1)),e.dataset.mpPaged="true",e.style.animationName="none",e.offsetWidth,e.style.animationName=""},[a]);return t("div",{role:"grid","aria-label":w(r,{year:"numeric",month:"long"}).format(a),className:"flex h-full flex-col",children:[e("div",{role:"rowgroup",children:e("div",{role:"row",className:"grid grid-cols-7",children:N.map((t,n)=>e("span",{role:"columnheader","aria-label":_[n],className:`text-mp-on-surface-variant flex h-(--_mp-cell) items-center justify-center select-none ${d}`,children:t},n))})}),e("div",{ref:F,role:"rowgroup",className:"mp-calendar__page flex flex-1 flex-col",children:T.map((t,o)=>e("div",{role:"row",className:"grid grid-cols-7",children:t.map(({date:t,label:o})=>{const r=!M(t,a);if(r&&!m)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--_mp-cell)"},t.getTime());const c=s.some(e=>S(e,t)),i=null!==C&&b(t,C[0])>=0&&b(t,C[1])<=0,d=null!==C&&i&&S(t,C[0]),v=null!==C&&i&&S(t,C[1]);return e(K,{label:o,selected:c,inRange:i&&!c,rangeEdge:i?d&&v?"both":d?"start":v?"end":"middle":null,current:S(t,z)&&!c,muted:r,disabled:p(t),focused:S(t,u),className:`size-(--_mp-cell) ${h[n]}`,onClick:()=>y(t),onPointerEnter:()=>x?.(t),onKeyDown:e=>((e,t)=>{const n=(t.getDay()-l+7)%7,o=U(e.currentTarget),r={ArrowLeft:()=>f(t,-o),ArrowRight:()=>f(t,o),ArrowUp:()=>f(t,-7),ArrowDown:()=>f(t,7),Home:()=>f(t,-n),End:()=>f(t,6-n),PageUp:()=>g(t,e.shiftKey?-12:-1),PageDown:()=>g(t,e.shiftKey?12:1)}[e.key];r&&(e.preventDefault(),D(r()))})(e,t),children:t.getDate()},t.getTime())})},o))})]})}function O({size:t,locale:n,month:r,chosen:l,minDate:a,maxDate:s,onMoveCursor:c,onPick:i}){const u=k(n,"short"),m=r.getFullYear(),d=new Date,p=o.useMemo(()=>{const e=w(n,{year:"numeric",month:"long"});return Array.from({length:12},(t,n)=>e.format(_(m,n,1)))},[n,m]),f=e=>{const t=U(e.currentTarget),n={ArrowLeft:-t,ArrowRight:t,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==n&&(e.preventDefault(),c(g(z(r),n)))};return e("div",{role:"grid","aria-label":String(m),className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(n=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(o=>{const c=3*n+o;return e(K,{label:p[c],selected:l.some(e=>e.getFullYear()===m&&e.getMonth()===c),current:d.getFullYear()===m&&d.getMonth()===c,disabled:N(_(m,c,1),"month",a,s),focused:c===r.getMonth(),className:`h-(--_mp-cell) w-full ${h[t]}`,onClick:()=>i(c),onKeyDown:f,children:u[c]},c)})},n))})}function q({size:t,month:n,chosen:o,minDate:r,maxDate:l,onMoveCursor:a,onPick:s}){const c=Y(n.getFullYear()),i=(new Date).getFullYear(),u=e=>{const t=U(e.currentTarget),o={ArrowLeft:-t,ArrowRight:t,ArrowUp:-4,ArrowDown:4,PageUp:-F,PageDown:F}[e.key];void 0!==o&&(e.preventDefault(),a(y(z(n),o)))};return e("div",{role:"grid","aria-label":`${c}–${c+F-1}`,className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(a=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(m=>{const d=c+4*a+m;return e(K,{label:String(d),selected:o.some(e=>e.getFullYear()===d),current:d===i,disabled:N(_(d,0,1),"year",r,l),focused:d===n.getFullYear(),className:`h-(--_mp-cell) w-full ${h[t]}`,onClick:()=>s(d),onKeyDown:u,children:d},d)})},a))})}function V(e,t){return Number.isFinite(e)?Math.min(t,Math.max(1,Math.round(e))):1}function G(e,t="auto"){const n=e.parentElement;if(!n)return;const o=e.getBoundingClientRect(),r=n.getBoundingClientRect(),l=o.top-r.top-n.clientTop+n.scrollTop,a=l+o.height;l<n.scrollTop?n.scrollTo({top:l,behavior:t}):a>n.scrollTop+n.clientHeight&&n.scrollTo({top:a-n.clientHeight,behavior:t})}export function MPTimeGrid({size:n,locale:r,value:l,referenceDate:a,onChange:s,hour12:c,showSeconds:i,hourStep:m,minuteStep:d,secondStep:f,shouldDisableTime:g,autoFocus:y=!1,labels:v}){const b=l??a,x=o.useRef(null),[D,S]=o.useMemo(()=>C(r),[r]);o.useEffect(()=>{const e=x.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(e=>G(e,"instant")),y){const t=e?.querySelector('[role="listbox"]');(t?.querySelector('[data-chosen="true"]')??t?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[y]);const M=o.useMemo(()=>{const e=c?12:24,t=V(m,e),n=Array.from({length:Math.ceil(e/t)},(e,n)=>n*t);return c?n.map(e=>0===e?12:e):n},[c,m]),N=o.useMemo(()=>{const e=V(d,60);return Array.from({length:Math.ceil(60/e)},(t,n)=>n*e)},[d]),P=o.useMemo(()=>{const e=V(f,60);return Array.from({length:Math.ceil(60/e)},(t,n)=>n*e)},[f]),_=e=>String(e).padStart(2,"0"),k=c?b.getHours()%12||12:b.getHours(),[j,z]=o.useState({}),A=(o,r,a,i,m)=>{const d=null===l?-1:a.findIndex(e=>i(e)),p=j[o]??(d>=0?d:0);return e("div",{role:"listbox","aria-label":r,className:["mp-time-grid__column flex flex-col gap-0.5 overflow-y-auto overscroll-contain","motion-safe:scroll-smooth","h-[calc(var(--_mp-cell)*7)] w-[calc(var(--_mp-cell)*1.75)]","scroll-py-0.5 [scrollbar-width:thin]"].join(" "),onKeyDown:e=>{const t={ArrowDown:1,ArrowUp:-1,PageDown:5,PageUp:-5}[e.key],n=void 0!==t?(e=>{const t=[...e.children].indexOf(document.activeElement);return t>=0?t:p})(e.currentTarget)+t:"Home"===e.key?0:"End"===e.key?a.length-1:null;null!==n&&(e.preventDefault(),((e,t)=>{const n=Math.min(a.length-1,Math.max(0,e)),r=t.children[n];z(e=>({...e,[o]:n})),r instanceof HTMLElement&&(r.focus({preventScroll:!0}),G(r))})(n,e.currentTarget))},children:a.map((r,a)=>{const d=((e,t)=>T(b,"hour"===e?{hours:c?t%12+(b.getHours()>=12?12:0):t}:"minute"===e?{minutes:t}:"second"===e?{seconds:t}:{hours:b.getHours()%12+12*t}))(o,r),f=null!==l&&i(r),y=g?.(d,o)??!1;return t("button",{type:"button",role:"option","aria-selected":f,"aria-disabled":y||void 0,"data-chosen":f?"true":void 0,tabIndex:a===p?0:-1,className:[H,"rounded-mp-full h-(--_mp-cell) w-full shrink-0",h[n],y?"bg-transparent cursor-default text-mp-on-surface/38":f?"bg-(--_mp-accent) text-(--_mp-on-accent)":"bg-transparent text-mp-on-surface"].join(" "),onFocus:()=>z(e=>({...e,[o]:a})),onClick:()=>{y||s(d)},children:[y?null:e(u,{}),m(r)]},r)})},o)};return t("div",{ref:x,className:"mp-time-grid flex gap-1",style:{"--_mp-cell":B[n]},children:[A("hour",v.hour,M,e=>e===k,e=>c?String(e):_(e)),A("minute",v.minute,N,e=>e===b.getMinutes(),_),i?A("second",v.second,P,e=>e===b.getSeconds(),_):null,c?A("meridiem",v.meridiem,[0,1],e=>(b.getHours()>=12?1:0)===e,e=>0===e?D:S):null,e("span",{className:p,"aria-live":"polite",children:null===l?"":w(r,{hour:"numeric",minute:"2-digit",...i?{second:"2-digit"}:{}}).format(l)})]})}
@@ -0,0 +1,205 @@
1
+ import * as React from 'react';
2
+ import { type ChartValue } from './chart.js';
3
+ import type { MPChartCategory, MPChartLegend, MPChartTooltip, MPChartTooltipItem, MPSide, MPSize } from '../types.js';
4
+ /**
5
+ * Everything a chart draws that is not the data.
6
+ *
7
+ * The legend, the hover panel, the spoken readout, the table behind the picture
8
+ * and the arrangement that holds them — the parts a pie chart and a line chart
9
+ * have in common, which is all of them except the plot.
10
+ *
11
+ * A file of its own for the reason `internal/density.ts` has one: the split
12
+ * stylesheet is cut along the import graph a **file** at a time, so a pie chart
13
+ * reaching into `ChartFrame.tsx` for a legend would carry the axes, the scales
14
+ * and the column hit-testing it has no use for. It arrives here instead, and
15
+ * the cartesian frame is one more consumer rather than the owner.
16
+ */
17
+ /** What every framed chart takes, whatever it draws. */
18
+ export interface ChartBaseProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children' | 'title'> {
19
+ /**
20
+ * How tall the drawing is. A number is pixels; a string is any CSS length.
21
+ * Defaults to the `size` ladder.
22
+ *
23
+ * The axis labels are drawn **inside** this rather than under it, so a card
24
+ * sized to the chart is a card the chart fits in.
25
+ */
26
+ height?: number | string;
27
+ /**
28
+ * How numbers are written everywhere they appear — the axis, the panel, the
29
+ * table. `Intl.NumberFormat` options, the same prop `MPStatistic` takes.
30
+ *
31
+ * Without it a tick is compacted past ten thousand, because four labels of
32
+ * seven digits is not an axis, it is a column of numbers beside a picture.
33
+ */
34
+ format?: Intl.NumberFormatOptions;
35
+ /** Which language the chart's own words and dates are in. */
36
+ locale?: string;
37
+ /**
38
+ * What the chart is a chart **of**. Read out in place of the drawing, and
39
+ * used as the caption of the table behind it.
40
+ */
41
+ label?: string;
42
+ /**
43
+ * The legend. Drawn from two series up and left off below that, because a
44
+ * legend with one swatch in it restates the title.
45
+ */
46
+ legend?: boolean | MPChartLegend;
47
+ /**
48
+ * What the pointer uncovers. On by default: a chart drawn in a browser is
49
+ * interactive, and a reader who wants March's number should not have to
50
+ * measure it against a gridline.
51
+ */
52
+ tooltip?: boolean | MPChartTooltip;
53
+ /** What to draw when there is nothing to draw. */
54
+ empty?: React.ReactNode;
55
+ /** @default 'md' */
56
+ size?: MPSize;
57
+ }
58
+ export interface Visibility {
59
+ visible: boolean[];
60
+ hovered: number | null;
61
+ toggle: (index: number) => void;
62
+ setHovered: (index: number | null) => void;
63
+ }
64
+ /**
65
+ * Which entries are drawn, and which one the legend is being pointed at.
66
+ *
67
+ * Keyed by an entry's place in the array as it was passed, which is what stops
68
+ * a hidden one renumbering those after it. Colours come off that same index, so
69
+ * hiding Europe leaves Asia exactly the colour it already was.
70
+ *
71
+ * It takes anything that can say whether it starts hidden rather than a series
72
+ * specifically, because a pie's entries are its slices.
73
+ */
74
+ export declare function useVisibility(series: readonly {
75
+ hidden?: boolean;
76
+ }[]): Visibility;
77
+ export declare const LEGEND_SIDE: {
78
+ readonly top: "flex-col-reverse";
79
+ readonly bottom: "flex-col";
80
+ readonly left: "flex-row-reverse";
81
+ readonly right: "flex-row";
82
+ };
83
+ interface LegendProps {
84
+ /**
85
+ * What each entry is called. Names rather than series, because a pie's
86
+ * entries are its slices — the entity a legend identifies is not always a
87
+ * series, and a legend that insisted on one would be a legend a pie has to
88
+ * fake a series array for.
89
+ */
90
+ names: readonly (string | undefined)[];
91
+ colors: readonly string[];
92
+ options: MPChartLegend;
93
+ visibility: Visibility;
94
+ size: MPSize;
95
+ values?: readonly (string | undefined)[];
96
+ swatch?: (index: number, color: string) => React.ReactNode;
97
+ }
98
+ /**
99
+ * The identity channel that does not depend on being able to see a colour.
100
+ *
101
+ * A swatch and a word, and the swatch is the only thing on the row wearing the
102
+ * series' colour — the name beside it stays in ordinary ink. That is the rule
103
+ * for every piece of text in a chart: a label written in the mark's colour is a
104
+ * label the reader has to decode before they can read it, and it fails outright
105
+ * in forced colours.
106
+ *
107
+ * Interactive by default, and each entry is a real `<button>` with
108
+ * `aria-pressed`. A legend that filters is a control, and a control that is a
109
+ * `<div>` with an `onClick` is one a keyboard cannot reach.
110
+ */
111
+ export declare function ChartLegend({ names, colors, options, visibility, size, values, swatch }: LegendProps): React.JSX.Element;
112
+ interface PanelProps {
113
+ heading?: React.ReactNode;
114
+ items: readonly MPChartTooltipItem[];
115
+ x: number;
116
+ y: number;
117
+ flip: boolean;
118
+ size: MPSize;
119
+ }
120
+ /**
121
+ * What the pointer uncovers, as a panel.
122
+ *
123
+ * `pointer-events-none` is the load-bearing part: a panel that could be hovered
124
+ * would sit under the pointer, take the hover from the plot, and close itself —
125
+ * then reopen, then close, for as long as the reader held still.
126
+ */
127
+ export declare function ChartTooltipPanel({ heading, items, x, y, flip, size }: PanelProps): React.JSX.Element;
128
+ /**
129
+ * The same reading, said out loud instead of drawn.
130
+ *
131
+ * It cannot be the panel above, and that is a constraint rather than a
132
+ * preference: the panel is drawn inside the element carrying `role="img"`, and
133
+ * `img` is a leaf role — everything under it is cut out of the accessibility
134
+ * tree, so a live region in there announces to nobody. This is a **sibling** of
135
+ * the picture, clipped rather than painted, and it is what makes the arrow keys
136
+ * mean something to a reader who is not looking at the plot.
137
+ *
138
+ * Empty when nothing is active, so leaving the chart clears what was said
139
+ * rather than leaving the last column standing in the region forever.
140
+ */
141
+ export declare function ChartStatus({ heading, items }: {
142
+ heading?: React.ReactNode;
143
+ items: readonly MPChartTooltipItem[];
144
+ }): React.JSX.Element;
145
+ interface TableProps {
146
+ id: string;
147
+ caption: string;
148
+ corner: React.ReactNode;
149
+ categories: readonly MPChartCategory[];
150
+ /** One per column, beside the category's own. */
151
+ names: readonly (string | undefined)[];
152
+ values: readonly (readonly ChartValue[])[];
153
+ format: (value: number) => string;
154
+ locale: string | undefined;
155
+ empty: string;
156
+ }
157
+ /**
158
+ * The numbers behind the picture, as a grid.
159
+ *
160
+ * Clipped rather than drawn. Every chart here ships one and it is what
161
+ * `aria-describedby` points at, so a reader who cannot see the plot has the
162
+ * data itself rather than a summary of it — and a reader who can see the plot
163
+ * is not made to scroll past a table they did not ask for.
164
+ *
165
+ * Rendered rather than built on demand, because it is the description of a
166
+ * focusable element: an `aria-describedby` pointing at an id that does not
167
+ * exist yet is an `aria-describedby` pointing at nothing.
168
+ */
169
+ export declare function ChartTable({ id, caption, corner, categories, names, values, format, locale, empty }: TableProps): React.JSX.Element;
170
+ export interface ChartShellProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'color' | 'title'> {
171
+ size: MPSize;
172
+ /** The element the drawing is measured in and focused on. */
173
+ plotRef: React.RefObject<HTMLDivElement | null>;
174
+ /** Its accessible name, already resolved — never an optional prop passed straight through. */
175
+ name: string;
176
+ /** The id of the table describing it, or nothing when there is nothing to describe. */
177
+ describedBy?: string;
178
+ /** Whether there is anything here to walk. A chart with no data is not a tab stop. */
179
+ interactive: boolean;
180
+ height?: number | string;
181
+ /** The pointer and keyboard handlers, which are the plot's own business. */
182
+ plotProps?: React.HTMLAttributes<HTMLDivElement>;
183
+ /** The drawing: an `<svg>`, or the empty state. */
184
+ children: React.ReactNode;
185
+ /** Floated over the drawing. */
186
+ tooltip?: React.ReactNode;
187
+ legend?: React.ReactNode;
188
+ legendSide?: MPSide;
189
+ status: {
190
+ heading?: React.ReactNode;
191
+ items: readonly MPChartTooltipItem[];
192
+ };
193
+ table?: React.ReactNode;
194
+ }
195
+ /**
196
+ * The arrangement: a plot, a legend on one of its four sides, a readout beside
197
+ * it and the table underneath.
198
+ *
199
+ * The readout is a **sibling** of the plot rather than a child, and that is a
200
+ * constraint rather than a layout preference — see `ChartStatus`. Putting the
201
+ * arrangement here is what keeps the two frames from disagreeing about it: the
202
+ * one place this is easy to get wrong is the one place it must not be.
203
+ */
204
+ export declare function ChartShell({ size, plotRef, name, describedBy, interactive, height, plotProps, children, tooltip, legend, legendSide, status, table, className, ...rest }: ChartShellProps): React.JSX.Element;
205
+ export {};