material-plus-ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/README.md +2 -2
  2. package/dist/components/accordion/MPAccordion.d.ts +21 -1
  3. package/dist/components/accordion/MPAccordion.js +1 -1
  4. package/dist/components/alert/MPAlert.d.ts +33 -2
  5. package/dist/components/alert/MPAlert.js +1 -1
  6. package/dist/components/anchor/MPAnchor.d.ts +107 -0
  7. package/dist/components/anchor/MPAnchor.js +2 -0
  8. package/dist/components/anchor/index.d.ts +2 -0
  9. package/dist/components/anchor/index.js +1 -0
  10. package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
  11. package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
  12. package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
  13. package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
  14. package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
  15. package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
  16. package/dist/components/animate-counter/index.d.ts +2 -0
  17. package/dist/components/animate-counter/index.js +1 -0
  18. package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
  19. package/dist/components/animate-fade/MPAnimateFade.js +2 -1
  20. package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
  21. package/dist/components/animate-float/MPAnimateFloat.js +2 -0
  22. package/dist/components/animate-float/index.d.ts +2 -0
  23. package/dist/components/animate-float/index.js +1 -0
  24. package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
  25. package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
  26. package/dist/components/animate-lighting/MPAnimateLighting.js +2 -1
  27. package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
  28. package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
  29. package/dist/components/animate-reveal/index.d.ts +2 -0
  30. package/dist/components/animate-reveal/index.js +1 -0
  31. package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
  32. package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
  33. package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
  34. package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
  35. package/dist/components/animate-scramble/index.d.ts +2 -0
  36. package/dist/components/animate-scramble/index.js +1 -0
  37. package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
  38. package/dist/components/animate-shake/MPAnimateShake.js +2 -0
  39. package/dist/components/animate-shake/index.d.ts +2 -0
  40. package/dist/components/animate-shake/index.js +1 -0
  41. package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
  42. package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
  43. package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
  44. package/dist/components/animate-split/MPAnimateSplit.js +2 -0
  45. package/dist/components/animate-split/index.d.ts +2 -0
  46. package/dist/components/animate-split/index.js +1 -0
  47. package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
  48. package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
  49. package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
  50. package/dist/components/app-logo/MPAppLogo.d.ts +156 -0
  51. package/dist/components/app-logo/MPAppLogo.js +2 -0
  52. package/dist/components/app-logo/index.d.ts +2 -0
  53. package/dist/components/app-logo/index.js +1 -0
  54. package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
  55. package/dist/components/area-chart/MPAreaChart.js +2 -0
  56. package/dist/components/area-chart/index.d.ts +2 -0
  57. package/dist/components/area-chart/index.js +1 -0
  58. package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
  59. package/dist/components/avatar/MPAvatar.d.ts +10 -1
  60. package/dist/components/avatar/MPAvatar.js +1 -1
  61. package/dist/components/badge/MPBadge.js +1 -1
  62. package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
  63. package/dist/components/bar-chart/MPBarChart.js +2 -0
  64. package/dist/components/bar-chart/index.d.ts +2 -0
  65. package/dist/components/bar-chart/index.js +1 -0
  66. package/dist/components/blockquote/MPBlockquote.d.ts +10 -1
  67. package/dist/components/blockquote/MPBlockquote.js +1 -1
  68. package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +19 -18
  69. package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
  70. package/dist/components/box/MPBox.d.ts +43 -8
  71. package/dist/components/box/MPBox.js +2 -1
  72. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  73. package/dist/components/button/MPButton.d.ts +49 -3
  74. package/dist/components/button/MPButton.js +1 -1
  75. package/dist/components/calendar/MPCalendar.d.ts +160 -0
  76. package/dist/components/calendar/MPCalendar.js +2 -0
  77. package/dist/components/calendar/index.d.ts +2 -0
  78. package/dist/components/calendar/index.js +1 -0
  79. package/dist/components/card/MPCard.js +1 -1
  80. package/dist/components/carousel/MPCarousel.js +1 -1
  81. package/dist/components/chat-bubble/MPChatBubble.js +1 -1
  82. package/dist/components/checkbox/MPCheckbox.js +1 -1
  83. package/dist/components/chip/MPChip.d.ts +31 -7
  84. package/dist/components/chip/MPChip.js +1 -1
  85. package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
  86. package/dist/components/code-block/MPCodeBlock.js +2 -0
  87. package/dist/components/code-block/index.d.ts +2 -0
  88. package/dist/components/code-block/index.js +1 -0
  89. package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
  90. package/dist/components/collapsible/MPCollapsible.js +1 -1
  91. package/dist/components/color-picker/MPColorPicker.js +1 -1
  92. package/dist/components/combobox/MPCombobox.d.ts +71 -5
  93. package/dist/components/combobox/MPCombobox.js +1 -1
  94. package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
  95. package/dist/components/command-palette/MPCommandPalette.js +1 -1
  96. package/dist/components/config/MPConfigProvider.d.ts +166 -0
  97. package/dist/components/config/MPConfigProvider.js +2 -0
  98. package/dist/components/config/index.d.ts +2 -0
  99. package/dist/components/config/index.js +1 -0
  100. package/dist/components/confirm/MPConfirmProvider.d.ts +143 -0
  101. package/dist/components/confirm/MPConfirmProvider.js +2 -0
  102. package/dist/components/confirm/index.d.ts +2 -0
  103. package/dist/components/confirm/index.js +1 -0
  104. package/dist/components/container/MPContainer.d.ts +9 -2
  105. package/dist/components/container/MPContainer.js +2 -1
  106. package/dist/components/data-list/MPDataList.d.ts +82 -0
  107. package/dist/components/data-list/MPDataList.js +2 -0
  108. package/dist/components/data-list/index.d.ts +2 -0
  109. package/dist/components/data-list/index.js +1 -0
  110. package/dist/components/data-table/MPDataTable.d.ts +295 -0
  111. package/dist/components/data-table/MPDataTable.js +2 -0
  112. package/dist/components/data-table/index.d.ts +2 -0
  113. package/dist/components/data-table/index.js +1 -0
  114. package/dist/components/date-picker/MPDatePicker.d.ts +53 -2
  115. package/dist/components/date-picker/MPDatePicker.js +1 -1
  116. package/dist/components/date-picker/index.d.ts +1 -1
  117. package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
  118. package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
  119. package/dist/components/dialog/MPDialog.d.ts +24 -3
  120. package/dist/components/dialog/MPDialog.js +1 -1
  121. package/dist/components/divider/MPDivider.js +1 -1
  122. package/dist/components/drawer/MPDrawer.d.ts +8 -2
  123. package/dist/components/drawer/MPDrawer.js +1 -1
  124. package/dist/components/empty/MPEmpty.d.ts +10 -1
  125. package/dist/components/empty/MPEmpty.js +1 -1
  126. package/dist/components/fieldset/MPFieldset.js +1 -1
  127. package/dist/components/file-picker/MPFilePicker.js +1 -1
  128. package/dist/components/flex/MPFlex.d.ts +95 -0
  129. package/dist/components/flex/MPFlex.js +2 -0
  130. package/dist/components/flex/index.d.ts +2 -0
  131. package/dist/components/flex/index.js +1 -0
  132. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  133. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
  134. package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
  135. package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
  136. package/dist/components/floating-bottom-navigation/index.js +1 -0
  137. package/dist/components/footer/MPFooter.d.ts +24 -4
  138. package/dist/components/footer/MPFooter.js +1 -1
  139. package/dist/components/form/MPForm.js +1 -1
  140. package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
  141. package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
  142. package/dist/components/gauge-chart/index.d.ts +2 -0
  143. package/dist/components/gauge-chart/index.js +1 -0
  144. package/dist/components/grid/MPGrid.d.ts +23 -1
  145. package/dist/components/grid/MPGrid.js +1 -1
  146. package/dist/components/header/MPHeader.d.ts +26 -4
  147. package/dist/components/header/MPHeader.js +1 -1
  148. package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
  149. package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
  150. package/dist/components/heatmap-chart/index.d.ts +2 -0
  151. package/dist/components/heatmap-chart/index.js +1 -0
  152. package/dist/components/hover-card/MPHoverCard.d.ts +100 -0
  153. package/dist/components/hover-card/MPHoverCard.js +2 -0
  154. package/dist/components/hover-card/index.d.ts +2 -0
  155. package/dist/components/hover-card/index.js +1 -0
  156. package/dist/components/image/MPImage.d.ts +121 -0
  157. package/dist/components/image/MPImage.js +2 -0
  158. package/dist/components/image/index.d.ts +2 -0
  159. package/dist/components/image/index.js +1 -0
  160. package/dist/components/line-chart/MPLineChart.d.ts +66 -0
  161. package/dist/components/line-chart/MPLineChart.js +2 -0
  162. package/dist/components/line-chart/index.d.ts +2 -0
  163. package/dist/components/line-chart/index.js +1 -0
  164. package/dist/components/list/MPList.d.ts +51 -1
  165. package/dist/components/list/MPList.js +1 -1
  166. package/dist/components/menu/MPMenu.d.ts +21 -2
  167. package/dist/components/menu/MPMenu.js +1 -1
  168. package/dist/components/menubar/MPMenubar.js +1 -1
  169. package/dist/components/meter/MPMeter.d.ts +87 -0
  170. package/dist/components/meter/MPMeter.js +2 -0
  171. package/dist/components/meter/index.d.ts +2 -0
  172. package/dist/components/meter/index.js +1 -0
  173. package/dist/components/mockup/MPMockup.d.ts +143 -0
  174. package/dist/components/mockup/MPMockup.js +2 -0
  175. package/dist/components/mockup/index.d.ts +2 -0
  176. package/dist/components/mockup/index.js +1 -0
  177. package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
  178. package/dist/components/number-field/MPNumberField.d.ts +3 -3
  179. package/dist/components/number-field/MPNumberField.js +1 -1
  180. package/dist/components/otp-field/MPOtpField.js +1 -1
  181. package/dist/components/overlay/MPOverlay.d.ts +1 -1
  182. package/dist/components/overlay/MPOverlay.js +1 -1
  183. package/dist/components/pagination/MPPagination.js +1 -1
  184. package/dist/components/panes/MPPanes.js +1 -1
  185. package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
  186. package/dist/components/pie-chart/MPPieChart.js +2 -0
  187. package/dist/components/pie-chart/index.d.ts +2 -0
  188. package/dist/components/pie-chart/index.js +1 -0
  189. package/dist/components/pill/MPPill.js +1 -1
  190. package/dist/components/popconfirm/MPPopconfirm.d.ts +92 -0
  191. package/dist/components/popconfirm/MPPopconfirm.js +2 -0
  192. package/dist/components/popconfirm/index.d.ts +2 -0
  193. package/dist/components/popconfirm/index.js +1 -0
  194. package/dist/components/popover/MPPopover.d.ts +1 -1
  195. package/dist/components/popover/MPPopover.js +1 -1
  196. package/dist/components/portal/MPPortal.d.ts +75 -0
  197. package/dist/components/portal/MPPortal.js +2 -0
  198. package/dist/components/portal/index.d.ts +2 -0
  199. package/dist/components/portal/index.js +1 -0
  200. package/dist/components/progress-box/MPProgressBox.js +1 -1
  201. package/dist/components/progress-circular/MPProgressCircular.js +1 -1
  202. package/dist/components/progress-linear/MPProgressLinear.js +1 -1
  203. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  204. package/dist/components/rating/MPRating.js +1 -1
  205. package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
  206. package/dist/components/scatter-chart/MPScatterChart.js +2 -0
  207. package/dist/components/scatter-chart/index.d.ts +2 -0
  208. package/dist/components/scatter-chart/index.js +1 -0
  209. package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
  210. package/dist/components/scroll-area/MPScrollArea.js +2 -0
  211. package/dist/components/scroll-area/index.d.ts +2 -0
  212. package/dist/components/scroll-area/index.js +1 -0
  213. package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
  214. package/dist/components/scroll-zone/MPScrollZone.js +2 -0
  215. package/dist/components/scroll-zone/index.d.ts +2 -0
  216. package/dist/components/scroll-zone/index.js +1 -0
  217. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  218. package/dist/components/select/MPSelect.d.ts +28 -5
  219. package/dist/components/select/MPSelect.js +1 -1
  220. package/dist/components/shortcut/MPShortcut.js +1 -1
  221. package/dist/components/show/MPShow.d.ts +78 -0
  222. package/dist/components/show/MPShow.js +2 -0
  223. package/dist/components/show/index.d.ts +2 -0
  224. package/dist/components/show/index.js +1 -0
  225. package/dist/components/sidebar/MPSidebar.d.ts +20 -1
  226. package/dist/components/sidebar/MPSidebar.js +1 -1
  227. package/dist/components/skeleton/MPSkeleton.js +1 -1
  228. package/dist/components/slider/MPSlider.d.ts +27 -0
  229. package/dist/components/slider/MPSlider.js +1 -1
  230. package/dist/components/snackbar/MPSnackbar.d.ts +20 -1
  231. package/dist/components/snackbar/MPSnackbar.js +1 -1
  232. package/dist/components/sparkline/MPSparkline.d.ts +85 -0
  233. package/dist/components/sparkline/MPSparkline.js +2 -0
  234. package/dist/components/sparkline/index.d.ts +2 -0
  235. package/dist/components/sparkline/index.js +1 -0
  236. package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
  237. package/dist/components/spoiler/MPSpoiler.js +1 -1
  238. package/dist/components/stack/MPStack.d.ts +198 -0
  239. package/dist/components/stack/MPStack.js +2 -0
  240. package/dist/components/stack/index.d.ts +2 -0
  241. package/dist/components/stack/index.js +1 -0
  242. package/dist/components/statistic/MPStatistic.d.ts +104 -0
  243. package/dist/components/statistic/MPStatistic.js +2 -0
  244. package/dist/components/statistic/index.d.ts +2 -0
  245. package/dist/components/statistic/index.js +1 -0
  246. package/dist/components/stepper/MPStepper.d.ts +153 -0
  247. package/dist/components/stepper/MPStepper.js +2 -0
  248. package/dist/components/stepper/index.d.ts +2 -0
  249. package/dist/components/stepper/index.js +1 -0
  250. package/dist/components/switch/MPSwitch.js +1 -1
  251. package/dist/components/table/MPTable.d.ts +24 -2
  252. package/dist/components/table/MPTable.js +1 -1
  253. package/dist/components/tabs/MPTabs.d.ts +12 -0
  254. package/dist/components/tabs/MPTabs.js +1 -1
  255. package/dist/components/text-field/MPTextField.d.ts +38 -14
  256. package/dist/components/text-field/MPTextField.js +1 -1
  257. package/dist/components/time-picker/MPTimePicker.js +1 -1
  258. package/dist/components/timeline/MPTimeline.d.ts +10 -2
  259. package/dist/components/timeline/MPTimeline.js +1 -1
  260. package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
  261. package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
  262. package/dist/components/timeline-chart/index.d.ts +2 -0
  263. package/dist/components/timeline-chart/index.js +1 -0
  264. package/dist/components/toggle/MPToggle.js +1 -1
  265. package/dist/components/toolbar/MPToolbar.d.ts +106 -0
  266. package/dist/components/toolbar/MPToolbar.js +2 -0
  267. package/dist/components/toolbar/index.d.ts +2 -0
  268. package/dist/components/toolbar/index.js +1 -0
  269. package/dist/components/tour/MPTour.d.ts +120 -0
  270. package/dist/components/tour/MPTour.js +2 -0
  271. package/dist/components/tour/index.d.ts +2 -0
  272. package/dist/components/tour/index.js +1 -0
  273. package/dist/components/transfer/MPTransfer.js +1 -1
  274. package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
  275. package/dist/components/tree-select/MPTreeSelect.js +2 -0
  276. package/dist/components/tree-select/index.d.ts +2 -0
  277. package/dist/components/tree-select/index.js +1 -0
  278. package/dist/components/tree-view/MPTreeView.d.ts +153 -0
  279. package/dist/components/tree-view/MPTreeView.js +2 -0
  280. package/dist/components/tree-view/index.d.ts +2 -0
  281. package/dist/components/tree-view/index.js +1 -0
  282. package/dist/components/typography/MPTypography.d.ts +17 -1
  283. package/dist/components/typography/MPTypography.js +1 -1
  284. package/dist/components/visually-hidden/MPVisuallyHidden.d.ts +60 -0
  285. package/dist/components/visually-hidden/MPVisuallyHidden.js +2 -0
  286. package/dist/components/visually-hidden/index.d.ts +2 -0
  287. package/dist/components/visually-hidden/index.js +1 -0
  288. package/dist/constants/glyphs.d.ts +4 -0
  289. package/dist/constants/glyphs.js +1 -1
  290. package/dist/constants/icons.d.ts +2 -0
  291. package/dist/constants/icons.js +1 -1
  292. package/dist/hooks/index.d.ts +40 -0
  293. package/dist/hooks/index.js +1 -0
  294. package/dist/hooks/useMPColorScheme.d.ts +135 -0
  295. package/dist/hooks/useMPColorScheme.js +2 -0
  296. package/dist/hooks/useMPDisclosure.d.ts +58 -0
  297. package/dist/hooks/useMPDisclosure.js +2 -0
  298. package/dist/hooks/useMPElementSize.d.ts +55 -0
  299. package/dist/hooks/useMPElementSize.js +2 -0
  300. package/dist/hooks/useMPMediaQuery.d.ts +40 -0
  301. package/dist/hooks/useMPMediaQuery.js +2 -0
  302. package/dist/hooks/useMPOnScreen.d.ts +58 -0
  303. package/dist/hooks/useMPOnScreen.js +2 -0
  304. package/dist/hooks/useMPReducedMotion.d.ts +32 -0
  305. package/dist/hooks/useMPReducedMotion.js +2 -0
  306. package/dist/hooks/useMPShortcut.d.ts +105 -0
  307. package/dist/hooks/useMPShortcut.js +2 -0
  308. package/dist/hooks/useMPWindowClass.d.ts +55 -0
  309. package/dist/hooks/useMPWindowClass.js +2 -0
  310. package/dist/index.d.ts +43 -1
  311. package/dist/index.js +1 -1
  312. package/dist/internal/Calendar.d.ts +19 -4
  313. package/dist/internal/Calendar.js +1 -1
  314. package/dist/internal/ChartChrome.d.ts +205 -0
  315. package/dist/internal/ChartChrome.js +2 -0
  316. package/dist/internal/ChartFrame.d.ts +197 -0
  317. package/dist/internal/ChartFrame.js +2 -0
  318. package/dist/internal/FieldOutline.d.ts +14 -5
  319. package/dist/internal/FieldOutline.js +1 -1
  320. package/dist/internal/Picker.d.ts +15 -3
  321. package/dist/internal/Picker.js +1 -1
  322. package/dist/internal/SupportingText.d.ts +24 -0
  323. package/dist/internal/SupportingText.js +1 -1
  324. package/dist/internal/animate-core.d.ts +121 -0
  325. package/dist/internal/animate-core.js +1 -0
  326. package/dist/internal/animate.d.ts +75 -55
  327. package/dist/internal/animate.js +1 -1
  328. package/dist/internal/bottom-navigation.d.ts +58 -0
  329. package/dist/internal/bottom-navigation.js +2 -0
  330. package/dist/internal/chart.d.ts +471 -0
  331. package/dist/internal/chart.js +1 -0
  332. package/dist/internal/color-scheme.d.ts +28 -0
  333. package/dist/internal/color-scheme.js +2 -0
  334. package/dist/internal/config.d.ts +62 -0
  335. package/dist/internal/config.js +2 -0
  336. package/dist/internal/data-table.d.ts +162 -0
  337. package/dist/internal/data-table.js +1 -0
  338. package/dist/internal/date.d.ts +50 -3
  339. package/dist/internal/date.js +1 -1
  340. package/dist/internal/density.d.ts +9 -0
  341. package/dist/internal/density.js +1 -0
  342. package/dist/internal/elevation.d.ts +26 -0
  343. package/dist/internal/elevation.js +1 -0
  344. package/dist/internal/highlight.d.ts +96 -0
  345. package/dist/internal/highlight.js +1 -0
  346. package/dist/internal/i18n.d.ts +196 -1
  347. package/dist/internal/initials.d.ts +28 -0
  348. package/dist/internal/initials.js +1 -0
  349. package/dist/internal/mark.d.ts +52 -0
  350. package/dist/internal/mark.js +1 -0
  351. package/dist/internal/measure.d.ts +31 -0
  352. package/dist/internal/measure.js +1 -0
  353. package/dist/internal/messages/anchor.d.ts +3 -0
  354. package/dist/internal/messages/anchor.js +1 -0
  355. package/dist/internal/messages/chart.d.ts +3 -0
  356. package/dist/internal/messages/chart.js +1 -0
  357. package/dist/internal/messages/code.d.ts +3 -0
  358. package/dist/internal/messages/code.js +1 -0
  359. package/dist/internal/messages/confirm.d.ts +3 -0
  360. package/dist/internal/messages/confirm.js +1 -0
  361. package/dist/internal/messages/data-table.d.ts +3 -0
  362. package/dist/internal/messages/data-table.js +1 -0
  363. package/dist/internal/messages/picker.js +1 -1
  364. package/dist/internal/messages/scroll.d.ts +3 -0
  365. package/dist/internal/messages/scroll.js +1 -0
  366. package/dist/internal/messages/sparkline.d.ts +3 -0
  367. package/dist/internal/messages/sparkline.js +1 -0
  368. package/dist/internal/messages/tour.d.ts +3 -0
  369. package/dist/internal/messages/tour.js +1 -0
  370. package/dist/internal/mockup.d.ts +174 -0
  371. package/dist/internal/mockup.js +2 -0
  372. package/dist/internal/page-layout.d.ts +24 -5
  373. package/dist/internal/page-layout.js +1 -1
  374. package/dist/internal/progress.d.ts +14 -0
  375. package/dist/internal/responsive.d.ts +55 -0
  376. package/dist/internal/responsive.js +1 -0
  377. package/dist/internal/scale.d.ts +0 -17
  378. package/dist/internal/scale.js +1 -1
  379. package/dist/internal/step.d.ts +86 -0
  380. package/dist/internal/step.js +1 -0
  381. package/dist/internal/table.d.ts +53 -0
  382. package/dist/internal/table.js +1 -0
  383. package/dist/internal/text.d.ts +57 -0
  384. package/dist/internal/text.js +1 -0
  385. package/dist/internal/threshold.d.ts +19 -0
  386. package/dist/internal/threshold.js +1 -0
  387. package/dist/internal/time-scale.d.ts +44 -0
  388. package/dist/internal/time-scale.js +1 -0
  389. package/dist/internal/transition.d.ts +33 -0
  390. package/dist/internal/transition.js +1 -0
  391. package/dist/internal/visibility.d.ts +48 -0
  392. package/dist/internal/visibility.js +1 -0
  393. package/dist/internal/window-class.d.ts +48 -0
  394. package/dist/internal/window-class.js +2 -0
  395. package/dist/locales/ar.js +1 -1
  396. package/dist/locales/de.js +1 -1
  397. package/dist/locales/es.js +1 -1
  398. package/dist/locales/fr.js +1 -1
  399. package/dist/locales/hi.js +1 -1
  400. package/dist/locales/id.js +1 -1
  401. package/dist/locales/it.js +1 -1
  402. package/dist/locales/ja.js +1 -1
  403. package/dist/locales/ko.js +1 -1
  404. package/dist/locales/nl.js +1 -1
  405. package/dist/locales/pl.js +1 -1
  406. package/dist/locales/pt.js +1 -1
  407. package/dist/locales/ru.js +1 -1
  408. package/dist/locales/th.js +1 -1
  409. package/dist/locales/tr.js +1 -1
  410. package/dist/locales/vi.js +1 -1
  411. package/dist/locales/zh-hans.js +1 -1
  412. package/dist/locales/zh-hant.js +1 -1
  413. package/dist/styles/accordion.css +1 -1
  414. package/dist/styles/alert.css +1 -1
  415. package/dist/styles/anchor.css +2 -0
  416. package/dist/styles/animate-appear.css +1 -1
  417. package/dist/styles/animate-blink.css +1 -1
  418. package/dist/styles/animate-counter.css +2 -0
  419. package/dist/styles/animate-fade.css +1 -1
  420. package/dist/styles/animate-float.css +2 -0
  421. package/dist/styles/animate-grow.css +1 -1
  422. package/dist/styles/animate-headline.css +1 -1
  423. package/dist/styles/animate-lighting.css +1 -1
  424. package/dist/styles/animate-marquee.css +1 -1
  425. package/dist/styles/animate-reveal.css +2 -0
  426. package/dist/styles/animate-rotate.css +1 -1
  427. package/dist/styles/animate-scramble.css +2 -0
  428. package/dist/styles/animate-shake.css +2 -0
  429. package/dist/styles/animate-slide.css +1 -1
  430. package/dist/styles/animate-split.css +2 -0
  431. package/dist/styles/animate-typing.css +1 -1
  432. package/dist/styles/animate-zoom.css +1 -1
  433. package/dist/styles/app-logo.css +2 -0
  434. package/dist/styles/area-chart.css +2 -0
  435. package/dist/styles/aspect-ratio.css +1 -1
  436. package/dist/styles/avatar.css +1 -1
  437. package/dist/styles/badge.css +1 -1
  438. package/dist/styles/bar-chart.css +2 -0
  439. package/dist/styles/blockquote.css +1 -1
  440. package/dist/styles/bottom-navigation.css +1 -1
  441. package/dist/styles/box.css +1 -1
  442. package/dist/styles/breadcrumb.css +1 -1
  443. package/dist/styles/button.css +1 -1
  444. package/dist/styles/calendar.css +2 -0
  445. package/dist/styles/card.css +1 -1
  446. package/dist/styles/carousel.css +1 -1
  447. package/dist/styles/chat-bubble.css +1 -1
  448. package/dist/styles/checkbox.css +1 -1
  449. package/dist/styles/chip.css +1 -1
  450. package/dist/styles/code-block.css +2 -0
  451. package/dist/styles/collapsible.css +1 -1
  452. package/dist/styles/color-picker.css +1 -1
  453. package/dist/styles/combobox.css +1 -1
  454. package/dist/styles/command-palette.css +1 -1
  455. package/dist/styles/config.css +2 -0
  456. package/dist/styles/confirm.css +2 -0
  457. package/dist/styles/container.css +1 -1
  458. package/dist/styles/data-list.css +2 -0
  459. package/dist/styles/data-table.css +2 -0
  460. package/dist/styles/date-picker.css +1 -1
  461. package/dist/styles/date-range-picker.css +1 -1
  462. package/dist/styles/date-time-picker.css +1 -1
  463. package/dist/styles/dialog.css +1 -1
  464. package/dist/styles/divider.css +1 -1
  465. package/dist/styles/drawer.css +1 -1
  466. package/dist/styles/empty.css +1 -1
  467. package/dist/styles/fieldset.css +1 -1
  468. package/dist/styles/file-picker.css +1 -1
  469. package/dist/styles/flex.css +2 -0
  470. package/dist/styles/floating-action-button.css +1 -1
  471. package/dist/styles/floating-bottom-navigation.css +2 -0
  472. package/dist/styles/footer.css +1 -1
  473. package/dist/styles/form.css +1 -1
  474. package/dist/styles/gauge-chart.css +2 -0
  475. package/dist/styles/grid.css +1 -1
  476. package/dist/styles/header.css +1 -1
  477. package/dist/styles/heatmap-chart.css +2 -0
  478. package/dist/styles/highlight.css +1 -1
  479. package/dist/styles/hover-card.css +2 -0
  480. package/dist/styles/icon-button.css +1 -1
  481. package/dist/styles/image.css +2 -0
  482. package/dist/styles/line-chart.css +2 -0
  483. package/dist/styles/list.css +1 -1
  484. package/dist/styles/locale.css +1 -1
  485. package/dist/styles/menu.css +1 -1
  486. package/dist/styles/menubar.css +1 -1
  487. package/dist/styles/meter.css +2 -0
  488. package/dist/styles/mockup.css +2 -0
  489. package/dist/styles/navigation-menu.css +1 -1
  490. package/dist/styles/number-field.css +1 -1
  491. package/dist/styles/otp-field.css +1 -1
  492. package/dist/styles/overlay.css +1 -1
  493. package/dist/styles/page-layout.css +1 -1
  494. package/dist/styles/pagination.css +1 -1
  495. package/dist/styles/panes.css +1 -1
  496. package/dist/styles/pie-chart.css +2 -0
  497. package/dist/styles/pill.css +1 -1
  498. package/dist/styles/popconfirm.css +2 -0
  499. package/dist/styles/popover.css +1 -1
  500. package/dist/styles/portal.css +2 -0
  501. package/dist/styles/progress-box.css +1 -1
  502. package/dist/styles/progress-circular.css +1 -1
  503. package/dist/styles/progress-linear.css +1 -1
  504. package/dist/styles/radio-group.css +1 -1
  505. package/dist/styles/rating.css +1 -1
  506. package/dist/styles/scatter-chart.css +2 -0
  507. package/dist/styles/scroll-area.css +2 -0
  508. package/dist/styles/scroll-zone.css +2 -0
  509. package/dist/styles/segmented-button.css +1 -1
  510. package/dist/styles/select.css +1 -1
  511. package/dist/styles/shortcut.css +1 -1
  512. package/dist/styles/show.css +2 -0
  513. package/dist/styles/sidebar.css +1 -1
  514. package/dist/styles/skeleton.css +1 -1
  515. package/dist/styles/slider.css +1 -1
  516. package/dist/styles/snackbar.css +1 -1
  517. package/dist/styles/sparkline.css +2 -0
  518. package/dist/styles/spoiler.css +1 -1
  519. package/dist/styles/stack.css +2 -0
  520. package/dist/styles/statistic.css +2 -0
  521. package/dist/styles/stepper.css +2 -0
  522. package/dist/styles/switch.css +1 -1
  523. package/dist/styles/table.css +1 -1
  524. package/dist/styles/tabs.css +1 -1
  525. package/dist/styles/text-field.css +1 -1
  526. package/dist/styles/text-link.css +1 -1
  527. package/dist/styles/time-picker.css +1 -1
  528. package/dist/styles/timeline-chart.css +2 -0
  529. package/dist/styles/timeline.css +1 -1
  530. package/dist/styles/toggle.css +1 -1
  531. package/dist/styles/tokens.css +1 -1
  532. package/dist/styles/toolbar.css +2 -0
  533. package/dist/styles/tour.css +2 -0
  534. package/dist/styles/transfer.css +1 -1
  535. package/dist/styles/tree-select.css +2 -0
  536. package/dist/styles/tree-view.css +2 -0
  537. package/dist/styles/typography.css +1 -1
  538. package/dist/styles/visually-hidden.css +2 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/tailwind.css +1423 -114
  541. package/dist/types.d.ts +628 -3
  542. package/package.json +8 -2
  543. package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
  544. package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
  545. package/dist/components/avatar-group/index.d.ts +0 -2
  546. package/dist/components/avatar-group/index.js +0 -1
  547. package/dist/internal/avatar-group.d.ts +0 -22
  548. package/dist/internal/avatar-group.js +0 -2
  549. package/dist/styles/avatar-group.css +0 -2
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Toggle as r}from"@base-ui/react/toggle";import{accentSlots as o}from"../../internal/accent.js";import{MPButtonGroupContext as a}from"../../internal/button-group.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{CONTROL_GAP as i,CONTROL_HEIGHT as c,CONTROL_PAD_X as l,CONTROL_SQUARE as p,CONTROL_TEXT as m,hasContent as d}from"../../internal/scale.js";const u={filled:"bg-mp-surface-container-highest text-mp-on-surface-variant",tonal:"bg-mp-surface-container text-mp-on-surface-variant",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface-variant",outlined:"border-mp-outline border bg-transparent text-mp-on-surface-variant",text:"bg-transparent text-mp-on-surface-variant"},f={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border-(--_mp-accent) border bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",text:"bg-transparent text-(--_mp-accent)"},b={filled:"bg-mp-on-surface/12 text-mp-on-surface/38",tonal:"bg-mp-on-surface/12 text-mp-on-surface/38",elevated:"bg-mp-on-surface/12 text-mp-on-surface/38 shadow-none",outlined:"border-mp-on-surface/12 border bg-transparent text-mp-on-surface/38",text:"bg-transparent text-mp-on-surface/38"};export const MPToggle=/*@__PURE__*/n.forwardRef(function({variant:g,size:x,color:v,disabled:h,pressed:w,defaultPressed:_,onPressedChange:j,value:y,startIcon:P,endIcon:z,fullWidth:C=!1,className:k,style:I,children:N,...B},L){const M=n.useContext(a),R=g??M?.variant??"outlined",S=x??M?.size??"md",T=v??M?.color??"primary",W=h??M?.disabled??!1,$=!d(N);return t(r,{ref:L,value:y,pressed:w,defaultPressed:_,onPressedChange:e=>j?.(e),disabled:W,"data-mp-size":S,"data-mp-variant":R,className:e=>["mp-toggle group relative inline-flex shrink-0 items-center justify-center","rounded-mp-full 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,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)",c[S],m[S],i[S],$?`${p[S]} px-0`:l[S],W?b[R]:e.pressed?f[R]:u[R],W?"cursor-default":"",C?"w-full":"",k??""].filter(Boolean).join(" "),style:{...o(T),...I},...B,children:[W?null:e(s,{}),P,N,z]})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Toggle as r}from"@base-ui/react/toggle";import{accentSlots as o}from"../../internal/accent.js";import{MPButtonGroupContext as a}from"../../internal/button-group.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{CONTROL_GAP as i,CONTROL_HEIGHT as c,CONTROL_PAD_X as l,CONTROL_SQUARE as p,CONTROL_TEXT as m,hasContent as d}from"../../internal/scale.js";import{useMPColor as u,useMPSize as f}from"../../internal/config.js";const b={filled:"bg-mp-surface-container-highest text-mp-on-surface-variant",tonal:"bg-mp-surface-container text-mp-on-surface-variant",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface-variant",outlined:"border-mp-outline border bg-transparent text-mp-on-surface-variant",text:"bg-transparent text-mp-on-surface-variant"},g={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border-(--_mp-accent) border bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",text:"bg-transparent text-(--_mp-accent)"},x={filled:"bg-mp-on-surface/12 text-mp-on-surface/38",tonal:"bg-mp-on-surface/12 text-mp-on-surface/38",elevated:"bg-mp-on-surface/12 text-mp-on-surface/38 shadow-none",outlined:"border-mp-on-surface/12 border bg-transparent text-mp-on-surface/38",text:"bg-transparent text-mp-on-surface/38"};export const MPToggle=/*@__PURE__*/n.forwardRef(function({variant:v,size:h,color:j,disabled:w,pressed:_,defaultPressed:y,onPressedChange:P,value:z,startIcon:C,endIcon:k,fullWidth:I=!1,className:N,style:B,children:L,...M},R){const S=n.useContext(a),T=v??S?.variant??"outlined",W=f(h??S?.size),$=u(j??S?.color),q=w??S?.disabled??!1,A=!d(L);return t(r,{ref:R,value:z,pressed:_,defaultPressed:y,onPressedChange:e=>P?.(e),disabled:q,"data-mp-size":W,"data-mp-variant":T,className:e=>["mp-toggle group relative inline-flex shrink-0 items-center justify-center","rounded-mp-full 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,border-color,box-shadow,color]","duration-(--mp-sys-motion-duration-short4)",c[W],m[W],i[W],A?`${p[W]} px-0`:l[W],q?x[T]:e.pressed?g[T]:b[T],q?"cursor-default":"",I?"w-full":"",N??""].filter(Boolean).join(" "),style:{...o($),...B},...M,children:[q?null:e(s,{}),C,L,k]})});
@@ -0,0 +1,106 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { MPDensity, MPElevation, MPPosition, MPSize, MPVariant } from '../../types.js';
4
+ /** Which edge a pinned bar is held against. */
5
+ export type MPToolbarSide = 'top' | 'bottom';
6
+ export interface MPToolbarProps extends React.ComponentPropsWithoutRef<'div'> {
7
+ /**
8
+ * How much surface the bar paints.
9
+ *
10
+ * A container's ladder, so the bar is never dyed — exactly as on `MPBox`. A
11
+ * toolbar holds other people's controls, and those controls arrive with
12
+ * colours of their own.
13
+ * @default 'outlined'
14
+ */
15
+ variant?: MPVariant;
16
+ /**
17
+ * How far off the page it is lifted, on MD3's five levels.
18
+ *
19
+ * Left unset the bar is flat even when it is pinned, and that is deliberate: a
20
+ * shadow under a header is a way of saying "there is content beneath this",
21
+ * which is only true once the page has been scrolled. Raise it yourself, or
22
+ * leave it flat and turn on `divider`.
23
+ */
24
+ elevation?: MPElevation;
25
+ /**
26
+ * The room inside. As on `MPBox`, `size` sets padding here and neither a
27
+ * height nor a type scale: a toolbar is as tall as the controls in it.
28
+ * @default 'md'
29
+ */
30
+ size?: MPSize;
31
+ /** Takes room out of that padding, two pixels a face per step. @default 0 */
32
+ density?: MPDensity;
33
+ /**
34
+ * How the bar sits in the page's scroll.
35
+ *
36
+ * - `static` — in the flow, scrolling away with the content.
37
+ * - `sticky` — in the flow until it reaches the edge, then held there. What an
38
+ * application header usually wants: it takes up its own room, so nothing
39
+ * underneath has to be padded around it.
40
+ * - `fixed` — out of the flow entirely. The page needs padding of its own, or
41
+ * the first screenful sits behind the bar.
42
+ * - `absolute` — pinned to the nearest positioned ancestor rather than to the
43
+ * window. For a bar along the edge of a panel.
44
+ * @default 'static'
45
+ */
46
+ position?: MPPosition;
47
+ /** Which edge it is held against when `position` is not `static`. @default 'top' */
48
+ side?: MPToolbarSide;
49
+ /**
50
+ * Draws a hairline along the edge that faces the content — under a `top` bar,
51
+ * over a `bottom` one.
52
+ * @default false
53
+ */
54
+ divider?: boolean;
55
+ /** Pinned to the start of the bar: a logo, a title, a back button. */
56
+ start?: React.ReactNode;
57
+ /** Pinned to the end: the actions. */
58
+ end?: React.ReactNode;
59
+ /**
60
+ * Renders something other than a `<div>`. Worth reaching for here more than
61
+ * anywhere else: a page's header should be a `<header>`.
62
+ */
63
+ render?: useRender.RenderProp;
64
+ /** The middle. Takes whatever width `start` and `end` leave. */
65
+ children?: React.ReactNode;
66
+ }
67
+ /**
68
+ * A bar of controls: an application header, a page's action row, the strip along
69
+ * the bottom of an editor.
70
+ *
71
+ * ```tsx
72
+ * <MPToolbar render={<header />} position="sticky" divider start={<MPAppLogo name="Acme" />}>
73
+ * <MPTextField placeholder="Search" />
74
+ * </MPToolbar>
75
+ * ```
76
+ *
77
+ * Three slots and a row. `start` and `end` are pinned to their ends and
78
+ * `children` takes what is left, which is the arrangement every toolbar has ever
79
+ * had — so it is laid out here rather than left to a caller and the spacer
80
+ * `<div>` they have to remember.
81
+ *
82
+ * ## It takes no height
83
+ *
84
+ * A toolbar is as tall as the controls in it plus its padding, and that padding
85
+ * is the `size`/`density` pair every other surface uses. So `density={-2}` gives
86
+ * the dense bar without a second prop that means the same thing, and without the
87
+ * type scale moving.
88
+ *
89
+ * ## It has no `role="toolbar"`, deliberately
90
+ *
91
+ * That role is a promise about keyboard behaviour — one tab stop for the whole
92
+ * bar, arrow keys between the controls inside it — and a bar that claims it
93
+ * without implementing it is worse for a keyboard reader than one that claimed
94
+ * nothing at all.
95
+ *
96
+ * What a page header wants is `render={<header />}`, which is a landmark and is
97
+ * true. What a genuine roving-focus toolbar wants is `MPButtonGroup`, which is
98
+ * one.
99
+ *
100
+ * ## What it is not
101
+ *
102
+ * Not `MPHeader`, which is `MPPageLayout`'s own slot and knows about the
103
+ * sidebar, the skip link and the drawer. This is a bar you can put anywhere,
104
+ * including inside a card.
105
+ */
106
+ export declare const MPToolbar: React.ForwardRefExoticComponent<MPToolbarProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import*as o from"react";import{useRender as r}from"@base-ui/react/use-render";import{sheetPadX as i,sheetPadY as n}from"../../internal/density.js";import{containerSurface as s}from"../../internal/elevation.js";import{SHEET_GAP as a,hasContent as m}from"../../internal/scale.js";import{useMPDensity as l,useMPSize as d}from"../../internal/config.js";const p={static:{top:"",bottom:""},absolute:{top:"absolute inset-x-0 top-0 z-20",bottom:"absolute inset-x-0 bottom-0 z-20"},sticky:{top:"sticky top-0 z-20",bottom:"sticky bottom-0 z-20"},fixed:{top:"fixed inset-x-0 top-0 z-30",bottom:"fixed inset-x-0 bottom-0 z-30"}},c={top:"border-mp-outline-variant border-b",bottom:"border-mp-outline-variant border-t"};export const MPToolbar=/*@__PURE__*/o.forwardRef(function({variant:b="outlined",elevation:f,size:x,density:u,position:v="static",side:h="top",divider:j=!1,start:z,end:y,render:w,className:_,style:g,children:k,...N},B){const F=d(x),M=l(u);return r({render:w,ref:B,props:{"data-mp-size":F,"data-mp-variant":b,className:["mp-toolbar box-border flex w-full min-w-0 items-center",i(F,M),n(F,M),a[F],"static"===v?"rounded-mp-md":"",s(b,f),"text-mp-on-surface",j?c[h]:"",p[v][h],_??""].filter(Boolean).join(" "),style:g,children:e(o.Fragment,{children:[m(z)?t("div",{className:"mp-toolbar__start flex min-w-0 shrink-0 items-center gap-2",children:z}):null,t("div",{className:"mp-toolbar__main flex min-w-0 flex-1 items-center gap-2",children:k}),m(y)?t("div",{className:"mp-toolbar__end flex min-w-0 shrink-0 items-center gap-2",children:y}):null]}),...N}})});
@@ -0,0 +1,2 @@
1
+ export { MPToolbar } from './MPToolbar.js';
2
+ export type { MPToolbarProps, MPToolbarSide } from './MPToolbar.js';
@@ -0,0 +1 @@
1
+ export{MPToolbar}from"./MPToolbar.js";
@@ -0,0 +1,120 @@
1
+ import * as React from 'react';
2
+ import type { MPAlign, MPColor, MPSide, MPSize, MPSlots } from '../../types.js';
3
+ /** One stop on the tour. */
4
+ export interface MPTourStep {
5
+ /**
6
+ * A CSS selector for what this step is about.
7
+ *
8
+ * Left out, the card is centred over the page with nothing cut out of the
9
+ * dimming — which is what a welcome step and a closing step are.
10
+ */
11
+ target?: string;
12
+ /** The step's heading. */
13
+ title?: React.ReactNode;
14
+ /** What it says. */
15
+ content?: React.ReactNode;
16
+ /** Which edge of the target the card sits on. @default 'bottom' */
17
+ side?: MPSide;
18
+ /** Where along that edge. @default 'center' */
19
+ align?: MPAlign;
20
+ /**
21
+ * How far the hole is inflated past the target, in pixels. A control with a
22
+ * focus ring wants a couple; a whole panel wants none.
23
+ * @default 6
24
+ */
25
+ padding?: number;
26
+ }
27
+ /**
28
+ * The parts an `MPTour` draws around its card.
29
+ *
30
+ * `className` is the card — the sheet the steps are written on — and `scrim` is
31
+ * the dimming behind it, which is a sibling of the card rather than a descendant
32
+ * and so has no other way in.
33
+ */
34
+ export type MPTourSlot = 'scrim' | 'title' | 'content' | 'close' | 'footer';
35
+ export interface MPTourProps {
36
+ /** The stops, in order. */
37
+ steps: readonly MPTourStep[];
38
+ /** Whether the tour is running. Use with `onOpenChange` for a controlled one. */
39
+ open?: boolean;
40
+ /** Whether it starts running, for an uncontrolled one. @default false */
41
+ defaultOpen?: boolean;
42
+ onOpenChange?: (open: boolean) => void;
43
+ /** Which stop, from `0`. Use with `onStepChange` for a controlled one. */
44
+ step?: number;
45
+ /** Which one it starts on. @default 0 */
46
+ defaultStep?: number;
47
+ onStepChange?: (step: number) => void;
48
+ /** Called when the last step's button is pressed, before the tour closes. */
49
+ onFinish?: () => void;
50
+ /**
51
+ * Dims the page and cuts the target out of the dimming. Off, the card is the
52
+ * only thing the tour draws.
53
+ * @default true
54
+ */
55
+ scrim?: boolean;
56
+ /** Offers the Skip button beside the counter. @default true */
57
+ skippable?: boolean;
58
+ /** Whether Escape and the × end the tour. @default true */
59
+ dismissible?: boolean;
60
+ /** Scrolls each target into view as the tour reaches it. @default true */
61
+ scrollIntoView?: boolean;
62
+ /**
63
+ * Which language the buttons and the counter are written in. Falls back to the
64
+ * nearest `MPLocaleProvider`, then to English.
65
+ */
66
+ locale?: string;
67
+ /** Individual overrides for the five words the tour says on its own behalf. */
68
+ labels?: Partial<{
69
+ previous: string;
70
+ next: string;
71
+ done: string;
72
+ skip: string;
73
+ position: string;
74
+ }>;
75
+ /** @default 'md' */
76
+ size?: MPSize;
77
+ /** Which accent family the buttons read. @default 'primary' */
78
+ color?: MPColor;
79
+ /** Class names for the card. */
80
+ className?: string;
81
+ style?: React.CSSProperties;
82
+ /**
83
+ * Class names for the parts around it. `className` is the card, so the dimming
84
+ * behind it is `classNames.scrim`.
85
+ */
86
+ classNames?: MPSlots<MPTourSlot>;
87
+ }
88
+ /**
89
+ * A guided walk over a page that already exists.
90
+ *
91
+ * ```tsx
92
+ * <MPTour
93
+ * defaultOpen
94
+ * steps={[{ target: '#search', title: 'Find anything', content: 'Press ⌘K.' }]}
95
+ * />
96
+ * ```
97
+ *
98
+ * It is [MPStepper](../display/stepper) turned inside out. That component puts
99
+ * the instructions *in* the page and the reader follows them; this one leaves
100
+ * the page exactly as it is and stands over it. The steps are therefore given by
101
+ * selector rather than as content: what a tour is about is already on screen,
102
+ * and describing it a second time inside the card would be two copies to keep in
103
+ * step.
104
+ *
105
+ * ## The dimming never takes the pointer
106
+ *
107
+ * A reader can use the control being pointed at while the card is up, and that
108
+ * is the difference between a tour and a sequence of dialogs. Nothing outside
109
+ * the card is blocked, no focus is trapped, and neither a press outside nor the
110
+ * focus leaving ends the tour — only Escape, the ×, and the card's own buttons
111
+ * do.
112
+ *
113
+ * ## What it is not
114
+ *
115
+ * It is not documentation, and it is not a place to put anything a reader will
116
+ * need twice. A tour is shown once, to somebody who has not asked for it, over
117
+ * a page they are trying to get on with — so three or four steps is the shape,
118
+ * and anything that has to be found again belongs on the page.
119
+ */
120
+ export declare function MPTour({ steps, open: openProp, defaultOpen, onOpenChange, step: stepProp, defaultStep, onStepChange, onFinish, scrim, skippable, dismissible, scrollIntoView, locale: localeProp, labels, size: sizeProp, color: colorProp, className, style, classNames }: MPTourProps): React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Popover as o}from"@base-ui/react/popover";import{MPButton as i}from"../button/MPButton.js";import{MPIcon as s}from"../icon/MPIcon.js";import{CloseIcon as r}from"../../constants/icons.js";import{accentSlots as l}from"../../internal/accent.js";import{useMPColor as a,useMPSize as c}from"../../internal/config.js";import{fillMessage as m}from"../../internal/i18n.js";import{useMPLocale as p,useMPMessages as u}from"../../internal/locale.js";import{COMMON as d}from"../../internal/messages/common.js";import{TOUR as f}from"../../internal/messages/tour.js";import{CONTROL_ICON as h,META_TEXT as g,PROSE_TEXT as x,SHEET_GAP as v,SHEET_PAD as b,SHEET_TITLE as j,hasContent as w}from"../../internal/scale.js";import{MPStateLayer as N}from"../../internal/StateLayer.js";import{FADE as y,PORTAL_LAYER as k}from"../../internal/surface.js";const _={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-md"},B={xs:"xs",sm:"xs",md:"sm",lg:"sm",xl:"md"};function S({spot:t,className:n}){return e("div",null===t?{"aria-hidden":"true",className:["mp-tour__scrim bg-mp-scrim/32 pointer-events-none fixed inset-0 z-40",n??""].filter(Boolean).join(" ")}:{"aria-hidden":"true",className:["mp-tour__scrim rounded-mp-xs pointer-events-none fixed z-40","shadow-[0_0_0_9999px_color-mix(in_oklab,var(--_mp-color-scrim)_32%,transparent)]","transition-[top,left,width,height] duration-(--mp-sys-motion-duration-medium1)","ease-mp-standard motion-reduce:transition-none",n??""].filter(Boolean).join(" "),style:{top:t.top,left:t.left,width:t.width,height:t.height}})}export function MPTour({steps:z,open:C,defaultOpen:M=!1,onOpenChange:P,step:O,defaultStep:$=0,onStepChange:R,onFinish:q,scrim:F=!0,skippable:I=!0,dismissible:T=!0,scrollIntoView:A=!0,locale:D,labels:E,size:H,color:L,className:V,style:W,classNames:G}){const J=c(H),K=a(L),Q=p(D),U=u(f,Q,E),X=u(d,Q),[Y,Z]=n.useState(M),[ee,te]=n.useState($),ne=C??Y,oe=Math.min(O??ee,Math.max(0,z.length-1)),ie=z[oe],[se,re]=n.useState(null),le=e=>{void 0===C&&Z(e),P?.(e)},ae=e=>{void 0===O&&te(e),R?.(e)},ce=ie?.target,me=ie?.padding??6;if(n.useEffect(()=>{if(!ne||!ce)return;const e=document.querySelector(ce);if(!(e instanceof HTMLElement))return;A&&e.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"});let t=0,n="";const o=()=>{const i=e.getBoundingClientRect(),s=`${i.top} ${i.left} ${i.width} ${i.height}`;s!==n&&(n=s,re({selector:ce,spot:{top:i.top-me,left:i.left-me,width:i.width+2*me,height:i.height+2*me}})),t=requestAnimationFrame(o)};return o(),()=>cancelAnimationFrame(t)},[ne,ce,me,A]),0===z.length)return null;const pe=ne&&ce&&se?.selector===ce?se.spot:null,ue=0===oe,de=oe===z.length-1,fe=B[J],he=w(ie?.title)||w(ie?.content);return t(o.Root,{open:ne,onOpenChange:(e,t)=>{e?le(!0):"outside-press"===t.reason||"focus-out"===t.reason||"escape-key"===t.reason&&!T?t.cancel():le(!1)},children:[ne&&F?e(S,{spot:pe,className:G?.scrim}):null,e(o.Portal,{children:e(o.Positioner,{className:k,side:ie?.side??"bottom",align:ie?.align??"center",sideOffset:ce?10:0,collisionPadding:12,anchor:()=>ce?document.querySelector(ce):{getBoundingClientRect:()=>new DOMRect(window.innerWidth/2,window.innerHeight/2,0,0)},children:t(o.Popup,{"data-mp-size":J,className:["mp-tour rounded-mp-md relative box-border flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-3",b[J],v[J],x[J],_[J],y,V??""].filter(Boolean).join(" "),style:{...l(K),...W},children:[he?t("div",{className:"flex items-start gap-3",children:[t("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[w(ie?.title)?e(o.Title,{className:["text-mp-on-surface m-0 font-medium",j[J],G?.title??""].filter(Boolean).join(" "),children:ie?.title}):null,w(ie?.content)?e(o.Description,{className:["text-mp-on-surface-variant m-0 min-w-0",G?.content??""].filter(Boolean).join(" "),children:ie?.content}):null]}),T?t("button",{type:"button","aria-label":X.close,onClick:()=>le(!1),className:["group/close rounded-mp-full text-mp-on-surface-variant relative -me-1 -mt-1","flex size-8 shrink-0 cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-1","focus-visible:outline-solid outline-none",G?.close??""].filter(Boolean).join(" "),children:[e(N,{className:"group-hover/close:opacity-8 group-focus-visible/close:opacity-10"}),e(s,{icon:r,size:h[J]})]}):null]}):null,t("div",{className:["flex items-center gap-2",G?.footer??""].filter(Boolean).join(" "),children:[e("span",{className:`text-mp-on-surface-variant shrink-0 tabular-nums ${g}`,children:m(U.position,{index:String(oe+1),total:String(z.length)})}),t("div",{className:"ms-auto flex items-center gap-1",children:[I&&!de?e(i,{size:fe,variant:"text",color:"secondary",onClick:()=>le(!1),children:U.skip}):null,ue?null:e(i,{size:fe,variant:"outlined",color:K,onClick:()=>ae(oe-1),children:U.previous}),e(i,{size:fe,color:K,onClick:()=>de?(q?.(),void le(!1)):ae(oe+1),children:de?U.done:U.next})]})]})]})})})]})}
@@ -0,0 +1,2 @@
1
+ export { MPTour } from './MPTour.js';
2
+ export type { MPTourProps, MPTourSlot, MPTourStep } from './MPTour.js';
@@ -0,0 +1 @@
1
+ export{MPTour}from"./MPTour.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{MPBox as l}from"../box/MPBox.js";import{MPCheckbox as s}from"../checkbox/MPCheckbox.js";import{MPIcon as r}from"../icon/MPIcon.js";import{MPIconButton as n}from"../icon-button/MPIconButton.js";import{MPTextField as i}from"../text-field/MPTextField.js";import{ArrowRightIcon as o}from"../../constants/icons.js";import{useMPLocale as c,useMPMessages as m}from"../../internal/locale.js";import{cssLength as d}from"../../internal/length.js";import{TRANSFER as h}from"../../internal/messages/transfer.js";import{hasContent as f,META_TEXT as u,SHEET_PAD_X as p}from"../../internal/scale.js";const v={xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},b={xs:"py-0.5",sm:"py-1",md:"py-1",lg:"py-1.5",xl:"py-2"};function g({title:t,rows:r,total:n,ticked:o,onTick:c,onTickAll:m,search:d,onSearch:h,searchable:f,disabled:g,height:x,messages:w,variant:k,size:j,color:y}){const S=r.filter(e=>!e.disabled),N=S.filter(e=>o.has(e.value)),z=S.length>0&&N.length===S.length,C=N.length>0&&!z,T=p[j];return a(l,{variant:k,size:j,padded:!1,className:"mp-transfer__panel flex min-w-0 flex-col overflow-hidden",children:[a("div",{className:["mp-transfer__heading border-mp-outline-variant flex items-center gap-2 border-b",T,v[j]].join(" "),children:[e("div",{className:"min-w-0 flex-1",children:e(s,{size:j,color:y,checked:z,indeterminate:C,disabled:g||0===S.length,label:e("span",{className:"block truncate font-medium",children:t}),onCheckedChange:e=>m(e)})}),a("span",{className:`text-mp-on-surface-variant shrink-0 tabular-nums ${u}`,children:[N.length,"/",n]})]}),f?e("div",{className:`${T} ${v[j]}`,children:e(i,{size:j,fullWidth:!0,disabled:g,placeholder:w.search,"aria-label":w.search,value:d,onChange:h})}):null,e("div",{className:`mp-transfer__list flex flex-col overflow-y-auto overscroll-contain ${T} ${v[j]}`,style:{height:x},children:0===r.length?e("span",{className:`text-mp-on-surface-variant ${u} ${b[j]}`,children:w.empty}):r.map((a,t)=>e("div",{className:b[j],children:e(s,{size:j,color:y,label:a.label,checked:o.has(a.value),disabled:g||a.disabled,onCheckedChange:e=>c(a.value,e)})},`${t}:${a.value}`))})]})}function x(e,a){return""===a||("string"!=typeof e.label||e.label.toLowerCase().includes(a.toLowerCase()))}export const MPTransfer=/*@__PURE__*/t.forwardRef(function({items:l,value:s,defaultValue:i,onValueChange:u,sourceLabel:p,targetLabel:v,searchable:b=!1,height:w=220,disabled:k=!1,variant:j="outlined",size:y="md",color:S="primary",locale:N,labels:z,className:C,...T},$){const _=c(N),M=m(h,_,z),[P,L]=t.useState(i??[]),A=s??P,[B,I]=t.useState(()=>new Set),[V,E]=t.useState(""),[F,R]=t.useState(""),W=t.useMemo(()=>new Set(A),[A]),q=l.filter(e=>!W.has(e.value)),D=l.filter(e=>W.has(e.value));t.useEffect(()=>{const e=new Set(l.map(e=>e.value));I(a=>{const t=[...a].filter(a=>e.has(a));return t.length===a.size?a:new Set(t)})},[l]);const G=(e,a)=>{I(t=>{const l=new Set(t);return a?l.add(e):l.delete(e),l})},H=(e,a)=>{I(t=>{const l=new Set(t);for(const t of e)t.disabled||(a?l.add(t.value):l.delete(t.value));return l})},J=(e,a)=>{const t=e.filter(e=>!e.disabled&&B.has(e.value));if(0===t.length)return;const r=new Set(t.map(e=>e.value)),n=a?l.filter(e=>W.has(e.value)||r.has(e.value)).map(e=>e.value):A.filter(e=>!r.has(e));I(e=>new Set([...e].filter(e=>!r.has(e)))),(e=>{void 0===s&&L(e),u?.(e)})(n)},K=q.filter(e=>x(e,V)),O=D.filter(e=>x(e,F)),Q=K.some(e=>!e.disabled&&B.has(e.value)),U=O.some(e=>!e.disabled&&B.has(e.value)),X=d(w),Y={ticked:B,disabled:k,height:X,messages:M,variant:j,size:y,color:S,searchable:b};return a("div",{ref:$,"data-mp-size":y,className:["mp-transfer grid w-full items-center gap-3","[grid-template-columns:minmax(0,1fr)]","min-[600px]:[grid-template-columns:minmax(0,1fr)_auto_minmax(0,1fr)]",C??""].filter(Boolean).join(" "),...T,children:[e(g,{...Y,title:f(p)?p:M.source,rows:K,total:q.length,onTick:G,onTickAll:e=>H(K,e),search:V,onSearch:E}),a("div",{className:"flex flex-row justify-center gap-2 min-[600px]:flex-col",children:[e(n,{size:y,color:S,variant:"text"===j?"text":"outlined",label:M.toTarget,disabled:k||!Q,onClick:()=>J(K,!0),icon:e(r,{icon:o,className:"rotate-90 min-[600px]:rotate-0"})}),e(n,{size:y,color:S,variant:"text"===j?"text":"outlined",label:M.toSource,disabled:k||!U,onClick:()=>J(O,!1),icon:e(r,{icon:o,className:"-rotate-90 min-[600px]:rotate-180"})})]}),e(g,{...Y,title:f(v)?v:M.target,rows:O,total:D.length,onTick:G,onTickAll:e=>H(O,e),search:F,onSearch:R})]})});
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{MPBox as l}from"../box/MPBox.js";import{MPCheckbox as r}from"../checkbox/MPCheckbox.js";import{MPIcon as s}from"../icon/MPIcon.js";import{MPIconButton as i}from"../icon-button/MPIconButton.js";import{MPTextField as n}from"../text-field/MPTextField.js";import{ArrowRightIcon as o}from"../../constants/icons.js";import{useMPLocale as c,useMPMessages as m}from"../../internal/locale.js";import{cssLength as d}from"../../internal/length.js";import{TRANSFER as u}from"../../internal/messages/transfer.js";import{useMPColor as h,useMPSize as f}from"../../internal/config.js";import{hasContent as p,META_TEXT as v,SHEET_PAD_X as g}from"../../internal/scale.js";const b={xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},x={xs:"py-0.5",sm:"py-1",md:"py-1",lg:"py-1.5",xl:"py-2"},w=new Set;function S({title:t,rows:s,total:i,ticked:o,arrived:c,onTick:m,onTickAll:d,search:u,onSearch:h,searchable:f,disabled:p,height:w,messages:S,variant:j,size:k,color:y}){const N=s.filter(e=>!e.disabled),T=N.filter(e=>o.has(e.value)),z=N.length>0&&T.length===N.length,C=T.length>0&&!z,$=g[k];return a(l,{variant:j,size:k,padded:!1,className:"mp-transfer__panel flex min-w-0 flex-col overflow-hidden",children:[a("div",{className:["mp-transfer__heading border-mp-outline-variant flex items-center gap-2 border-b",$,b[k]].join(" "),children:[e("div",{className:"min-w-0 flex-1",children:e(r,{size:k,color:y,checked:z,indeterminate:C,disabled:p||0===N.length,label:e("span",{className:"block truncate font-medium",children:t}),onCheckedChange:e=>d(e)})}),a("span",{className:`text-mp-on-surface-variant shrink-0 tabular-nums ${v}`,children:[T.length,"/",i]})]}),f?e("div",{className:`${$} ${b[k]}`,children:e(n,{size:k,fullWidth:!0,disabled:p,placeholder:S.search,"aria-label":S.search,value:u,onChange:h})}):null,e("div",{className:`mp-transfer__list flex flex-col overflow-y-auto overscroll-contain ${$} ${b[k]}`,style:{height:w},children:0===s.length?e("span",{className:`text-mp-on-surface-variant ${v} ${x[k]}`,children:S.empty}):s.map((a,t)=>e("div",{className:[x[k],c.has(a.value)?"mp-row-arrive":""].filter(Boolean).join(" "),children:e(r,{size:k,color:y,label:a.label,checked:o.has(a.value),disabled:p||a.disabled,onCheckedChange:e=>m(a.value,e)})},`${t}:${a.value}`))})]})}function j(e,a){return""===a||("string"!=typeof e.label||e.label.toLowerCase().includes(a.toLowerCase()))}export const MPTransfer=/*@__PURE__*/t.forwardRef(function({items:l,value:r,defaultValue:n,onValueChange:v,sourceLabel:g,targetLabel:b,searchable:x=!1,height:k=220,disabled:y=!1,variant:N="outlined",size:T,color:z,locale:C,labels:$,className:_,...M},P){const B=f(T),L=h(z),A=c(C),I=m(u,A,$),[V,E]=t.useState(n??[]),F=r??V,[R,W]=t.useState(()=>new Set),[q,D]=t.useState(()=>({values:new Set,toTarget:!0})),[G,H]=t.useState(""),[J,K]=t.useState(""),O=t.useMemo(()=>new Set(F),[F]),Q=l.filter(e=>!O.has(e.value)),U=l.filter(e=>O.has(e.value));t.useEffect(()=>{const e=new Set(l.map(e=>e.value));W(a=>{const t=[...a].filter(a=>e.has(a));return t.length===a.size?a:new Set(t)})},[l]);const X=(e,a)=>{W(t=>{const l=new Set(t);return a?l.add(e):l.delete(e),l})},Y=(e,a)=>{W(t=>{const l=new Set(t);for(const t of e)t.disabled||(a?l.add(t.value):l.delete(t.value));return l})},Z=(e,a)=>{const t=e.filter(e=>!e.disabled&&R.has(e.value));if(0===t.length)return;const s=new Set(t.map(e=>e.value)),i=a?l.filter(e=>O.has(e.value)||s.has(e.value)).map(e=>e.value):F.filter(e=>!s.has(e));W(e=>new Set([...e].filter(e=>!s.has(e)))),D({values:s,toTarget:a}),(e=>{void 0===r&&E(e),v?.(e)})(i)},ee=Q.filter(e=>j(e,G)),ae=U.filter(e=>j(e,J)),te=ee.some(e=>!e.disabled&&R.has(e.value)),le=ae.some(e=>!e.disabled&&R.has(e.value)),re=d(k),se={ticked:R,disabled:y,height:re,messages:I,variant:N,size:B,color:L,searchable:x};return a("div",{ref:P,"data-mp-size":B,className:["mp-transfer grid w-full items-center gap-3","[grid-template-columns:minmax(0,1fr)]","mp-medium:[grid-template-columns:minmax(0,1fr)_auto_minmax(0,1fr)]",_??""].filter(Boolean).join(" "),...M,children:[e(S,{...se,title:p(g)?g:I.source,rows:ee,total:Q.length,arrived:q.toTarget?w:q.values,onTick:X,onTickAll:e=>Y(ee,e),search:G,onSearch:H}),a("div",{className:"flex flex-row justify-center gap-2 mp-medium:flex-col",children:[e(i,{size:B,color:L,variant:"text"===N?"text":"outlined",label:I.toTarget,disabled:y||!te,onClick:()=>Z(ee,!0),icon:e(s,{icon:o,className:"rotate-90 mp-medium:rotate-0"})}),e(i,{size:B,color:L,variant:"text"===N?"text":"outlined",label:I.toSource,disabled:y||!le,onClick:()=>Z(ae,!1),icon:e(s,{icon:o,className:"-rotate-90 mp-medium:rotate-180"})})]}),e(S,{...se,title:p(b)?b:I.target,rows:ae,total:U.length,arrived:q.toTarget?q.values:w,onTick:X,onTickAll:e=>Y(ae,e),search:J,onSearch:K})]})});
@@ -0,0 +1,113 @@
1
+ import * as React from 'react';
2
+ import { type MPTreeViewValue } from '../tree-view/MPTreeView.js';
3
+ import { type MPPickerShellProps } from '../../internal/Picker.js';
4
+ import type { MPPickerLabels } from '../../internal/Calendar.js';
5
+ import type { MPSlots } from '../../types.js';
6
+ /** One node of the tree the reader is choosing from. */
7
+ export interface MPTreeSelectItem {
8
+ /** What is stored when this node is chosen. Unique across the whole tree. */
9
+ value: MPTreeViewValue;
10
+ label: React.ReactNode;
11
+ /** What a search matches against. Falls back to `label` when it is a string. */
12
+ searchLabel?: string;
13
+ startIcon?: React.ReactNode;
14
+ disabled?: boolean;
15
+ /**
16
+ * Whether this node may itself be chosen.
17
+ *
18
+ * `false` makes it a heading with children under it — a "Europe" that groups
19
+ * countries without being one. Defaults to `true` for a leaf and follows
20
+ * `selectableBranches` for a node that has children.
21
+ */
22
+ selectable?: boolean;
23
+ children?: MPTreeSelectItem[];
24
+ }
25
+ /** The parts an `MPTreeSelect` draws that a `className` cannot reach. */
26
+ export type MPTreeSelectSlot = 'popup' | 'tree' | 'item' | 'empty';
27
+ export interface MPTreeSelectProps extends MPPickerShellProps {
28
+ /** The tree, as nested items. */
29
+ items?: MPTreeSelectItem[];
30
+ /** The chosen value, or values when `multiple`. */
31
+ value?: MPTreeViewValue | MPTreeViewValue[] | null;
32
+ defaultValue?: MPTreeViewValue | MPTreeViewValue[] | null;
33
+ onValueChange?: (value: MPTreeViewValue[]) => void;
34
+ /** Whether more than one node may be held. @default false */
35
+ multiple?: boolean;
36
+ /**
37
+ * Whether a node that has children may itself be chosen.
38
+ *
39
+ * Off by default, which is the shape most of these trees have: the branches
40
+ * are the taxonomy and the leaves are the answers, and a "Europe" that can be
41
+ * chosen alongside "France" is usually a data model nobody meant. An item's
42
+ * own `selectable` overrides it either way.
43
+ * @default false
44
+ */
45
+ selectableBranches?: boolean;
46
+ /** Which branches start open. */
47
+ defaultExpanded?: MPTreeViewValue[];
48
+ expanded?: MPTreeViewValue[];
49
+ onExpandedChange?: (expanded: MPTreeViewValue[]) => void;
50
+ /** Whether the popup is open. Use with `onOpenChange` to control it. */
51
+ open?: boolean;
52
+ defaultOpen?: boolean;
53
+ onOpenChange?: (open: boolean) => void;
54
+ /** Shown in the trigger while nothing is chosen. */
55
+ placeholder?: React.ReactNode;
56
+ /** Offers the × that empties the control. @default false */
57
+ clearable?: boolean;
58
+ /** Closes the popup as soon as a node is chosen. @default !multiple */
59
+ closeOnSelect?: boolean;
60
+ /**
61
+ * Offers a field above the tree that filters it.
62
+ *
63
+ * A match keeps its ancestors, because a node with its parents cut away is a
64
+ * node the reader cannot place — "Seoul" under nothing at all.
65
+ * @default false
66
+ */
67
+ searchable?: boolean;
68
+ searchPlaceholder?: string;
69
+ /**
70
+ * Which language this draws its own strings in — the search field's
71
+ * placeholder, the line an empty tree shows, the × that empties the control.
72
+ */
73
+ locale?: string;
74
+ /** How the trigger writes what is held. Defaults to the labels, comma-joined. */
75
+ format?: (chosen: MPTreeSelectItem[]) => React.ReactNode;
76
+ labels?: Partial<MPPickerLabels>;
77
+ /** Identifies the field when a form is submitted. One input per value. */
78
+ name?: string;
79
+ classNames?: MPSlots<MPTreeSelectSlot>;
80
+ }
81
+ /**
82
+ * A value chosen from a tree rather than from a list.
83
+ *
84
+ * ```tsx
85
+ * <MPTreeSelect label="Category" items={categories} searchable />
86
+ * ```
87
+ *
88
+ * The gap between `MPSelect` and `MPTreeView`: the first is a flat list behind
89
+ * a field, the second is a hierarchy that shows what it holds but has no field.
90
+ * A category, a folder, an org-chart node and a region are all chosen from a
91
+ * shape a flat list flattens away.
92
+ *
93
+ * ## Branches are not answers by default
94
+ *
95
+ * `selectableBranches` is off, because that is the shape most of these trees
96
+ * have: the branches are the taxonomy and the leaves are the answers, and a
97
+ * "Europe" that can be chosen alongside "France" is usually a data model
98
+ * nobody meant. An item's own `selectable` overrides it either way, which is how
99
+ * a tree with one selectable branch says so.
100
+ *
101
+ * A branch that cannot be chosen still opens and shuts, and still looks like
102
+ * every other row — it is not the answer, which is not the same as being
103
+ * unavailable. Its press is answered here rather than by the tree, so that a
104
+ * press on "Europe" leaves the "France" underneath it alone.
105
+ *
106
+ * ## A search keeps the ancestors
107
+ *
108
+ * Filtered to bare matches, a tree is a list — and a list of leaves is exactly
109
+ * what a tree was chosen over. So a match brings its parents with it, and every
110
+ * branch the filter kept is opened: a match folded inside a shut parent is a
111
+ * match the reader was not shown.
112
+ */
113
+ export declare const MPTreeSelect: React.ForwardRefExoticComponent<MPTreeSelectProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{MPTreeItem as n,MPTreeView as r}from"../tree-view/MPTreeView.js";import{MPPickerShell as t}from"../../internal/Picker.js";import{useMPLocale as o,useMPMessages as i}from"../../internal/locale.js";import{COMBOBOX as s}from"../../internal/messages/combobox.js";import{TRANSFER as c}from"../../internal/messages/transfer.js";import{PICKER as d}from"../../internal/messages/picker.js";import{META_TEXT as p}from"../../internal/scale.js";import{useMPColor as m,useMPSize as u}from"../../internal/config.js";function h(e,l=new Map){for(const a of e)l.set(a.value,a),a.children&&h(a.children,l);return l}const f=e=>e.trim().toLocaleLowerCase();function v(e){return f(e.searchLabel??("string"==typeof e.label?e.label:String(e.value)))}function g(e,l){if(""===l)return e;const a=[];for(const n of e){const e=n.children?g(n.children,l):void 0,r=v(n).includes(l);(r||e&&e.length>0)&&a.push({...n,children:r?n.children:e})}return a}function b(e,l=[]){for(const a of e)a.children&&a.children.length>0&&(l.push(a.value),b(a.children,l));return l}export const MPTreeSelect=/*@__PURE__*/a.forwardRef(function({items:v=[],value:x,defaultValue:j,onValueChange:y,multiple:C=!1,selectableBranches:S=!1,defaultExpanded:w,expanded:N,onExpandedChange:M,open:O,defaultOpen:_,onOpenChange:k,placeholder:P,clearable:V=!1,closeOnSelect:z,searchable:B=!1,searchPlaceholder:E,locale:L,format:T,labels:A,name:I,size:R,color:D,readOnly:q=!1,disabled:F=!1,classNames:G,...H},J){const K=u(R),Q=m(D),U=o(L),W=i(s,U),X=i(d,U,A),Y=i(c,U),Z=e=>null==e?[]:Array.isArray(e)?e:[e],[$,ee]=a.useState(()=>Z(j)),le=void 0!==x?Z(x):$,[ae,ne]=a.useState(_??!1),re=O??ae,[te,oe]=a.useState(""),ie=a.useMemo(()=>h(v),[v]),se=f(te),ce=a.useMemo(()=>g(v,se),[v,se]),de=a.useMemo(()=>""===se?void 0:b(ce),[se,ce]),[pe,me]=a.useState(()=>w??[]),ue=de??N??pe,he=e=>{de||(void 0===N&&me(e),M?.(e))},fe=e=>{e&&(q||F)||(void 0===O&&ne(e),e||oe(""),k?.(e))},ve=e=>{void 0===x&&ee(e),y?.(e)},ge=e=>e.selectable??(!(e.children&&e.children.length>0)||S),be=e=>l=>{l.preventDefault(),e.children&&e.children.length>0&&he(ue.includes(e.value)?ue.filter(l=>l!==e.value):[...ue,e.value])},xe=le.map(e=>ie.get(e)).filter(e=>void 0!==e),je=0===xe.length?P??"":T?T(xe):xe.map(e=>e.label).reduce((e,l,a)=>0===a?[l]:[...e,", ",l],[]),ye=l=>l.map(l=>e(n,{value:l.value,label:l.label,startIcon:l.startIcon,disabled:l.disabled,onClick:ge(l)?void 0:be(l),className:G?.item,children:l.children?ye(l.children):null},l.value));return e(t,{...H,slug:"tree-select",size:K,color:Q,readOnly:q,disabled:F,triggerRef:J,display:je,empty:0===xe.length,clearable:V,onClear:()=>ve([]),open:re,onOpenChange:fe,labels:X,hiddenValues:I?le.map(e=>({name:I,value:String(e)})):void 0,children:l("div",{className:["mp-tree-select__popup flex max-h-80 w-64 flex-col gap-2",G?.popup??""].filter(Boolean).join(" "),children:[B?e("input",{type:"text",value:te,placeholder:E??Y.search,"aria-label":E??Y.search,onChange:e=>oe(e.currentTarget.value),className:["mp-tree-select__search text-mp-on-surface w-full shrink-0 bg-transparent","placeholder:text-mp-on-surface-variant px-1 py-1 [font:inherit] outline-none"].join(" ")}):null,e("div",{className:"min-h-0 flex-1 overflow-auto",children:0===ce.length?e("p",{className:["mp-tree-select__empty text-mp-on-surface-variant m-0 px-1 py-2",p,G?.empty??""].filter(Boolean).join(" "),children:W.empty}):e(r,{size:K,variant:"text",multiple:C,selected:le,onSelectedChange:e=>{const l=e.filter(e=>ie.has(e));ve(C?l:l.slice(-1)),(z??!C)&&fe(!1)},expanded:ue,onExpandedChange:he,className:G?.tree,children:ye(ce)})})]})})});
@@ -0,0 +1,2 @@
1
+ export { MPTreeSelect } from './MPTreeSelect.js';
2
+ export type { MPTreeSelectItem, MPTreeSelectProps, MPTreeSelectSlot } from './MPTreeSelect.js';
@@ -0,0 +1 @@
1
+ export{MPTreeSelect}from"./MPTreeSelect.js";
@@ -0,0 +1,153 @@
1
+ import * as React from 'react';
2
+ import type { MPDensity, MPElevation, MPSize, MPVariant } from '../../types.js';
3
+ /**
4
+ * How the hierarchy is drawn between the rows.
5
+ *
6
+ * - `none` — indentation only. The quietest, and usually right for a navigation
7
+ * sidebar, where the tree is two levels deep and the labels say what the
8
+ * structure is.
9
+ * - `simple` — one hairline rail per level, running the full height of the
10
+ * group. Enough to follow a column of rows back to the branch it belongs to.
11
+ * - `folder` — the rail plus an elbow into every row, with the rail under a
12
+ * last child stopping at that row. The file-manager drawing, and the one to
13
+ * reach for when the tree is deep.
14
+ */
15
+ export type MPTreeViewLines = 'none' | 'simple' | 'folder';
16
+ /** A row's identity, and what `expanded` and `selected` are lists of. */
17
+ export type MPTreeViewValue = string | number;
18
+ export interface MPTreeViewProps extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'defaultValue' | 'onSelect'> {
19
+ /**
20
+ * How much surface the sheet paints.
21
+ *
22
+ * A container's ladder, so the sheet is never dyed — a tree holds other
23
+ * people's labels, and those arrive with colours of their own. `text` is the
24
+ * one to reach for in a sidebar: the sidebar is already a surface, and a
25
+ * second bordered rectangle inside it is a second rectangle.
26
+ * @default 'outlined'
27
+ */
28
+ variant?: MPVariant;
29
+ /** How far off the page the sheet is lifted, on MD3's five levels. */
30
+ elevation?: MPElevation;
31
+ /** The row height and the type the labels are set in. @default 'md' */
32
+ size?: MPSize;
33
+ /** Takes room out of that row height, four pixels a step. @default 0 */
34
+ density?: MPDensity;
35
+ /**
36
+ * How the hierarchy is drawn between the rows.
37
+ * @default 'simple'
38
+ */
39
+ lines?: MPTreeViewLines;
40
+ /** Which branches are open. Use with `onExpandedChange` for a controlled tree. */
41
+ expanded?: MPTreeViewValue[];
42
+ /** Which start open, for an uncontrolled one. */
43
+ defaultExpanded?: MPTreeViewValue[];
44
+ onExpandedChange?: (expanded: MPTreeViewValue[]) => void;
45
+ /**
46
+ * Which rows are chosen. An array even when only one row may be chosen at a
47
+ * time — the same shape `MPAccordion`'s value takes, so turning `multiple` on
48
+ * does not also change the type of the value.
49
+ */
50
+ selected?: MPTreeViewValue[];
51
+ /** Which start chosen, for an uncontrolled one. */
52
+ defaultSelected?: MPTreeViewValue[];
53
+ onSelectedChange?: (selected: MPTreeViewValue[]) => void;
54
+ /**
55
+ * Whether more than one row may be chosen at a time.
56
+ * @default false
57
+ */
58
+ multiple?: boolean;
59
+ /** Every row stops answering. */
60
+ disabled?: boolean;
61
+ /** The name the tree is announced by. */
62
+ label?: string;
63
+ /** The top-level `MPTreeItem`s. */
64
+ children?: React.ReactNode;
65
+ }
66
+ export interface MPTreeItemProps extends Omit<React.ComponentPropsWithoutRef<'li'>, 'onClick'> {
67
+ /**
68
+ * Identifies the row to `expanded` and `selected`. One is generated when it is
69
+ * left out, which is fine for a tree nobody drives from code.
70
+ */
71
+ value?: MPTreeViewValue;
72
+ /**
73
+ * The row's text. Its own prop rather than `children`, because in a tree the
74
+ * children are the rows underneath it.
75
+ */
76
+ label?: React.ReactNode;
77
+ /** Content before the label — a folder glyph, a file type, a status dot. */
78
+ startIcon?: React.ReactNode;
79
+ /** Content after the label, inside the pressable area — a count, a badge. */
80
+ endIcon?: React.ReactNode;
81
+ /**
82
+ * A control pinned to the end of the row, deliberately outside the pressable
83
+ * area — the same shape `MPListItem` uses. A row that both opens and holds a
84
+ * menu button has two things to press.
85
+ */
86
+ action?: React.ReactNode;
87
+ /** Renders the row as a link, for a tree that is navigation. */
88
+ href?: string;
89
+ /** Fires when the row is pressed, before it opens or is chosen. */
90
+ onClick?: React.MouseEventHandler<HTMLElement>;
91
+ /**
92
+ * Forces the disclosure arrow onto a row with no children yet — the branch
93
+ * that is fetched the first time it is opened.
94
+ */
95
+ expandable?: boolean;
96
+ /** Unavailable. Its branch, if it is open, keeps working. */
97
+ disabled?: boolean;
98
+ /** The rows underneath this one. */
99
+ children?: React.ReactNode;
100
+ }
101
+ /**
102
+ * A tree of rows that open and shut.
103
+ *
104
+ * ```tsx
105
+ * <MPTreeView label="Files" defaultExpanded={['src']}>
106
+ * <MPTreeItem value="src" label="src">
107
+ * <MPTreeItem value="index" label="index.ts" />
108
+ * </MPTreeItem>
109
+ * </MPTreeView>
110
+ * ```
111
+ *
112
+ * There is no Base UI primitive under this — the library has no tree — and the
113
+ * three things a tree owes are most of the component: the
114
+ * `tree`/`treeitem`/`group` roles, one tab stop for the whole widget, and the
115
+ * arrow keys that walk it.
116
+ *
117
+ * ## The keyboard is handled once, at the top
118
+ *
119
+ * A tree's arrow keys are questions about the **tree** — what is the next
120
+ * visible row, where is my parent — and the only element that can answer them
121
+ * is the one holding all of them. The rows a query returns are in document
122
+ * order, which is reading order, because a shut branch is unmounted rather than
123
+ * hidden.
124
+ *
125
+ * | | |
126
+ * | --- | --- |
127
+ * | Up, Down | The previous and next visible row |
128
+ * | Home, End | The first and last |
129
+ * | Right | Opens a shut branch; steps into an open one |
130
+ * | Left | Shuts an open branch; steps out of a leaf |
131
+ * | Enter, Space | Presses the row, which chooses it and opens it |
132
+ *
133
+ * Right and Left swap under RTL, read off the element rather than off a prop: a
134
+ * caller may have set `dir` three ancestors up, and ArrowRight has to mean
135
+ * "further in" either way.
136
+ *
137
+ * ## Why the arrow is not a button
138
+ *
139
+ * The `<li>` is the `treeitem` and it is what takes focus, which is the ARIA
140
+ * pattern. A button inside it would be a second tab stop in a widget that is
141
+ * supposed to have exactly one — and the keyboard already opens a branch with
142
+ * ArrowRight. So the disclosure arrow is a plain span with a click handler: a
143
+ * pointer target, and nothing a keyboard has to walk past.
144
+ */
145
+ export declare const MPTreeView: React.ForwardRefExoticComponent<MPTreeViewProps & React.RefAttributes<HTMLUListElement>>;
146
+ /**
147
+ * One row, and everything under it.
148
+ *
149
+ * The `<li>` is the `treeitem` and it is what takes focus, which is the ARIA
150
+ * pattern — see the note on `MPTreeView` for why that makes the disclosure
151
+ * arrow a span rather than a button.
152
+ */
153
+ export declare const MPTreeItem: React.ForwardRefExoticComponent<MPTreeItemProps & React.RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{MPIcon as n}from"../icon/MPIcon.js";import{ChevronDownIcon as a}from"../../constants/icons.js";import{containerSurface as o}from"../../internal/elevation.js";import{MPStateLayer as i}from"../../internal/StateLayer.js";import{CONTROL_GAP as s,CONTROL_ICON as l,PROSE_TEXT as c,hasContent as u}from"../../internal/scale.js";import{useMPDensity as d,useMPSize as m}from"../../internal/config.js";const p=/*@__PURE__*/r.createContext({size:"md",density:0,disabled:!1,expandedKeys:new Set,selectedKeys:new Set,activeKey:null,toggle:()=>{},select:()=>{},activate:()=>{},register:()=>()=>{}}),f=/*@__PURE__*/r.createContext(!1),g={xs:28,sm:32,md:40,lg:48,xl:56},x={xs:14,sm:16,md:20,lg:24,xl:28},v={xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"},h="rounded-mp-full",b={none:"",simple:"mp-tree--simple",folder:"mp-tree--folder"};function y(e,t){return Math.max(24,g[e]+4*t)}function w(e){return Array.from(e.querySelectorAll('[role="treeitem"]')).filter(e=>null===e.closest("[data-mp-closing]"))}const k=e=>String(e);export const MPTreeView=/*@__PURE__*/r.forwardRef(function({variant:t="outlined",elevation:n,size:a,density:i,lines:s="simple",expanded:l,defaultExpanded:c,onExpandedChange:u,selected:f,defaultSelected:g,onSelectedChange:v,multiple:h=!1,disabled:C=!1,label:j,className:N,style:S,children:_,onKeyDown:A,...K},D){const P=m(a),E=d(i),[R,M]=r.useState(c??[]),[I,z]=r.useState(g??[]),[B,F]=r.useState(null),T=l??R,V=f??I,L=r.useRef(null),$=r.useCallback(e=>{L.current=e,"function"==typeof D?D(e):D&&(D.current=e)},[D]),q=r.useCallback(e=>{const t=k(e),r=l??R,n=r.some(e=>k(e)===t)?r.filter(e=>k(e)!==t):[...r,e];void 0===l&&M(n),u?.(n)},[l,R,u]),H=r.useCallback(e=>{const t=k(e),r=f??I,n=r.some(e=>k(e)===t),a=h?n?r.filter(e=>k(e)!==t):[...r,e]:[e];void 0===f&&z(a),v?.(a)},[h,f,I,v]),O=r.useRef(new Map),U=r.useCallback((e,t)=>(O.current.set(e,t),()=>{O.current.delete(e)}),[]),G=r.useMemo(()=>T.map(k).join("\0"),[T]),J=r.useMemo(()=>V.map(k).join("\0"),[V]),Q=r.useMemo(()=>({size:P,density:E,disabled:C,expandedKeys:new Set(T.map(k)),selectedKeys:new Set(V.map(k)),activeKey:B,toggle:q,select:H,activate:F,register:U}),[P,E,C,G,J,B,q,H,U]);return r.useEffect(()=>{if(null!==B&&O.current.has(B))return;const e=L.current;if(!e)return;const t=w(e);t.length>0&&F(t[0].dataset.mpValue??null)}),e(p.Provider,{value:Q,children:e("ul",{ref:$,role:"tree","aria-label":j,"aria-multiselectable":h||void 0,"data-mp-size":P,"data-mp-variant":t,className:["mp-tree rounded-mp-md m-0 box-border flex list-none flex-col p-1",o(t,n),"text-mp-on-surface",b[s],N??""].filter(Boolean).join(" "),style:{"--_mp-tree-indent":`${x[P]}px`,"--_mp-tree-row":`${y(P,E)}px`,...S},onKeyDown:function(e){if(A?.(e),e.defaultPrevented)return;const t=L.current,r=e.target?.closest?.('[role="treeitem"]');if(!t||!r||!t.contains(r))return;const n=w(t),a=n.indexOf(r);if(-1===a)return;const o=t=>{t&&(e.preventDefault(),F(t.dataset.mpValue??null),t.focus())},i=e=>{const t=e.dataset.mpValue;t&&O.current.get(t)?.toggle()},s="rtl"===getComputedStyle(t).direction,l=s?"ArrowLeft":"ArrowRight",c=s?"ArrowRight":"ArrowLeft",u=r.getAttribute("aria-expanded");switch(e.key){case"ArrowDown":o(n[a+1]);break;case"ArrowUp":o(n[a-1]);break;case"Home":o(n[0]);break;case"End":o(n[n.length-1]);break;case l:"false"===u?(e.preventDefault(),i(r)):"true"===u&&o(n[a+1]);break;case c:"true"===u?(e.preventDefault(),i(r)):o(r.parentElement?.closest('[role="treeitem"]'));break;case"Enter":case" ":e.preventDefault(),r.click()}},...K,children:_})})});export const MPTreeItem=/*@__PURE__*/r.forwardRef(function({value:o,label:d,startIcon:m,endIcon:g,action:x,href:b,expandable:y,disabled:w=!1,className:C,children:j,onClick:N,...S},_){const{size:A,disabled:K,expandedKeys:D,selectedKeys:P,activeKey:E,toggle:R,select:M,activate:I,register:z}=r.useContext(p),B=r.useId(),F=o??B,T=k(F),V=r.useRef(null),L=r.useCallback(e=>{V.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),$=r.Children.toArray(j),q=y??$.length>0,H=q&&D.has(T),O=P.has(T),U=w||K,G=r.useRef({toggle:()=>{}});G.current.toggle=()=>{!U&&q&&R(F)};const J=r.useContext(f);r.useEffect(()=>J?void 0:z(T,G.current),[J,T,z]);const[Q,W]=r.useState(H),[X,Y]=r.useState(H),Z=r.useRef(null);r.useEffect(()=>{if(H){W(!0);const e=requestAnimationFrame(()=>Y(!0));return()=>cancelAnimationFrame(e)}Y(!1);const e=Z.current;(null===e||getComputedStyle(e).transitionDuration.split(",").every(e=>0===Number.parseFloat(e)))&&W(!1)},[H]);const ee=["mp-tree__row group relative flex min-w-0 flex-1 items-center overflow-hidden text-start","h-(--_mp-tree-row) no-underline",v[A],h,s[A],c[A],"transition-[background-color,color] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none","group-focus-visible/tree-item:outline-mp-secondary","group-focus-visible/tree-item:outline-2 group-focus-visible/tree-item:-outline-offset-2","group-focus-visible/tree-item:outline-solid",U?"text-mp-on-surface/38 cursor-default":O?"bg-mp-secondary-container text-mp-on-secondary-container cursor-pointer":"text-mp-on-surface cursor-pointer"].filter(Boolean).join(" "),te=t(r.Fragment,{children:[U?null:e(i,{}),e("span",{"aria-hidden":"true",onClick:e=>{!U&&q&&(e.stopPropagation(),e.preventDefault(),V.current?.focus(),I(T),R(F))},className:["mp-tree__arrow relative flex h-[1lh] w-[1.15em] shrink-0 items-center justify-center","transition-[rotate] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none",q?"text-mp-on-surface-variant":"",H?"rotate-0":"-rotate-90 rtl:rotate-90"].filter(Boolean).join(" "),children:q?e(n,{icon:a,size:l[A]-6}):null}),u(m)?e("span",{className:"text-mp-on-surface-variant relative flex h-[1lh] shrink-0 items-center",children:m}):null,e("span",{className:"relative min-w-0 flex-1 truncate",children:d}),u(g)?e("span",{className:"text-mp-on-surface-variant relative flex h-[1lh] shrink-0 items-center",children:g}):null]});return t("li",{ref:L,role:"treeitem","aria-expanded":q?H:void 0,"aria-selected":!!O||void 0,"aria-disabled":U||void 0,"data-mp-value":T,tabIndex:E===T?0:-1,className:["mp-tree__item group/tree-item relative block",C??""].filter(Boolean).join(" "),style:{outline:"none"},onClick:function(e){e.stopPropagation(),U?e.preventDefault():(V.current?.focus(),I(T),N?.(e),e.defaultPrevented||(q&&R(F),M(F)))},...S,children:[t("div",{className:"flex w-full items-center",children:[b&&!U?e("a",{href:b,tabIndex:-1,className:ee,"aria-current":O?"page":void 0,children:te}):e("div",{className:ee,children:te}),u(x)?e("span",{className:`mp-tree__action flex shrink-0 items-center ${v[A]}`,onClick:e=>e.stopPropagation(),children:x}):null]}),q&&Q&&$.length>0?e("div",{ref:Z,"data-mp-closing":H?void 0:"",className:["mp-tree__branch grid","transition-[grid-template-rows] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none",X?"grid-rows-[1fr]":"pointer-events-none grid-rows-[0fr]"].join(" "),onTransitionEnd:e=>{e.target!==e.currentTarget||"grid-template-rows"!==e.propertyName||H||W(!1)},children:e("ul",{role:"group",className:"m-0 min-h-0 list-none overflow-hidden ps-(--_mp-tree-indent)",children:e(f.Provider,{value:J||!H,children:j})})}):null]})});
@@ -0,0 +1,2 @@
1
+ export { MPTreeItem, MPTreeView } from './MPTreeView.js';
2
+ export type { MPTreeItemProps, MPTreeViewLines, MPTreeViewProps, MPTreeViewValue } from './MPTreeView.js';
@@ -0,0 +1 @@
1
+ export{MPTreeItem,MPTreeView}from"./MPTreeView.js";