material-plus-ui 0.0.1 → 1.1.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 (341) hide show
  1. package/README.md +39 -28
  2. package/dist/components/accordion/MPAccordion.d.ts +115 -0
  3. package/dist/components/accordion/MPAccordion.js +1 -0
  4. package/dist/components/accordion/index.d.ts +2 -0
  5. package/dist/components/accordion/index.js +1 -0
  6. package/dist/components/alert/MPAlert.d.ts +91 -0
  7. package/dist/components/alert/MPAlert.js +1 -0
  8. package/dist/components/alert/index.d.ts +2 -0
  9. package/dist/components/alert/index.js +1 -0
  10. package/dist/components/animate-appear/MPAnimateAppear.d.ts +56 -0
  11. package/dist/components/animate-appear/MPAnimateAppear.js +1 -0
  12. package/dist/components/animate-appear/index.d.ts +2 -0
  13. package/dist/components/animate-appear/index.js +1 -0
  14. package/dist/components/animate-blink/MPAnimateBlink.d.ts +41 -0
  15. package/dist/components/animate-blink/MPAnimateBlink.js +1 -0
  16. package/dist/components/animate-blink/index.d.ts +2 -0
  17. package/dist/components/animate-blink/index.js +1 -0
  18. package/dist/components/animate-fade/MPAnimateFade.d.ts +38 -0
  19. package/dist/components/animate-fade/MPAnimateFade.js +1 -0
  20. package/dist/components/animate-fade/index.d.ts +2 -0
  21. package/dist/components/animate-fade/index.js +1 -0
  22. package/dist/components/animate-grow/MPAnimateGrow.d.ts +52 -0
  23. package/dist/components/animate-grow/MPAnimateGrow.js +1 -0
  24. package/dist/components/animate-grow/index.d.ts +2 -0
  25. package/dist/components/animate-grow/index.js +1 -0
  26. package/dist/components/animate-headline/MPAnimateHeadline.d.ts +63 -0
  27. package/dist/components/animate-headline/MPAnimateHeadline.js +1 -0
  28. package/dist/components/animate-headline/index.d.ts +2 -0
  29. package/dist/components/animate-headline/index.js +1 -0
  30. package/dist/components/animate-lighting/MPAnimateLighting.d.ts +68 -0
  31. package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
  32. package/dist/components/animate-lighting/index.d.ts +2 -0
  33. package/dist/components/animate-lighting/index.js +1 -0
  34. package/dist/components/animate-marquee/MPAnimateMarquee.d.ts +66 -0
  35. package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -0
  36. package/dist/components/animate-marquee/index.d.ts +2 -0
  37. package/dist/components/animate-marquee/index.js +1 -0
  38. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +56 -0
  39. package/dist/components/animate-rotate/MPAnimateRotate.js +1 -0
  40. package/dist/components/animate-rotate/index.d.ts +2 -0
  41. package/dist/components/animate-rotate/index.js +1 -0
  42. package/dist/components/animate-slide/MPAnimateSlide.d.ts +53 -0
  43. package/dist/components/animate-slide/MPAnimateSlide.js +1 -0
  44. package/dist/components/animate-slide/index.d.ts +2 -0
  45. package/dist/components/animate-slide/index.js +1 -0
  46. package/dist/components/animate-typing/MPAnimateTyping.d.ts +59 -0
  47. package/dist/components/animate-typing/MPAnimateTyping.js +1 -0
  48. package/dist/components/animate-typing/index.d.ts +2 -0
  49. package/dist/components/animate-typing/index.js +1 -0
  50. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +44 -0
  51. package/dist/components/animate-zoom/MPAnimateZoom.js +1 -0
  52. package/dist/components/animate-zoom/index.d.ts +2 -0
  53. package/dist/components/animate-zoom/index.js +1 -0
  54. package/dist/components/aspect-ratio/MPAspectRatio.d.ts +69 -0
  55. package/dist/components/aspect-ratio/MPAspectRatio.js +1 -0
  56. package/dist/components/aspect-ratio/index.d.ts +2 -0
  57. package/dist/components/aspect-ratio/index.js +1 -0
  58. package/dist/components/avatar/MPAvatar.d.ts +104 -0
  59. package/dist/components/avatar/MPAvatar.js +1 -0
  60. package/dist/components/avatar/index.d.ts +2 -0
  61. package/dist/components/avatar/index.js +1 -0
  62. package/dist/components/badge/MPBadge.d.ts +104 -0
  63. package/dist/components/badge/MPBadge.js +1 -0
  64. package/dist/components/badge/index.d.ts +2 -0
  65. package/dist/components/badge/index.js +1 -0
  66. package/dist/components/blockquote/MPBlockquote.d.ts +73 -0
  67. package/dist/components/blockquote/MPBlockquote.js +1 -0
  68. package/dist/components/blockquote/index.d.ts +2 -0
  69. package/dist/components/blockquote/index.js +1 -0
  70. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +144 -0
  71. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -0
  72. package/dist/components/bottom-navigation/index.d.ts +2 -0
  73. package/dist/components/bottom-navigation/index.js +1 -0
  74. package/dist/components/box/MPBox.d.ts +78 -0
  75. package/dist/components/box/MPBox.js +1 -0
  76. package/dist/components/box/index.d.ts +2 -0
  77. package/dist/components/box/index.js +1 -0
  78. package/dist/components/breadcrumb/MPBreadcrumb.d.ts +127 -0
  79. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -0
  80. package/dist/components/breadcrumb/index.d.ts +2 -0
  81. package/dist/components/breadcrumb/index.js +1 -0
  82. package/dist/components/button/MPButton.d.ts +75 -0
  83. package/dist/components/button/MPButton.js +1 -0
  84. package/dist/components/button/index.d.ts +2 -0
  85. package/dist/components/button/index.js +1 -0
  86. package/dist/components/button-group/MPButtonGroup.d.ts +31 -0
  87. package/dist/components/button-group/MPButtonGroup.js +1 -0
  88. package/dist/components/button-group/index.d.ts +2 -0
  89. package/dist/components/button-group/index.js +1 -0
  90. package/dist/components/card/MPCard.d.ts +73 -0
  91. package/dist/components/card/MPCard.js +1 -0
  92. package/dist/components/card/index.d.ts +2 -0
  93. package/dist/components/card/index.js +1 -0
  94. package/dist/components/carousel/MPCarousel.d.ts +116 -0
  95. package/dist/components/carousel/MPCarousel.js +1 -0
  96. package/dist/components/carousel/index.d.ts +2 -0
  97. package/dist/components/carousel/index.js +1 -0
  98. package/dist/components/chat-bubble/MPChatBubble.d.ts +132 -0
  99. package/dist/components/chat-bubble/MPChatBubble.js +1 -0
  100. package/dist/components/chat-bubble/index.d.ts +2 -0
  101. package/dist/components/chat-bubble/index.js +1 -0
  102. package/dist/components/checkbox/MPCheckbox.d.ts +76 -0
  103. package/dist/components/checkbox/MPCheckbox.js +1 -0
  104. package/dist/components/checkbox/index.d.ts +2 -0
  105. package/dist/components/checkbox/index.js +1 -0
  106. package/dist/components/chip/MPChip.d.ts +74 -0
  107. package/dist/components/chip/MPChip.js +1 -0
  108. package/dist/components/chip/index.d.ts +2 -0
  109. package/dist/components/chip/index.js +1 -0
  110. package/dist/components/collapsible/MPCollapsible.d.ts +97 -0
  111. package/dist/components/collapsible/MPCollapsible.js +1 -0
  112. package/dist/components/collapsible/index.d.ts +2 -0
  113. package/dist/components/collapsible/index.js +1 -0
  114. package/dist/components/color-picker/MPColorPicker.d.ts +131 -0
  115. package/dist/components/color-picker/MPColorPicker.js +1 -0
  116. package/dist/components/color-picker/index.d.ts +2 -0
  117. package/dist/components/color-picker/index.js +1 -0
  118. package/dist/components/combobox/MPCombobox.d.ts +175 -0
  119. package/dist/components/combobox/MPCombobox.js +1 -0
  120. package/dist/components/combobox/index.d.ts +2 -0
  121. package/dist/components/combobox/index.js +1 -0
  122. package/dist/components/container/MPContainer.d.ts +75 -0
  123. package/dist/components/container/MPContainer.js +1 -0
  124. package/dist/components/container/index.d.ts +2 -0
  125. package/dist/components/container/index.js +1 -0
  126. package/dist/components/date-picker/MPDatePicker.d.ts +98 -0
  127. package/dist/components/date-picker/MPDatePicker.js +1 -0
  128. package/dist/components/date-picker/index.d.ts +2 -0
  129. package/dist/components/date-picker/index.js +1 -0
  130. package/dist/components/date-range-picker/MPDateRangePicker.d.ts +98 -0
  131. package/dist/components/date-range-picker/MPDateRangePicker.js +1 -0
  132. package/dist/components/date-range-picker/index.d.ts +2 -0
  133. package/dist/components/date-range-picker/index.js +1 -0
  134. package/dist/components/date-time-picker/MPDateTimePicker.d.ts +78 -0
  135. package/dist/components/date-time-picker/MPDateTimePicker.js +1 -0
  136. package/dist/components/date-time-picker/index.d.ts +2 -0
  137. package/dist/components/date-time-picker/index.js +1 -0
  138. package/dist/components/dialog/MPDialog.d.ts +150 -0
  139. package/dist/components/dialog/MPDialog.js +1 -0
  140. package/dist/components/dialog/index.d.ts +2 -0
  141. package/dist/components/dialog/index.js +1 -0
  142. package/dist/components/divider/MPDivider.d.ts +80 -0
  143. package/dist/components/divider/MPDivider.js +1 -0
  144. package/dist/components/divider/index.d.ts +2 -0
  145. package/dist/components/divider/index.js +1 -0
  146. package/dist/components/drawer/MPDrawer.d.ts +168 -0
  147. package/dist/components/drawer/MPDrawer.js +1 -0
  148. package/dist/components/drawer/index.d.ts +2 -0
  149. package/dist/components/drawer/index.js +1 -0
  150. package/dist/components/empty/MPEmpty.d.ts +74 -0
  151. package/dist/components/empty/MPEmpty.js +1 -0
  152. package/dist/components/empty/index.d.ts +2 -0
  153. package/dist/components/empty/index.js +1 -0
  154. package/dist/components/file-picker/MPFilePicker.d.ts +113 -0
  155. package/dist/components/file-picker/MPFilePicker.js +1 -0
  156. package/dist/components/file-picker/index.d.ts +2 -0
  157. package/dist/components/file-picker/index.js +1 -0
  158. package/dist/components/floating-action-button/MPFloatingActionButton.d.ts +126 -0
  159. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -0
  160. package/dist/components/floating-action-button/index.d.ts +2 -0
  161. package/dist/components/floating-action-button/index.js +1 -0
  162. package/dist/components/grid/MPGrid.d.ts +155 -0
  163. package/dist/components/grid/MPGrid.js +1 -0
  164. package/dist/components/grid/index.d.ts +2 -0
  165. package/dist/components/grid/index.js +1 -0
  166. package/dist/components/highlight/MPHighlight.d.ts +95 -0
  167. package/dist/components/highlight/MPHighlight.js +1 -0
  168. package/dist/components/highlight/index.d.ts +2 -0
  169. package/dist/components/highlight/index.js +1 -0
  170. package/dist/components/icon-button/MPIconButton.d.ts +59 -0
  171. package/dist/components/icon-button/MPIconButton.js +1 -0
  172. package/dist/components/icon-button/index.d.ts +2 -0
  173. package/dist/components/icon-button/index.js +1 -0
  174. package/dist/components/list/MPList.d.ts +96 -0
  175. package/dist/components/list/MPList.js +1 -0
  176. package/dist/components/list/index.d.ts +2 -0
  177. package/dist/components/list/index.js +1 -0
  178. package/dist/components/locale/MPLocaleProvider.d.ts +63 -0
  179. package/dist/components/locale/MPLocaleProvider.js +1 -0
  180. package/dist/components/locale/index.d.ts +2 -0
  181. package/dist/components/locale/index.js +1 -0
  182. package/dist/components/menu/MPMenu.d.ts +232 -0
  183. package/dist/components/menu/MPMenu.js +1 -0
  184. package/dist/components/menu/index.d.ts +2 -0
  185. package/dist/components/menu/index.js +1 -0
  186. package/dist/components/number-field/MPNumberField.d.ts +117 -0
  187. package/dist/components/number-field/MPNumberField.js +1 -0
  188. package/dist/components/number-field/index.d.ts +2 -0
  189. package/dist/components/number-field/index.js +1 -0
  190. package/dist/components/otp-field/MPOtpField.d.ts +89 -0
  191. package/dist/components/otp-field/MPOtpField.js +1 -0
  192. package/dist/components/otp-field/index.d.ts +2 -0
  193. package/dist/components/otp-field/index.js +1 -0
  194. package/dist/components/overlay/MPOverlay.d.ts +96 -0
  195. package/dist/components/overlay/MPOverlay.js +1 -0
  196. package/dist/components/overlay/index.d.ts +2 -0
  197. package/dist/components/overlay/index.js +1 -0
  198. package/dist/components/pagination/MPPagination.d.ts +106 -0
  199. package/dist/components/pagination/MPPagination.js +1 -0
  200. package/dist/components/pagination/index.d.ts +2 -0
  201. package/dist/components/pagination/index.js +1 -0
  202. package/dist/components/panes/MPPanes.d.ts +100 -0
  203. package/dist/components/panes/MPPanes.js +1 -0
  204. package/dist/components/panes/index.d.ts +2 -0
  205. package/dist/components/panes/index.js +1 -0
  206. package/dist/components/pill/MPPill.d.ts +117 -0
  207. package/dist/components/pill/MPPill.js +1 -0
  208. package/dist/components/pill/index.d.ts +2 -0
  209. package/dist/components/pill/index.js +1 -0
  210. package/dist/components/popover/MPPopover.d.ts +143 -0
  211. package/dist/components/popover/MPPopover.js +1 -0
  212. package/dist/components/popover/index.d.ts +2 -0
  213. package/dist/components/popover/index.js +1 -0
  214. package/dist/components/progress-box/MPProgressBox.d.ts +40 -0
  215. package/dist/components/progress-box/MPProgressBox.js +1 -0
  216. package/dist/components/progress-box/index.d.ts +2 -0
  217. package/dist/components/progress-box/index.js +1 -0
  218. package/dist/components/progress-circular/MPProgressCircular.d.ts +32 -0
  219. package/dist/components/progress-circular/MPProgressCircular.js +1 -0
  220. package/dist/components/progress-circular/index.d.ts +2 -0
  221. package/dist/components/progress-circular/index.js +1 -0
  222. package/dist/components/progress-linear/MPProgressLinear.d.ts +32 -0
  223. package/dist/components/progress-linear/MPProgressLinear.js +1 -0
  224. package/dist/components/progress-linear/index.d.ts +2 -0
  225. package/dist/components/progress-linear/index.js +1 -0
  226. package/dist/components/radio-group/MPRadioGroup.d.ts +81 -0
  227. package/dist/components/radio-group/MPRadioGroup.js +1 -0
  228. package/dist/components/radio-group/index.d.ts +2 -0
  229. package/dist/components/radio-group/index.js +1 -0
  230. package/dist/components/rating/MPRating.d.ts +135 -0
  231. package/dist/components/rating/MPRating.js +1 -0
  232. package/dist/components/rating/index.d.ts +2 -0
  233. package/dist/components/rating/index.js +1 -0
  234. package/dist/components/segmented-button/MPSegmentedButton.d.ts +75 -0
  235. package/dist/components/segmented-button/MPSegmentedButton.js +1 -0
  236. package/dist/components/segmented-button/index.d.ts +2 -0
  237. package/dist/components/segmented-button/index.js +1 -0
  238. package/dist/components/select/MPSelect.d.ts +103 -0
  239. package/dist/components/select/MPSelect.js +1 -0
  240. package/dist/components/select/index.d.ts +2 -0
  241. package/dist/components/select/index.js +1 -0
  242. package/dist/components/shortcut/MPShortcut.d.ts +67 -0
  243. package/dist/components/shortcut/MPShortcut.js +1 -0
  244. package/dist/components/shortcut/index.d.ts +2 -0
  245. package/dist/components/shortcut/index.js +1 -0
  246. package/dist/components/skeleton/MPSkeleton.d.ts +76 -0
  247. package/dist/components/skeleton/MPSkeleton.js +1 -0
  248. package/dist/components/skeleton/index.d.ts +2 -0
  249. package/dist/components/skeleton/index.js +1 -0
  250. package/dist/components/slider/MPSlider.d.ts +77 -0
  251. package/dist/components/slider/MPSlider.js +1 -0
  252. package/dist/components/slider/index.d.ts +2 -0
  253. package/dist/components/slider/index.js +1 -0
  254. package/dist/components/snackbar/MPSnackbar.d.ts +175 -0
  255. package/dist/components/snackbar/MPSnackbar.js +1 -0
  256. package/dist/components/snackbar/index.d.ts +2 -0
  257. package/dist/components/snackbar/index.js +1 -0
  258. package/dist/components/spoiler/MPSpoiler.d.ts +106 -0
  259. package/dist/components/spoiler/MPSpoiler.js +1 -0
  260. package/dist/components/spoiler/index.d.ts +2 -0
  261. package/dist/components/spoiler/index.js +1 -0
  262. package/dist/components/switch/MPSwitch.d.ts +75 -0
  263. package/dist/components/switch/MPSwitch.js +1 -0
  264. package/dist/components/switch/index.d.ts +2 -0
  265. package/dist/components/switch/index.js +1 -0
  266. package/dist/components/table/MPTable.d.ts +120 -0
  267. package/dist/components/table/MPTable.js +1 -0
  268. package/dist/components/table/index.d.ts +2 -0
  269. package/dist/components/table/index.js +1 -0
  270. package/dist/components/tabs/MPTabs.d.ts +145 -0
  271. package/dist/components/tabs/MPTabs.js +1 -0
  272. package/dist/components/tabs/index.d.ts +2 -0
  273. package/dist/components/tabs/index.js +1 -0
  274. package/dist/components/text-field/MPTextField.d.ts +51 -22
  275. package/dist/components/text-field/MPTextField.js +1 -1
  276. package/dist/components/text-link/MPTextLink.d.ts +88 -0
  277. package/dist/components/text-link/MPTextLink.js +1 -0
  278. package/dist/components/text-link/index.d.ts +2 -0
  279. package/dist/components/text-link/index.js +1 -0
  280. package/dist/components/time-picker/MPTimePicker.d.ts +108 -0
  281. package/dist/components/time-picker/MPTimePicker.js +1 -0
  282. package/dist/components/time-picker/index.d.ts +2 -0
  283. package/dist/components/time-picker/index.js +1 -0
  284. package/dist/components/timeline/MPTimeline.d.ts +96 -0
  285. package/dist/components/timeline/MPTimeline.js +1 -0
  286. package/dist/components/timeline/index.d.ts +2 -0
  287. package/dist/components/timeline/index.js +1 -0
  288. package/dist/components/tooltip/MPTooltip.d.ts +117 -0
  289. package/dist/components/tooltip/MPTooltip.js +1 -0
  290. package/dist/components/tooltip/index.d.ts +2 -0
  291. package/dist/components/tooltip/index.js +1 -0
  292. package/dist/components/typography/MPTypography.d.ts +94 -0
  293. package/dist/components/typography/MPTypography.js +1 -0
  294. package/dist/components/typography/index.d.ts +2 -0
  295. package/dist/components/typography/index.js +1 -0
  296. package/dist/constants/icons.d.ts +49 -0
  297. package/dist/constants/icons.js +1 -1
  298. package/dist/index.d.ts +73 -0
  299. package/dist/index.js +1 -1
  300. package/dist/internal/Calendar.d.ts +118 -0
  301. package/dist/internal/Calendar.js +1 -0
  302. package/dist/internal/FieldOutline.d.ts +109 -0
  303. package/dist/internal/FieldOutline.js +1 -0
  304. package/dist/internal/Picker.d.ts +153 -0
  305. package/dist/internal/Picker.js +1 -0
  306. package/dist/internal/StateLayer.d.ts +45 -0
  307. package/dist/internal/StateLayer.js +1 -0
  308. package/dist/internal/SupportingText.d.ts +23 -0
  309. package/dist/internal/SupportingText.js +1 -0
  310. package/dist/internal/WidthSizer.d.ts +31 -0
  311. package/dist/internal/WidthSizer.js +1 -0
  312. package/dist/internal/accent.d.ts +39 -0
  313. package/dist/internal/accent.js +1 -0
  314. package/dist/internal/animate.d.ts +179 -0
  315. package/dist/internal/animate.js +1 -0
  316. package/dist/internal/button-group.d.ts +21 -0
  317. package/dist/internal/button-group.js +1 -0
  318. package/dist/internal/color.d.ts +125 -0
  319. package/dist/internal/color.js +1 -0
  320. package/dist/internal/date.d.ts +179 -0
  321. package/dist/internal/date.js +1 -0
  322. package/dist/internal/i18n.d.ts +241 -0
  323. package/dist/internal/i18n.js +1 -0
  324. package/dist/internal/inert.d.ts +11 -0
  325. package/dist/internal/inert.js +1 -0
  326. package/dist/internal/locale.d.ts +43 -0
  327. package/dist/internal/locale.js +1 -0
  328. package/dist/internal/menu.d.ts +23 -0
  329. package/dist/internal/menu.js +1 -0
  330. package/dist/internal/progress.d.ts +126 -0
  331. package/dist/internal/progress.js +1 -0
  332. package/dist/internal/scale.d.ts +127 -0
  333. package/dist/internal/scale.js +1 -0
  334. package/dist/internal/surface.d.ts +76 -0
  335. package/dist/internal/surface.js +1 -0
  336. package/dist/internal/visually-hidden.d.ts +23 -0
  337. package/dist/internal/visually-hidden.js +1 -0
  338. package/dist/styles.css +1 -1
  339. package/dist/tailwind.css +1871 -20
  340. package/dist/types.d.ts +262 -16
  341. package/package.json +16 -21
@@ -0,0 +1,96 @@
1
+ import * as React from 'react';
2
+ import type { MPAlign, MPSize } from '../../types';
3
+ /**
4
+ * How much of the page the overlay takes away.
5
+ *
6
+ * One axis, four steps — how legible is what is behind — and they are tuned with
7
+ * the blur radius as much as with the alpha, because past about 16px a backdrop
8
+ * smears into flat colour and the sheet reads opaque however low its alpha goes.
9
+ *
10
+ * - `scrim` — MD3's own scrim, and exactly what `MPDialog` puts behind itself.
11
+ * The page is still there and still readable; it has only stopped being
12
+ * reachable.
13
+ * - `blur` — frosted. A lighter dim over a real blur, so the page is present as
14
+ * shape and colour but not as words. For "this is being replaced".
15
+ * - `solid` — the page's own `surface`, opaque. For a screen that is genuinely
16
+ * gone.
17
+ * - `clear` — nothing drawn at all. Still blocks the pointer, which is the whole
18
+ * reason to reach for it: an invisible sheet that catches a click.
19
+ */
20
+ export type MPOverlayTone = 'scrim' | 'blur' | 'solid' | 'clear';
21
+ /**
22
+ * An overlay takes `size`, `align` and `tone` and stops there.
23
+ *
24
+ * There is no `variant` — the five weights answer "how much of a surface does
25
+ * this paint", and an overlay has taken the page. There is no `color` either: an
26
+ * accent is what a control uses to say which of several things it is, and there
27
+ * is only ever one overlay.
28
+ */
29
+ export interface MPOverlayProps {
30
+ /** The overlay is shown. Use with `onOpenChange` for a controlled overlay. */
31
+ open?: boolean;
32
+ /** Whether the overlay starts shown, for an uncontrolled one. */
33
+ defaultOpen?: boolean;
34
+ onOpenChange?: (open: boolean) => void;
35
+ /**
36
+ * How much of the page is taken away.
37
+ * @default 'scrim'
38
+ */
39
+ tone?: MPOverlayTone;
40
+ /**
41
+ * Whether clicking the overlay or pressing Escape closes it.
42
+ *
43
+ * Off by default, which is the other way round from `MPDialog`. A dialog asks a
44
+ * question and Escape is the universal "no"; an overlay is not asking anything
45
+ * — it is saying *wait* — and a save that can be dismissed by a stray click is
46
+ * a save the reader will believe finished. Turn it on for the overlay whose job
47
+ * is to catch a click outside something.
48
+ * @default false
49
+ */
50
+ dismissible?: boolean;
51
+ /**
52
+ * Whether the page behind is taken away for the keyboard too. `'trap-focus'`
53
+ * leaves the page scrollable and clickable while still holding focus inside,
54
+ * which is usually what a `clear` overlay wants.
55
+ * @default true
56
+ */
57
+ modal?: boolean | 'trap-focus';
58
+ /**
59
+ * Where the content sits down the viewport.
60
+ * @default 'center'
61
+ */
62
+ align?: MPAlign;
63
+ /**
64
+ * The room between the content and the edge of the viewport. The one thing
65
+ * `size` decides here — an overlay has no surface of its own to scale.
66
+ * @default 'md'
67
+ */
68
+ size?: MPSize;
69
+ /**
70
+ * The accessible name of the overlay.
71
+ *
72
+ * It has a default rather than being optional, which almost nothing else in
73
+ * this library does: an overlay that holds nothing readable — a bare spinner, a
74
+ * `clear` sheet — still has to say what it is, and the alternative is a modal
75
+ * region a screen reader announces as nothing at all.
76
+ * @default 'Overlay'
77
+ */
78
+ label?: string;
79
+ /** What sits on top — a spinner, a line of text, a small card. */
80
+ children?: React.ReactNode;
81
+ className?: string;
82
+ style?: React.CSSProperties;
83
+ }
84
+ /**
85
+ * A sheet over the whole page that stops it being used.
86
+ *
87
+ * What separates this from `MPDialog` is what is *not* here: no surface, no
88
+ * outline, no title, no actions. An overlay is the scrim on its own, with
89
+ * whatever the caller puts on top of it — most often an `MPProgressCircular` and
90
+ * a line saying what is being waited for.
91
+ *
92
+ * `dismissible` is the one prop worth reading twice, and it is off. Everything
93
+ * else Base UI owns: the portal, the scroll lock, the focus held inside, the page
94
+ * behind going inert, and focus returning to wherever it came from on close.
95
+ */
96
+ export declare function MPOverlay({ open, defaultOpen, onOpenChange, tone, dismissible, modal, align, size, label, className, style, children }: MPOverlayProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{FADE as l,PORTAL_LAYER as s,SCRIM as t}from"../../internal/surface";import{SHEET_PAD as i}from"../../internal/scale";const n={scrim:t,blur:"bg-mp-scrim/20 [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-mp-surface",clear:""},o={start:"items-start",center:"items-center",end:"items-end"};export function MPOverlay({open:t,defaultOpen:c,onOpenChange:m,tone:p="scrim",dismissible:d=!1,modal:f=!0,align:u="center",size:x="md",label:b="Overlay",className:h,style:y,children:j}){return e(r.Root,{open:t,defaultOpen:c,modal:f,disablePointerDismissal:!d,onOpenChange:(e,a)=>{d||e||"escape-key"!==a.reason?m?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:`${s} fixed inset-0 ${l} ${n[p]}`}),e(r.Viewport,{className:[s,"fixed inset-0 flex justify-center",o[u],i[x]].join(" "),children:e(r.Popup,{"aria-label":b,"data-mp-size":x,className:["mp-overlay flex max-h-full max-w-full flex-col items-center justify-center","text-mp-on-surface outline-none",l,h??""].filter(Boolean).join(" "),style:y,children:j})})]})})}
@@ -0,0 +1,2 @@
1
+ export { MPOverlay } from './MPOverlay';
2
+ export type { MPOverlayProps, MPOverlayTone } from './MPOverlay';
@@ -0,0 +1 @@
1
+ export{MPOverlay}from"./MPOverlay";
@@ -0,0 +1,106 @@
1
+ import * as React from 'react';
2
+ import { type MPMessages } from '../../internal/i18n';
3
+ import type { MPColor, MPStyleProps } from '../../types';
4
+ /** The words the row says on its own behalf. */
5
+ export type MPPaginationLabels = MPMessages['pagination'];
6
+ export interface MPPaginationProps extends MPStyleProps, Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'onChange'> {
7
+ /**
8
+ * How many pages there are. Fewer than two and the whole control renders
9
+ * nothing — one page is not a set of pages, and a row holding a lone disabled
10
+ * "1" is a control advertising that it has nothing to do.
11
+ */
12
+ count: number;
13
+ /** The current page, 1-based. Use with `onPageChange` for a controlled row. */
14
+ page?: number;
15
+ /**
16
+ * Which page starts current, for an uncontrolled row.
17
+ * @default 1
18
+ */
19
+ defaultPage?: number;
20
+ /** Called with the page that was chosen. */
21
+ onPageChange?: (page: number) => void;
22
+ /**
23
+ * How many pages are always shown on either side of the current one.
24
+ * @default 1
25
+ */
26
+ siblingCount?: number;
27
+ /**
28
+ * How many pages are always shown at each end, whatever page is current. `0`
29
+ * drops the first and last page from the row, leaving only the window.
30
+ * @default 1
31
+ */
32
+ boundaryCount?: number;
33
+ /**
34
+ * Shows the two steppers that jump to the first and last page.
35
+ * @default false
36
+ */
37
+ showEdges?: boolean;
38
+ /**
39
+ * Shows the two steppers that move by one page.
40
+ * @default true
41
+ */
42
+ showArrows?: boolean;
43
+ /**
44
+ * Which accent family the current page is filled with.
45
+ * @default 'primary'
46
+ */
47
+ color?: MPColor;
48
+ /** Unavailable. Every cell in the row stops answering. */
49
+ disabled?: boolean;
50
+ /**
51
+ * The address of a page, which turns every number in the row into a real link.
52
+ *
53
+ * Without it the row is buttons, and a crawler cannot press one — so a paged
54
+ * list of articles, products or search results exists for a reader and stops
55
+ * at page one for everything else. With it the numbers are `<a href>`, the two
56
+ * steppers carry `rel="prev"` and `rel="next"`, and the browser's own
57
+ * behaviour comes back: open in a new tab, copy the address, see where a press
58
+ * is going before making it.
59
+ *
60
+ * `onPageChange` still fires and the navigation is still cancelled first, so a
61
+ * client-side router keeps the page it already has.
62
+ */
63
+ getPageHref?: (page: number) => string;
64
+ /**
65
+ * Which language the row names itself in — a BCP 47 tag such as `ko`, `pt-BR`
66
+ * or `zh-Hant`. Unsupported tags fall back to English.
67
+ *
68
+ * Nothing here is ever drawn, so without it a Korean page reads its pages out
69
+ * in English.
70
+ */
71
+ locale?: string;
72
+ /** Overrides for the words themselves. They win over the translation. */
73
+ labels?: Partial<MPPaginationLabels>;
74
+ }
75
+ /**
76
+ * A row of pages, one of which is the one being read.
77
+ *
78
+ * Material has no pagination component, so what is Material here is everything
79
+ * *around* the decision: the cells are pills at the library's own control
80
+ * heights, the current one is filled with the accent under its own ink, the rest
81
+ * are the quiet `text` treatment, and every one of them carries the state layer
82
+ * the specification uses in place of a hover colour.
83
+ *
84
+ * The current page is the one thing the row has to say without being read, which
85
+ * is why it is the only cell that is filled. Nine filled cells in a row would say
86
+ * that all nine are the primary action.
87
+ *
88
+ * ## The markup, and why it is that
89
+ *
90
+ * A `<nav>` around a `<ul>`: a named landmark a screen reader can skip, holding
91
+ * a list whose length says how far the pages go, with `aria-current="page"`
92
+ * marking where the reader is. The ellipsis is a `<span>` rather than a disabled
93
+ * button — it is not a control that happens to be unavailable, it is
94
+ * punctuation — and it is `aria-hidden`, because "horizontal ellipsis" read out
95
+ * between two numbers is noise.
96
+ *
97
+ * ## Why it builds its own cells
98
+ *
99
+ * For the reason [MPSegmentedButton](../inputs/segmented-button) does: a page
100
+ * cell is square-ish and grows only for a long number, which is not a shape
101
+ * [MPButton](../inputs/button) has — a button is a pill with inline padding
102
+ * proportional to its height, and nine of those in a row is a very long row. The
103
+ * heights, the type scale and the state layer are the shared ones, so a `sm`
104
+ * pagination still lines up with a `sm` button beside it.
105
+ */
106
+ export declare const MPPagination: React.ForwardRefExoticComponent<MPPaginationProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{MPIcon as a}from"../icon/MPIcon";import{ChevronLeftIcon as i,ChevronRightIcon as r,ChevronsLeftIcon as l,ChevronsRightIcon as o}from"../../constants/icons";import{accentSlots as s}from"../../internal/accent";import{fillMessage as m}from"../../internal/i18n";import{useMPLocale as c,useMPMessages as p}from"../../internal/locale";import{MPStateLayer as u}from"../../internal/StateLayer";import{CONTROL_ICON as f,CONTROL_TEXT as d}from"../../internal/scale";import{VISUALLY_HIDDEN as h}from"../../internal/visually-hidden";const g={xs:"h-8 min-w-8 px-1.5",sm:"h-10 min-w-10 px-2",md:"h-14 min-w-14 px-2.5",lg:"h-16 min-w-16 px-3",xl:"h-18 min-w-18 px-3.5"},x={xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"};function b(e,n){return Array.from({length:Math.max(0,n-e+1)},(n,t)=>e+t)}export const MPPagination=t.forwardRef(function({count:y,page:v,defaultPage:M=1,onPageChange:w,siblingCount:N=1,boundaryCount:j=1,showEdges:P=!1,showArrows:C=!0,size:S="md",color:K="primary",fullWidth:_=!1,disabled:k=!1,getPageHref:z,locale:$,labels:A,className:B,style:D,...E},H){const I=c($),L=p("pagination",I,A),[R,W]=t.useState(M),q=void 0!==v,F=Math.min(Math.max(v??R,1),Math.max(y,1));if(y<2)return null;const G=function(e,n,t,a){const i=b(1,Math.min(a,e)),r=b(Math.max(e-a+1,a+1),e),l=Math.max(Math.min(n-t,e-a-2*t-1),a+2),o=Math.min(Math.max(n+t,a+2*t+2),r.length>0?r[0]-2:e-1);return[...i,...l>a+2?["start-ellipsis"]:a+1<e-a?[a+1]:[],...b(l,o),...o<e-a-1?["end-ellipsis"]:e-a>a?[e-a]:[],...r]}(y,F,N,j),J=F<=1,O=F>=y,Q=(e,n)=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||z&&!w||(e.preventDefault(),(e=>{const n=Math.min(Math.max(e,1),y);n!==F&&(q||W(n),w?.(n))})(n))},T=(e,n)=>["mp-pagination__cell group relative inline-flex items-center justify-center","rounded-mp-full box-border appearance-none overflow-hidden align-middle select-none","border-0 font-[inherit] tabular-nums whitespace-nowrap no-underline","transition-[background-color,color] duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none",g[S],d[S],n?"text-mp-on-surface/38 cursor-default bg-transparent":e?"bg-(--_mp-accent) text-(--_mp-on-accent) cursor-pointer":"text-mp-on-surface cursor-pointer bg-transparent"].join(" "),U=(t,a,i,r,l,o,s)=>e("li",{className:"flex",children:!z||i||r?n("button",{type:"button",disabled:i,"aria-label":l,"aria-current":r?"page":void 0,className:T(r,i),onClick:e=>Q(e,a),children:[i?null:e(u,{}),e("span",{className:"relative",children:o})]}):n("a",{href:z(a),rel:s,"aria-label":l,className:T(!1,!1),onClick:e=>Q(e,a),children:[e(u,{}),e("span",{className:"relative",children:o})]})},t),V=n=>e(a,{icon:n,size:f[S],className:"rtl:rotate-180"});return n("nav",{ref:H,"aria-label":L.label,"data-mp-size":S,className:["mp-pagination flex",_?"w-full justify-center":"",B??""].filter(Boolean).join(" "),style:{...s(K),...D},...E,children:[n("ul",{role:"list",className:`m-0 flex list-none items-center p-0 ${x[S]}`,children:[P?U("first",1,k||J,!1,L.first,V(l)):null,C?U("previous",F-1,k||J,!1,L.previous,V(i),"prev"):null,G.map((n,t)=>"number"==typeof n?U(`slot-${t}`,n,k,n===F,m(L.page,{page:String(n)}),n):e("li",{"aria-hidden":"true",className:["text-mp-on-surface-variant flex items-center justify-center select-none",g[S],d[S]].join(" "),children:"…"},`slot-${t}`)),C?U("next",F+1,k||O,!1,L.next,V(r),"next"):null,P?U("last",y,k||O,!1,L.last,V(o)):null]}),e("span",{className:h,"aria-live":"polite",children:m(L.status,{page:String(F),total:String(y)})})]})});
@@ -0,0 +1,2 @@
1
+ export { MPPagination } from './MPPagination';
2
+ export type { MPPaginationLabels, MPPaginationProps } from './MPPagination';
@@ -0,0 +1 @@
1
+ export{MPPagination}from"./MPPagination";
@@ -0,0 +1,100 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPOrientation, MPSize } from '../../types';
3
+ /**
4
+ * A pane's share of the split, as a percentage of the container or as a CSS
5
+ * length.
6
+ *
7
+ * A bare number is a percentage — that is what a split is usually described in,
8
+ * and a percentage keeps its meaning when the window changes size. A string is
9
+ * an absolute length (`'240px'`, `'15rem'`, `'20%'`), which is what a sidebar
10
+ * with a minimum actually needs: "at least 200 pixels" does not survive being
11
+ * written down as a percentage of a width nobody knows yet.
12
+ */
13
+ export type MPPaneSize = number | string;
14
+ export interface MPPanesProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
15
+ /**
16
+ * Which way the panes run. `horizontal` puts them side by side with upright
17
+ * handles between them; `vertical` stacks them.
18
+ * @default 'horizontal'
19
+ */
20
+ orientation?: MPOrientation;
21
+ /**
22
+ * Whether the handles between the panes can be dragged. Turn it off for a
23
+ * split that is a layout rather than a control.
24
+ * @default true
25
+ */
26
+ resizable?: boolean;
27
+ /**
28
+ * Which accent family the handles light up in.
29
+ * @default 'primary'
30
+ */
31
+ color?: MPColor;
32
+ /**
33
+ * How thick a handle is, and how far it reaches.
34
+ * @default 'md'
35
+ */
36
+ size?: MPSize;
37
+ /** Fires with every pane's share, in percent, while a handle is dragged. */
38
+ onResize?: (sizes: number[]) => void;
39
+ /** Fires once, with the same shape, when the handle is let go. */
40
+ onResizeEnd?: (sizes: number[]) => void;
41
+ /** The panes. Anything that is not an `MPPane` is laid out but has no size. */
42
+ children?: React.ReactNode;
43
+ }
44
+ export interface MPPaneProps extends React.ComponentPropsWithoutRef<'div'> {
45
+ /**
46
+ * The share this pane starts with. Panes with no `defaultSize` split whatever
47
+ * is left over equally.
48
+ */
49
+ defaultSize?: MPPaneSize;
50
+ /**
51
+ * How small it may be dragged.
52
+ * @default 0
53
+ */
54
+ minSize?: MPPaneSize;
55
+ /** How large it may be dragged. Unbounded when left out. */
56
+ maxSize?: MPPaneSize;
57
+ /** What is inside the pane. */
58
+ children?: React.ReactNode;
59
+ }
60
+ /**
61
+ * A set of panes with draggable handles between them.
62
+ *
63
+ * The panes are sized in **fractions**, written out as
64
+ * `flex-basis: calc((100% - gutters) * fraction)`. That is the one decision the
65
+ * rest of this file follows from: a split described in percentages survives the
66
+ * window being resized without a single line of JavaScript running, so the
67
+ * component measures itself only twice — once on mount, to turn a `'240px'`
68
+ * default into a fraction, and once at the start of each drag, to know what a
69
+ * pixel of pointer movement is worth.
70
+ *
71
+ * The handles are interleaved here rather than written by the caller, so the
72
+ * children of an `MPPanes` are just panes. That does mean the direct children
73
+ * have to *be* panes: the constraints are read off their props, and an `MPPane`
74
+ * wrapped in something else is a pane with no minimum.
75
+ *
76
+ * ## Why there is no Base UI primitive under this
77
+ *
78
+ * There is nothing to delegate. A splitter's behaviour is a pointer capture and
79
+ * a clamp, and its accessibility is one ARIA role — `separator` with a value,
80
+ * which is the window-splitter pattern — carried by an element the component has
81
+ * to own anyway because it draws it. What Base UI is here for is the things that
82
+ * are genuinely hard and invisible when they work: a focus trap, a positioner, a
83
+ * typeahead. A rail between two boxes is not one of them.
84
+ *
85
+ * ## What it does not draw
86
+ *
87
+ * No surface, on either half. A split is layout, and the moment a pane drew a
88
+ * sheet it would stop being usable as the thing a table, a card or an editor is
89
+ * put *inside*. The family reaches exactly three places — the hairline, the wash
90
+ * under a hovered handle, and the focus ring — because those are the only marks
91
+ * this component makes.
92
+ */
93
+ export declare const MPPanes: React.ForwardRefExoticComponent<MPPanesProps & React.RefAttributes<HTMLDivElement>>;
94
+ /**
95
+ * One region of a split.
96
+ *
97
+ * `defaultSize`, `minSize` and `maxSize` are read by the `MPPanes` around it
98
+ * rather than used here — a pane cannot know what "half" is, only the split can.
99
+ */
100
+ export declare const MPPane: React.ForwardRefExoticComponent<MPPaneProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{accentSlots as r}from"../../internal/accent";const o=n.createContext({basis:null,id:null}),i={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},a={xs:4,sm:6,md:8,lg:10,xl:12};function s(e,t,n){if(null==e)return;if("number"==typeof e)return t*e/100;const r=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!r)return;const o=Number(r[1]);if(!Number.isNaN(o))switch(r[2]){case"px":return o;case"%":return t*o/100;case"rem":return o*Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");case"em":return o*Number.parseFloat(n&&getComputedStyle(n).fontSize||"16");default:return}}export const MPPanes=n.forwardRef(function({orientation:l="horizontal",resizable:u=!0,color:c="primary",size:m="md",onResize:d,onResizeEnd:f,className:p,style:h,children:g,...v},b){const x=n.Children.toArray(g).filter(n.isValidElement),y=x.length,z=n.useId(),w=n.useRef(null),S=n.useCallback(e=>{w.current=e,"function"==typeof b?b(e):b&&(b.current=e)},[b]),E=n.useRef([]),N=x.map(e=>e.props),[R,M]=n.useState(null),j=R&&R.length===y?R:null,C=n.useRef(null);n.useLayoutEffect(()=>{E.current=N,C.current=j});const k=n.useRef(null);n.useEffect(()=>()=>{null!==k.current&&(document.body.style.userSelect=k.current,k.current=null)},[]);const L="horizontal"===l,$=a[m]*Math.max(0,y-1);function P(e){const t=w.current,n=C.current;if(!u||!t||!n||void 0===n[e+1])return null;const r=t.getBoundingClientRect(),o=(L?r.width:r.height)-$;if(o<=0)return null;const i=E.current[e],a=E.current[e+1],l=n[e]*o,c=l+n[e+1]*o,m=Math.max(s(i?.minSize,o,t)??0,c-(s(a?.maxSize,o,t)??c)),f=Math.min(s(i?.maxSize,o,t)??c,c-(s(a?.minSize,o,t)??0));return f<m?null:{root:t,current:n,lower:m,upper:f,start:l,resize(t){const r=Math.min(f,Math.max(m,l+t)),i=[...n];return i[e]=r/o,i[e+1]=(c-r)/o,M(i),d?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{const e=w.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect(),n=(L?t.width:t.height)-$;n<=0||M(t=>t&&t.length===y?t:function(e,t,n){const r=e.map(e=>s(e.defaultSize,t,n)),o=r.reduce((e,t)=>e+(t??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,t-o)/i:0,l=r.map(e=>Math.max(0,e??a)),u=l.reduce((e,t)=>e+t,0);return u<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/u)}(E.current,n,e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[y,L,$]);const _=["mp-panes__handle group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",i[m],"transition-colors duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-0","focus-visible:outline-solid outline-none",u?[L?"cursor-col-resize":"cursor-row-resize","hover:bg-(--_mp-accent)/8 data-[dragging]:bg-(--_mp-accent)/10"].join(" "):""].filter(Boolean).join(" ");return e("div",{ref:S,"data-mp-size":m,className:["mp-panes flex h-full w-full",L?"flex-row":"flex-col","min-h-0 min-w-0",p??""].filter(Boolean).join(" "),style:{...r(c),...h},...v,children:x.map((r,i)=>t(n.Fragment,{children:[i>0?e("div",{role:"separator","aria-orientation":L?"vertical":"horizontal","aria-valuenow":j?Math.round(100*j[i-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!u||void 0,"aria-controls":`${z}-${i-1}`,tabIndex:u?0:-1,className:_,onPointerDown:e=>{0===e.button&&function(e,t){const n=P(e);if(!n)return;const r=t.currentTarget;try{r.setPointerCapture(t.pointerId)}catch{}r.dataset.dragging="true";const o=document.body.style.userSelect;k.current=o,document.body.style.userSelect="none";const i=L?t.clientX:t.clientY,a=L&&"rtl"===getComputedStyle(n.root).direction?-1:1;let s=n.current;const l=e=>{const t=L?e.clientX:e.clientY;s=n.resize((t-i)*a)},u=()=>{r.removeEventListener("pointermove",l),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",u),delete r.dataset.dragging,document.body.style.userSelect=o,k.current=null,f?.(s.map(e=>100*e))};r.addEventListener("pointermove",l),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",u)}(i-1,e)},onKeyDown:e=>{const t=L?"ArrowLeft":"ArrowUp",n=L?"ArrowRight":"ArrowDown";if(e.key===t||e.key===n)return e.preventDefault(),void function(e,t){const n=P(e);if(!n)return;const r=n.resize(t);f?.(r.map(e=>100*e))}(i-1,e.key===n?16:-16);"Home"!==e.key&&"End"!==e.key||(e.preventDefault(),function(e,t){const n=P(e);if(!n)return;const r=n.resize(n[t]-n.start);f?.(r.map(e=>100*e))}(i-1,"Home"===e.key?"lower":"upper"))},children:e("span",{"aria-hidden":"true",className:["bg-mp-outline-variant pointer-events-none","transition-colors duration-(--mp-sys-motion-duration-short4)",L?"h-full w-px":"h-px w-full",u?["group-hover/handle:bg-(--_mp-accent)","group-focus-visible/handle:bg-(--_mp-accent)","group-data-[dragging]/handle:bg-(--_mp-accent)"].join(" "):""].filter(Boolean).join(" ")})}):null,e(o.Provider,{value:{basis:j?`calc((100% - ${$}px) * ${j[i].toFixed(6)})`:null,id:`${z}-${i}`},children:r})]},r.key??i))})});export const MPPane=n.forwardRef(function({defaultSize:t,minSize:r,maxSize:i,className:a,style:s,children:l,...u},c){const{basis:m,id:d}=n.useContext(o);return e("div",{ref:c,id:d??void 0,className:["mp-pane relative min-h-0 min-w-0 overflow-auto",a??""].filter(Boolean).join(" "),style:{flex:m?`0 0 ${m}`:"1 1 0%",...s},...u,children:l})});
@@ -0,0 +1,2 @@
1
+ export { MPPane, MPPanes } from './MPPanes';
2
+ export type { MPPaneProps, MPPanesProps, MPPaneSize } from './MPPanes';
@@ -0,0 +1 @@
1
+ export{MPPane,MPPanes}from"./MPPanes";
@@ -0,0 +1,117 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPSize, MPVariant } from '../../types';
3
+ /**
4
+ * How the lozenge sits in the page's scroll.
5
+ *
6
+ * Local to this component rather than in `src/types.ts`, which is the rule that
7
+ * file states: an axis joins the shared vocabulary when a **second** component
8
+ * needs it, not in anticipation of one. Nothing else in the library pins itself
9
+ * to the viewport.
10
+ */
11
+ export type MPPillPosition = 'static' | 'sticky' | 'fixed';
12
+ export interface MPPillProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'onClick' | 'title'> {
13
+ /**
14
+ * The leading slot — a glyph, an avatar, a status dot, a photograph.
15
+ *
16
+ * It is given a square box of its own and clipped to a circle, so an `<img>`
17
+ * lands in it as readily as an icon does: the picture fills the box and is
18
+ * cropped rather than letterboxed, which is what a 20px avatar wants.
19
+ */
20
+ startIcon?: React.ReactNode;
21
+ /** The trailing slot. Outside the pressable area, so it can be a control. */
22
+ endIcon?: React.ReactNode;
23
+ /**
24
+ * The headline in the middle — what the pill is currently about.
25
+ *
26
+ * A prop rather than something to compose, for the reason a card's title is
27
+ * one: the arrangement is fixed. Almost every pill is a line of text with an
28
+ * optional second line under it, and spelling that as children means every
29
+ * caller inventing their own centring and type scale.
30
+ */
31
+ title?: React.ReactNode;
32
+ /** The second line, under the title. One step down and quieter. */
33
+ description?: React.ReactNode;
34
+ /**
35
+ * The second half, revealed when `expanded`.
36
+ *
37
+ * The pill grows downward into it rather than swapping to a different shape:
38
+ * one object saying more, which is the whole idea behind this component.
39
+ */
40
+ details?: React.ReactNode;
41
+ /**
42
+ * Whether `details` is showing.
43
+ * @default false
44
+ */
45
+ expanded?: boolean;
46
+ /**
47
+ * How it sits in the page's scroll. `fixed` pins it against the viewport and
48
+ * centres it, which is the arrangement this shape exists for.
49
+ * @default 'static'
50
+ */
51
+ position?: MPPillPosition;
52
+ /**
53
+ * Which edge it is held against when `position` is not `static`.
54
+ * @default 'top'
55
+ */
56
+ side?: 'top' | 'bottom';
57
+ /** Passing it makes the middle a real button. */
58
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
59
+ /**
60
+ * How much surface the lozenge paints.
61
+ *
62
+ * The **control** ladder rather than the container one: a pill is the thing
63
+ * being coloured, so `filled` takes the accent under its own ink.
64
+ * @default 'filled'
65
+ */
66
+ variant?: MPVariant;
67
+ /**
68
+ * The row's minimum height and the type scale in it. The same numbers a button
69
+ * is drawn at, so a collapsed pill lines up with one beside it.
70
+ * @default 'md'
71
+ */
72
+ size?: MPSize;
73
+ /**
74
+ * @default 'secondary'
75
+ */
76
+ color?: MPColor;
77
+ /**
78
+ * Anything the middle needs that `title` and `description` cannot say — a pair
79
+ * of small readouts, a live counter, a progress indicator. Rendered under
80
+ * them, in the same centred column.
81
+ */
82
+ children?: React.ReactNode;
83
+ }
84
+ /**
85
+ * A floating lozenge holding a small amount of live information.
86
+ *
87
+ * MD3 does not describe this shape, and the library ships it for the reason it
88
+ * ships [MPProgressBox](../feedback/progress-box): there is a real thing here
89
+ * that the specification's own parts can draw, and no component in the set draws
90
+ * it. What it is *for* is the state a page has that is not about any one control
91
+ * — a call in progress, an upload that is still going, a recording, a train two
92
+ * minutes away.
93
+ *
94
+ * ## The shape, and the one house rule it bends
95
+ *
96
+ * A collapsed pill is a stadium: `corner-full`, which every other **sheet** in
97
+ * this library is held back from. That is allowed here for the same reason the
98
+ * rule exists — a radius says what kind of object something is, and this is not
99
+ * a sheet lying on the page. It is an object hovering over it, and an object
100
+ * hovering over the page should not look like it was cut from the same material.
101
+ *
102
+ * Opening `details` moves the corner to `corner-extra-large`, and the move is
103
+ * transitioned. That is not decoration: `corner-full` on a box that has grown to
104
+ * six lines is a corner a third of its height, which eats the first two words of
105
+ * every line. The pill morphs from a lozenge into a rounded rectangle with the
106
+ * loudest corner the sheet ladder has, which is the shape it should have been
107
+ * all along at that size.
108
+ *
109
+ * ## What is measured, and why
110
+ *
111
+ * `details` is revealed by animating a **measured** height, exactly as an
112
+ * accordion panel is — but the measurement is a `ResizeObserver` rather than
113
+ * Base UI's one-shot one, because live information is the kind of content that
114
+ * changes while it is on screen. A pill whose details grew after they opened
115
+ * would otherwise be clipped at the height they had when they arrived.
116
+ */
117
+ export declare const MPPill: React.ForwardRefExoticComponent<MPPillProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{accentSlots as i}from"../../internal/accent";import{inertProps as r}from"../../internal/inert";import{MPStateLayer as s}from"../../internal/StateLayer";import{CONTROL_GAP as a,CONTROL_ICON as l,CONTROL_TEXT as c,hasContent as m,META_TEXT as d,PROSE_TEXT as p,SHEET_PAD_X as u}from"../../internal/scale";const f={xs:"min-h-8",sm:"min-h-10",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"},h={xs:"px-4",sm:"px-5",md:"px-6",lg:"px-8",xl:"px-10"},x={filled:"shadow-mp-2 bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"shadow-mp-2 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-2 bg-mp-surface-container-low text-(--_mp-accent)",outlined:"border-mp-outline shadow-mp-1 border bg-mp-surface-container text-mp-on-surface",text:"shadow-mp-1 bg-mp-surface-container text-mp-on-surface"},b={static:{top:"",bottom:""},sticky:{top:"sticky top-3 z-20",bottom:"sticky bottom-3 z-20"},fixed:{top:"fixed inset-x-0 top-3 z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-3 z-30 mx-auto w-fit"}};export const MPPill=o.forwardRef(function({startIcon:w,endIcon:v,title:g,description:y,details:j,expanded:N=!1,position:k="static",side:_="top",onClick:z,variant:B="filled",size:C="md",color:I="secondary",className:R,style:$,children:H,...P},S){const E=o.useRef(null),F=o.useId(),[L,M]=o.useState(0);o.useEffect(()=>{const e=E.current;if(!e)return;const t=new ResizeObserver(()=>M(e.scrollHeight));return t.observe(e),M(e.scrollHeight),()=>t.disconnect()},[j]);const O=Boolean(z),q=u[C],A=t(n,{children:[m(w)?e("span",{className:"flex shrink-0 items-center justify-center overflow-hidden rounded-mp-full [&_img]:size-full [&_img]:object-cover",style:{width:l[C],height:l[C]},children:w}):null,m(g)||m(y)||m(H)?t("span",{className:["flex min-w-0 flex-1 flex-col items-center justify-center text-center",h[C]].join(" "),children:[m(g)?e("span",{className:"max-w-full truncate",children:g}):null,m(y)?e("span",{className:`max-w-full truncate font-normal ${d} [color:color-mix(in_oklab,currentColor_72%,transparent)]`,children:y}):null,H]}):null]});return t("div",{ref:S,"data-mp-size":C,"data-mp-variant":B,"data-mp-expanded":N||void 0,className:["mp-pill inline-flex max-w-full flex-col overflow-hidden align-middle","box-border whitespace-nowrap select-none",N?"rounded-mp-xl":"rounded-mp-full","transition-[border-radius,background-color,box-shadow]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard","motion-reduce:transition-none",c[C],x[B],b[k][_],R??""].filter(Boolean).join(" "),style:{...i(I),...$},...P,children:[t("div",{className:["flex shrink-0 items-center py-1",f[C],a[C],O?"ps-0":q,m(v)?"pe-1":O?"pe-0":""].filter(Boolean).join(" "),children:[O?t("button",{type:"button",className:["group relative flex min-w-0 flex-1 cursor-pointer items-center justify-center","self-stretch appearance-none border-0 bg-transparent font-[inherit] text-inherit","rounded-[inherit]",a[C],q,"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),"aria-expanded":m(j)?N:void 0,"aria-controls":m(j)?F:void 0,onClick:z,children:[e(s,{}),A]}):A,m(v)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:v}):null]}),m(j)?e("div",{id:F,className:["overflow-hidden","transition-[height] duration-(--mp-sys-motion-duration-short4) ease-mp-standard","motion-reduce:transition-none"].join(" "),style:{height:N?L:0},...r(!N),children:e("div",{ref:E,className:`${q} pb-2 whitespace-normal ${p[C]}`,children:j})}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPPill } from './MPPill';
2
+ export type { MPPillPosition, MPPillProps } from './MPPill';
@@ -0,0 +1 @@
1
+ export{MPPill}from"./MPPill";
@@ -0,0 +1,143 @@
1
+ import * as React from 'react';
2
+ import { Popover } from '@base-ui/react/popover';
3
+ import type { MPAlign, MPSide, MPSize } from '../../types';
4
+ /**
5
+ * A popover takes `side`, `align` and `size`, and stops there.
6
+ *
7
+ * There is no `variant` — the five weights answer "how much does this surface
8
+ * assert itself against the page", and a popup that had to be asked for has
9
+ * already been asserted. There is no `color` either: MD3's own answer for a
10
+ * surface that floats beside a control is `surface-container` at elevation 2,
11
+ * neutral, and a popover that could be dyed would dye the form somebody put in
12
+ * it.
13
+ */
14
+ export interface MPPopoverProps {
15
+ /**
16
+ * The element the popup hangs off and that opens it. Exactly one element, and
17
+ * it must accept a ref and spread props — every Material Plus component does.
18
+ *
19
+ * Optional: a controlled popover anchored from elsewhere needs none, though it
20
+ * then has nothing to position against and will sit against the viewport.
21
+ */
22
+ trigger?: React.ReactElement;
23
+ /** The heading, rendered as the element that names the popup. */
24
+ title?: React.ReactNode;
25
+ /** A line under it, and the popup's accessible description. */
26
+ description?: React.ReactNode;
27
+ /**
28
+ * Which edge of the trigger it appears on. Flips to the opposite side when
29
+ * there is no room, which is Base UI's doing and is the right behaviour.
30
+ * @default 'bottom'
31
+ */
32
+ side?: MPSide;
33
+ /**
34
+ * Where it sits along that edge.
35
+ * @default 'center'
36
+ */
37
+ align?: MPAlign;
38
+ /**
39
+ * Distance from the trigger, in pixels.
40
+ * @default 8
41
+ */
42
+ sideOffset?: number;
43
+ /**
44
+ * Shift along that edge, in pixels.
45
+ * @default 0
46
+ */
47
+ alignOffset?: number;
48
+ /**
49
+ * Draws the little wedge pointing at the trigger.
50
+ *
51
+ * Off by default. MD3 draws no wedge on a menu and none on a rich tooltip: a
52
+ * popup eight pixels from the control that opened it does not need to say what
53
+ * it belongs to. Turn it on where the trigger is far enough away that it does.
54
+ * @default false
55
+ */
56
+ arrow?: boolean;
57
+ /** Whether the popover is open. Use with `onOpenChange` for a controlled one. */
58
+ open?: boolean;
59
+ /** Whether it starts open, for an uncontrolled one. */
60
+ defaultOpen?: boolean;
61
+ onOpenChange?: (open: boolean) => void;
62
+ /**
63
+ * Whether the page behind is taken away.
64
+ *
65
+ * `false` — the default — leaves the page scrollable and clickable, which is
66
+ * what separates a popover from a [dialog](./dialog): it is a detail *beside*
67
+ * the page, not instead of it. `'trap-focus'` holds focus inside without
68
+ * locking the scroll.
69
+ * @default false
70
+ */
71
+ modal?: boolean | 'trap-focus';
72
+ /**
73
+ * Whether pressing Escape or clicking outside closes the popup. Turn it off
74
+ * only for a popup with its own way out, because there will be no other.
75
+ * @default true
76
+ */
77
+ dismissible?: boolean;
78
+ /**
79
+ * Shows the × in the corner.
80
+ * @default false
81
+ */
82
+ showClose?: boolean;
83
+ /**
84
+ * Accessible name of the × button. Defaults to the word for "close" in
85
+ * `locale`.
86
+ */
87
+ closeLabel?: string;
88
+ /**
89
+ * Which language the × button's default name is written in. Falls back to the
90
+ * nearest `MPLocaleProvider`, then to English.
91
+ */
92
+ locale?: string;
93
+ /**
94
+ * A hard cap on the popup's width, overriding the one `size` implies. Numbers
95
+ * are pixels. For the popover whose *content* decides its width — a form, a
96
+ * single line of help — rather than for tuning the scale, which is `size`.
97
+ */
98
+ width?: number | string;
99
+ /**
100
+ * The room inside the popup, the type scale in it, and how wide it may get.
101
+ * @default 'md'
102
+ */
103
+ size?: MPSize;
104
+ /** The body. */
105
+ children?: React.ReactNode;
106
+ className?: string;
107
+ style?: React.CSSProperties;
108
+ }
109
+ export type MPPopoverCloseProps = React.ComponentProps<typeof Popover.Close>;
110
+ /**
111
+ * Closes the popover it is inside.
112
+ *
113
+ * Exported for `MPDialogClose`'s reason: an uncontrolled popover has no
114
+ * `setOpen` for its Cancel button to call, and making every popover controlled
115
+ * is a piece of state per popover that exists only to answer a button.
116
+ *
117
+ * `render` is Base UI's own escape hatch, so a real Material Plus button
118
+ * dismisses: `<MPPopoverClose render={<MPButton variant="text">Cancel</MPButton>} />`.
119
+ */
120
+ export declare const MPPopoverClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
121
+ /**
122
+ * A sheet that opens beside the thing that opened it.
123
+ *
124
+ * The difference from a [tooltip](./tooltip) is that this one can be *reached*:
125
+ * it stays up until it is dismissed, it can be entered with the pointer or the
126
+ * keyboard, and what is inside it can be clicked and typed into. The difference
127
+ * from a [dialog](./dialog) is that it does not take the page — it is anchored
128
+ * to a control, and the page behind goes on working.
129
+ *
130
+ * Base UI owns everything hard about it: the anchoring and the flip at the
131
+ * window's edge, the click outside and Escape, returning focus to the trigger,
132
+ * and the `aria-labelledby` / `aria-describedby` wiring. What is left here is
133
+ * the surface, the width ladder and the header.
134
+ *
135
+ * ## The surface
136
+ *
137
+ * `surface-container` at elevation 2 and `corner-medium`, which is what MD3
138
+ * gives a menu and a rich tooltip — the two things in the specification that are
139
+ * this: a small sheet anchored to a control. It is deliberately *not* the
140
+ * dialog's `surface-container-high` at elevation 3, because a popover has not
141
+ * taken the page and should not sit above the menus that did not either.
142
+ */
143
+ export declare function MPPopover({ trigger, title, description, side, align, sideOffset, alignOffset, arrow, open, defaultOpen, onOpenChange, modal, dismissible, showClose, closeLabel, locale: localeProp, width, size, className, style, children }: MPPopoverProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Popover as t}from"@base-ui/react/popover";import{MPIcon as i}from"../icon/MPIcon";import{CloseIcon as a}from"../../constants/icons";import{useMPLocale as l,useMPMessages as r}from"../../internal/locale";import{MPStateLayer as s}from"../../internal/StateLayer";import{hasContent as n,META_TEXT as c,PROSE_TEXT as m,SHEET_GAP as d,SHEET_PAD as p,SHEET_TITLE as f}from"../../internal/scale";import{FADE as u,PORTAL_LAYER as x}from"../../internal/surface";const h={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},g={xs:8,sm:9,md:10,lg:11,xl:12};export const MPPopoverClose=t.Close;export function MPPopover({trigger:v,title:b,description:w,side:N="bottom",align:O="center",sideOffset:P=8,alignOffset:j=0,arrow:y=!1,open:C,defaultOpen:z,onOpenChange:k,modal:M=!1,dismissible:L=!0,showClose:$=!1,closeLabel:B,locale:T,width:A,size:D="md",className:I,style:R,children:S}){const W=l(T),_=r("common",W),q=n(b)||n(w),E=g[D];return o(t.Root,{open:C,defaultOpen:z,modal:M,onOpenChange:(e,o)=>{L||e||"escape-key"!==o.reason&&"outside-press"!==o.reason&&"focus-out"!==o.reason?k?.(e):o.cancel()},children:[v?e(t.Trigger,{render:v}):null,e(t.Portal,{children:e(t.Positioner,{className:x,side:N,align:O,sideOffset:P,alignOffset:j,children:o(t.Popup,{"data-mp-size":D,className:["mp-popover rounded-mp-md relative flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-2","box-border",p[D],d[D],m[D],void 0===A?h[D]:"",u,I??""].filter(Boolean).join(" "),style:{...void 0===A?null:{maxWidth:"number"==typeof A?`${A}px`:A},...R},children:[y?e(t.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:e("svg",{width:E,height:E/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:e("path",{d:"M0 0h10L5 5z",fill:"var(--_mp-color-surface-container)"})})}):null,q||$?o("div",{className:"flex shrink-0 items-start gap-3",children:[o("div",{className:"flex min-w-0 flex-1 flex-col",children:[n(b)?e(t.Title,{className:`m-0 ${f[D]}`,children:b}):null,n(w)?e(t.Description,{className:`text-mp-on-surface-variant m-0 ${c}`,children:w}):null]}),$?o(t.Close,{"aria-label":B??_.close,className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","rounded-mp-full -m-1 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(" "),children:[e(s,{}),e(i,{icon:a,size:18})]}):null]}):null,n(S)?e("div",{className:"min-w-0",children:S}):null]})})})]})}
@@ -0,0 +1,2 @@
1
+ export { MPPopover, MPPopoverClose } from './MPPopover';
2
+ export type { MPPopoverCloseProps, MPPopoverProps } from './MPPopover';
@@ -0,0 +1 @@
1
+ export{MPPopover,MPPopoverClose}from"./MPPopover";