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 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{MPIcon as t}from"../icon/MPIcon";import{CloseIcon as a,UploadIcon as i}from"../../constants/icons";import{fillMessage as o}from"../../internal/i18n";import{useMPLocale as l,useMPMessages as s}from"../../internal/locale";import{MPStateLayer as c}from"../../internal/StateLayer";import{CONTROL_ICON as p,META_TEXT as m,PROSE_TEXT as u,STACK_GAP as d,hasContent as f}from"../../internal/scale";const h={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 x(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=n.forwardRef(function({accept:b,multiple:v=!1,maxSize:g,maxFiles:y,value:N,defaultValue:j,onFilesChange:k,onReject:w,label:z,description:C,errorMessage:I,title:B,hint:D,icon:F,showList:L=!0,removeLabel:M,locale:S,size:$="md",fullWidth:T=!0,required:W=!1,disabled:_=!1,readOnly:P=!1,name:R,id:E},O){const q=l(S),A=s("common",q),V=n.useRef(null);n.useImperativeHandle(O,()=>V.current,[]);const[G,H]=n.useState(()=>[...j??[]]),Y=N?[...N]:G,J=n.useRef(0),[K,Q]=n.useState(!1),U=f(I),X=_||P,Z=n.useId(),ee=n.useId(),re=n.useCallback(e=>{N||H(e),k?.(e)},[k,N]),ne=n.useCallback(e=>{const r=[],n=[],t=v?y??Number.POSITIVE_INFINITY:1,a=v?Y.length:0;for(const i of e)b&&!x(i,b)?n.push({file:i,reason:"type"}):void 0!==g&&i.size>g?n.push({file:i,reason:"size"}):a+r.length>=t?n.push({file:i,reason:"count"}):r.push(i);return{kept:r,rejections:n}},[b,Y.length,y,g,v]),te=n.useCallback(e=>{const{kept:r,rejections:n}=ne(e);n.length>0&&w?.(n),r.length>0&&re(v?[...Y,...r]:r)},[ne,re,Y,v,w]);return r("div",{className:["mp-file-picker flex-col align-top",d[$],T?"flex w-full":"inline-flex"].join(" "),"data-mp-size":$,"data-disabled":_||void 0,"data-invalid":U||void 0,children:[f(z)?r("span",{id:ee,className:[m,_?"text-mp-on-surface/38":U?"text-mp-error":"text-mp-on-surface-variant"].join(" "),children:[z,W?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,r("div",{className:"flex w-full flex-col",onDragEnter:e=>{X||(e.preventDefault(),J.current+=1,Q(!0))},onDragOver:e=>{X||(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{X||(J.current=Math.max(0,J.current-1),0===J.current&&Q(!1))},onDrop:e=>{X||(e.preventDefault(),J.current=0,Q(!1),te(Array.from(e.dataTransfer.files)))},children:[r("button",{type:"button",id:E,disabled:_,"aria-describedby":f(C)||U?Z:void 0,"aria-invalid":U||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)",h[$],u[$],_?"border-mp-on-surface/12 text-mp-on-surface/38 cursor-default":[P?"cursor-default":"cursor-pointer",U?"border-mp-error":"border-mp-outline-variant","text-mp-on-surface",K?"border-mp-primary bg-mp-primary/8":""].filter(Boolean).join(" ")].filter(Boolean).join(" "),onClick:()=>{!X&&V.current&&(V.current.value="",V.current.click())},children:[X?null:e(c,{layer:"inset-0 rounded-[inherit] bg-mp-primary"}),void 0===F?e(t,{icon:i,size:1.6*p[$],className:_?"":"text-mp-primary"}):f(F)?e("span",{className:_?"":"text-mp-primary",children:F}):null,e("span",{className:"font-medium",children:B??"Drop files here, or click to browse"}),f(D)?e("span",{className:[m,_?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:D}):null]}),e("input",{ref:V,type:"file",name:R,accept:b,multiple:v,required:W&&0===Y.length,disabled:X,tabIndex:-1,"aria-labelledby":f(z)?ee:void 0,"aria-describedby":f(C)||U?Z:void 0,className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>te(Array.from(e.target.files??[]))})]}),L&&Y.length>0?e("ul",{className:["mp-file-picker__list m-0 flex w-full list-none flex-col p-0",d[$]].join(" "),children:Y.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",u[$],_?"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:[m,"shrink-0 tabular-nums",_?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:formatFileSize(n.size)}),X?null:r("button",{type:"button","aria-label":M?M(n.name):o(A.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:()=>re(Y.filter((e,r)=>r!==i)),children:[e(c,{}),e(t,{icon:a,size:18})]})]},`${n.name}-${n.size}-${n.lastModified}-${i}`))}):null,U?e("span",{id:Z,className:[m,"text-mp-error"].join(" "),children:I}):f(C)?e("span",{id:Z,className:[m,_?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:C}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPFilePicker, formatFileSize } from './MPFilePicker';
2
+ export type { MPFilePickerProps, MPFileRejection, MPFileRejectionReason } from './MPFilePicker';
@@ -0,0 +1 @@
1
+ export{MPFilePicker,formatFileSize}from"./MPFilePicker";
@@ -0,0 +1,126 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPCorner, MPPosition, MPSize } from '../../types';
3
+ /**
4
+ * The three containers MD3 gives a floating button, and the reason there are not
5
+ * five of them.
6
+ *
7
+ * - `tonal` is the specification's own default: the accent *container* under its
8
+ * own ink, which is `primary-container` on `on-primary-container` before any
9
+ * colour is chosen.
10
+ * - `filled` is the accent itself, for the one screen where the button has to
11
+ * carry more weight than the content behind it.
12
+ * - `elevated` is MD3's *surface* FAB: a neutral container with the accent as
13
+ * the glyph, for a button floating over something colourful enough that a
14
+ * tonal one has nothing quiet to sit on.
15
+ *
16
+ * `outlined` and `text` are absent because a floating button *is* its container.
17
+ * A hairline disc over a scrolling page is a shape with the page moving through
18
+ * it, and a text one is a glyph with nothing to press.
19
+ */
20
+ export type MPFloatingActionButtonVariant = 'filled' | 'tonal' | 'elevated';
21
+ export interface MPFloatingActionButtonProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'color'> {
22
+ /**
23
+ * The glyph.
24
+ *
25
+ * Wrap it in an [MPIcon](../display/icon) when it needs a size of its own;
26
+ * passed bare it is drawn at the rung's own glyph size.
27
+ */
28
+ icon?: React.ReactNode;
29
+ /**
30
+ * What the button does, in words.
31
+ *
32
+ * Required, and the one prop here that is. A button whose whole label is a
33
+ * drawing has no accessible name at all, and "a floating button with no
34
+ * `aria-label`" is a defect that ships precisely because the control looks
35
+ * finished without one. With `extended` this is also the word written on the
36
+ * button, so the two can never say different things.
37
+ */
38
+ label: string;
39
+ /**
40
+ * Writes `label` beside the glyph, which turns the disc into a stadium — MD3's
41
+ * extended floating button, for the one action a screen is about.
42
+ * @default false
43
+ */
44
+ extended?: boolean;
45
+ /**
46
+ * Which container it paints.
47
+ * @default 'tonal'
48
+ */
49
+ variant?: MPFloatingActionButtonVariant;
50
+ /**
51
+ * Which accent family it reads. Not an arbitrary colour: to change what
52
+ * `primary` *is*, set the token.
53
+ * @default 'primary'
54
+ */
55
+ color?: MPColor;
56
+ /**
57
+ * The button's size. `md` is MD3's own 56dp; `xs` and `xl` are the
58
+ * specification's small and large floating buttons at 40 and 96dp.
59
+ * @default 'md'
60
+ */
61
+ size?: MPSize;
62
+ /**
63
+ * How it sits in the page. `fixed` — the default, against the `static`
64
+ * everything else in this library defaults to — is what a floating button *is*:
65
+ * held against a corner of the window whatever the page under it does.
66
+ *
67
+ * `absolute` pins it to the nearest positioned ancestor instead, which is what
68
+ * a button floating over a card or a map wants. `static` puts it back in the
69
+ * flow — drawn as `position: relative`, because the state layer still needs
70
+ * something to fill.
71
+ * @default 'fixed'
72
+ */
73
+ position?: MPPosition;
74
+ /**
75
+ * Which corner it is pinned to. Logical, so `bottom-end` is bottom-left under
76
+ * RTL. No effect while `position` is `static`.
77
+ * @default 'bottom-end'
78
+ */
79
+ corner?: MPCorner;
80
+ /**
81
+ * How far in from both edges, as a CSS length or a number of pixels. MD3's own
82
+ * is 16dp.
83
+ * @default 16
84
+ */
85
+ offset?: number | string;
86
+ /** Unavailable. Keeps its place, stops answering, and stops floating. */
87
+ disabled?: boolean;
88
+ /**
89
+ * `button`, not `submit`. A native button defaults to submitting the form
90
+ * around it.
91
+ * @default 'button'
92
+ */
93
+ type?: 'button' | 'submit' | 'reset';
94
+ }
95
+ /**
96
+ * The one action a screen is about, floating over it.
97
+ *
98
+ * MD3's floating action button, drawn from the specification's own component
99
+ * tokens: the three containers, the three sizes with the corner each of them
100
+ * takes, level-3 elevation, the state layer, and the extended shape. The default
101
+ * — `tonal` on `primary` — is the specification's default FAB exactly:
102
+ * `primary-container` under `on-primary-container`.
103
+ *
104
+ * ## Why there is no speed dial
105
+ *
106
+ * A floating button that fans out into three or four smaller ones is a Material
107
+ * **2** pattern, and MD3 dropped it. It was never good: the actions are
108
+ * unlabelled discs in the corner of the screen, they cover the content the
109
+ * reader was looking at, and a fan of buttons that claims `role="menu"` without
110
+ * the keyboard contract of one is worse for a keyboard reader than something
111
+ * that never claimed anything.
112
+ *
113
+ * When there genuinely are several actions, they belong in an
114
+ * [MPMenu](../inputs/menu) — which *is* a menu, with the roving focus, the
115
+ * typeahead and the escape behaviour that word promises — opened from this
116
+ * button.
117
+ *
118
+ * ## Why it is `fixed` by default
119
+ *
120
+ * Because that is the component. Everything else in this library sits in the
121
+ * page's flow and would be wrong to take out of it; this one is defined by not
122
+ * being part of the page. `position="absolute"` is the escape hatch for a button
123
+ * that belongs to a region rather than to the window, and `static` puts it back
124
+ * in the flow entirely.
125
+ */
126
+ export declare const MPFloatingActionButton: React.ForwardRefExoticComponent<MPFloatingActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Button as a}from"@base-ui/react/button";import{accentSlots as n}from"../../internal/accent";import{MPStateLayer as s}from"../../internal/StateLayer";import{hasContent as i}from"../../internal/scale";const r={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:"size-10",sm:"size-12",md:"size-14",lg:"size-18",xl:"size-24"},m={xs:"h-10",sm:"h-12",md:"h-14",lg:"h-18",xl:"h-24"},p={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},d={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"},c={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"},x={"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=o.forwardRef(function({icon:o,label:b,extended:g=!1,variant:h="tonal",color:y="primary",size:_="md",position:w="fixed",corner:v="bottom-end",offset:z=16,disabled:$=!1,type:j="button",className:k,style:N,...B},A){return t(a,{ref:A,type:j,disabled:$,"aria-label":b,"data-mp-size":_,"data-mp-variant":h,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]","duration-(--mp-sys-motion-duration-short4)",p[_],g?`${m[_]} ${c[_]} ${d[_]}`:l[_],$?"bg-mp-on-surface/12 text-mp-on-surface/38 cursor-default shadow-none":`${r[h]} shadow-mp-3`,"static"===w?"relative":`${u[w]} ${x[v]}`,k??""].filter(Boolean).join(" "),style:{...n(y),"--_mp-fab-offset":"number"==typeof z?`${z}px`:z,...N},...B,children:[$?null:e(s,{}),i(o)?e("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:f[_],height:f[_]},children:o}):null,g?e("span",{className:"relative truncate",children:b}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPFloatingActionButton } from './MPFloatingActionButton';
2
+ export type { MPFloatingActionButtonProps, MPFloatingActionButtonVariant } from './MPFloatingActionButton';
@@ -0,0 +1 @@
1
+ export{MPFloatingActionButton}from"./MPFloatingActionButton";
@@ -0,0 +1,155 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { MPResponsive } from '../../types';
4
+ /**
5
+ * How a row divides the space its items did not take.
6
+ *
7
+ * CSS's own words rather than a set of this library's, because this is CSS's own
8
+ * question: a grid is the one component whose props are asking the layout engine
9
+ * for something directly, and inventing a second spelling for `space-between`
10
+ * would mean a caller has to translate what they already know.
11
+ */
12
+ export type MPGridJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
13
+ /** How items sit against each other across a row. */
14
+ export type MPGridAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
15
+ /** The same, for one item overriding the row it is in. */
16
+ export type MPGridAlignSelf = MPGridAlign | 'auto';
17
+ export interface MPGridProps extends React.ComponentPropsWithoutRef<'div'> {
18
+ /**
19
+ * How many columns a row is divided into. Every `span` and every `offset`
20
+ * inside is read against this number, so `columns={24}` makes `span={12}` a
21
+ * half rather than a full width.
22
+ *
23
+ * MD3's own layout grid is `{ compact: 4, medium: 12 }`.
24
+ * @default 12
25
+ */
26
+ columns?: MPResponsive<number>;
27
+ /**
28
+ * The gutter between items, on Tailwind's spacing scale — `spacing={4}` is
29
+ * `1rem`, the same length `gap-4` is. Fractions are allowed, so `1.5` is
30
+ * `0.375rem`.
31
+ *
32
+ * MD3's own gutter is `{ compact: 4, medium: 6 }` — 16dp on a phone, 24dp from
33
+ * a medium window up.
34
+ * @default 4
35
+ */
36
+ spacing?: MPResponsive<number>;
37
+ /** The gutter between rows only. Falls back to `spacing`. */
38
+ rowSpacing?: MPResponsive<number>;
39
+ /** The gutter between columns only. Falls back to `spacing`. */
40
+ columnSpacing?: MPResponsive<number>;
41
+ /** How a row distributes the width its items did not use. */
42
+ justifyContent?: MPGridJustify;
43
+ /**
44
+ * How items sit against each other across a row.
45
+ * @default 'stretch'
46
+ */
47
+ alignItems?: MPGridAlign;
48
+ /** Where the rows sit when the grid is shorter than the box holding it. */
49
+ alignContent?: MPGridJustify | 'stretch';
50
+ /**
51
+ * Whether a row that runs out of columns continues on the next one. Turned
52
+ * off, the grid is one row that overflows — which is what a horizontally
53
+ * scrolling strip wants and nothing else does.
54
+ * @default true
55
+ */
56
+ wrap?: boolean;
57
+ /**
58
+ * Renders something other than a `<div>`: `render={<section />}`,
59
+ * `render={<ul />}`. Base UI's own escape hatch, so it behaves here exactly as
60
+ * it does on every Base UI primitive.
61
+ */
62
+ render?: useRender.RenderProp;
63
+ /** The `MPGridItem`s. */
64
+ children?: React.ReactNode;
65
+ }
66
+ export interface MPGridItemProps extends React.ComponentPropsWithoutRef<'div'> {
67
+ /**
68
+ * How many of the grid's columns the item takes. Read against the grid's
69
+ * `columns`, so `span={6}` is half of the default twelve and a quarter of
70
+ * `columns={24}`.
71
+ *
72
+ * Responsive: `span={{ compact: 12, medium: 6, expanded: 4 }}` is full width on
73
+ * a phone, half from 600dp and a third from 840dp. Each entry applies from its
74
+ * own window class up, so two of them usually describe a whole layout.
75
+ *
76
+ * A span wider than the row is clamped to the row rather than overflowing.
77
+ * @default the grid's full width
78
+ */
79
+ span?: MPResponsive<number>;
80
+ /**
81
+ * Columns left empty *before* the item — space pushed in ahead of it, not an
82
+ * absolute position in the row. First in a twelve-column row, `offset={4}` with
83
+ * `span={4}` is the middle third; after an item that already took four columns,
84
+ * the same offset skips four more and lands on the last third.
85
+ *
86
+ * Responsive in the same way `span` is.
87
+ * @default 0
88
+ */
89
+ offset?: MPResponsive<number>;
90
+ /** Overrides the row's `alignItems` for this item alone. */
91
+ alignSelf?: MPGridAlignSelf;
92
+ /**
93
+ * Renders something other than a `<div>`: `render={<li />}`,
94
+ * `render={<article />}`. Base UI's own escape hatch.
95
+ */
96
+ render?: useRender.RenderProp;
97
+ children?: React.ReactNode;
98
+ }
99
+ /**
100
+ * Material's layout grid: a row divided into columns, and items that take some
101
+ * of them.
102
+ *
103
+ * MD3 describes a page as a number of columns with a gutter between them, and
104
+ * describes how that number changes with the **window size class** rather than
105
+ * with a pixel width — four columns in a compact window, twelve from medium up.
106
+ * That is what this component is, and it is why `span` and `columns` take
107
+ * `{ compact, medium, expanded, large, extra-large }` rather than a set of
108
+ * breakpoints of the library's own invention. See `MPWindowClass` for why those
109
+ * are not Tailwind's four.
110
+ *
111
+ * ## Why the widths are real CSS and not utilities
112
+ *
113
+ * They cannot be utilities. A column is
114
+ * `(100% + gutter) * span / columns - gutter`, it has to be recomputed at four
115
+ * widths, and it is the width of an element whose column count is declared on its
116
+ * *parent* — none of which Tailwind can spell, because Tailwind finds classes by
117
+ * scanning source text and `columns` is a number the caller picks at runtime.
118
+ *
119
+ * So the arithmetic is written once, in `src/styles.css`, and the per-instance
120
+ * numbers arrive as inline `--_mp-*` slots — exactly how a `color` reaches a
121
+ * background in this library. The count and the two gutters are declared on the
122
+ * grid and *inherited* by the items rather than passed through a React context,
123
+ * which is not a shortcut: a media query can change an inherited custom property
124
+ * without React hearing about it, so the column count an item lays itself out
125
+ * against is always the one that is actually on screen. A context would have to
126
+ * re-render the subtree at every window class to say the same thing.
127
+ *
128
+ * ## Why a grid paints nothing
129
+ *
130
+ * No `variant`, no `color`, no padding. A grid is not a surface — it is the
131
+ * arrangement of the surfaces inside it — and the moment it draws a sheet of its
132
+ * own it stops being usable as the outermost thing on a page. Wrap it in an
133
+ * [MPBox](./box) or an [MPCard](./card) when the sheet is wanted, and in an
134
+ * [MPContainer](./container) when what is wanted is the page margin.
135
+ *
136
+ * Nesting is an `MPGrid` inside an `MPGridItem`, not a grid that is also an item:
137
+ * the inner grid redeclares the column count for its own subtree while the item
138
+ * around it keeps the width the outer grid gave it.
139
+ */
140
+ export declare const MPGrid: React.ForwardRefExoticComponent<MPGridProps & React.RefAttributes<HTMLDivElement>>;
141
+ /**
142
+ * One cell of an `MPGrid`.
143
+ *
144
+ * It is a width and nothing else — no surface, no padding, no typography. What
145
+ * goes inside brings its own, which is the whole reason a cell and an
146
+ * [MPBox](./box) are two components: wrapping something in a layout must not
147
+ * change how it looks, and a cell that drew a sheet would make `span` a visual
148
+ * decision.
149
+ *
150
+ * The column count it divides by is inherited from the grid as a custom
151
+ * property, so an item with no `MPGrid` above it falls back to twelve rather than
152
+ * breaking. It will still be a plain block in a plain parent, which is not a
153
+ * layout — always wrap.
154
+ */
155
+ export declare const MPGridItem: React.ForwardRefExoticComponent<MPGridItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";const n=["compact","medium","expanded","large","extra-large"];function r(e,t,r){const a=function(e){return null==e?{}:"object"==typeof e?e:{compact:e}}(t),s={};for(const t of n){const n=a[t];void 0!==n&&(s[`--_mp-${e}-${t}`]=r(n))}return s}function a(e,t){return null==e?t:"object"==typeof e?{compact:t,...e}:e}function s(e){return String(Math.max(1,Math.round(e)))}function o(e){return String(Math.max(1,Math.round(e)))}function c(e){return String(Math.max(0,Math.round(e)))}function i(e){const t=.25*Math.max(0,e);return`${Number(t.toFixed(5))}rem`}const l={start:"justify-start",center:"justify-center",end:"justify-end","space-between":"justify-between","space-around":"justify-around","space-evenly":"justify-evenly"},f={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},u={start:"content-start",center:"content-center",end:"content-end","space-between":"content-between","space-around":"content-around","space-evenly":"content-evenly",stretch:"content-stretch"},p={auto:"self-auto",start:"self-start",center:"self-center",end:"self-end",stretch:"self-stretch",baseline:"self-baseline"};export const MPGrid=e.forwardRef(function({columns:e,spacing:n,rowSpacing:o,columnSpacing:c,justifyContent:p,alignItems:d,alignContent:m,wrap:y=!0,render:g,className:h,style:x,children:b,...j},w){return t({render:g,ref:w,props:{className:["mp-grid flex",y?"flex-wrap":"flex-nowrap","gap-x-(--_mp-gap-x) gap-y-(--_mp-gap-y)",p?l[p]:"",d?f[d]:"",m?u[m]:"",h??""].filter(Boolean).join(" "),style:{...r("cols",a(e,12),s),...r("gap-x",a(c??n,4),i),...r("gap-y",a(o??n,4),i),...x},children:b,...j}})});export const MPGridItem=e.forwardRef(function({span:e,offset:n,alignSelf:a,render:s,className:i,style:l,children:f,...u},d){return t({render:s,ref:d,props:{className:["mp-grid-item",a?p[a]:"",i??""].filter(Boolean).join(" "),style:{...r("span",e,o),...r("offset",n,c),...l},children:f,...u}})});
@@ -0,0 +1,2 @@
1
+ export { MPGrid, MPGridItem } from './MPGrid';
2
+ export type { MPGridAlign, MPGridAlignSelf, MPGridItemProps, MPGridJustify, MPGridProps } from './MPGrid';
@@ -0,0 +1 @@
1
+ export{MPGrid,MPGridItem}from"./MPGrid";
@@ -0,0 +1,95 @@
1
+ import * as React from 'react';
2
+ import type { MPTypographyWeight } from '../typography/MPTypography';
3
+ import type { MPColor, MPVariant } from '../../types';
4
+ /**
5
+ * The four weights a mark can be drawn at.
6
+ *
7
+ * `elevated` is deliberately absent, and it is the one member of `MPVariant` that
8
+ * could not mean anything here: elevation is a surface lifting off the page, and
9
+ * a mark is *inside* a line of text. A raised word would cast a shadow onto the
10
+ * sentence it is part of.
11
+ */
12
+ export type MPHighlightVariant = Exclude<MPVariant, 'elevated'>;
13
+ export interface MPHighlightProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
14
+ /**
15
+ * What to find.
16
+ *
17
+ * A string is one term, an array is several — the longest is tried first, so
18
+ * `['data', 'database']` marks the whole word rather than the first four
19
+ * letters of it. A `RegExp` is used as written, with the global flag forced on;
20
+ * `caseSensitive` and `wholeWord` are ignored for it, because a regular
21
+ * expression already says both of those things itself.
22
+ */
23
+ query: string | string[] | RegExp;
24
+ /**
25
+ * How much surface the mark paints.
26
+ *
27
+ * `tonal` is the default, and it is the only one of the four that is a
28
+ * highlighter pen: MD3's container roles are a pale wash under dark ink, which
29
+ * is a marked word rather than a word replaced by a block of colour. `filled`
30
+ * is the accent proper under its own ink — loud, and right for one match on a
31
+ * page. `outlined` boxes the word, `text` recolours it and draws nothing.
32
+ * @default 'tonal'
33
+ */
34
+ variant?: MPHighlightVariant;
35
+ /**
36
+ * Which accent family the mark reads.
37
+ *
38
+ * `tertiary` rather than `primary`, and this is the one place in the library
39
+ * where that is the right default. `primary` is what a page uses for the thing
40
+ * it wants pressed; a search match is not that, and a page whose marked words
41
+ * are the same colour as its buttons has two things competing to be the loudest
42
+ * thing on it.
43
+ * @default 'tertiary'
44
+ */
45
+ color?: MPColor;
46
+ /**
47
+ * Whether `a` and `A` are different letters.
48
+ * @default false
49
+ */
50
+ caseSensitive?: boolean;
51
+ /**
52
+ * Whether a term has to be a word on its own — `cat` marking "cat" but not
53
+ * "concatenate".
54
+ *
55
+ * A word here is a run of letters, digits and underscores in any script, so it
56
+ * means what it should for `café` and `naïve`. It means very little for Korean
57
+ * or Japanese, where a phrase is not delimited by spaces at all; that is a
58
+ * property of the writing system rather than of this prop, and is why it is off
59
+ * by default.
60
+ * @default false
61
+ */
62
+ wholeWord?: boolean;
63
+ /** Underlines the mark as well. Combines with every variant. */
64
+ underline?: boolean;
65
+ /**
66
+ * Sets the mark's weight. Omit it and the mark is the weight of the text around
67
+ * it — the surface is already saying "this one", and a bolded word inside a
68
+ * sentence changes the rhythm of the whole line.
69
+ */
70
+ weight?: MPTypographyWeight;
71
+ /**
72
+ * The text to search. Elements are walked into and left otherwise untouched, so
73
+ * a match inside a `<strong>` is still marked and the `<strong>` survives.
74
+ */
75
+ children?: React.ReactNode;
76
+ }
77
+ /**
78
+ * Marks the words a reader is looking for, inside text they were already reading.
79
+ *
80
+ * The component is the search, not just the styling: `query` is what a search box
81
+ * holds, and everything about *how* the matching is done — case, whole words, a
82
+ * regular expression — is a prop rather than something a caller has to
83
+ * pre-compute into a list of offsets.
84
+ *
85
+ * The mark is a real `<mark>`, which is the element for text of relevance to the
86
+ * reader and is announced as such. That has one consequence worth knowing:
87
+ * marking eleven words in a paragraph tells a screen reader that eleven things
88
+ * are important, which is a way of saying nothing. A highlight is for a handful
89
+ * of matches.
90
+ *
91
+ * Nothing here is stateful and nothing measures — the whole component is a pure
92
+ * function of `children` and `query`, so it re-marks on its own the moment the
93
+ * search box changes.
94
+ */
95
+ export declare const MPHighlight: React.ForwardRefExoticComponent<MPHighlightProps & React.RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{accentSlots as t}from"../../internal/accent";const r={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border border-(--_mp-accent) bg-transparent text-(--_mp-accent)",text:"bg-transparent text-(--_mp-accent)"},o={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},i=/[\p{L}\p{N}_]/u;function l(e){return e.replace(/[-.*+?^${}()|[\]\\]/g,"\\$&")}function a(e,n,t){const r=n>0?e[n-1]:"",o=t<e.length?e[t]:"";return!i.test(r)&&!i.test(o)}function c(e,n,t,r){n.lastIndex=0;const o=[];let i,l=0;for(;null!==(i=n.exec(e));){if(""===i[0]){n.lastIndex+=1;continue}const c=i.index,s=c+i[0].length;t&&!a(e,c,s)||(c>l&&o.push(e.slice(l,c)),o.push(r(i[0],String(c))),l=s)}return 0===o.length?e:(l<e.length&&o.push(e.slice(l)),o)}function s(e,t,r,o){if("string"==typeof e)return c(e,t,r,o);if("number"==typeof e)return c(String(e),t,r,o);if(Array.isArray(e))return n.Children.map(e,e=>s(e,t,r,o));if(n.isValidElement(e)){const i=e.props.children;return void 0===i||"function"==typeof i?e:n.cloneElement(e,void 0,s(i,t,r,o))}return e}export const MPHighlight=n.forwardRef(function({query:i,variant:a="tonal",color:c="tertiary",caseSensitive:u=!1,wholeWord:f=!1,underline:m=!1,weight:p,className:g,style:d,children:h,...x},b){const y=i instanceof RegExp?`re ${i.source} ${i.flags}`:Array.isArray(i)?`a ${i.join("\0")}`:`s ${i}`,_=n.useMemo(()=>function(e,n){if(e instanceof RegExp)return new RegExp(e.source,e.global?e.flags:`${e.flags}g`);const t=(Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(Boolean).sort((e,n)=>n.length-e.length);return 0===t.length?null:new RegExp(t.map(l).join("|"),n?"gu":"giu")}(i,u),[y,u]),$=["rounded-mp-xs -mx-0.5 px-0.5","box-decoration-clone",r[a],m?"underline decoration-2 underline-offset-2":"",p?o[p]:""].filter(Boolean).join(" "),j=n.useMemo(()=>_?s(h,_,f,(n,t)=>e("mark",{className:$,children:n},t)):h,[h,_,f,$]);return e("span",{ref:b,className:["mp-highlight",g??""].filter(Boolean).join(" "),style:{...t(c),...d},...x,children:j})});
@@ -0,0 +1,2 @@
1
+ export { MPHighlight } from './MPHighlight';
2
+ export type { MPHighlightProps, MPHighlightVariant } from './MPHighlight';
@@ -0,0 +1 @@
1
+ export{MPHighlight}from"./MPHighlight";
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ import { type MPButtonProps } from '../button/MPButton';
3
+ export interface MPIconButtonProps extends Omit<MPButtonProps, 'children' | 'startIcon' | 'endIcon' | 'fullWidth'> {
4
+ /**
5
+ * The glyph.
6
+ *
7
+ * Wrap it in an `MPIcon` when it needs a size of its own; passed bare it is
8
+ * laid out exactly as a button's `startIcon` is, which is what keeps an icon
9
+ * button and a labelled button with the same glyph drawing it at the same
10
+ * size.
11
+ */
12
+ icon: React.ReactNode;
13
+ /**
14
+ * What the button does, in words.
15
+ *
16
+ * Required, and the one prop here that is. A button whose whole label is a
17
+ * drawing has no accessible name at all, and "an icon button with no
18
+ * `aria-label`" is the single most common accessibility defect a component
19
+ * library ships. Making it required is the only fix that survives review — a
20
+ * default would be a name that is right for nobody, and a warning is a thing
21
+ * that gets filtered out of a console.
22
+ */
23
+ label: string;
24
+ }
25
+ /**
26
+ * A round button with a glyph in it and nothing else.
27
+ *
28
+ * There is almost nothing here, and that is the point: an [MPButton](./button)
29
+ * with an icon and no children already goes square and is already a pill, which
30
+ * for a square is a circle — MD3's icon button shape falls out of the button's
31
+ * own `corner-full` with no second table to keep in step. What this component
32
+ * adds is the *name*, which is the part that cannot be defaulted and is the part
33
+ * that is always missing.
34
+ *
35
+ * Everything else is the button's, unchanged and on purpose: the five variants,
36
+ * the four families, the size ladder, the state layer, `loading`, and the values
37
+ * a surrounding `MPButtonGroup` sets. Two components drawing the same surface
38
+ * from two copies of one table are two components that will eventually disagree
39
+ * about it.
40
+ *
41
+ * ## Why the default variant is `text` and the button's is `filled`
42
+ *
43
+ * Because MD3's default icon button is its *standard* one — a glyph with no
44
+ * container at all — and the specification is right about why. A labelled button
45
+ * is usually the one thing on a row worth pressing; an icon button is usually
46
+ * one of several sitting in a toolbar or a card's corner, and five filled discs
47
+ * in a row is a row with no emphasis left in it. Reach for `filled` when the
48
+ * icon button *is* the action on the screen.
49
+ *
50
+ * ## No toggle state
51
+ *
52
+ * MD3 also describes a *toggle* icon button, which swaps its container and its
53
+ * ink when selected. This is not that, and a `selected` prop would make it half
54
+ * of one: a toggle needs a pressed state that survives the press, a group that
55
+ * can enforce one choice, and a name that changes with the state. That is
56
+ * [MPSegmentedButton](./segmented-button) for a set, and a `<MPIconButton>` whose
57
+ * `icon` and `label` are both derived from your own state for a single one.
58
+ */
59
+ export declare const MPIconButton: React.ForwardRefExoticComponent<MPIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import*as r from"react";import{MPButton as o}from"../button/MPButton";export const MPIconButton=r.forwardRef(function({icon:r,label:a,variant:n="text",...e},i){return t(o,{ref:i,"aria-label":a,variant:n,startIcon:r,...e})});
@@ -0,0 +1,2 @@
1
+ export { MPIconButton } from './MPIconButton';
2
+ export type { MPIconButtonProps } from './MPIconButton';
@@ -0,0 +1 @@
1
+ export{MPIconButton}from"./MPIconButton";
@@ -0,0 +1,96 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { MPColor, MPSize, MPVariant } from '../../types';
4
+ export interface MPListProps extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'color'> {
5
+ /**
6
+ * How much surface the sheet paints behind the rows.
7
+ * @default 'outlined'
8
+ */
9
+ variant?: MPVariant;
10
+ /**
11
+ * The row height and type scale. Each rung lands a one-line row on exactly the
12
+ * control height of the same name — see `PAD_Y`.
13
+ * @default 'md'
14
+ */
15
+ size?: MPSize;
16
+ /**
17
+ * Which accent family a selected or hovered row reads. The sheet itself stays
18
+ * neutral whatever this is.
19
+ * @default 'primary'
20
+ */
21
+ color?: MPColor;
22
+ /**
23
+ * Separates the rows with a hairline instead of with space.
24
+ *
25
+ * It changes more than it sounds like: with dividers the rules have to reach
26
+ * both edges of the sheet, so the list gives up its inner padding and the rows
27
+ * give up their rounded corners. A row cannot be a floating tile and a ruled
28
+ * line at the same time.
29
+ * @default false
30
+ */
31
+ dividers?: boolean;
32
+ /**
33
+ * Renders something other than a `<ul>` — `render={<ol />}` for a list where
34
+ * the order is the point. Base UI's own escape hatch.
35
+ */
36
+ render?: useRender.RenderProp;
37
+ children?: React.ReactNode;
38
+ }
39
+ export interface MPListItemProps extends Omit<React.ComponentPropsWithoutRef<'li'>, 'color' | 'onClick'> {
40
+ /**
41
+ * Passing it is what turns the row into a real `<button>`. It lands on that
42
+ * button rather than on the `<li>`, which is why the type is loosened from the
43
+ * list item the shell actually is.
44
+ */
45
+ onClick?: React.MouseEventHandler<HTMLElement>;
46
+ /** Content before the label — an icon, an avatar, a status dot. */
47
+ startIcon?: React.ReactNode;
48
+ /** Content after the label, inside the pressable area. */
49
+ endIcon?: React.ReactNode;
50
+ /**
51
+ * A second line under the label. MD3 calls this the supporting text, and it is
52
+ * one step down the type scale in `on-surface-variant`.
53
+ */
54
+ description?: React.ReactNode;
55
+ /**
56
+ * A control pinned to the end of the row — a switch, a menu button.
57
+ *
58
+ * Deliberately outside the pressable area: a row that both navigates and holds
59
+ * a toggle has two things to press, and nesting one button inside another is
60
+ * markup the browser rewrites on parse.
61
+ */
62
+ action?: React.ReactNode;
63
+ /** Renders the row as a link. Mutually exclusive with `onClick` in practice. */
64
+ href?: string;
65
+ /** Marks the row as the chosen one — the open page, the current filter. */
66
+ selected?: boolean;
67
+ /** Unavailable. Drops the accent family, as everywhere else in the library. */
68
+ disabled?: boolean;
69
+ /** The label. */
70
+ children?: React.ReactNode;
71
+ }
72
+ /**
73
+ * A stack of rows.
74
+ *
75
+ * The list is a sheet and the rows are what is on it, which is the whole reason
76
+ * the two are separate components: `size` and `color` are properties of the
77
+ * stack, not of any one line in it, and a context is what carries them down.
78
+ *
79
+ * There is no Base UI primitive under this on purpose. A list is not a composite
80
+ * widget — it has no roving focus, no selection model, no keyboard contract of
81
+ * its own. Reaching for a menu or a listbox primitive to get one would hand
82
+ * every consumer's plain list of links the semantics of a menu, which is the
83
+ * most common way a component library breaks a screen reader.
84
+ */
85
+ export declare const MPList: React.ForwardRefExoticComponent<MPListProps & React.RefAttributes<HTMLUListElement>>;
86
+ /**
87
+ * One row.
88
+ *
89
+ * The shell is always an `<li>`. What changes is what is inside it: a plain run
90
+ * of content, or — when `onClick` or `href` is given — a real `<button>` or
91
+ * `<a>` wrapping that content, with `action` sitting outside it as a separate
92
+ * control. This is the same shape `MPChip` uses, for the same two reasons: a
93
+ * `<span>` carrying a click handler is invisible to a keyboard, and a `<button>`
94
+ * inside a `<button>` is markup Chrome silently un-nests.
95
+ */
96
+ export declare const MPListItem: React.ForwardRefExoticComponent<MPListItemProps & React.RefAttributes<HTMLLIElement>>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import*as t from"react";import{useRender as i}from"@base-ui/react/use-render";import{accentSlots as o}from"../../internal/accent";import{CONTROL_GAP as l,hasContent as s,PROSE_TEXT as a,SHEET_PAD_X as d}from"../../internal/scale";import{MPStateLayer as c}from"../../internal/StateLayer";import{CONTAINER_SURFACE as m}from"../../internal/surface";const p=t.createContext({size:"md",color:"primary",dividers:!1}),u={xs:"py-1.5",sm:"py-2.5",md:"py-4",lg:"py-5",xl:"py-6"},f={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-medium",xl:"text-mp-body-medium"},x={xs:"rounded-mp-xs",sm:"rounded-mp-xs",md:"rounded-mp-sm",lg:"rounded-mp-sm",xl:"rounded-mp-md"};export const MPList=t.forwardRef(function({variant:r="outlined",size:n="md",color:l="primary",dividers:s=!1,render:a,className:d,style:c,children:u,...f},x){const h=t.useMemo(()=>({size:n,color:l,dividers:s}),[n,l,s]),v=["mp-list rounded-mp-md flex flex-col",m[r],"text-mp-on-surface",s?"overflow-hidden [&>li+li]:border-mp-outline-variant [&>li+li]:border-t":"p-1",d??""].filter(Boolean).join(" "),b=i({render:a??e("ul",{}),ref:x,props:{role:"list","data-mp-size":n,"data-mp-variant":r,className:v,style:{...o(l),...c},children:u,...f}});return e(p.Provider,{value:h,children:b})});export const MPListItem=t.forwardRef(function({startIcon:i,endIcon:o,description:m,action:h,href:v,selected:b=!1,disabled:y=!1,className:N,children:g,onClick:j,...k},w){const{size:z,dividers:B}=t.useContext(p),C=Boolean(j||v)&&!y,I=d[z],L=["group relative flex min-w-0 flex-1 items-center overflow-hidden text-start","font-[inherit] no-underline",I,u[z],l[z],a[z],"transition-[background-color,color] duration-(--mp-sys-motion-duration-short4)",B?"":x[z],y?"text-mp-on-surface/38 cursor-default":b?"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)":"",C?["cursor-pointer appearance-none border-0",b?"":"bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].filter(Boolean).join(" "):""].filter(Boolean).join(" "),M=r(n,{children:[C?e(c,{}):null,s(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null,r("span",{className:"flex min-w-0 flex-1 flex-col",children:[s(g)?e("span",{className:"truncate",children:g}):null,s(m)?e("span",{className:["truncate",f[z],b?"opacity-80":"text-mp-on-surface-variant"].join(" "),children:m}):null]}),s(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:o}):null]});return r("li",{ref:w,"data-selected":b||void 0,className:["flex w-full items-center",N??""].filter(Boolean).join(" "),...k,children:[C&&v?e("a",{href:v,className:L,"aria-current":b?"page":void 0,onClick:j,children:M}):C?e("button",{type:"button",className:L,"aria-current":!!b||void 0,onClick:j,children:M}):e("div",{className:L,"aria-disabled":y||void 0,children:M}),s(h)?e("div",{className:`flex shrink-0 items-center ${I}`,children:h}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPList, MPListItem } from './MPList';
2
+ export type { MPListItemProps, MPListProps } from './MPList';
@@ -0,0 +1 @@
1
+ export{MPList,MPListItem}from"./MPList";