material-plus-ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/README.md +2 -2
  2. package/dist/components/accordion/MPAccordion.d.ts +21 -1
  3. package/dist/components/accordion/MPAccordion.js +1 -1
  4. package/dist/components/alert/MPAlert.d.ts +33 -2
  5. package/dist/components/alert/MPAlert.js +1 -1
  6. package/dist/components/anchor/MPAnchor.d.ts +107 -0
  7. package/dist/components/anchor/MPAnchor.js +2 -0
  8. package/dist/components/anchor/index.d.ts +2 -0
  9. package/dist/components/anchor/index.js +1 -0
  10. package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
  11. package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
  12. package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
  13. package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
  14. package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
  15. package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
  16. package/dist/components/animate-counter/index.d.ts +2 -0
  17. package/dist/components/animate-counter/index.js +1 -0
  18. package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
  19. package/dist/components/animate-fade/MPAnimateFade.js +2 -1
  20. package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
  21. package/dist/components/animate-float/MPAnimateFloat.js +2 -0
  22. package/dist/components/animate-float/index.d.ts +2 -0
  23. package/dist/components/animate-float/index.js +1 -0
  24. package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
  25. package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
  26. package/dist/components/animate-lighting/MPAnimateLighting.js +2 -1
  27. package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
  28. package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
  29. package/dist/components/animate-reveal/index.d.ts +2 -0
  30. package/dist/components/animate-reveal/index.js +1 -0
  31. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
  32. package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
  33. package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
  34. package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
  35. package/dist/components/animate-scramble/index.d.ts +2 -0
  36. package/dist/components/animate-scramble/index.js +1 -0
  37. package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
  38. package/dist/components/animate-shake/MPAnimateShake.js +2 -0
  39. package/dist/components/animate-shake/index.d.ts +2 -0
  40. package/dist/components/animate-shake/index.js +1 -0
  41. package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
  42. package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
  43. package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
  44. package/dist/components/animate-split/MPAnimateSplit.js +2 -0
  45. package/dist/components/animate-split/index.d.ts +2 -0
  46. package/dist/components/animate-split/index.js +1 -0
  47. package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
  48. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
  49. package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
  50. package/dist/components/app-logo/MPAppLogo.d.ts +156 -0
  51. package/dist/components/app-logo/MPAppLogo.js +2 -0
  52. package/dist/components/app-logo/index.d.ts +2 -0
  53. package/dist/components/app-logo/index.js +1 -0
  54. package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
  55. package/dist/components/area-chart/MPAreaChart.js +2 -0
  56. package/dist/components/area-chart/index.d.ts +2 -0
  57. package/dist/components/area-chart/index.js +1 -0
  58. package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
  59. package/dist/components/avatar/MPAvatar.d.ts +10 -1
  60. package/dist/components/avatar/MPAvatar.js +1 -1
  61. package/dist/components/badge/MPBadge.js +1 -1
  62. package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
  63. package/dist/components/bar-chart/MPBarChart.js +2 -0
  64. package/dist/components/bar-chart/index.d.ts +2 -0
  65. package/dist/components/bar-chart/index.js +1 -0
  66. package/dist/components/blockquote/MPBlockquote.d.ts +10 -1
  67. package/dist/components/blockquote/MPBlockquote.js +1 -1
  68. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +19 -18
  69. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
  70. package/dist/components/box/MPBox.d.ts +43 -8
  71. package/dist/components/box/MPBox.js +2 -1
  72. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  73. package/dist/components/button/MPButton.d.ts +49 -3
  74. package/dist/components/button/MPButton.js +1 -1
  75. package/dist/components/calendar/MPCalendar.d.ts +160 -0
  76. package/dist/components/calendar/MPCalendar.js +2 -0
  77. package/dist/components/calendar/index.d.ts +2 -0
  78. package/dist/components/calendar/index.js +1 -0
  79. package/dist/components/card/MPCard.js +1 -1
  80. package/dist/components/carousel/MPCarousel.js +1 -1
  81. package/dist/components/chat-bubble/MPChatBubble.js +1 -1
  82. package/dist/components/checkbox/MPCheckbox.js +1 -1
  83. package/dist/components/chip/MPChip.d.ts +31 -7
  84. package/dist/components/chip/MPChip.js +1 -1
  85. package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
  86. package/dist/components/code-block/MPCodeBlock.js +2 -0
  87. package/dist/components/code-block/index.d.ts +2 -0
  88. package/dist/components/code-block/index.js +1 -0
  89. package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
  90. package/dist/components/collapsible/MPCollapsible.js +1 -1
  91. package/dist/components/color-picker/MPColorPicker.js +1 -1
  92. package/dist/components/combobox/MPCombobox.d.ts +71 -5
  93. package/dist/components/combobox/MPCombobox.js +1 -1
  94. package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
  95. package/dist/components/command-palette/MPCommandPalette.js +1 -1
  96. package/dist/components/config/MPConfigProvider.d.ts +166 -0
  97. package/dist/components/config/MPConfigProvider.js +2 -0
  98. package/dist/components/config/index.d.ts +2 -0
  99. package/dist/components/config/index.js +1 -0
  100. package/dist/components/confirm/MPConfirmProvider.d.ts +143 -0
  101. package/dist/components/confirm/MPConfirmProvider.js +2 -0
  102. package/dist/components/confirm/index.d.ts +2 -0
  103. package/dist/components/confirm/index.js +1 -0
  104. package/dist/components/container/MPContainer.d.ts +9 -2
  105. package/dist/components/container/MPContainer.js +2 -1
  106. package/dist/components/data-list/MPDataList.d.ts +82 -0
  107. package/dist/components/data-list/MPDataList.js +2 -0
  108. package/dist/components/data-list/index.d.ts +2 -0
  109. package/dist/components/data-list/index.js +1 -0
  110. package/dist/components/data-table/MPDataTable.d.ts +295 -0
  111. package/dist/components/data-table/MPDataTable.js +2 -0
  112. package/dist/components/data-table/index.d.ts +2 -0
  113. package/dist/components/data-table/index.js +1 -0
  114. package/dist/components/date-picker/MPDatePicker.d.ts +53 -2
  115. package/dist/components/date-picker/MPDatePicker.js +1 -1
  116. package/dist/components/date-picker/index.d.ts +1 -1
  117. package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
  118. package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
  119. package/dist/components/dialog/MPDialog.d.ts +24 -3
  120. package/dist/components/dialog/MPDialog.js +1 -1
  121. package/dist/components/divider/MPDivider.js +1 -1
  122. package/dist/components/drawer/MPDrawer.d.ts +8 -2
  123. package/dist/components/drawer/MPDrawer.js +1 -1
  124. package/dist/components/empty/MPEmpty.d.ts +10 -1
  125. package/dist/components/empty/MPEmpty.js +1 -1
  126. package/dist/components/fieldset/MPFieldset.js +1 -1
  127. package/dist/components/file-picker/MPFilePicker.js +1 -1
  128. package/dist/components/flex/MPFlex.d.ts +95 -0
  129. package/dist/components/flex/MPFlex.js +2 -0
  130. package/dist/components/flex/index.d.ts +2 -0
  131. package/dist/components/flex/index.js +1 -0
  132. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  133. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
  134. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
  135. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  136. package/dist/components/floating-bottom-navigation/index.js +1 -0
  137. package/dist/components/footer/MPFooter.d.ts +24 -4
  138. package/dist/components/footer/MPFooter.js +1 -1
  139. package/dist/components/form/MPForm.js +1 -1
  140. package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
  141. package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
  142. package/dist/components/gauge-chart/index.d.ts +2 -0
  143. package/dist/components/gauge-chart/index.js +1 -0
  144. package/dist/components/grid/MPGrid.d.ts +23 -1
  145. package/dist/components/grid/MPGrid.js +1 -1
  146. package/dist/components/header/MPHeader.d.ts +26 -4
  147. package/dist/components/header/MPHeader.js +1 -1
  148. package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
  149. package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
  150. package/dist/components/heatmap-chart/index.d.ts +2 -0
  151. package/dist/components/heatmap-chart/index.js +1 -0
  152. package/dist/components/hover-card/MPHoverCard.d.ts +100 -0
  153. package/dist/components/hover-card/MPHoverCard.js +2 -0
  154. package/dist/components/hover-card/index.d.ts +2 -0
  155. package/dist/components/hover-card/index.js +1 -0
  156. package/dist/components/image/MPImage.d.ts +121 -0
  157. package/dist/components/image/MPImage.js +2 -0
  158. package/dist/components/image/index.d.ts +2 -0
  159. package/dist/components/image/index.js +1 -0
  160. package/dist/components/line-chart/MPLineChart.d.ts +66 -0
  161. package/dist/components/line-chart/MPLineChart.js +2 -0
  162. package/dist/components/line-chart/index.d.ts +2 -0
  163. package/dist/components/line-chart/index.js +1 -0
  164. package/dist/components/list/MPList.d.ts +51 -1
  165. package/dist/components/list/MPList.js +1 -1
  166. package/dist/components/menu/MPMenu.d.ts +21 -2
  167. package/dist/components/menu/MPMenu.js +1 -1
  168. package/dist/components/menubar/MPMenubar.js +1 -1
  169. package/dist/components/meter/MPMeter.d.ts +87 -0
  170. package/dist/components/meter/MPMeter.js +2 -0
  171. package/dist/components/meter/index.d.ts +2 -0
  172. package/dist/components/meter/index.js +1 -0
  173. package/dist/components/mockup/MPMockup.d.ts +143 -0
  174. package/dist/components/mockup/MPMockup.js +2 -0
  175. package/dist/components/mockup/index.d.ts +2 -0
  176. package/dist/components/mockup/index.js +1 -0
  177. package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
  178. package/dist/components/number-field/MPNumberField.d.ts +3 -3
  179. package/dist/components/number-field/MPNumberField.js +1 -1
  180. package/dist/components/otp-field/MPOtpField.js +1 -1
  181. package/dist/components/overlay/MPOverlay.d.ts +1 -1
  182. package/dist/components/overlay/MPOverlay.js +1 -1
  183. package/dist/components/pagination/MPPagination.js +1 -1
  184. package/dist/components/panes/MPPanes.js +1 -1
  185. package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
  186. package/dist/components/pie-chart/MPPieChart.js +2 -0
  187. package/dist/components/pie-chart/index.d.ts +2 -0
  188. package/dist/components/pie-chart/index.js +1 -0
  189. package/dist/components/pill/MPPill.js +1 -1
  190. package/dist/components/popconfirm/MPPopconfirm.d.ts +92 -0
  191. package/dist/components/popconfirm/MPPopconfirm.js +2 -0
  192. package/dist/components/popconfirm/index.d.ts +2 -0
  193. package/dist/components/popconfirm/index.js +1 -0
  194. package/dist/components/popover/MPPopover.d.ts +1 -1
  195. package/dist/components/popover/MPPopover.js +1 -1
  196. package/dist/components/portal/MPPortal.d.ts +75 -0
  197. package/dist/components/portal/MPPortal.js +2 -0
  198. package/dist/components/portal/index.d.ts +2 -0
  199. package/dist/components/portal/index.js +1 -0
  200. package/dist/components/progress-box/MPProgressBox.js +1 -1
  201. package/dist/components/progress-circular/MPProgressCircular.js +1 -1
  202. package/dist/components/progress-linear/MPProgressLinear.js +1 -1
  203. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  204. package/dist/components/rating/MPRating.js +1 -1
  205. package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
  206. package/dist/components/scatter-chart/MPScatterChart.js +2 -0
  207. package/dist/components/scatter-chart/index.d.ts +2 -0
  208. package/dist/components/scatter-chart/index.js +1 -0
  209. package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
  210. package/dist/components/scroll-area/MPScrollArea.js +2 -0
  211. package/dist/components/scroll-area/index.d.ts +2 -0
  212. package/dist/components/scroll-area/index.js +1 -0
  213. package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
  214. package/dist/components/scroll-zone/MPScrollZone.js +2 -0
  215. package/dist/components/scroll-zone/index.d.ts +2 -0
  216. package/dist/components/scroll-zone/index.js +1 -0
  217. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  218. package/dist/components/select/MPSelect.d.ts +28 -5
  219. package/dist/components/select/MPSelect.js +1 -1
  220. package/dist/components/shortcut/MPShortcut.js +1 -1
  221. package/dist/components/show/MPShow.d.ts +78 -0
  222. package/dist/components/show/MPShow.js +2 -0
  223. package/dist/components/show/index.d.ts +2 -0
  224. package/dist/components/show/index.js +1 -0
  225. package/dist/components/sidebar/MPSidebar.d.ts +20 -1
  226. package/dist/components/sidebar/MPSidebar.js +1 -1
  227. package/dist/components/skeleton/MPSkeleton.js +1 -1
  228. package/dist/components/slider/MPSlider.d.ts +27 -0
  229. package/dist/components/slider/MPSlider.js +1 -1
  230. package/dist/components/snackbar/MPSnackbar.d.ts +20 -1
  231. package/dist/components/snackbar/MPSnackbar.js +1 -1
  232. package/dist/components/sparkline/MPSparkline.d.ts +85 -0
  233. package/dist/components/sparkline/MPSparkline.js +2 -0
  234. package/dist/components/sparkline/index.d.ts +2 -0
  235. package/dist/components/sparkline/index.js +1 -0
  236. package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
  237. package/dist/components/spoiler/MPSpoiler.js +1 -1
  238. package/dist/components/stack/MPStack.d.ts +198 -0
  239. package/dist/components/stack/MPStack.js +2 -0
  240. package/dist/components/stack/index.d.ts +2 -0
  241. package/dist/components/stack/index.js +1 -0
  242. package/dist/components/statistic/MPStatistic.d.ts +104 -0
  243. package/dist/components/statistic/MPStatistic.js +2 -0
  244. package/dist/components/statistic/index.d.ts +2 -0
  245. package/dist/components/statistic/index.js +1 -0
  246. package/dist/components/stepper/MPStepper.d.ts +153 -0
  247. package/dist/components/stepper/MPStepper.js +2 -0
  248. package/dist/components/stepper/index.d.ts +2 -0
  249. package/dist/components/stepper/index.js +1 -0
  250. package/dist/components/switch/MPSwitch.js +1 -1
  251. package/dist/components/table/MPTable.d.ts +24 -2
  252. package/dist/components/table/MPTable.js +1 -1
  253. package/dist/components/tabs/MPTabs.d.ts +12 -0
  254. package/dist/components/tabs/MPTabs.js +1 -1
  255. package/dist/components/text-field/MPTextField.d.ts +38 -14
  256. package/dist/components/text-field/MPTextField.js +1 -1
  257. package/dist/components/time-picker/MPTimePicker.js +1 -1
  258. package/dist/components/timeline/MPTimeline.d.ts +10 -2
  259. package/dist/components/timeline/MPTimeline.js +1 -1
  260. package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
  261. package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
  262. package/dist/components/timeline-chart/index.d.ts +2 -0
  263. package/dist/components/timeline-chart/index.js +1 -0
  264. package/dist/components/toggle/MPToggle.js +1 -1
  265. package/dist/components/toolbar/MPToolbar.d.ts +106 -0
  266. package/dist/components/toolbar/MPToolbar.js +2 -0
  267. package/dist/components/toolbar/index.d.ts +2 -0
  268. package/dist/components/toolbar/index.js +1 -0
  269. package/dist/components/tour/MPTour.d.ts +120 -0
  270. package/dist/components/tour/MPTour.js +2 -0
  271. package/dist/components/tour/index.d.ts +2 -0
  272. package/dist/components/tour/index.js +1 -0
  273. package/dist/components/transfer/MPTransfer.js +1 -1
  274. package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
  275. package/dist/components/tree-select/MPTreeSelect.js +2 -0
  276. package/dist/components/tree-select/index.d.ts +2 -0
  277. package/dist/components/tree-select/index.js +1 -0
  278. package/dist/components/tree-view/MPTreeView.d.ts +153 -0
  279. package/dist/components/tree-view/MPTreeView.js +2 -0
  280. package/dist/components/tree-view/index.d.ts +2 -0
  281. package/dist/components/tree-view/index.js +1 -0
  282. package/dist/components/typography/MPTypography.d.ts +17 -1
  283. package/dist/components/typography/MPTypography.js +1 -1
  284. package/dist/components/visually-hidden/MPVisuallyHidden.d.ts +60 -0
  285. package/dist/components/visually-hidden/MPVisuallyHidden.js +2 -0
  286. package/dist/components/visually-hidden/index.d.ts +2 -0
  287. package/dist/components/visually-hidden/index.js +1 -0
  288. package/dist/constants/glyphs.d.ts +4 -0
  289. package/dist/constants/glyphs.js +1 -1
  290. package/dist/constants/icons.d.ts +2 -0
  291. package/dist/constants/icons.js +1 -1
  292. package/dist/hooks/index.d.ts +40 -0
  293. package/dist/hooks/index.js +1 -0
  294. package/dist/hooks/useMPColorScheme.d.ts +135 -0
  295. package/dist/hooks/useMPColorScheme.js +2 -0
  296. package/dist/hooks/useMPDisclosure.d.ts +58 -0
  297. package/dist/hooks/useMPDisclosure.js +2 -0
  298. package/dist/hooks/useMPElementSize.d.ts +55 -0
  299. package/dist/hooks/useMPElementSize.js +2 -0
  300. package/dist/hooks/useMPMediaQuery.d.ts +40 -0
  301. package/dist/hooks/useMPMediaQuery.js +2 -0
  302. package/dist/hooks/useMPOnScreen.d.ts +58 -0
  303. package/dist/hooks/useMPOnScreen.js +2 -0
  304. package/dist/hooks/useMPReducedMotion.d.ts +32 -0
  305. package/dist/hooks/useMPReducedMotion.js +2 -0
  306. package/dist/hooks/useMPShortcut.d.ts +105 -0
  307. package/dist/hooks/useMPShortcut.js +2 -0
  308. package/dist/hooks/useMPWindowClass.d.ts +55 -0
  309. package/dist/hooks/useMPWindowClass.js +2 -0
  310. package/dist/index.d.ts +43 -1
  311. package/dist/index.js +1 -1
  312. package/dist/internal/Calendar.d.ts +19 -4
  313. package/dist/internal/Calendar.js +1 -1
  314. package/dist/internal/ChartChrome.d.ts +205 -0
  315. package/dist/internal/ChartChrome.js +2 -0
  316. package/dist/internal/ChartFrame.d.ts +197 -0
  317. package/dist/internal/ChartFrame.js +2 -0
  318. package/dist/internal/FieldOutline.d.ts +14 -5
  319. package/dist/internal/FieldOutline.js +1 -1
  320. package/dist/internal/Picker.d.ts +15 -3
  321. package/dist/internal/Picker.js +1 -1
  322. package/dist/internal/SupportingText.d.ts +24 -0
  323. package/dist/internal/SupportingText.js +1 -1
  324. package/dist/internal/animate-core.d.ts +121 -0
  325. package/dist/internal/animate-core.js +1 -0
  326. package/dist/internal/animate.d.ts +75 -55
  327. package/dist/internal/animate.js +1 -1
  328. package/dist/internal/bottom-navigation.d.ts +58 -0
  329. package/dist/internal/bottom-navigation.js +2 -0
  330. package/dist/internal/chart.d.ts +471 -0
  331. package/dist/internal/chart.js +1 -0
  332. package/dist/internal/color-scheme.d.ts +28 -0
  333. package/dist/internal/color-scheme.js +2 -0
  334. package/dist/internal/config.d.ts +62 -0
  335. package/dist/internal/config.js +2 -0
  336. package/dist/internal/data-table.d.ts +162 -0
  337. package/dist/internal/data-table.js +1 -0
  338. package/dist/internal/date.d.ts +50 -3
  339. package/dist/internal/date.js +1 -1
  340. package/dist/internal/density.d.ts +9 -0
  341. package/dist/internal/density.js +1 -0
  342. package/dist/internal/elevation.d.ts +26 -0
  343. package/dist/internal/elevation.js +1 -0
  344. package/dist/internal/highlight.d.ts +96 -0
  345. package/dist/internal/highlight.js +1 -0
  346. package/dist/internal/i18n.d.ts +196 -1
  347. package/dist/internal/initials.d.ts +28 -0
  348. package/dist/internal/initials.js +1 -0
  349. package/dist/internal/mark.d.ts +52 -0
  350. package/dist/internal/mark.js +1 -0
  351. package/dist/internal/measure.d.ts +31 -0
  352. package/dist/internal/measure.js +1 -0
  353. package/dist/internal/messages/anchor.d.ts +3 -0
  354. package/dist/internal/messages/anchor.js +1 -0
  355. package/dist/internal/messages/chart.d.ts +3 -0
  356. package/dist/internal/messages/chart.js +1 -0
  357. package/dist/internal/messages/code.d.ts +3 -0
  358. package/dist/internal/messages/code.js +1 -0
  359. package/dist/internal/messages/confirm.d.ts +3 -0
  360. package/dist/internal/messages/confirm.js +1 -0
  361. package/dist/internal/messages/data-table.d.ts +3 -0
  362. package/dist/internal/messages/data-table.js +1 -0
  363. package/dist/internal/messages/picker.js +1 -1
  364. package/dist/internal/messages/scroll.d.ts +3 -0
  365. package/dist/internal/messages/scroll.js +1 -0
  366. package/dist/internal/messages/sparkline.d.ts +3 -0
  367. package/dist/internal/messages/sparkline.js +1 -0
  368. package/dist/internal/messages/tour.d.ts +3 -0
  369. package/dist/internal/messages/tour.js +1 -0
  370. package/dist/internal/mockup.d.ts +174 -0
  371. package/dist/internal/mockup.js +2 -0
  372. package/dist/internal/page-layout.d.ts +24 -5
  373. package/dist/internal/page-layout.js +1 -1
  374. package/dist/internal/progress.d.ts +14 -0
  375. package/dist/internal/responsive.d.ts +55 -0
  376. package/dist/internal/responsive.js +1 -0
  377. package/dist/internal/scale.d.ts +0 -17
  378. package/dist/internal/scale.js +1 -1
  379. package/dist/internal/step.d.ts +86 -0
  380. package/dist/internal/step.js +1 -0
  381. package/dist/internal/table.d.ts +53 -0
  382. package/dist/internal/table.js +1 -0
  383. package/dist/internal/text.d.ts +57 -0
  384. package/dist/internal/text.js +1 -0
  385. package/dist/internal/threshold.d.ts +19 -0
  386. package/dist/internal/threshold.js +1 -0
  387. package/dist/internal/time-scale.d.ts +44 -0
  388. package/dist/internal/time-scale.js +1 -0
  389. package/dist/internal/transition.d.ts +33 -0
  390. package/dist/internal/transition.js +1 -0
  391. package/dist/internal/visibility.d.ts +48 -0
  392. package/dist/internal/visibility.js +1 -0
  393. package/dist/internal/window-class.d.ts +48 -0
  394. package/dist/internal/window-class.js +2 -0
  395. package/dist/locales/ar.js +1 -1
  396. package/dist/locales/de.js +1 -1
  397. package/dist/locales/es.js +1 -1
  398. package/dist/locales/fr.js +1 -1
  399. package/dist/locales/hi.js +1 -1
  400. package/dist/locales/id.js +1 -1
  401. package/dist/locales/it.js +1 -1
  402. package/dist/locales/ja.js +1 -1
  403. package/dist/locales/ko.js +1 -1
  404. package/dist/locales/nl.js +1 -1
  405. package/dist/locales/pl.js +1 -1
  406. package/dist/locales/pt.js +1 -1
  407. package/dist/locales/ru.js +1 -1
  408. package/dist/locales/th.js +1 -1
  409. package/dist/locales/tr.js +1 -1
  410. package/dist/locales/vi.js +1 -1
  411. package/dist/locales/zh-hans.js +1 -1
  412. package/dist/locales/zh-hant.js +1 -1
  413. package/dist/styles/accordion.css +1 -1
  414. package/dist/styles/alert.css +1 -1
  415. package/dist/styles/anchor.css +2 -0
  416. package/dist/styles/animate-appear.css +1 -1
  417. package/dist/styles/animate-blink.css +1 -1
  418. package/dist/styles/animate-counter.css +2 -0
  419. package/dist/styles/animate-fade.css +1 -1
  420. package/dist/styles/animate-float.css +2 -0
  421. package/dist/styles/animate-grow.css +1 -1
  422. package/dist/styles/animate-headline.css +1 -1
  423. package/dist/styles/animate-lighting.css +1 -1
  424. package/dist/styles/animate-marquee.css +1 -1
  425. package/dist/styles/animate-reveal.css +2 -0
  426. package/dist/styles/animate-rotate.css +1 -1
  427. package/dist/styles/animate-scramble.css +2 -0
  428. package/dist/styles/animate-shake.css +2 -0
  429. package/dist/styles/animate-slide.css +1 -1
  430. package/dist/styles/animate-split.css +2 -0
  431. package/dist/styles/animate-typing.css +1 -1
  432. package/dist/styles/animate-zoom.css +1 -1
  433. package/dist/styles/app-logo.css +2 -0
  434. package/dist/styles/area-chart.css +2 -0
  435. package/dist/styles/aspect-ratio.css +1 -1
  436. package/dist/styles/avatar.css +1 -1
  437. package/dist/styles/badge.css +1 -1
  438. package/dist/styles/bar-chart.css +2 -0
  439. package/dist/styles/blockquote.css +1 -1
  440. package/dist/styles/bottom-navigation.css +1 -1
  441. package/dist/styles/box.css +1 -1
  442. package/dist/styles/breadcrumb.css +1 -1
  443. package/dist/styles/button.css +1 -1
  444. package/dist/styles/calendar.css +2 -0
  445. package/dist/styles/card.css +1 -1
  446. package/dist/styles/carousel.css +1 -1
  447. package/dist/styles/chat-bubble.css +1 -1
  448. package/dist/styles/checkbox.css +1 -1
  449. package/dist/styles/chip.css +1 -1
  450. package/dist/styles/code-block.css +2 -0
  451. package/dist/styles/collapsible.css +1 -1
  452. package/dist/styles/color-picker.css +1 -1
  453. package/dist/styles/combobox.css +1 -1
  454. package/dist/styles/command-palette.css +1 -1
  455. package/dist/styles/config.css +2 -0
  456. package/dist/styles/confirm.css +2 -0
  457. package/dist/styles/container.css +1 -1
  458. package/dist/styles/data-list.css +2 -0
  459. package/dist/styles/data-table.css +2 -0
  460. package/dist/styles/date-picker.css +1 -1
  461. package/dist/styles/date-range-picker.css +1 -1
  462. package/dist/styles/date-time-picker.css +1 -1
  463. package/dist/styles/dialog.css +1 -1
  464. package/dist/styles/divider.css +1 -1
  465. package/dist/styles/drawer.css +1 -1
  466. package/dist/styles/empty.css +1 -1
  467. package/dist/styles/fieldset.css +1 -1
  468. package/dist/styles/file-picker.css +1 -1
  469. package/dist/styles/flex.css +2 -0
  470. package/dist/styles/floating-action-button.css +1 -1
  471. package/dist/styles/floating-bottom-navigation.css +2 -0
  472. package/dist/styles/footer.css +1 -1
  473. package/dist/styles/form.css +1 -1
  474. package/dist/styles/gauge-chart.css +2 -0
  475. package/dist/styles/grid.css +1 -1
  476. package/dist/styles/header.css +1 -1
  477. package/dist/styles/heatmap-chart.css +2 -0
  478. package/dist/styles/highlight.css +1 -1
  479. package/dist/styles/hover-card.css +2 -0
  480. package/dist/styles/icon-button.css +1 -1
  481. package/dist/styles/image.css +2 -0
  482. package/dist/styles/line-chart.css +2 -0
  483. package/dist/styles/list.css +1 -1
  484. package/dist/styles/locale.css +1 -1
  485. package/dist/styles/menu.css +1 -1
  486. package/dist/styles/menubar.css +1 -1
  487. package/dist/styles/meter.css +2 -0
  488. package/dist/styles/mockup.css +2 -0
  489. package/dist/styles/navigation-menu.css +1 -1
  490. package/dist/styles/number-field.css +1 -1
  491. package/dist/styles/otp-field.css +1 -1
  492. package/dist/styles/overlay.css +1 -1
  493. package/dist/styles/page-layout.css +1 -1
  494. package/dist/styles/pagination.css +1 -1
  495. package/dist/styles/panes.css +1 -1
  496. package/dist/styles/pie-chart.css +2 -0
  497. package/dist/styles/pill.css +1 -1
  498. package/dist/styles/popconfirm.css +2 -0
  499. package/dist/styles/popover.css +1 -1
  500. package/dist/styles/portal.css +2 -0
  501. package/dist/styles/progress-box.css +1 -1
  502. package/dist/styles/progress-circular.css +1 -1
  503. package/dist/styles/progress-linear.css +1 -1
  504. package/dist/styles/radio-group.css +1 -1
  505. package/dist/styles/rating.css +1 -1
  506. package/dist/styles/scatter-chart.css +2 -0
  507. package/dist/styles/scroll-area.css +2 -0
  508. package/dist/styles/scroll-zone.css +2 -0
  509. package/dist/styles/segmented-button.css +1 -1
  510. package/dist/styles/select.css +1 -1
  511. package/dist/styles/shortcut.css +1 -1
  512. package/dist/styles/show.css +2 -0
  513. package/dist/styles/sidebar.css +1 -1
  514. package/dist/styles/skeleton.css +1 -1
  515. package/dist/styles/slider.css +1 -1
  516. package/dist/styles/snackbar.css +1 -1
  517. package/dist/styles/sparkline.css +2 -0
  518. package/dist/styles/spoiler.css +1 -1
  519. package/dist/styles/stack.css +2 -0
  520. package/dist/styles/statistic.css +2 -0
  521. package/dist/styles/stepper.css +2 -0
  522. package/dist/styles/switch.css +1 -1
  523. package/dist/styles/table.css +1 -1
  524. package/dist/styles/tabs.css +1 -1
  525. package/dist/styles/text-field.css +1 -1
  526. package/dist/styles/text-link.css +1 -1
  527. package/dist/styles/time-picker.css +1 -1
  528. package/dist/styles/timeline-chart.css +2 -0
  529. package/dist/styles/timeline.css +1 -1
  530. package/dist/styles/toggle.css +1 -1
  531. package/dist/styles/tokens.css +1 -1
  532. package/dist/styles/toolbar.css +2 -0
  533. package/dist/styles/tour.css +2 -0
  534. package/dist/styles/transfer.css +1 -1
  535. package/dist/styles/tree-select.css +2 -0
  536. package/dist/styles/tree-view.css +2 -0
  537. package/dist/styles/typography.css +1 -1
  538. package/dist/styles/visually-hidden.css +2 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/tailwind.css +1423 -114
  541. package/dist/types.d.ts +628 -3
  542. package/package.json +8 -2
  543. package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
  544. package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
  545. package/dist/components/avatar-group/index.d.ts +0 -2
  546. package/dist/components/avatar-group/index.js +0 -1
  547. package/dist/internal/avatar-group.d.ts +0 -22
  548. package/dist/internal/avatar-group.js +0 -2
  549. package/dist/styles/avatar-group.css +0 -2
@@ -1,7 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { type MPPickerLabels } from '../../internal/Calendar.js';
3
3
  import { type MPPickerShellProps } from '../../internal/Picker.js';
4
+ import { type MPDatePrecision } from '../../internal/date.js';
4
5
  import type { MPWeekday } from '../../types.js';
6
+ /**
7
+ * Which unit a picker asks for.
8
+ *
9
+ * Re-exported so a caller storing the answer can name what they are holding —
10
+ * a `'month'` picker's value is a month, and the day inside it is an artefact.
11
+ */
12
+ export type { MPDatePrecision };
5
13
  export interface MPDatePickerProps extends MPPickerShellProps {
6
14
  /** The chosen day. Use with `onValueChange` for a controlled picker. */
7
15
  value?: Date | null;
@@ -13,18 +21,45 @@ export interface MPDatePickerProps extends MPPickerShellProps {
13
21
  open?: boolean;
14
22
  defaultOpen?: boolean;
15
23
  onOpenChange?: (open: boolean) => void;
24
+ /**
25
+ * Which unit the picker asks for.
26
+ *
27
+ * `'month'` stops the calendar at its grid of twelve months and answers with
28
+ * the 1st of the one that is pressed; `'year'` stops at the grid of years and
29
+ * answers with the 1st of January. A card's expiry, a fiscal year, the month a
30
+ * report covers — the questions where a day is not something the reader has to
31
+ * give and the value should not pretend they did.
32
+ *
33
+ * The finer views are not hidden so much as absent: a month picker never draws
34
+ * a day grid, so there is no way through it to a day. What follows the
35
+ * precision with it is the trigger's default `format`, what the hidden input
36
+ * submits, and the word on the footer's shortcut.
37
+ * @default 'day'
38
+ */
39
+ precision?: MPDatePrecision;
16
40
  /**
17
41
  * Which month the calendar opens on when there is no value.
18
42
  * @default this month
19
43
  */
20
44
  defaultMonth?: Date;
21
- /** The earliest day that may be chosen. Day-granular — the time is ignored. */
45
+ /**
46
+ * The earliest day that may be chosen. Day-granular — the time is ignored.
47
+ *
48
+ * Read at whatever `precision` asks for: a minimum of 10 July still leaves
49
+ * July pickable on a month picker, because there the bound is about which
50
+ * months exist.
51
+ */
22
52
  minDate?: Date | null;
23
53
  /** The latest day that may be chosen. */
24
54
  maxDate?: Date | null;
25
55
  /**
26
56
  * Blocks individual days that are inside the range but still not available —
27
57
  * weekends, holidays, a room that is already booked.
58
+ *
59
+ * Asked about days and only about days, so a picker whose `precision` is a
60
+ * month or a year never consults it: a rule written about weekends has no
61
+ * answer for "is July available", and inventing one out of the 1st would block
62
+ * whichever months happened to start on a Sunday.
28
63
  */
29
64
  shouldDisableDate?: (date: Date) => boolean;
30
65
  /**
@@ -42,6 +77,8 @@ export interface MPDatePickerProps extends MPPickerShellProps {
42
77
  *
43
78
  * An object written inline is fine: what the picker keeps between renders is
44
79
  * keyed on what the format *says*, not on the object that says it.
80
+ *
81
+ * Left out, it follows `precision`: a medium date, `July 2026`, or `2026`.
45
82
  * @default { dateStyle: 'medium' }
46
83
  */
47
84
  format?: Intl.DateTimeFormatOptions;
@@ -54,6 +91,9 @@ export interface MPDatePickerProps extends MPPickerShellProps {
54
91
  clearable?: boolean;
55
92
  /**
56
93
  * Offers the shortcut to today in the footer.
94
+ *
95
+ * It lands on whatever unit is being asked for, and says so: *Today*, *This
96
+ * month* or *This year*.
57
97
  * @default true
58
98
  */
59
99
  showTodayButton?: boolean;
@@ -67,7 +107,10 @@ export interface MPDatePickerProps extends MPPickerShellProps {
67
107
  * given falls back to the translation for `locale`, and then to English.
68
108
  */
69
109
  labels?: Partial<MPPickerLabels>;
70
- /** Identifies the field when a form is submitted, as `YYYY-MM-DD`. */
110
+ /**
111
+ * Identifies the field when a form is submitted, as `YYYY-MM-DD` — or as
112
+ * `YYYY-MM` or `YYYY` when `precision` asks for less.
113
+ */
71
114
  name?: string;
72
115
  }
73
116
  /**
@@ -86,6 +129,14 @@ export interface MPDatePickerProps extends MPPickerShellProps {
86
129
  * picker, and this is drawn on MD3's own numbers: a 40dp cell, a filled circle
87
130
  * for the chosen day, an outlined one for today.
88
131
  *
132
+ * ## A day, a month, or a year
133
+ *
134
+ * `precision` decides which of the three the calendar stops at, and it stops by
135
+ * leaving the finer views out rather than by refusing them: a month picker opens
136
+ * on the twelve months and has no day grid to reach, a year picker opens on the
137
+ * years. Everything downstream follows — how the trigger writes the value, what
138
+ * a form submits, and whether the footer's shortcut says *Today* or *This year*.
139
+ *
89
140
  * ## Every string comes from the platform
90
141
  *
91
142
  * The month names, the weekday initials, the order of the header's two buttons
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{MPButton as o}from"../button/MPButton.js";import{MPIcon as t}from"../icon/MPIcon.js";import{CalendarIcon as n}from"../../constants/icons.js";import{MPCalendar as r}from"../../internal/Calendar.js";import{FOOTER_SIZE as s,MPPickerFooter as i,MPPickerShell as c,useDisplaySamples as m}from"../../internal/Picker.js";import{useMPLocale as d,useMPMessages as u}from"../../internal/locale.js";import{PICKER as p}from"../../internal/messages/picker.js";import{CONTROL_ICON as f}from"../../internal/scale.js";import{formatDate as h,isDayOutside as j,isValidDate as b,localeWeekStart as v,mergeDateAndTime as x,startOfDay as g,startOfMonth as D,toISODate as k,today as y,withPlaceholder as C}from"../../internal/date.js";export const MPDatePicker=/*@__PURE__*/l.forwardRef(function({value:O,defaultValue:S,onValueChange:z,open:M,defaultOpen:P,onOpenChange:w,defaultMonth:I,minDate:V,maxDate:B,shouldDisableDate:R,locale:E,weekStartsOn:F,format:N={dateStyle:"medium"},placeholder:T,clearable:q=!1,showTodayButton:A=!0,closeOnSelect:G=!0,labels:H,name:J,size:K="md",color:L="primary",readOnly:Q=!1,disabled:U=!1,startIcon:W,...X},Y){const Z=d(E),$=u(p,Z,H),_=F??v(Z),[ee,ae]=l.useState(S??null),le=void 0!==O?O:ee,[oe,te]=l.useState(P??!1),ne=M??oe,[re,se]=l.useState(()=>D(b(le)?le:I??y()));l.useEffect(()=>{ne&&se(D(b(le)?le:I??y()))},[ne]);const ie=e=>{e&&(Q||U)||(void 0===M&&te(e),w?.(e))},ce=e=>{void 0===O&&ae(e),z?.(e)},me=e=>{const a=b(le)?x(e,le):g(e);ce(a),se(D(a)),G&&ie(!1)},de=y(),ue=j(de,V,B)||(R?.(de)??!1),pe=A||q,fe=C(m(Z,N),T);return e(c,{...X,slug:"date-picker",size:K,color:L,readOnly:Q,disabled:U,triggerRef:Y,startIcon:void 0===W?e(t,{icon:n,size:f[K]}):W,display:b(le)?h(le,Z,N):T??"",samples:fe,empty:!b(le),clearable:q,onClear:()=>ce(null),open:ne,onOpenChange:ie,labels:$,hiddenValues:J?[{name:J,value:b(le)?k(le):""}]:void 0,children:a("div",{className:"flex flex-col "+(pe?"gap-1.5":""),children:[e(r,{size:K,color:L,locale:Z,weekStartsOn:_,month:re,onMonthChange:se,selected:[le],onSelect:me,minDate:V,maxDate:B,shouldDisableDate:R,labels:$,autoFocus:!0}),pe?a(i,{children:[q?e(o,{variant:"text",size:s[K],color:L,onClick:()=>{ce(null),ie(!1)},children:$.clear}):null,A?e(o,{variant:"text",size:s[K],color:L,disabled:ue,onClick:()=>me(de),children:$.today}):null]}):null]})})});
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as o from"react";import{MPButton as t}from"../button/MPButton.js";import{MPIcon as n}from"../icon/MPIcon.js";import{CalendarIcon as l}from"../../constants/icons.js";import{Calendar as r}from"../../internal/Calendar.js";import{FOOTER_SIZE as i,MPPickerFooter as s,MPPickerShell as c,useDisplaySamples as m}from"../../internal/Picker.js";import{useMPLocale as d,useMPMessages as u}from"../../internal/locale.js";import{PICKER as p}from"../../internal/messages/picker.js";import{CONTROL_ICON as f}from"../../internal/scale.js";import{formatDate as h,isUnitOutside as y,isValidDate as j,localeWeekStart as b,mergeDateAndTime as g,startOfMonth as v,startOfUnit as x,toISODate as D,toISOMonth as k,toISOYear as C,today as O,withPlaceholder as S}from"../../internal/date.js";import{useMPColor as z,useMPSize as M}from"../../internal/config.js";const P={day:{dateStyle:"medium"},month:{year:"numeric",month:"long"},year:{year:"numeric"}},w={day:D,month:k,year:C};export const MPDatePicker=/*@__PURE__*/o.forwardRef(function({value:D,defaultValue:k,onValueChange:C,open:I,defaultOpen:V,onOpenChange:B,precision:R="day",defaultMonth:E,minDate:F,maxDate:N,shouldDisableDate:T,locale:Y,weekStartsOn:q,format:A,placeholder:G,clearable:H=!1,showTodayButton:J=!0,closeOnSelect:K=!0,labels:L,name:Q,size:U,color:W,readOnly:X=!1,disabled:Z=!1,startIcon:$,..._},ee){const ae=M(U),oe=z(W),te=d(Y),ne=u(p,te,L),le=q??b(te),re=A??P[R],[ie,se]=o.useState(k??null),ce=void 0!==D?D:ie,[me,de]=o.useState(V??!1),ue=I??me,[pe,fe]=o.useState(()=>v(j(ce)?ce:E??O()));o.useEffect(()=>{ue&&fe(v(j(ce)?ce:E??O()))},[ue]);const he=e=>{e&&(X||Z)||(void 0===I&&de(e),B?.(e))},ye=e=>{void 0===D&&se(e),C?.(e)},je=e=>{const a=x(e,R),o=j(ce)?g(a,ce):a;ye(o),fe(v(o)),K&&he(!1)},be=O(),ge=y(be,R,F,N)||"day"===R&&(T?.(be)??!1),ve="year"===R?ne.thisYear:"month"===R?ne.thisMonth:ne.today,xe=J||H,De=S(m(te,re),G);return e(c,{..._,slug:"date-picker",size:ae,color:oe,readOnly:X,disabled:Z,triggerRef:ee,startIcon:void 0===$?e(n,{icon:l,size:f[ae]}):$,display:j(ce)?h(ce,te,re):G??"",samples:De,empty:!j(ce),clearable:H,onClear:()=>ye(null),open:ue,onOpenChange:he,labels:ne,hiddenValues:Q?[{name:Q,value:j(ce)?w[R](ce):""}]:void 0,children:a("div",{className:"flex flex-col "+(xe?"gap-1.5":""),children:[e(r,{size:ae,color:oe,locale:te,weekStartsOn:le,month:pe,onMonthChange:fe,selected:[ce],onSelect:je,minDate:F,maxDate:N,shouldDisableDate:T,precision:R,labels:ne,autoFocus:!0}),xe?a(s,{children:[H?e(t,{variant:"text",size:i[ae],color:oe,onClick:()=>{ye(null),he(!1)},children:ne.clear}):null,J?e(t,{variant:"text",size:i[ae],color:oe,disabled:ge,onClick:()=>je(be),children:ve}):null]}):null]})})});
@@ -1,2 +1,2 @@
1
1
  export { MPDatePicker } from './MPDatePicker.js';
2
- export type { MPDatePickerProps } from './MPDatePicker.js';
2
+ export type { MPDatePickerProps, MPDatePrecision } from './MPDatePicker.js';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{MPButton as a}from"../button/MPButton.js";import{MPIcon as t}from"../icon/MPIcon.js";import{ArrowRightIcon as r,CalendarIcon as s}from"../../constants/icons.js";import{MPCalendar as o}from"../../internal/Calendar.js";import{FOOTER_SIZE as i,MPPickerFooter as c,MPPickerShell as u,useDisplaySamples as m}from"../../internal/Picker.js";import{useMPLocale as d,useMPMessages as p}from"../../internal/locale.js";import{PICKER as h}from"../../internal/messages/picker.js";import{MPWidthSizer as f}from"../../internal/WidthSizer.js";import{CONTROL_ICON as v,META_TEXT as x}from"../../internal/scale.js";import{addMonths as g,compareDay as j,formatDate as b,isValidDate as w,localeWeekStart as N,startOfDay as S,startOfMonth as C,toISODate as y,today as D,withPlaceholder as k}from"../../internal/date.js";const O={start:null,end:null};export const MPDateRangePicker=/*@__PURE__*/n.forwardRef(function({value:P,defaultValue:z,onValueChange:M,open:B,defaultOpen:I,onOpenChange:R,defaultMonth:V,minDate:E,maxDate:F,shouldDisableDate:W,locale:$,weekStartsOn:_,format:q={dateStyle:"medium"},monthCount:A=2,startPlaceholder:G,endPlaceholder:H,presets:J,clearable:K=!1,closeOnSelect:L=!0,labels:Q,name:T,size:U="md",color:X="primary",readOnly:Y=!1,disabled:Z=!1,startIcon:ee,...le},ne){const ae=d($),te=p(h,ae,Q),re=_??N(ae),[se,oe]=n.useState(z??O),ie=void 0!==P?P??O:se,ce=w(ie.start)?ie.start:null,ue=w(ie.end)?ie.end:null,[me,de]=n.useState(I??!1),pe=B??me,[he,fe]=n.useState(null),[ve,xe]=n.useState(null),[ge,je]=n.useState(()=>C(ce??V??D()));n.useEffect(()=>{pe?je(C(ce??V??D())):(fe(null),xe(null))},[pe]);const be=e=>{e&&(Y||Z)||(void 0===B&&de(e),R?.(e))},we=e=>{void 0===P&&oe(e),M?.(e)},Ne=he??ce,Se=null!==he?ve:ue,Ce=(l,n)=>w(l)?b(l,ae,q):e("span",{className:"text-mp-on-surface-variant",children:n??""}),ye=g(ge,1),De=2===A,ke=m(ae,q),Oe=null!==he?te.end:null===ce?te.start:null,Pe={size:U,color:X,locale:ae,weekStartsOn:re,selected:[ce,ue,he],rangeStart:Ne,rangeEnd:Se,onSelect:e=>{const l=S(e);if(null===he)return fe(l),xe(l),void we({start:l,end:null});const[n,a]=j(l,he)<0?[l,he]:[he,l];fe(null),xe(null),we({start:n,end:a}),L&&be(!1)},onPreviewChange:e=>{null!==he&&xe(e??he)},minDate:E,maxDate:F,shouldDisableDate:W,showOutsideDays:!1,labels:te};return e(u,{...le,slug:"date-range-picker",size:U,color:X,readOnly:Y,disabled:Z,triggerRef:ne,startIcon:void 0===ee?e(t,{icon:s,size:v[U]}):ee,display:l("span",{className:"flex min-w-0 items-center gap-1.5",children:[l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:Ce(ce,G)}),e(f,{samples:k(ke,G)})]}),e("span",{"aria-hidden":"true",className:"text-mp-on-surface-variant flex shrink-0 items-center rtl:rotate-180",children:e(t,{icon:r,size:v[U]})}),l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:Ce(ue,H)}),e(f,{samples:k(ke,H)})]})]}),empty:null===ce&&null===ue,clearable:K,onClear:()=>we(O),open:pe,onOpenChange:be,labels:te,hiddenValues:T?[{name:T,value:ce?y(ce):""},{name:T,value:ue?y(ue):""}]:void 0,children:l("div",{className:"flex flex-col gap-1.5",children:[l("div",{className:"flex items-stretch gap-2",children:[J&&J.length>0?e("div",{className:"border-mp-outline-variant flex max-h-[calc(var(--_mp-cell,2.5rem)*8)] flex-col overflow-y-auto border-e pe-1.5",children:J.map((l,n)=>e(a,{variant:"text",size:i[U],color:X,className:"justify-start whitespace-nowrap",onClick:()=>(e=>{const l="function"==typeof e.value?e.value():e.value;fe(null),xe(null),we(l),w(l.start)&&je(C(l.start)),L&&be(!1)})(l),children:l.label},n))}):null,e(o,{...Pe,month:ge,onMonthChange:je,showNextButton:!De,autoFocus:!0}),De?e(o,{...Pe,month:ye,onMonthChange:e=>je(g(e,-1)),showPreviousButton:!1}):null]}),K||null!==Oe?l(c,{children:[null!==Oe?e("span",{className:`text-mp-on-surface-variant me-auto ${x}`,children:Oe}):null,K?e(a,{variant:"text",size:i[U],color:X,onClick:()=>{fe(null),xe(null),we(O),be(!1)},children:te.clear}):null]}):null]})})});
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{MPButton as a}from"../button/MPButton.js";import{MPIcon as t}from"../icon/MPIcon.js";import{ArrowRightIcon as r,CalendarIcon as s}from"../../constants/icons.js";import{Calendar as o}from"../../internal/Calendar.js";import{FOOTER_SIZE as i,MPPickerFooter as c,MPPickerShell as u,useDisplaySamples as m}from"../../internal/Picker.js";import{useMPLocale as d,useMPMessages as p}from"../../internal/locale.js";import{PICKER as f}from"../../internal/messages/picker.js";import{MPWidthSizer as h}from"../../internal/WidthSizer.js";import{CONTROL_ICON as v,META_TEXT as x}from"../../internal/scale.js";import{addMonths as g,compareDay as j,formatDate as b,isValidDate as w,localeWeekStart as N,startOfDay as S,startOfMonth as C,toISODate as D,today as k,withPlaceholder as y}from"../../internal/date.js";import{useMPColor as O,useMPSize as P}from"../../internal/config.js";const z={start:null,end:null};export const MPDateRangePicker=/*@__PURE__*/n.forwardRef(function({value:M,defaultValue:B,onValueChange:I,open:R,defaultOpen:V,onOpenChange:E,defaultMonth:F,minDate:W,maxDate:$,shouldDisableDate:_,locale:q,weekStartsOn:A,format:G={dateStyle:"medium"},monthCount:H=2,startPlaceholder:J,endPlaceholder:K,presets:L,clearable:Q=!1,closeOnSelect:T=!0,labels:U,name:X,size:Y,color:Z,readOnly:ee=!1,disabled:le=!1,startIcon:ne,...ae},te){const re=P(Y),se=O(Z),oe=d(q),ie=p(f,oe,U),ce=A??N(oe),[ue,me]=n.useState(B??z),de=void 0!==M?M??z:ue,pe=w(de.start)?de.start:null,fe=w(de.end)?de.end:null,[he,ve]=n.useState(V??!1),xe=R??he,[ge,je]=n.useState(null),[be,we]=n.useState(null),[Ne,Se]=n.useState(()=>C(pe??F??k()));n.useEffect(()=>{xe?Se(C(pe??F??k())):(je(null),we(null))},[xe]);const Ce=e=>{e&&(ee||le)||(void 0===R&&ve(e),E?.(e))},De=e=>{void 0===M&&me(e),I?.(e)},ke=ge??pe,ye=null!==ge?be:fe,Oe=(l,n)=>w(l)?b(l,oe,G):e("span",{className:"text-mp-on-surface-variant",children:n??""}),Pe=g(Ne,1),ze=2===H,Me=m(oe,G),Be=null!==ge?ie.end:null===pe?ie.start:null,Ie={size:re,color:se,locale:oe,weekStartsOn:ce,selected:[pe,fe,ge],rangeStart:ke,rangeEnd:ye,onSelect:e=>{const l=S(e);if(null===ge)return je(l),we(l),void De({start:l,end:null});const[n,a]=j(l,ge)<0?[l,ge]:[ge,l];je(null),we(null),De({start:n,end:a}),T&&Ce(!1)},onPreviewChange:e=>{null!==ge&&we(e??ge)},minDate:W,maxDate:$,shouldDisableDate:_,showOutsideDays:!1,labels:ie};return e(u,{...ae,slug:"date-range-picker",size:re,color:se,readOnly:ee,disabled:le,triggerRef:te,startIcon:void 0===ne?e(t,{icon:s,size:v[re]}):ne,display:l("span",{className:"flex min-w-0 items-center gap-1.5",children:[l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:Oe(pe,J)}),e(h,{samples:y(Me,J)})]}),e("span",{"aria-hidden":"true",className:"text-mp-on-surface-variant flex shrink-0 items-center rtl:rotate-180",children:e(t,{icon:r,size:v[re]})}),l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:Oe(fe,K)}),e(h,{samples:y(Me,K)})]})]}),empty:null===pe&&null===fe,clearable:Q,onClear:()=>De(z),open:xe,onOpenChange:Ce,labels:ie,hiddenValues:X?[{name:X,value:pe?D(pe):""},{name:X,value:fe?D(fe):""}]:void 0,children:l("div",{className:"flex flex-col gap-1.5",children:[l("div",{className:"flex items-stretch gap-2",children:[L&&L.length>0?e("div",{className:"border-mp-outline-variant flex max-h-[calc(var(--_mp-cell,2.5rem)*8)] flex-col overflow-y-auto border-e pe-1.5",children:L.map((l,n)=>e(a,{variant:"text",size:i[re],color:se,className:"justify-start whitespace-nowrap",onClick:()=>(e=>{const l="function"==typeof e.value?e.value():e.value;je(null),we(null),De(l),w(l.start)&&Se(C(l.start)),T&&Ce(!1)})(l),children:l.label},n))}):null,e(o,{...Ie,month:Ne,onMonthChange:Se,showNextButton:!ze,autoFocus:!0}),ze?e(o,{...Ie,month:Pe,onMonthChange:e=>Se(g(e,-1)),showPreviousButton:!1}):null]}),Q||null!==Be?l(c,{children:[null!==Be?e("span",{className:`text-mp-on-surface-variant me-auto ${x}`,children:Be}):null,Q?e(a,{variant:"text",size:i[re],color:se,onClick:()=>{je(null),we(null),De(z),Ce(!1)},children:ie.clear}):null]}):null]})})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{MPButton as l}from"../button/MPButton.js";import{MPIcon as a}from"../icon/MPIcon.js";import{CalendarIcon as n}from"../../constants/icons.js";import{MPCalendar as s,MPTimeGrid as r}from"../../internal/Calendar.js";import{FOOTER_SIZE as i,MPPickerDivider as c,MPPickerFooter as m,MPPickerShell as d,useDisplaySamples as u}from"../../internal/Picker.js";import{useMPLocale as p,useMPMessages as h}from"../../internal/locale.js";import{PICKER as f}from"../../internal/messages/picker.js";import{CONTROL_ICON as S}from"../../internal/scale.js";import{formatDate as b,isDayOutside as g,isHour12 as v,isValidDate as D,localeWeekStart as j,mergeDateAndTime as x,startOfDay as C,startOfMonth as k,timeUnitSpan as w,toISODateTime as z,today as O,withPlaceholder as y,withTime as T}from"../../internal/date.js";export const MPDateTimePicker=/*@__PURE__*/t.forwardRef(function({value:M,defaultValue:P,onValueChange:I,open:N,defaultOpen:V,onOpenChange:B,defaultMonth:R,minDate:E,maxDate:F,shouldDisableDate:q,shouldDisableTime:A,locale:G,weekStartsOn:H,format:J,hour12:K,showSeconds:L=!1,hourStep:Q=1,minuteStep:U=1,secondStep:W=1,placeholder:X,clearable:Y=!1,showNowButton:Z=!0,closeOnSelect:$=!1,labels:_,name:ee,size:oe="md",color:te="primary",readOnly:le=!1,disabled:ae=!1,startIcon:ne,...se},re){const ie=p(G),ce=h(f,ie,_),me=H??j(ie),de=K??v(ie),[ue,pe]=t.useState(P??null),he=void 0!==M?M:ue,[fe,Se]=t.useState(V??!1),be=N??fe,[ge,ve]=t.useState(()=>k(D(he)?he:R??O()));t.useEffect(()=>{be&&ve(k(D(he)?he:R??O()))},[be]);const De=e=>{e&&(le||ae)||(void 0===N&&Se(e),B?.(e))},je=e=>{void 0===M&&pe(e),I?.(e)},xe=t.useCallback((e,o)=>{const[t,l]=w(o,e),a=C(e).getTime();return!!(D(E)&&a+1e3*l<E.getTime())||(!!(D(F)&&a+1e3*t>F.getTime())||(A?.(e,o)??!1))},[E,F,A]),Ce=J??{dateStyle:"medium",timeStyle:"short",hour12:de},ke=new Date,we=T(ke,{seconds:L?ke.getSeconds():0}),ze=g(we,E,F)||(q?.(we)??!1)||xe(we,"second"),Oe=y(u(ie,Ce),X);return e(d,{...se,slug:"date-time-picker",size:oe,color:te,readOnly:le,disabled:ae,triggerRef:re,startIcon:void 0===ne?e(a,{icon:n,size:S[oe]}):ne,display:D(he)?b(he,ie,Ce):X??"",samples:Oe,empty:!D(he),clearable:Y,onClear:()=>je(null),open:be,onOpenChange:De,labels:ce,hiddenValues:ee?[{name:ee,value:D(he)?z(he,L):""}]:void 0,children:o("div",{className:"flex flex-col gap-1.5",children:[o("div",{className:"flex items-stretch gap-2",children:[e(s,{size:oe,color:te,locale:ie,weekStartsOn:me,month:ge,onMonthChange:ve,selected:[he],onSelect:e=>{const o=D(he)?x(e,he):C(e);je(o),ve(k(o)),$&&De(!1)},minDate:E,maxDate:F,shouldDisableDate:q,labels:ce,autoFocus:!0}),e(c,{}),e(r,{size:oe,locale:ie,value:D(he)?he:null,referenceDate:D(he)?he:O(),onChange:je,hour12:de,showSeconds:L,hourStep:Q,minuteStep:U,secondStep:W,shouldDisableTime:xe,labels:ce})]}),o(m,{children:[Y?e(l,{variant:"text",size:i[oe],color:te,onClick:()=>{je(null),De(!1)},children:ce.clear}):null,Z?e(l,{variant:"text",size:i[oe],color:te,disabled:ze,onClick:()=>{je(we),ve(k(we))},children:ce.now}):null,e(l,{variant:"filled",size:i[oe],color:te,onClick:()=>De(!1),children:ce.done})]})]})})});
2
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{MPButton as l}from"../button/MPButton.js";import{MPIcon as n}from"../icon/MPIcon.js";import{CalendarIcon as a}from"../../constants/icons.js";import{Calendar as s,MPTimeGrid as r}from"../../internal/Calendar.js";import{FOOTER_SIZE as i,MPPickerDivider as c,MPPickerFooter as m,MPPickerShell as d,useDisplaySamples as u}from"../../internal/Picker.js";import{useMPLocale as p,useMPMessages as h}from"../../internal/locale.js";import{PICKER as f}from"../../internal/messages/picker.js";import{CONTROL_ICON as S}from"../../internal/scale.js";import{formatDate as g,isDayOutside as b,isHour12 as j,isValidDate as v,localeWeekStart as D,mergeDateAndTime as x,startOfDay as C,startOfMonth as k,timeUnitSpan as w,toISODateTime as z,today as O,withPlaceholder as y,withTime as T}from"../../internal/date.js";import{useMPColor as M,useMPSize as P}from"../../internal/config.js";export const MPDateTimePicker=/*@__PURE__*/t.forwardRef(function({value:I,defaultValue:N,onValueChange:V,open:B,defaultOpen:R,onOpenChange:E,defaultMonth:F,minDate:q,maxDate:A,shouldDisableDate:G,shouldDisableTime:H,locale:J,weekStartsOn:K,format:L,hour12:Q,showSeconds:U=!1,hourStep:W=1,minuteStep:X=1,secondStep:Y=1,placeholder:Z,clearable:$=!1,showNowButton:_=!0,closeOnSelect:ee=!1,labels:oe,name:te,size:le,color:ne,readOnly:ae=!1,disabled:se=!1,startIcon:re,...ie},ce){const me=P(le),de=M(ne),ue=p(J),pe=h(f,ue,oe),he=K??D(ue),fe=Q??j(ue),[Se,ge]=t.useState(N??null),be=void 0!==I?I:Se,[je,ve]=t.useState(R??!1),De=B??je,[xe,Ce]=t.useState(()=>k(v(be)?be:F??O()));t.useEffect(()=>{De&&Ce(k(v(be)?be:F??O()))},[De]);const ke=e=>{e&&(ae||se)||(void 0===B&&ve(e),E?.(e))},we=e=>{void 0===I&&ge(e),V?.(e)},ze=t.useCallback((e,o)=>{const[t,l]=w(o,e),n=C(e).getTime();return!!(v(q)&&n+1e3*l<q.getTime())||(!!(v(A)&&n+1e3*t>A.getTime())||(H?.(e,o)??!1))},[q,A,H]),Oe=L??{dateStyle:"medium",timeStyle:"short",hour12:fe},ye=new Date,Te=T(ye,{seconds:U?ye.getSeconds():0}),Me=b(Te,q,A)||(G?.(Te)??!1)||ze(Te,"second"),Pe=y(u(ue,Oe),Z);return e(d,{...ie,slug:"date-time-picker",size:me,color:de,readOnly:ae,disabled:se,triggerRef:ce,startIcon:void 0===re?e(n,{icon:a,size:S[me]}):re,display:v(be)?g(be,ue,Oe):Z??"",samples:Pe,empty:!v(be),clearable:$,onClear:()=>we(null),open:De,onOpenChange:ke,labels:pe,hiddenValues:te?[{name:te,value:v(be)?z(be,U):""}]:void 0,children:o("div",{className:"flex flex-col gap-1.5",children:[o("div",{className:"flex items-stretch gap-2",children:[e(s,{size:me,color:de,locale:ue,weekStartsOn:he,month:xe,onMonthChange:Ce,selected:[be],onSelect:e=>{const o=v(be)?x(e,be):C(e);we(o),Ce(k(o)),ee&&ke(!1)},minDate:q,maxDate:A,shouldDisableDate:G,labels:pe,autoFocus:!0}),e(c,{}),e(r,{size:me,locale:ue,value:v(be)?be:null,referenceDate:v(be)?be:O(),onChange:we,hour12:fe,showSeconds:U,hourStep:W,minuteStep:X,secondStep:Y,shouldDisableTime:ze,labels:pe})]}),o(m,{children:[$?e(l,{variant:"text",size:i[me],color:de,onClick:()=>{we(null),ke(!1)},children:pe.clear}):null,_?e(l,{variant:"text",size:i[me],color:de,disabled:Me,onClick:()=>{we(Te),Ce(k(Te))},children:pe.now}):null,e(l,{variant:"filled",size:i[me],color:de,onClick:()=>ke(!1),children:pe.done})]})]})})});
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Dialog } from '@base-ui/react/dialog';
3
- import type { MPColor, MPSize } from '../../types.js';
3
+ import type { MPColor, MPControlEventProps, MPSize, MPSlots } from '../../types.js';
4
4
  /**
5
5
  * A dialog takes `size` and `color` and stops there.
6
6
  *
@@ -8,7 +8,20 @@ import type { MPColor, MPSize } from '../../types.js';
8
8
  * paint against the page around it", and a modal has already taken the page.
9
9
  * There is no `elevation` prop either — see the note on the sheet below.
10
10
  */
11
- export interface MPDialogProps {
11
+ /**
12
+ * A dialog's sheet, which is where an event handler lands.
13
+ *
14
+ * The same rule the eight controls follow, applied to the one component that had
15
+ * no element a caller could reach at all: a class describes the whole dialog and
16
+ * lands on its outermost element, an event came from somewhere inside the sheet
17
+ * and lands on the sheet. So `onKeyDown` is a keystroke inside the dialog and
18
+ * never one on the trigger that opened it, and never one on the page behind.
19
+ *
20
+ * It is the popup rather than the backdrop deliberately. A key pressed while the
21
+ * dialog holds focus reaches the popup by bubbling; a click on the scrim does
22
+ * not, which is `dismissible`'s job and not this one's.
23
+ */
24
+ export interface MPDialogProps extends MPControlEventProps<HTMLElement> {
12
25
  /** The dialog is shown. Use with `onOpenChange` for a controlled dialog. */
13
26
  open?: boolean;
14
27
  /** Whether the dialog starts open, for an uncontrolled one. */
@@ -113,6 +126,14 @@ export interface MPDialogProps {
113
126
  children?: React.ReactNode;
114
127
  className?: string;
115
128
  style?: React.CSSProperties;
129
+ /**
130
+ * A class name for a part `className` cannot reach.
131
+ *
132
+ * - `backdrop` — the scrim behind the sheet. It is a sibling of the dialog
133
+ * rather than a child, and both render at the end of `<body>`, so nothing
134
+ * written against the root reaches it.
135
+ */
136
+ classNames?: MPSlots<'backdrop'>;
116
137
  }
117
138
  export type MPDialogCloseProps = React.ComponentProps<typeof Dialog.Close>;
118
139
  /**
@@ -147,4 +168,4 @@ export declare const MPDialogClose: React.ForwardRefExoticComponent<Omit<import(
147
168
  * is no `variant`: a dialog that could be told to sit flat on the page would be a
148
169
  * dialog that could be told to stop being a dialog.
149
170
  */
150
- export declare function MPDialog({ open, defaultOpen, onOpenChange, trigger, icon, title, description, actions, dividers, showClose, closeLabel, locale: localeProp, width, fullWidth, fullScreen, modal, dismissible, size, color, className, style, children }: MPDialogProps): React.JSX.Element;
171
+ export declare function MPDialog({ open, defaultOpen, onOpenChange, trigger, icon, title, description, actions, dividers, showClose, closeLabel, locale: localeProp, width, fullWidth, fullScreen, modal, dismissible, size: sizeProp, color, onKeyDown, onKeyUp, onFocus, onBlur, onClick, onDoubleClick, onContextMenu, classNames, className, style, children }: MPDialogProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Dialog as t}from"@base-ui/react/dialog";import{MPIcon as i}from"../icon/MPIcon.js";import{CloseIcon as n}from"../../constants/icons.js";import{accentSlots as s}from"../../internal/accent.js";import{cssLength as o}from"../../internal/length.js";import{useMPLocale as a,useMPMessages as r}from"../../internal/locale.js";import{COMMON as m}from"../../internal/messages/common.js";import{MPStateLayer as c}from"../../internal/StateLayer.js";import{SHEET_GAP as p,hasContent as d}from"../../internal/scale.js";import{FADE as x,PORTAL_LAYER as f,SCRIM as u,SHEET_MOTION as h}from"../../internal/surface.js";const g={xs:"max-w-[320px]",sm:"max-w-[400px]",md:"max-w-[560px]",lg:"max-w-[720px]",xl:"max-w-[960px]"},y=`transition-[opacity,scale] ${h}`,j=/*@__PURE__*/["motion-safe:data-starting-style:scale-95","motion-safe:data-ending-style:scale-95"].join(" "),v={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-7",xl:"p-8"},b={xs:"px-3",sm:"px-4",md:"px-6",lg:"px-7",xl:"px-8"},w={xs:"py-3",sm:"py-4",md:"py-6",lg:"py-7",xl:"py-8"},N={xs:"text-mp-title-medium",sm:"text-mp-title-large",md:"text-mp-headline-small",lg:"text-mp-headline-medium",xl:"text-mp-headline-large"},$={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-large",xl:"text-mp-body-large"},k={xs:20,sm:22,md:24,lg:28,xl:32};export const MPDialogClose=t.Close;export function MPDialog({open:h,defaultOpen:C,onOpenChange:P,trigger:B,icon:z,title:D,description:O,actions:M,dividers:L=!1,showClose:S,closeLabel:T,locale:W,width:I,fullWidth:R=!0,fullScreen:V=!1,modal:_=!0,dismissible:q=!0,size:A="md",color:E="secondary",className:F,style:G,children:H}){const J=a(W),K=r(m,J),Q=S??V,U=d(z),X=d(D)||d(O)||U,Y=d(M),Z=L?v[A]:b[A],ee="border-mp-outline-variant border-t";return l(t.Root,{open:h,defaultOpen:C,modal:_,disablePointerDismissal:!q,onOpenChange:(e,l)=>{q||e||"escape-key"!==l.reason?P?.(e):l.cancel()},children:[B?e(t.Trigger,{render:B}):null,l(t.Portal,{children:[e(t.Backdrop,{className:`${f} fixed inset-0 ${x} ${u}`}),e(t.Viewport,{className:[f,"fixed inset-0 flex justify-center",V?"items-stretch":"items-center p-4"].join(" "),children:l(t.Popup,{"data-mp-size":A,className:["mp-dialog relative flex w-full flex-col overflow-hidden","bg-mp-surface-container-high text-mp-on-surface shadow-mp-3 outline-none",V?"h-full max-w-none rounded-none":`rounded-mp-xl max-h-full ${void 0===I?g[A]:""}`,V||R?"":"w-auto",L?"":`${w[A]} ${p[A]}`,y,V?"":j,F??""].filter(Boolean).join(" "),style:{...s(E),...void 0===I||V?null:{maxWidth:o(I)},...G},children:[X||Q?l("div",{className:["flex shrink-0 items-start gap-3",Z,U&&!Q?"flex-col items-center text-center":""].filter(Boolean).join(" "),children:[U?e("span",{className:"flex shrink-0 items-center justify-center text-(--_mp-accent)",children:z}):null,l("div",{className:`flex min-w-0 flex-1 flex-col ${p[A]}`,children:[d(D)?e(t.Title,{className:`m-0 ${N[A]}`,children:D}):null,d(O)?e(t.Description,{className:`text-mp-on-surface-variant m-0 ${$[A]}`,children:O}):null]}),Q?l(t.Close,{"aria-label":T??K.close,className:["group text-mp-on-surface-variant relative flex size-10 shrink-0","rounded-mp-full cursor-pointer items-center justify-center","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(c,{}),e(i,{icon:n,size:k[A]})]}):null]}):null,d(H)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",$[A],Z,L&&(X||Q)?ee:""].filter(Boolean).join(" "),children:H}):null,Y?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",Z,L?ee:""].filter(Boolean).join(" "),children:M}):null]})})]})]})}
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Dialog as n}from"@base-ui/react/dialog";import{MPIcon as o}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{accentSlots as t}from"../../internal/accent.js";import{cssLength as s}from"../../internal/length.js";import{useMPLocale as a,useMPMessages as r}from"../../internal/locale.js";import{COMMON as m}from"../../internal/messages/common.js";import{MPStateLayer as c}from"../../internal/StateLayer.js";import{SHEET_GAP as p,hasContent as d}from"../../internal/scale.js";import{FADE as x,PORTAL_LAYER as f,SCRIM as u,SHEET_MOTION as h}from"../../internal/surface.js";import{useMPSize as g}from"../../internal/config.js";const y={xs:"max-w-[320px]",sm:"max-w-[400px]",md:"max-w-[560px]",lg:"max-w-[720px]",xl:"max-w-[960px]"},j=`transition-[opacity,scale] ${h}`,b=/*@__PURE__*/["motion-safe:data-starting-style:scale-95","motion-safe:data-ending-style:scale-95"].join(" "),v={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-7",xl:"p-8"},w={xs:"px-3",sm:"px-4",md:"px-6",lg:"px-7",xl:"px-8"},N={xs:"py-3",sm:"py-4",md:"py-6",lg:"py-7",xl:"py-8"},C={xs:"text-mp-title-medium",sm:"text-mp-title-large",md:"text-mp-headline-small",lg:"text-mp-headline-medium",xl:"text-mp-headline-large"},k={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-large",xl:"text-mp-body-large"},B={xs:20,sm:22,md:24,lg:28,xl:32};export const MPDialogClose=n.Close;export function MPDialog({open:h,defaultOpen:D,onOpenChange:$,trigger:P,icon:M,title:z,description:K,actions:O,dividers:F=!1,showClose:L,closeLabel:S,locale:T,width:U,fullWidth:W=!0,fullScreen:I=!1,modal:R=!0,dismissible:V=!0,size:_,color:q="secondary",onKeyDown:A,onKeyUp:E,onFocus:G,onBlur:H,onClick:J,onDoubleClick:Q,onContextMenu:X,classNames:Y,className:Z,style:ee,children:le}){const ne=g(_),oe=a(T),ie=r(m,oe),te=L??I,se=d(M),ae=d(z)||d(K)||se,re=d(O),me=F?v[ne]:w[ne],ce="border-mp-outline-variant border-t";return l(n.Root,{open:h,defaultOpen:D,modal:R,disablePointerDismissal:!V,onOpenChange:(e,l)=>{V||e||"escape-key"!==l.reason?$?.(e):l.cancel()},children:[P?e(n.Trigger,{render:P}):null,l(n.Portal,{children:[e(n.Backdrop,{className:[`${f} fixed inset-0`,x,u,Y?.backdrop??""].filter(Boolean).join(" ")}),e(n.Viewport,{className:[f,"fixed inset-0 flex justify-center",I?"items-stretch":"items-center p-4"].join(" "),children:l(n.Popup,{"data-mp-size":ne,onKeyDown:A,onKeyUp:E,onFocus:G,onBlur:H,onClick:J,onDoubleClick:Q,onContextMenu:X,className:["mp-dialog relative flex w-full flex-col overflow-hidden","bg-mp-surface-container-high text-mp-on-surface shadow-mp-3 outline-none",I?"h-full max-w-none rounded-none":`rounded-mp-xl max-h-full ${void 0===U?y[ne]:""}`,I||W?"":"w-auto",F?"":`${N[ne]} ${p[ne]}`,j,I?"":b,Z??""].filter(Boolean).join(" "),style:{...t(q),...void 0===U||I?null:{maxWidth:s(U)},...ee},children:[ae||te?l("div",{className:["flex shrink-0 items-start gap-3",me,se&&!te?"flex-col items-center text-center":""].filter(Boolean).join(" "),children:[se?e("span",{className:"flex shrink-0 items-center justify-center text-(--_mp-accent)",children:M}):null,l("div",{className:`flex min-w-0 flex-1 flex-col ${p[ne]}`,children:[d(z)?e(n.Title,{className:`m-0 ${C[ne]}`,children:z}):null,d(K)?e(n.Description,{className:`text-mp-on-surface-variant m-0 ${k[ne]}`,children:K}):null]}),te?l(n.Close,{"aria-label":S??ie.close,className:["group text-mp-on-surface-variant relative flex size-10 shrink-0","rounded-mp-full cursor-pointer items-center justify-center","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(c,{}),e(o,{icon:i,size:B[ne]})]}):null]}):null,d(le)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",k[ne],me,F&&(ae||te)?ce:""].filter(Boolean).join(" "),children:le}):null,re?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",me,F?ce:""].filter(Boolean).join(" "),children:O}):null]})})]})]})}
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{Separator as l}from"@base-ui/react/separator";import{hasContent as a}from"../../internal/scale.js";import{cssLength as i}from"../../internal/length.js";const o="[border-color:var(--_mp-line)]",n={horizontal:{start:["w-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","w-4 shrink-0"]},vertical:{start:["h-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","h-4 shrink-0"]}},s={xs:"text-mp-label-small",sm:"text-mp-label-small",md:"text-mp-label-medium",lg:"text-mp-label-large",xl:"text-mp-label-large"},m={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const MPDivider=/*@__PURE__*/t.forwardRef(function({orientation:t="horizontal",color:d,size:p="md",length:c,thickness:f,textAlign:h="center",className:x,style:u,children:v,...b},w){const g="vertical"===t,_=a(v),j={"--_mp-line":d?`var(--_mp-color-${d})`:"var(--_mp-color-outline-variant)","--_mp-rule":i(f)??"1px"},$=i(c),k={...j,...void 0===$?null:g?{height:$}:{width:$},...u};if(!_)return e(l,{ref:w,orientation:t,"data-mp-size":p,className:["mp-divider",g?"w-0 border-l [border-left-width:var(--_mp-rule)] "+(void 0===$?"self-stretch":""):"h-0 w-full border-t [border-top-width:var(--_mp-rule)]",o,x??""].filter(Boolean).join(" "),style:k,...b});const[N,z]=n[t][h],y=g?"w-0 border-l [border-left-width:var(--_mp-rule)]":"h-0 border-t [border-top-width:var(--_mp-rule)]";return r(l,{ref:w,orientation:t,"aria-label":"string"==typeof v?v:void 0,"data-mp-size":p,className:["mp-divider flex items-center",g?"w-auto flex-col "+(void 0===$?"self-stretch":""):"w-full",m[p],x??""].filter(Boolean).join(" "),style:k,...b,children:[e("span",{"aria-hidden":"true",className:`${y} ${N} ${o}`}),e("span",{className:["text-mp-on-surface-variant shrink-0 whitespace-nowrap",s[p],g?"[writing-mode:vertical-rl]":""].filter(Boolean).join(" "),children:v}),e("span",{"aria-hidden":"true",className:`${y} ${z} ${o}`})]})});
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{Separator as l}from"@base-ui/react/separator";import{hasContent as a}from"../../internal/scale.js";import{cssLength as i}from"../../internal/length.js";import{useMPSize as o}from"../../internal/config.js";const n="[border-color:var(--_mp-line)]",s={horizontal:{start:["w-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","w-4 shrink-0"]},vertical:{start:["h-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","h-4 shrink-0"]}},m={xs:"text-mp-label-small",sm:"text-mp-label-small",md:"text-mp-label-medium",lg:"text-mp-label-large",xl:"text-mp-label-large"},p={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const MPDivider=/*@__PURE__*/t.forwardRef(function({orientation:t="horizontal",color:d,size:c,length:f,thickness:h,textAlign:x="center",className:u,style:v,children:b,...g},w){const j=o(c),_="vertical"===t,$=a(b),k={"--_mp-line":d?`var(--_mp-color-${d})`:"var(--_mp-color-outline-variant)","--_mp-rule":i(h)??"1px"},N=i(f),z={...k,...void 0===N?null:_?{height:N}:{width:N},...v};if(!$)return e(l,{ref:w,orientation:t,"data-mp-size":j,className:["mp-divider",_?"w-0 border-l [border-left-width:var(--_mp-rule)] "+(void 0===N?"self-stretch":""):"h-0 w-full border-t [border-top-width:var(--_mp-rule)]",n,u??""].filter(Boolean).join(" "),style:z,...g});const[y,B]=s[t][x],A=_?"w-0 border-l [border-left-width:var(--_mp-rule)]":"h-0 border-t [border-top-width:var(--_mp-rule)]";return r(l,{ref:w,orientation:t,"aria-label":"string"==typeof b?b:void 0,"data-mp-size":j,className:["mp-divider flex items-center",_?"w-auto flex-col "+(void 0===N?"self-stretch":""):"w-full",p[j],u??""].filter(Boolean).join(" "),style:z,...g,children:[e("span",{"aria-hidden":"true",className:`${A} ${y} ${n}`}),e("span",{className:["text-mp-on-surface-variant shrink-0 whitespace-nowrap",m[j],_?"[writing-mode:vertical-rl]":""].filter(Boolean).join(" "),children:b}),e("span",{"aria-hidden":"true",className:`${A} ${B} ${n}`})]})});
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Dialog } from '@base-ui/react/dialog';
3
- import type { MPSide, MPSize } from '../../types.js';
3
+ import type { MPSide, MPSize, MPSlots } from '../../types.js';
4
4
  /**
5
5
  * How the panel relates to the page, in MD3's own two words for it.
6
6
  *
@@ -123,6 +123,12 @@ export interface MPDrawerProps {
123
123
  children?: React.ReactNode;
124
124
  className?: string;
125
125
  style?: React.CSSProperties;
126
+ /**
127
+ * A class name for a part `className` cannot reach.
128
+ *
129
+ * - `backdrop` — the scrim behind the panel, drawn only on a modal drawer.
130
+ */
131
+ classNames?: MPSlots<'backdrop'>;
126
132
  }
127
133
  export type MPDrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;
128
134
  /**
@@ -184,4 +190,4 @@ export declare const MPDrawerClose: React.ForwardRefExoticComponent<Omit<import(
184
190
  * `SLIDE` gives a reader who asked for less motion the old behaviour exactly:
185
191
  * the fade, with nowhere to travel from.
186
192
  */
187
- export declare function MPDrawer({ side, mode, open, defaultOpen, onOpenChange, trigger, title, description, actions, dividers, showClose, closeLabel, locale: localeProp, extent, rounded, dismissible, size, className, style, children }: MPDrawerProps): React.JSX.Element | null;
193
+ export declare function MPDrawer({ side, mode, open, defaultOpen, onOpenChange, trigger, title, description, actions, dividers, showClose, closeLabel, locale: localeProp, extent, rounded, dismissible, size: sizeProp, classNames, className, style, children }: MPDrawerProps): React.JSX.Element | null;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import*as a from"react";import{Dialog as o}from"@base-ui/react/dialog";import{MPIcon as n}from"../icon/MPIcon.js";import{CloseIcon as r}from"../../constants/icons.js";import{useMPLocale as i,useMPMessages as s}from"../../internal/locale.js";import{COMMON as d}from"../../internal/messages/common.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{cssLength as f}from"../../internal/length.js";import{hasContent as c,META_TEXT as p,PROSE_TEXT as u,SHEET_GAP as x,SHEET_PAD_X as h,SHEET_PAD_Y as g,SHEET_TITLE as b}from"../../internal/scale.js";import{FADE as y,PORTAL_LAYER as v,SCRIM as j,SHEET_MOTION as w}from"../../internal/surface.js";const $={xs:"w-60",sm:"w-72",md:"w-90",lg:"w-104",xl:"w-120"},N={left:"rounded-r-mp-lg",right:"rounded-l-mp-lg",top:"rounded-b-mp-xl",bottom:"rounded-t-mp-xl"},C={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},k={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},z={left:"motion-safe:data-starting-style:-translate-x-full motion-safe:data-ending-style:-translate-x-full",right:"motion-safe:data-starting-style:translate-x-full motion-safe:data-ending-style:translate-x-full",top:"motion-safe:data-starting-style:-translate-y-full motion-safe:data-ending-style:-translate-y-full",bottom:"motion-safe:data-starting-style:translate-y-full motion-safe:data-ending-style:translate-y-full"},P=`transition-[opacity,translate] ${w}`,B="border-mp-outline-variant border-t";export const MPDrawerClose=o.Close;export function MPDrawer({side:w="left",mode:D="modal",open:O,defaultOpen:M,onOpenChange:L,trigger:S,title:T,description:F,actions:I,dividers:R=!1,showClose:V,closeLabel:q,locale:A,extent:E,rounded:G=!0,dismissible:H=!0,size:J="md",className:K,style:Q,children:U}){const W=i(A),X=s(d,W),Y="modal"===D,Z="left"===w||"right"===w,_=V??Y,ee=q??X.close,[te,le]=a.useState(M??!0),ae=O??te,oe=h[J],ne=g[J],re=R?`${oe} ${ne}`:oe,ie=c(T)||c(F),se=c(I),de=void 0===E?null:{[Z?"width":"height"]:f(E)},me=["mp-drawer relative flex flex-col overflow-hidden box-border","border-mp-outline-variant outline-none",Y?"bg-mp-surface-container-low shadow-mp-1":"bg-mp-surface","text-mp-on-surface",u[J],C[w],G?N[w]:"",Y?`${P} ${z[w]}`:"",Z?`h-full max-w-full ${void 0===E?$[J]:""}`:"w-full "+(void 0===E?"max-h-[85%]":""),R?"":`${ne} ${x[J]}`,K??""].filter(Boolean).join(" "),fe=Y?o.Title:"h2",ce=Y?o.Description:"p",pe=/*@__PURE__*/["group text-mp-on-surface-variant relative flex size-10 shrink-0","rounded-mp-full cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),ue=t(l,{children:[ie||_?t("div",{className:`flex shrink-0 items-start gap-3 ${re}`,children:[t("div",{className:"flex min-w-0 flex-1 flex-col",children:[c(T)?e(fe,{className:`m-0 ${b[J]}`,children:T}):null,c(F)?e(ce,{className:`text-mp-on-surface-variant m-0 ${p}`,children:F}):null]}),_?Y?t(o.Close,{"aria-label":ee,className:pe,children:[e(m,{}),e(n,{icon:r,size:20})]}):t("button",{type:"button","aria-label":ee,className:pe,onClick:()=>{void 0===O&&le(!1),L?.(!1)},children:[e(m,{}),e(n,{icon:r,size:20})]}):null]}):null,c(U)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",re,R&&(ie||_)?B:"",R?"":"-my-1 py-1"].filter(Boolean).join(" "),children:U}):null,se?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",re,R?B:""].filter(Boolean).join(" "),children:I}):null]});return Y?t(o.Root,{open:O,defaultOpen:M,disablePointerDismissal:!H,onOpenChange:(e,t)=>{H||e||"escape-key"!==t.reason?L?.(e):t.cancel()},children:[S?e(o.Trigger,{render:S}):null,t(o.Portal,{children:[e(o.Backdrop,{className:`${v} fixed inset-0 ${y} ${j}`}),e(o.Viewport,{className:`${v} fixed inset-0 flex ${k[w]}`,children:e(o.Popup,{"data-mp-size":J,"data-mp-side":w,"data-mp-mode":D,className:me,style:{...de,...Q},children:ue})})]})]}):ae?e("div",{"data-mp-size":J,"data-mp-side":w,"data-mp-mode":D,className:me,style:{...de,...Q},children:ue}):null}
2
+ import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import*as a from"react";import{Dialog as o}from"@base-ui/react/dialog";import{MPIcon as n}from"../icon/MPIcon.js";import{CloseIcon as r}from"../../constants/icons.js";import{useMPLocale as i,useMPMessages as s}from"../../internal/locale.js";import{COMMON as d}from"../../internal/messages/common.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{cssLength as f}from"../../internal/length.js";import{hasContent as c,META_TEXT as p,PROSE_TEXT as u,SHEET_GAP as x,SHEET_PAD_X as h,SHEET_PAD_Y as g,SHEET_TITLE as b}from"../../internal/scale.js";import{FADE as y,PORTAL_LAYER as j,SCRIM as v,SHEET_MOTION as w}from"../../internal/surface.js";import{useMPSize as N}from"../../internal/config.js";const $={xs:"w-60",sm:"w-72",md:"w-90",lg:"w-104",xl:"w-120"},k={left:"rounded-r-mp-lg",right:"rounded-l-mp-lg",top:"rounded-b-mp-xl",bottom:"rounded-t-mp-xl"},C={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},z={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},P={left:"motion-safe:data-starting-style:-translate-x-full motion-safe:data-ending-style:-translate-x-full",right:"motion-safe:data-starting-style:translate-x-full motion-safe:data-ending-style:translate-x-full",top:"motion-safe:data-starting-style:-translate-y-full motion-safe:data-ending-style:-translate-y-full",bottom:"motion-safe:data-starting-style:translate-y-full motion-safe:data-ending-style:translate-y-full"},B=`transition-[opacity,translate] ${w}`,D="border-mp-outline-variant border-t";export const MPDrawerClose=o.Close;export function MPDrawer({side:w="left",mode:O="modal",open:M,defaultOpen:L,onOpenChange:S,trigger:T,title:F,description:I,actions:R,dividers:V=!1,showClose:q,closeLabel:A,locale:E,extent:G,rounded:H=!0,dismissible:J=!0,size:K,classNames:Q,className:U,style:W,children:X}){const Y=N(K),Z=i(E),_=s(d,Z),ee="modal"===O,te="left"===w||"right"===w,le=q??ee,ae=A??_.close,[oe,ne]=a.useState(L??!0),re=M??oe,ie=h[Y],se=g[Y],de=V?`${ie} ${se}`:ie,me=c(F)||c(I),fe=c(R),ce=void 0===G?null:{[te?"width":"height"]:f(G)},pe=["mp-drawer relative flex flex-col overflow-hidden box-border","border-mp-outline-variant outline-none",ee?"bg-mp-surface-container-low shadow-mp-1":"bg-mp-surface","text-mp-on-surface",u[Y],C[w],H?k[w]:"",ee?`${B} ${P[w]}`:"",te?`h-full max-w-full ${void 0===G?$[Y]:""}`:"w-full "+(void 0===G?"max-h-[85%]":""),V?"":`${se} ${x[Y]}`,U??""].filter(Boolean).join(" "),ue=ee?o.Title:"h2",xe=ee?o.Description:"p",he=/*@__PURE__*/["group text-mp-on-surface-variant relative flex size-10 shrink-0","rounded-mp-full cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),ge=t(l,{children:[me||le?t("div",{className:`flex shrink-0 items-start gap-3 ${de}`,children:[t("div",{className:"flex min-w-0 flex-1 flex-col",children:[c(F)?e(ue,{className:`m-0 ${b[Y]}`,children:F}):null,c(I)?e(xe,{className:`text-mp-on-surface-variant m-0 ${p}`,children:I}):null]}),le?ee?t(o.Close,{"aria-label":ae,className:he,children:[e(m,{}),e(n,{icon:r,size:20})]}):t("button",{type:"button","aria-label":ae,className:he,onClick:()=>{void 0===M&&ne(!1),S?.(!1)},children:[e(m,{}),e(n,{icon:r,size:20})]}):null]}):null,c(X)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",de,V&&(me||le)?D:"",V?"":"-my-1 py-1"].filter(Boolean).join(" "),children:X}):null,fe?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",de,V?D:""].filter(Boolean).join(" "),children:R}):null]});return ee?t(o.Root,{open:M,defaultOpen:L,disablePointerDismissal:!J,onOpenChange:(e,t)=>{J||e||"escape-key"!==t.reason?S?.(e):t.cancel()},children:[T?e(o.Trigger,{render:T}):null,t(o.Portal,{children:[e(o.Backdrop,{className:[`${j} fixed inset-0`,y,v,Q?.backdrop??""].filter(Boolean).join(" ")}),e(o.Viewport,{className:`${j} fixed inset-0 flex ${z[w]}`,children:e(o.Popup,{"data-mp-size":Y,"data-mp-side":w,"data-mp-mode":O,className:pe,style:{...ce,...W},children:ge})})]})]}):re?e("div",{"data-mp-size":Y,"data-mp-side":w,"data-mp-mode":O,className:pe,style:{...ce,...W},children:ge}):null}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useRender } from '@base-ui/react/use-render';
3
- import type { MPSize, MPVariant } from '../../types.js';
3
+ import type { MPSize, MPTransition, MPVariant } from '../../types.js';
4
4
  export interface MPEmptyProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {
5
5
  /**
6
6
  * The headline. Defaults to the words for "nothing here" in `locale`; pass
@@ -46,6 +46,15 @@ export interface MPEmptyProps extends Omit<React.ComponentPropsWithoutRef<'div'>
46
46
  render?: useRender.RenderProp;
47
47
  /** The sentence under the headline: why it is empty, or what to do next. */
48
48
  children?: React.ReactNode;
49
+ /**
50
+ * An entrance, run once as it mounts.
51
+ *
52
+ * `transition="fade"` is the whole of what most callers want; the object form
53
+ * takes a duration, an edge to come from, or a scale to start at. Anything
54
+ * that has to run again — on scroll, on hover, under your own control — is an
55
+ * [MPAnimateFade](../motion/animate-fade) and its siblings.
56
+ */
57
+ transition?: MPTransition;
49
58
  }
50
59
  /**
51
60
  * What stands where content would have been: a glyph, a headline, a sentence and
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as s from"react";import{useRender as n}from"@base-ui/react/use-render";import{useMPLocale as a,useMPMessages as l}from"../../internal/locale.js";import{EMPTY as i}from"../../internal/messages/empty.js";import{hasContent as o,PROSE_TEXT as m,SHEET_GAP as c,SHEET_PAD_X as d,SHEET_TITLE as p}from"../../internal/scale.js";import{CONTAINER_SURFACE as f}from"../../internal/surface.js";const x={xs:"py-5",sm:"py-6",md:"py-8",lg:"py-10",xl:"py-12"},u={xs:"text-[1.5rem]",sm:"text-[1.75rem]",md:"text-[2.25rem]",lg:"text-[2.75rem]",xl:"text-[3.25rem]"};function h(){return t("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[1em]",children:[e("path",{d:"M1.75 9.75h3l.9 1.6h4.7l.9-1.6h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"m1.75 9.75 2.1-6a1.5 1.5 0 0 1 1.42-1h5.46a1.5 1.5 0 0 1 1.42 1l2.1 6v2a1.5 1.5 0 0 1-1.5 1.5h-9.5a1.5 1.5 0 0 1-1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]})}export const MPEmpty=/*@__PURE__*/s.forwardRef(function({variant:s="text",size:v="md",title:j,icon:y,action:N,locale:g,render:k,className:w,style:z,children:$,...L},B){const C=a(g),M=l(i,C),W=void 0===j?M.title:j,b=void 0===y?e(h,{}):y,E=o(W),F=["mp-empty flex w-full flex-col items-center justify-center text-center",d[v],x[v],"text"===s?"":"rounded-mp-md",c[v],f[s],"text-mp-on-surface",w??""].filter(Boolean).join(" ");return n({render:k,ref:B,props:{role:"status","data-mp-size":v,"data-mp-variant":s,className:F,style:z,children:t(r,{children:[o(b)?e("span",{className:`text-mp-on-surface-variant flex items-center ${u[v]} [&>svg]:size-[1em]`,children:b}):null,E||o($)?t("div",{className:`flex max-w-prose flex-col items-center ${c[v]}`,children:[E?e("div",{className:p[v],children:W}):null,o($)?e("div",{className:`${m[v]} ${E?"text-mp-on-surface-variant":""}`,children:$}):null]}):null,o(N)?e("div",{className:"flex flex-wrap items-center justify-center gap-2",children:N}):null]}),...L}})});
2
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as s from"react";import{useRender as n}from"@base-ui/react/use-render";import{useMPLocale as a,useMPMessages as i}from"../../internal/locale.js";import{transitionProps as l}from"../../internal/transition.js";import{EMPTY as o}from"../../internal/messages/empty.js";import{hasContent as m,PROSE_TEXT as c,SHEET_GAP as d,SHEET_PAD_X as p,SHEET_TITLE as f}from"../../internal/scale.js";import{CONTAINER_SURFACE as x}from"../../internal/surface.js";import{useMPSize as u}from"../../internal/config.js";const h={xs:"py-5",sm:"py-6",md:"py-8",lg:"py-10",xl:"py-12"},j={xs:"text-[1.5rem]",sm:"text-[1.75rem]",md:"text-[2.25rem]",lg:"text-[2.75rem]",xl:"text-[3.25rem]"};function v(){return t("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[1em]",children:[e("path",{d:"M1.75 9.75h3l.9 1.6h4.7l.9-1.6h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"m1.75 9.75 2.1-6a1.5 1.5 0 0 1 1.42-1h5.46a1.5 1.5 0 0 1 1.42 1l2.1 6v2a1.5 1.5 0 0 1-1.5 1.5h-9.5a1.5 1.5 0 0 1-1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]})}export const MPEmpty=/*@__PURE__*/s.forwardRef(function({variant:s="text",size:y,title:N,icon:g,action:k,locale:$,render:w,transition:z,className:L,style:B,children:C,...M},W){const b=l(z),E=u(y),F=a($),P=i(o,F),R=void 0===N?P.title:N,Z=void 0===g?e(v,{}):g,q=m(R),A=["mp-empty flex w-full flex-col items-center justify-center text-center",p[E],h[E],"text"===s?"":"rounded-mp-md",d[E],x[s],"text-mp-on-surface",L??""].filter(Boolean).join(" ");return n({render:w,ref:W,props:{role:"status","data-mp-size":E,"data-mp-variant":s,className:`${A}${b.className?` ${b.className}`:""}`,style:{...b.style,...B},children:t(r,{children:[m(Z)?e("span",{className:`text-mp-on-surface-variant flex items-center ${j[E]} [&>svg]:size-[1em]`,children:Z}):null,q||m(C)?t("div",{className:`flex max-w-prose flex-col items-center ${d[E]}`,children:[q?e("div",{className:f[E],children:R}):null,m(C)?e("div",{className:`${c[E]} ${q?"text-mp-on-surface-variant":""}`,children:C}):null]}):null,m(k)?e("div",{className:"flex flex-wrap items-center justify-center gap-2",children:k}):null]}),...M}})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as l from"react";import{Fieldset as a}from"@base-ui/react/fieldset";import{hasContent as r,META_TEXT as n,SHEET_GAP as i,SHEET_TITLE as t,STACK_GAP as o}from"../../internal/scale.js";export const MPFieldset=/*@__PURE__*/l.forwardRef(function({legend:l,description:m,disabled:c=!1,size:d="md",className:f,children:p,...x},u){const h=r(l)||r(m);return s(a.Root,{ref:u,disabled:c,"data-mp-size":d,className:["mp-fieldset flex min-w-0 flex-col","m-0 border-0 p-0",i[d],f??""].filter(Boolean).join(" "),...x,children:[h?s(a.Legend,{className:`mp-fieldset__legend flex min-w-0 flex-col p-0 ${o[d]}`,children:[r(l)?e("span",{className:`text-mp-on-surface ${t[d]}`,children:l}):null,r(m)?e("span",{className:`text-mp-on-surface-variant ${n}`,children:m}):null]}):null,p]})});
2
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as l from"react";import{Fieldset as r}from"@base-ui/react/fieldset";import{useMPSize as a}from"../../internal/config.js";import{hasContent as n,META_TEXT as i,SHEET_GAP as t,SHEET_TITLE as o,STACK_GAP as m}from"../../internal/scale.js";export const MPFieldset=/*@__PURE__*/l.forwardRef(function({legend:l,description:c,disabled:d=!1,size:f,className:p,children:x,...u},j){const h=a(f),N=n(l)||n(c);return s(r.Root,{ref:j,disabled:d,"data-mp-size":h,className:["mp-fieldset flex min-w-0 flex-col","m-0 border-0 p-0",t[h],p??""].filter(Boolean).join(" "),...u,children:[N?s(r.Legend,{className:`mp-fieldset__legend flex min-w-0 flex-col p-0 ${m[h]}`,children:[n(l)?e("span",{className:`text-mp-on-surface ${o[h]}`,children:l}):null,n(c)?e("span",{className:`text-mp-on-surface-variant ${i}`,children:c}):null]}):null,x]})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{MPIcon as t}from"../icon/MPIcon.js";import{CloseIcon as a,UploadIcon as i}from"../../constants/icons.js";import{fillMessage as l}from"../../internal/i18n.js";import{useMPLocale as o,useMPMessages as s}from"../../internal/locale.js";import{COMMON as c}from"../../internal/messages/common.js";import{FILE_PICKER as m}from"../../internal/messages/file-picker.js";import{MPStateLayer as p}from"../../internal/StateLayer.js";import{CONTROL_ICON as u,META_TEXT as d,PROSE_TEXT as f,STACK_GAP as h,hasContent as x}from"../../internal/scale.js";const b={xs:"p-4",sm:"p-5",md:"p-6",lg:"p-8",xl:"p-10"};export function formatFileSize(e){if(e<1e3)return`${e} B`;const r=["kB","MB","GB","TB"];let n=e/1e3,t=0;for(;n>=1e3&&t<r.length-1;)n/=1e3,t+=1;return`${n<10?n.toFixed(1):Math.round(n)} ${r[t]}`}function v(e,r){const n=e.name.toLowerCase(),t=e.type.toLowerCase();return r.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?t.startsWith(e.slice(0,-1)):t===e)}export const MPFilePicker=/*@__PURE__*/n.forwardRef(function({accept:g,multiple:j=!1,maxSize:y,maxFiles:N,value:k,defaultValue:z,onFilesChange:w,onReject:C,label:I,description:B,errorMessage:D,title:F,hint:L,icon:M,showList:S=!0,removeLabel:$,locale:T,size:W="md",fullWidth:_=!0,required:P=!1,disabled:R=!1,readOnly:E=!1,name:O,id:q,className:A,style:V},G){const H=o(T),Y=s(c,H),J=s(m,H),K=n.useRef(null);n.useImperativeHandle(G,()=>K.current,[]);const[Q,U]=n.useState(()=>[...z??[]]),X=k?[...k]:Q,Z=n.useRef(0),[ee,re]=n.useState(!1),ne=x(D),te=R||E,ae=n.useId(),ie=n.useId(),le=n.useCallback(e=>{k||U(e),w?.(e)},[w,k]),oe=n.useCallback(e=>{const r=[],n=[],t=j?N??Number.POSITIVE_INFINITY:1,a=j?X.length:0;for(const i of e)g&&!v(i,g)?n.push({file:i,reason:"type"}):void 0!==y&&i.size>y?n.push({file:i,reason:"size"}):a+r.length>=t?n.push({file:i,reason:"count"}):r.push(i);return{kept:r,rejections:n}},[g,X.length,N,y,j]),se=n.useCallback(e=>{const{kept:r,rejections:n}=oe(e);n.length>0&&C?.(n),r.length>0&&le(j?[...X,...r]:r)},[oe,le,X,j,C]);return r("div",{className:["mp-file-picker flex-col align-top",h[W],_?"flex w-full":"inline-flex",A??""].filter(Boolean).join(" "),style:V,"data-mp-size":W,"data-disabled":R||void 0,"data-invalid":ne||void 0,children:[x(I)?r("span",{id:ie,className:[d,R?"text-mp-on-surface/38":ne?"text-mp-error":"text-mp-on-surface-variant"].join(" "),children:[I,P?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,r("div",{className:"relative flex w-full flex-col",onDragEnter:e=>{te||(e.preventDefault(),Z.current+=1,re(!0))},onDragOver:e=>{te||(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{te||(Z.current=Math.max(0,Z.current-1),0===Z.current&&re(!1))},onDrop:e=>{te||(e.preventDefault(),Z.current=0,re(!1),se(Array.from(e.dataTransfer.files)))},children:[r("button",{type:"button",id:q,disabled:R,"aria-describedby":x(B)||ne?ae:void 0,"aria-invalid":ne||void 0,className:["mp-file-picker__zone group relative flex w-full flex-col items-center","justify-center gap-2 text-center","rounded-mp-md box-border border-2 border-dashed","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color,background-color] duration-(--mp-sys-motion-duration-short4)",b[W],f[W],R?"border-mp-on-surface/12 text-mp-on-surface/38 cursor-default":[E?"cursor-default":"cursor-pointer",ne?"border-mp-error":"border-mp-outline-variant","text-mp-on-surface",ee?"border-mp-primary bg-mp-primary/8":""].filter(Boolean).join(" ")].filter(Boolean).join(" "),onClick:()=>{!te&&K.current&&(K.current.value="",K.current.click())},children:[te?null:e(p,{layer:"inset-0 rounded-[inherit] bg-mp-primary"}),void 0===M?e(t,{icon:i,size:1.6*u[W],className:R?"":"text-mp-primary"}):x(M)?e("span",{className:R?"":"text-mp-primary",children:M}):null,e("span",{className:"font-medium",children:F??J.prompt}),x(L)?e("span",{className:[d,R?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:L}):null]}),e("input",{ref:K,type:"file",name:O,accept:g,multiple:j,required:P&&0===X.length,disabled:te,tabIndex:-1,"aria-labelledby":x(I)?ie:void 0,"aria-describedby":x(B)||ne?ae:void 0,className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>se(Array.from(e.target.files??[]))})]}),S&&X.length>0?e("ul",{className:["mp-file-picker__list m-0 flex w-full list-none flex-col p-0",h[W]].join(" "),children:X.map((n,i)=>r("li",{className:["rounded-mp-xs bg-mp-surface-container-low flex w-full items-center gap-3","px-3 py-2",f[W],R?"text-mp-on-surface/38":"text-mp-on-surface"].join(" "),children:[e("span",{className:"min-w-0 flex-1 truncate",children:n.name}),e("span",{className:[d,"shrink-0 tabular-nums",R?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:formatFileSize(n.size)}),te?null:r("button",{type:"button","aria-label":$?$(n.name):l(Y.removeNamed,{label:n.name}),className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","cursor-pointer appearance-none items-center justify-center rounded-full","bg-transparent p-0 font-[inherit] outline-none"].join(" "),onClick:()=>le(X.filter((e,r)=>r!==i)),children:[e(p,{}),e(t,{icon:a,size:18})]})]},`${n.name}-${n.size}-${n.lastModified}-${i}`))}):null,ne?e("span",{id:ae,className:[d,"text-mp-error"].join(" "),children:D}):x(B)?e("span",{id:ae,className:[d,R?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:B}):null]})});
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{MPIcon as t}from"../icon/MPIcon.js";import{CloseIcon as a,UploadIcon as i}from"../../constants/icons.js";import{fillMessage as o}from"../../internal/i18n.js";import{useMPLocale as l,useMPMessages as s}from"../../internal/locale.js";import{COMMON as c}from"../../internal/messages/common.js";import{FILE_PICKER as m}from"../../internal/messages/file-picker.js";import{MPStateLayer as p}from"../../internal/StateLayer.js";import{CONTROL_ICON as u,META_TEXT as d,PROSE_TEXT as f,STACK_GAP as h,hasContent as x}from"../../internal/scale.js";import{useMPSize as b}from"../../internal/config.js";const v={xs:"p-4",sm:"p-5",md:"p-6",lg:"p-8",xl:"p-10"};export function formatFileSize(e){if(e<1e3)return`${e} B`;const r=["kB","MB","GB","TB"];let n=e/1e3,t=0;for(;n>=1e3&&t<r.length-1;)n/=1e3,t+=1;return`${n<10?n.toFixed(1):Math.round(n)} ${r[t]}`}function g(e){return`${e.name}-${e.size}-${e.lastModified}`}const j=new Set;function y(e,r){const n=e.name.toLowerCase(),t=e.type.toLowerCase();return r.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?t.startsWith(e.slice(0,-1)):t===e)}export const MPFilePicker=/*@__PURE__*/n.forwardRef(function({accept:N,multiple:k=!1,maxSize:w,maxFiles:z,value:B,defaultValue:C,onFilesChange:I,onReject:S,label:$,description:D,errorMessage:F,title:L,hint:M,icon:T,showList:W=!0,removeLabel:_,locale:P,size:R,fullWidth:E=!0,required:O=!1,disabled:q=!1,readOnly:A=!1,name:V,id:G,className:H,style:Y},J){const K=b(R),Q=l(P),U=s(c,Q),X=s(m,Q),Z=n.useRef(null);n.useImperativeHandle(J,()=>Z.current,[]);const[ee,re]=n.useState(()=>[...C??[]]),ne=B?[...B]:ee,te=n.useRef(0),[ae,ie]=n.useState(!1),oe=x(F),le=q||A,se=n.useId(),ce=n.useId(),me=n.useCallback(e=>{B||re(e),I?.(e)},[I,B]),pe=n.useCallback(e=>{const r=[],n=[],t=k?z??Number.POSITIVE_INFINITY:1,a=k?ne.length:0;for(const i of e)N&&!y(i,N)?n.push({file:i,reason:"type"}):void 0!==w&&i.size>w?n.push({file:i,reason:"size"}):a+r.length>=t?n.push({file:i,reason:"count"}):r.push(i);return{kept:r,rejections:n}},[N,ne.length,z,w,k]),[ue,de]=n.useState(j),fe=n.useCallback(e=>{const{kept:r,rejections:n}=pe(e);n.length>0&&S?.(n),r.length>0&&(de(new Set(r.map(g))),me(k?[...ne,...r]:r))},[pe,me,ne,k,S]);return r("div",{className:["mp-file-picker flex-col align-top",h[K],E?"flex w-full":"inline-flex",H??""].filter(Boolean).join(" "),style:Y,"data-mp-size":K,"data-disabled":q||void 0,"data-invalid":oe||void 0,children:[x($)?r("span",{id:ce,className:[d,q?"text-mp-on-surface/38":oe?"text-mp-error":"text-mp-on-surface-variant"].join(" "),children:[$,O?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,r("div",{className:"relative flex w-full flex-col",onDragEnter:e=>{le||(e.preventDefault(),te.current+=1,ie(!0))},onDragOver:e=>{le||(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{le||(te.current=Math.max(0,te.current-1),0===te.current&&ie(!1))},onDrop:e=>{le||(e.preventDefault(),te.current=0,ie(!1),fe(Array.from(e.dataTransfer.files)))},children:[r("button",{type:"button",id:G,disabled:q,"aria-describedby":x(D)||oe?se:void 0,"aria-invalid":oe||void 0,className:["mp-file-picker__zone group relative flex w-full flex-col items-center","justify-center gap-2 text-center","rounded-mp-md box-border border-2 border-dashed","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color,background-color] duration-(--mp-sys-motion-duration-short4)",v[K],f[K],q?"border-mp-on-surface/12 text-mp-on-surface/38 cursor-default":[A?"cursor-default":"cursor-pointer",oe?"border-mp-error":"border-mp-outline-variant","text-mp-on-surface",ae?"border-mp-primary bg-mp-primary/8":""].filter(Boolean).join(" ")].filter(Boolean).join(" "),onClick:()=>{!le&&Z.current&&(Z.current.value="",Z.current.click())},children:[le?null:e(p,{layer:"inset-0 rounded-[inherit] bg-mp-primary"}),void 0===T?e(t,{icon:i,size:1.6*u[K],className:q?"":"text-mp-primary"}):x(T)?e("span",{className:q?"":"text-mp-primary",children:T}):null,e("span",{className:"font-medium",children:L??X.prompt}),x(M)?e("span",{className:[d,q?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:M}):null]}),e("input",{ref:Z,type:"file",name:V,accept:N,multiple:k,required:O&&0===ne.length,disabled:le,tabIndex:-1,"aria-labelledby":x($)?ce:void 0,"aria-describedby":x(D)||oe?se:void 0,className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>fe(Array.from(e.target.files??[]))})]}),W&&ne.length>0?e("ul",{className:["mp-file-picker__list m-0 flex w-full list-none flex-col p-0",h[K]].join(" "),children:ne.map((n,i)=>r("li",{className:["rounded-mp-xs bg-mp-surface-container-low flex w-full items-center gap-3","px-3 py-2",f[K],q?"text-mp-on-surface/38":"text-mp-on-surface",ue.has(g(n))?"mp-row-arrive":""].filter(Boolean).join(" "),children:[e("span",{className:"min-w-0 flex-1 truncate",children:n.name}),e("span",{className:[d,"shrink-0 tabular-nums",q?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:formatFileSize(n.size)}),le?null:r("button",{type:"button","aria-label":_?_(n.name):o(U.removeNamed,{label:n.name}),className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","cursor-pointer appearance-none items-center justify-center rounded-full","bg-transparent p-0 font-[inherit] outline-none"].join(" "),onClick:()=>me(ne.filter((e,r)=>r!==i)),children:[e(p,{}),e(t,{icon:a,size:18})]})]},`${g(n)}-${i}`))}):null,oe?e("span",{id:se,className:[d,"text-mp-error"].join(" "),children:F}):x(D)?e("span",{id:se,className:[d,q?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:D}):null]})});
@@ -0,0 +1,95 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { MPGridAlign, MPGridJustify } from '../grid/MPGrid.js';
4
+ import type { MPResponsive } from '../../types.js';
5
+ /** Which way the items run. */
6
+ export type MPFlexDirection = 'row' | 'column';
7
+ export interface MPFlexProps extends React.ComponentPropsWithoutRef<'div'> {
8
+ /**
9
+ * Which way the items run, and the width at which that changes.
10
+ *
11
+ * `direction={{ compact: 'column', medium: 'row' }}` is the whole reason this
12
+ * component exists as something other than a `className`: a stack on a phone
13
+ * and a row from 600dp up is the most common layout decision there is, and
14
+ * writing it as a Tailwind variant means writing the library's boundary out
15
+ * again in a number that has to match.
16
+ * @default 'row'
17
+ */
18
+ direction?: MPResponsive<MPFlexDirection>;
19
+ /**
20
+ * Whether items that do not fit move onto another line.
21
+ * @default false
22
+ */
23
+ wrap?: MPResponsive<boolean>;
24
+ /**
25
+ * How the space the items did not take is divided along the direction.
26
+ * @default 'start'
27
+ */
28
+ justify?: MPResponsive<MPGridJustify>;
29
+ /**
30
+ * How the items sit across it.
31
+ *
32
+ * `stretch` is CSS's own default and is what makes two cards in a row the same
33
+ * height without either being told a height. `center` is what a row of a label
34
+ * and a control wants.
35
+ * @default 'stretch'
36
+ */
37
+ align?: MPResponsive<MPGridAlign>;
38
+ /**
39
+ * The space between items. A number is pixels, a string is any CSS length.
40
+ * @default 0
41
+ */
42
+ gap?: MPResponsive<number | string>;
43
+ /**
44
+ * Lays out as `inline-flex`, so the box is as wide as its contents and sits in
45
+ * a line of text.
46
+ * @default false
47
+ */
48
+ inline?: boolean;
49
+ /**
50
+ * Renders something other than a `<div>`. Base UI's own escape hatch, so it
51
+ * behaves here exactly as it does on every Base UI primitive.
52
+ */
53
+ render?: useRender.RenderProp;
54
+ children?: React.ReactNode;
55
+ }
56
+ /**
57
+ * A row, or a column, and the width at which it changes from one to the other.
58
+ *
59
+ * It draws nothing. No surface, no padding, no corner — only the five properties
60
+ * a flex container has, each of which can be said per window size class.
61
+ *
62
+ * ## Why this and not a `className`
63
+ *
64
+ * For a row that is always a row, a `className` is the better answer and this
65
+ * component is overhead. What it is for is the row that is a column on a phone:
66
+ *
67
+ * ```tsx
68
+ * <MPFlex direction={{ compact: 'column', medium: 'row' }} gap={16}>
69
+ * ```
70
+ *
71
+ * Written as Tailwind variants that is `flex-col md:flex-row`, which is the
72
+ * library's boundary said again in Tailwind's numbers — 768px rather than 600 —
73
+ * and a layout that reflows at one width while the `MPGrid` beside it reflows at
74
+ * another. The variants this package ships (`mp-medium:flex-row`) fix the number
75
+ * and are the right answer where a page is already writing Tailwind; this is the
76
+ * answer for a page that would rather say it in props, and it resolves in CSS
77
+ * either way. See [Breakpoints](../../design/breakpoints).
78
+ *
79
+ * ## Its relationship to the other three
80
+ *
81
+ * - [MPGrid](./grid) divides a row into columns and is what a *page* is laid out
82
+ * on. Reach for it when things have to line up with things in another row.
83
+ * - [MPStack](./stack) lays things **over** each other in a pile, which is a
84
+ * different idea that shares an unfortunate name across the ecosystem.
85
+ * - [MPBox](./box) is a sheet with padding and a surface. This is neither.
86
+ *
87
+ * ## Every axis is responsive, and resolved in CSS
88
+ *
89
+ * The values reach the stylesheet as `--_mp-flex-*` slots, one per class the
90
+ * caller actually named, and the rules in `styles.css` fall each class back to
91
+ * the one below it. So a window crossing 600dp changes the layout with nothing
92
+ * re-rendering, and a server-rendered first paint is already right — which is
93
+ * the half of this that a hook and a branch cannot do.
94
+ */
95
+ export declare const MPFlex: React.ForwardRefExoticComponent<MPFlexProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{responsiveSlots as n}from"../../internal/responsive.js";import{cssLength as t}from"../../internal/length.js";export const MPFlex=/*@__PURE__*/e.forwardRef(function({direction:e,wrap:f,justify:a,align:o,gap:s,inline:p=!1,render:x,className:c,style:m,children:d,...u},g){return r({render:x,ref:g,props:{className:["mp-flex",p?"inline-flex":"flex",c??""].filter(Boolean).join(" "),style:{...n("flex-dir",e,e=>e),...n("flex-wrap",f,e=>e?"wrap":"nowrap"),...n("flex-justify",a,i),...n("flex-align",o,l),...n("flex-gap",s,e=>t(e)),...m},children:d,...u}})});function i(e){return"start"===e||"end"===e?`flex-${e}`:e}function l(e){return"start"===e||"end"===e?`flex-${e}`:e}
@@ -0,0 +1,2 @@
1
+ export { MPFlex } from './MPFlex.js';
2
+ export type { MPFlexDirection, MPFlexProps } from './MPFlex.js';
@@ -0,0 +1 @@
1
+ export{MPFlex}from"./MPFlex.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Button as n}from"@base-ui/react/button";import{accentSlots as o}from"../../internal/accent.js";import{cssLength as i}from"../../internal/length.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{hasContent as r}from"../../internal/scale.js";const m={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"bg-mp-surface-container-high text-(--_mp-accent)"},l={xs:"h-10",sm:"h-12",md:"h-14",lg:"h-18",xl:"h-24"},p={xs:"min-w-10 gap-0 px-0",sm:"min-w-12 gap-0 px-0",md:"min-w-14 gap-0 px-0",lg:"min-w-18 gap-0 px-0",xl:"min-w-24 gap-0 px-0"},d={xs:"rounded-mp-md",sm:"rounded-mp-lg",md:"rounded-mp-lg",lg:"rounded-mp-xl",xl:"rounded-mp-xl"},f={xs:24,sm:24,md:24,lg:30,xl:36},c={xs:"text-mp-label-large",sm:"text-mp-label-large",md:"text-mp-label-large",lg:"text-mp-title-medium",xl:"text-mp-title-medium"},x={xs:"min-w-16 gap-1.5 px-3",sm:"min-w-18 gap-2 px-4",md:"min-w-20 gap-2 px-4",lg:"min-w-24 gap-2.5 px-5",xl:"min-w-28 gap-3 px-6"},u={absolute:"absolute z-30",sticky:"sticky z-30",fixed:"fixed z-40"},b={"top-start":"top-(--_mp-fab-offset) start-(--_mp-fab-offset)","top-end":"top-(--_mp-fab-offset) end-(--_mp-fab-offset)","bottom-start":"bottom-(--_mp-fab-offset) start-(--_mp-fab-offset)","bottom-end":"bottom-(--_mp-fab-offset) end-(--_mp-fab-offset)"};export const MPFloatingActionButton=/*@__PURE__*/a.forwardRef(function({icon:a,label:g,extended:h=!1,variant:w="tonal",color:y="primary",size:_="md",position:j="fixed",corner:v="bottom-end",offset:k=16,disabled:z=!1,type:N="button",className:B,style:$,...A},F){return e(n,{ref:F,type:N,disabled:z,"aria-label":g,"data-mp-size":_,"data-mp-variant":w,className:["mp-fab group inline-flex shrink-0 items-center justify-center","box-border overflow-hidden align-middle whitespace-nowrap select-none","cursor-pointer appearance-none font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none","transition-[background-color,box-shadow,color,min-width,padding,gap]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",d[_],l[_],c[_],h?x[_]:p[_],z?"bg-mp-on-surface/12 text-mp-on-surface/38 cursor-default shadow-none":`${m[w]} shadow-mp-3`,"static"===j?"relative":`${u[j]} ${b[v]}`,B??""].filter(Boolean).join(" "),style:{...o(y),"--_mp-fab-offset":i(k),...$},...A,children:[z?null:t(s,{}),r(a)?t("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:f[_],height:f[_]},children:a}):null,t("span",{className:["relative grid transition-[grid-template-columns]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",h?"grid-cols-[1fr]":"grid-cols-[0fr]"].join(" "),children:t("span",{className:"min-w-0 truncate",children:g})})]})});
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import*as n from"react";import{Button as o}from"@base-ui/react/button";import{accentSlots as a}from"../../internal/accent.js";import{cssLength as i}from"../../internal/length.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{hasContent as r}from"../../internal/scale.js";import{useMPColor as m,useMPSize as l}from"../../internal/config.js";const p={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"bg-mp-surface-container-high text-(--_mp-accent)"},d={xs:"h-10",sm:"h-12",md:"h-14",lg:"h-18",xl:"h-24"},f={xs:"min-w-10 gap-0 px-0",sm:"min-w-12 gap-0 px-0",md:"min-w-14 gap-0 px-0",lg:"min-w-18 gap-0 px-0",xl:"min-w-24 gap-0 px-0"},c={xs:"rounded-mp-md",sm:"rounded-mp-lg",md:"rounded-mp-lg",lg:"rounded-mp-xl",xl:"rounded-mp-xl"},x={xs:24,sm:24,md:24,lg:30,xl:36},u={xs:"text-mp-label-large",sm:"text-mp-label-large",md:"text-mp-label-large",lg:"text-mp-title-medium",xl:"text-mp-title-medium"},g={xs:"min-w-16 gap-1.5 px-3",sm:"min-w-18 gap-2 px-4",md:"min-w-20 gap-2 px-4",lg:"min-w-24 gap-2.5 px-5",xl:"min-w-28 gap-3 px-6"},b={absolute:"absolute z-30",sticky:"sticky z-30",fixed:"fixed z-40"},h={"top-start":"top-(--_mp-fab-offset) start-(--_mp-fab-offset)","top-end":"top-(--_mp-fab-offset) end-(--_mp-fab-offset)","bottom-start":"bottom-(--_mp-fab-offset) start-(--_mp-fab-offset)","bottom-end":"bottom-(--_mp-fab-offset) end-(--_mp-fab-offset)"};export const MPFloatingActionButton=/*@__PURE__*/n.forwardRef(function({icon:n,label:w,extended:_=!1,variant:y="tonal",color:j,size:v,position:k="fixed",corner:z="bottom-end",offset:N=16,disabled:B=!1,type:$="button",className:A,style:F,...L},M){const P=m(j),R=l(v);return e(o,{ref:M,type:$,disabled:B,"aria-label":w,"data-mp-size":R,"data-mp-variant":y,className:["mp-fab group inline-flex shrink-0 items-center justify-center","box-border overflow-hidden align-middle whitespace-nowrap select-none","cursor-pointer appearance-none font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none","transition-[background-color,box-shadow,color,min-width,padding,gap]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",c[R],d[R],u[R],_?g[R]:f[R],B?"bg-mp-on-surface/12 text-mp-on-surface/38 cursor-default shadow-none":`${p[y]} shadow-mp-3`,"static"===k?"relative":`${b[k]} ${h[z]}`,A??""].filter(Boolean).join(" "),style:{...a(P),"--_mp-fab-offset":i(N),...F},...L,children:[B?null:t(s,{}),r(n)?t("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:x[R],height:x[R]},children:n}):null,t("span",{className:["relative grid transition-[grid-template-columns]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",_?"grid-cols-[1fr]":"grid-cols-[0fr]"].join(" "),children:t("span",{className:"min-w-0 truncate",children:w})})]})});