material-plus-ui 1.3.1 → 1.5.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 (261) hide show
  1. package/.fix.py +92 -0
  2. package/README.md +2 -2
  3. package/dist/components/alert/MPAlert.d.ts +26 -0
  4. package/dist/components/alert/MPAlert.js +1 -1
  5. package/dist/components/alert/index.d.ts +1 -1
  6. package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -1
  7. package/dist/components/avatar/MPAvatar.js +1 -1
  8. package/dist/components/avatar-group/MPAvatarGroup.d.ts +74 -0
  9. package/dist/components/avatar-group/MPAvatarGroup.js +2 -0
  10. package/dist/components/avatar-group/index.d.ts +2 -0
  11. package/dist/components/avatar-group/index.js +1 -0
  12. package/dist/components/breadcrumb/MPBreadcrumb.d.ts +10 -4
  13. package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
  14. package/dist/components/button/MPButton.js +1 -1
  15. package/dist/components/button-group/MPButtonGroup.d.ts +9 -0
  16. package/dist/components/button-group/MPButtonGroup.js +1 -1
  17. package/dist/components/carousel/MPCarousel.d.ts +12 -7
  18. package/dist/components/carousel/MPCarousel.js +1 -1
  19. package/dist/components/chat-bubble/MPChatBubble.d.ts +15 -2
  20. package/dist/components/chat-bubble/MPChatBubble.js +1 -1
  21. package/dist/components/checkbox/MPCheckbox.d.ts +6 -0
  22. package/dist/components/checkbox/MPCheckbox.js +1 -1
  23. package/dist/components/color-picker/MPColorPicker.d.ts +20 -17
  24. package/dist/components/color-picker/MPColorPicker.js +1 -1
  25. package/dist/components/combobox/MPCombobox.d.ts +22 -4
  26. package/dist/components/combobox/MPCombobox.js +1 -1
  27. package/dist/components/command-palette/MPCommandPalette.d.ts +132 -0
  28. package/dist/components/command-palette/MPCommandPalette.js +2 -0
  29. package/dist/components/command-palette/index.d.ts +2 -0
  30. package/dist/components/command-palette/index.js +1 -0
  31. package/dist/components/container/MPContainer.js +1 -1
  32. package/dist/components/date-time-picker/MPDateTimePicker.d.ts +5 -0
  33. package/dist/components/dialog/MPDialog.js +1 -1
  34. package/dist/components/divider/MPDivider.js +1 -1
  35. package/dist/components/drawer/MPDrawer.js +1 -1
  36. package/dist/components/fieldset/MPFieldset.d.ts +52 -0
  37. package/dist/components/fieldset/MPFieldset.js +2 -0
  38. package/dist/components/fieldset/index.d.ts +2 -0
  39. package/dist/components/fieldset/index.js +1 -0
  40. package/dist/components/file-picker/MPFilePicker.d.ts +10 -3
  41. package/dist/components/file-picker/MPFilePicker.js +1 -1
  42. package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
  43. package/dist/components/footer/MPFooter.d.ts +94 -0
  44. package/dist/components/footer/MPFooter.js +2 -0
  45. package/dist/components/footer/index.d.ts +2 -0
  46. package/dist/components/footer/index.js +1 -0
  47. package/dist/components/form/MPForm.d.ts +73 -0
  48. package/dist/components/form/MPForm.js +2 -0
  49. package/dist/components/form/index.d.ts +2 -0
  50. package/dist/components/form/index.js +1 -0
  51. package/dist/components/header/MPHeader.d.ts +122 -0
  52. package/dist/components/header/MPHeader.js +2 -0
  53. package/dist/components/header/index.d.ts +2 -0
  54. package/dist/components/header/index.js +1 -0
  55. package/dist/components/highlight/MPHighlight.d.ts +7 -0
  56. package/dist/components/menu/MPMenu.d.ts +4 -2
  57. package/dist/components/menu/MPMenu.js +1 -1
  58. package/dist/components/menubar/MPMenubar.d.ts +89 -0
  59. package/dist/components/menubar/MPMenubar.js +2 -0
  60. package/dist/components/menubar/index.d.ts +2 -0
  61. package/dist/components/menubar/index.js +1 -0
  62. package/dist/components/navigation-menu/MPNavigationMenu.d.ts +158 -0
  63. package/dist/components/navigation-menu/MPNavigationMenu.js +2 -0
  64. package/dist/components/navigation-menu/index.d.ts +2 -0
  65. package/dist/components/navigation-menu/index.js +1 -0
  66. package/dist/components/number-field/MPNumberField.d.ts +19 -4
  67. package/dist/components/number-field/MPNumberField.js +1 -1
  68. package/dist/components/overlay/MPOverlay.d.ts +8 -2
  69. package/dist/components/overlay/MPOverlay.js +1 -1
  70. package/dist/components/page-layout/MPPageLayout.d.ts +145 -0
  71. package/dist/components/page-layout/MPPageLayout.js +2 -0
  72. package/dist/components/page-layout/index.d.ts +2 -0
  73. package/dist/components/page-layout/index.js +1 -0
  74. package/dist/components/panes/MPPanes.js +1 -1
  75. package/dist/components/popover/MPPopover.js +1 -1
  76. package/dist/components/progress-box/MPProgressBox.js +1 -1
  77. package/dist/components/progress-circular/MPProgressCircular.js +1 -1
  78. package/dist/components/progress-linear/MPProgressLinear.js +1 -1
  79. package/dist/components/radio-group/MPRadioGroup.d.ts +12 -0
  80. package/dist/components/radio-group/MPRadioGroup.js +1 -1
  81. package/dist/components/segmented-button/MPSegmentedButton.d.ts +7 -0
  82. package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
  83. package/dist/components/select/MPSelect.d.ts +19 -1
  84. package/dist/components/select/MPSelect.js +1 -1
  85. package/dist/components/shortcut/MPShortcut.js +1 -1
  86. package/dist/components/sidebar/MPSidebar.d.ts +160 -0
  87. package/dist/components/sidebar/MPSidebar.js +2 -0
  88. package/dist/components/sidebar/MPSidebarTrigger.d.ts +45 -0
  89. package/dist/components/sidebar/MPSidebarTrigger.js +2 -0
  90. package/dist/components/sidebar/index.d.ts +4 -0
  91. package/dist/components/sidebar/index.js +1 -0
  92. package/dist/components/skeleton/MPSkeleton.js +1 -1
  93. package/dist/components/slider/MPSlider.d.ts +6 -0
  94. package/dist/components/slider/MPSlider.js +1 -1
  95. package/dist/components/snackbar/MPSnackbar.js +1 -1
  96. package/dist/components/switch/MPSwitch.d.ts +6 -0
  97. package/dist/components/switch/MPSwitch.js +1 -1
  98. package/dist/components/table/MPTable.d.ts +27 -5
  99. package/dist/components/table/MPTable.js +1 -1
  100. package/dist/components/text-field/MPTextField.d.ts +21 -2
  101. package/dist/components/text-field/MPTextField.js +1 -1
  102. package/dist/components/text-link/MPTextLink.d.ts +7 -1
  103. package/dist/components/text-link/MPTextLink.js +1 -1
  104. package/dist/components/time-picker/MPTimePicker.d.ts +4 -0
  105. package/dist/components/toggle/MPToggle.d.ts +72 -0
  106. package/dist/components/toggle/MPToggle.js +2 -0
  107. package/dist/components/toggle/index.d.ts +2 -0
  108. package/dist/components/toggle/index.js +1 -0
  109. package/dist/components/toggle-group/MPToggleGroup.d.ts +74 -0
  110. package/dist/components/toggle-group/MPToggleGroup.js +2 -0
  111. package/dist/components/toggle-group/index.d.ts +2 -0
  112. package/dist/components/toggle-group/index.js +1 -0
  113. package/dist/components/tooltip/MPTooltip.js +1 -1
  114. package/dist/components/transfer/MPTransfer.d.ts +98 -0
  115. package/dist/components/transfer/MPTransfer.js +2 -0
  116. package/dist/components/transfer/index.d.ts +2 -0
  117. package/dist/components/transfer/index.js +1 -0
  118. package/dist/constants/glyphs.d.ts +10 -0
  119. package/dist/constants/glyphs.js +1 -1
  120. package/dist/constants/icons.d.ts +1 -0
  121. package/dist/constants/icons.js +1 -1
  122. package/dist/index.d.ts +13 -0
  123. package/dist/index.js +1 -1
  124. package/dist/internal/Calendar.js +1 -1
  125. package/dist/internal/FieldOutline.js +1 -1
  126. package/dist/internal/SupportingText.d.ts +1 -1
  127. package/dist/internal/SupportingText.js +1 -1
  128. package/dist/internal/animate.d.ts +0 -17
  129. package/dist/internal/animate.js +1 -1
  130. package/dist/internal/avatar-group.d.ts +22 -0
  131. package/dist/internal/avatar-group.js +2 -0
  132. package/dist/internal/button-group.d.ts +20 -1
  133. package/dist/internal/button-group.js +1 -1
  134. package/dist/internal/color.d.ts +0 -5
  135. package/dist/internal/color.js +1 -1
  136. package/dist/internal/date.js +1 -1
  137. package/dist/internal/i18n.d.ts +201 -4
  138. package/dist/internal/keys.d.ts +72 -0
  139. package/dist/internal/keys.js +2 -0
  140. package/dist/internal/length.d.ts +42 -0
  141. package/dist/internal/length.js +1 -0
  142. package/dist/internal/link.d.ts +44 -0
  143. package/dist/internal/link.js +1 -0
  144. package/dist/internal/locale.d.ts +20 -1
  145. package/dist/internal/locale.js +1 -1
  146. package/dist/internal/messages/breadcrumb.d.ts +3 -0
  147. package/dist/internal/messages/breadcrumb.js +1 -0
  148. package/dist/internal/messages/carousel.d.ts +3 -0
  149. package/dist/internal/messages/carousel.js +1 -0
  150. package/dist/internal/messages/color-picker.d.ts +3 -0
  151. package/dist/internal/messages/color-picker.js +1 -0
  152. package/dist/internal/messages/combobox.d.ts +3 -0
  153. package/dist/internal/messages/combobox.js +1 -0
  154. package/dist/internal/messages/command.d.ts +3 -0
  155. package/dist/internal/messages/command.js +1 -0
  156. package/dist/internal/messages/file-picker.d.ts +3 -0
  157. package/dist/internal/messages/file-picker.js +1 -0
  158. package/dist/internal/messages/layout.d.ts +3 -0
  159. package/dist/internal/messages/layout.js +1 -0
  160. package/dist/internal/messages/number-field.d.ts +3 -0
  161. package/dist/internal/messages/number-field.js +1 -0
  162. package/dist/internal/messages/overlay.d.ts +3 -0
  163. package/dist/internal/messages/overlay.js +1 -0
  164. package/dist/internal/messages/table.d.ts +3 -0
  165. package/dist/internal/messages/table.js +1 -0
  166. package/dist/internal/messages/text-link.d.ts +3 -0
  167. package/dist/internal/messages/text-link.js +1 -0
  168. package/dist/internal/messages/transfer.d.ts +3 -0
  169. package/dist/internal/messages/transfer.js +1 -0
  170. package/dist/internal/page-layout.d.ts +182 -0
  171. package/dist/internal/page-layout.js +2 -0
  172. package/dist/internal/scale.d.ts +17 -0
  173. package/dist/internal/scale.js +1 -1
  174. package/dist/locales/ar.js +1 -1
  175. package/dist/locales/de.js +1 -1
  176. package/dist/locales/es.js +1 -1
  177. package/dist/locales/fr.js +1 -1
  178. package/dist/locales/hi.js +1 -1
  179. package/dist/locales/id.js +1 -1
  180. package/dist/locales/it.js +1 -1
  181. package/dist/locales/ja.js +1 -1
  182. package/dist/locales/ko.js +1 -1
  183. package/dist/locales/nl.js +1 -1
  184. package/dist/locales/pl.js +1 -1
  185. package/dist/locales/pt.js +1 -1
  186. package/dist/locales/ru.js +1 -1
  187. package/dist/locales/th.js +1 -1
  188. package/dist/locales/tr.js +1 -1
  189. package/dist/locales/vi.js +1 -1
  190. package/dist/locales/zh-hans.js +1 -1
  191. package/dist/locales/zh-hant.js +1 -1
  192. package/dist/styles/accordion.css +1 -1
  193. package/dist/styles/alert.css +1 -1
  194. package/dist/styles/avatar-group.css +2 -0
  195. package/dist/styles/avatar.css +1 -1
  196. package/dist/styles/badge.css +1 -1
  197. package/dist/styles/blockquote.css +1 -1
  198. package/dist/styles/bottom-navigation.css +1 -1
  199. package/dist/styles/box.css +1 -1
  200. package/dist/styles/breadcrumb.css +1 -1
  201. package/dist/styles/button-group.css +1 -1
  202. package/dist/styles/button.css +1 -1
  203. package/dist/styles/card.css +1 -1
  204. package/dist/styles/carousel.css +1 -1
  205. package/dist/styles/chat-bubble.css +1 -1
  206. package/dist/styles/checkbox.css +1 -1
  207. package/dist/styles/chip.css +1 -1
  208. package/dist/styles/collapsible.css +1 -1
  209. package/dist/styles/color-picker.css +1 -1
  210. package/dist/styles/combobox.css +1 -1
  211. package/dist/styles/command-palette.css +2 -0
  212. package/dist/styles/date-picker.css +1 -1
  213. package/dist/styles/date-range-picker.css +1 -1
  214. package/dist/styles/date-time-picker.css +1 -1
  215. package/dist/styles/dialog.css +1 -1
  216. package/dist/styles/divider.css +1 -1
  217. package/dist/styles/drawer.css +1 -1
  218. package/dist/styles/empty.css +1 -1
  219. package/dist/styles/fieldset.css +2 -0
  220. package/dist/styles/file-picker.css +1 -1
  221. package/dist/styles/floating-action-button.css +1 -1
  222. package/dist/styles/footer.css +2 -0
  223. package/dist/styles/form.css +2 -0
  224. package/dist/styles/header.css +2 -0
  225. package/dist/styles/highlight.css +1 -1
  226. package/dist/styles/icon-button.css +1 -1
  227. package/dist/styles/list.css +1 -1
  228. package/dist/styles/locale.css +1 -1
  229. package/dist/styles/menu.css +1 -1
  230. package/dist/styles/menubar.css +2 -0
  231. package/dist/styles/navigation-menu.css +2 -0
  232. package/dist/styles/number-field.css +1 -1
  233. package/dist/styles/otp-field.css +1 -1
  234. package/dist/styles/overlay.css +1 -1
  235. package/dist/styles/page-layout.css +2 -0
  236. package/dist/styles/pagination.css +1 -1
  237. package/dist/styles/panes.css +1 -1
  238. package/dist/styles/pill.css +1 -1
  239. package/dist/styles/popover.css +1 -1
  240. package/dist/styles/progress-box.css +1 -1
  241. package/dist/styles/progress-circular.css +1 -1
  242. package/dist/styles/progress-linear.css +1 -1
  243. package/dist/styles/radio-group.css +1 -1
  244. package/dist/styles/segmented-button.css +1 -1
  245. package/dist/styles/select.css +1 -1
  246. package/dist/styles/sidebar.css +2 -0
  247. package/dist/styles/skeleton.css +1 -1
  248. package/dist/styles/slider.css +1 -1
  249. package/dist/styles/spoiler.css +1 -1
  250. package/dist/styles/switch.css +1 -1
  251. package/dist/styles/table.css +1 -1
  252. package/dist/styles/tabs.css +1 -1
  253. package/dist/styles/text-field.css +1 -1
  254. package/dist/styles/text-link.css +1 -1
  255. package/dist/styles/time-picker.css +1 -1
  256. package/dist/styles/timeline.css +1 -1
  257. package/dist/styles/toggle-group.css +2 -0
  258. package/dist/styles/toggle.css +2 -0
  259. package/dist/styles/transfer.css +2 -0
  260. package/dist/styles.css +1 -1
  261. package/package.json +2 -2
@@ -0,0 +1,158 @@
1
+ import * as React from 'react';
2
+ import type { MPColor, MPOrientation, MPSize } from '../../types.js';
3
+ export interface MPNavigationMenuProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'defaultValue' | 'onChange'> {
4
+ /**
5
+ * Which way the row runs. `vertical` is a rail whose panels open beside it
6
+ * rather than under it; the arrow keys follow either way.
7
+ * @default 'horizontal'
8
+ */
9
+ orientation?: MPOrientation;
10
+ /** Which item's panel is open, by its `value`. Nullish is closed. */
11
+ value?: string | null;
12
+ /** Which starts open, for an uncontrolled menu. */
13
+ defaultValue?: string | null;
14
+ onValueChange?: (value: string | null) => void;
15
+ /**
16
+ * How long the pointer rests on an item before its panel opens, in
17
+ * milliseconds.
18
+ */
19
+ delay?: number;
20
+ /** And how long a panel stays after the pointer leaves. */
21
+ closeDelay?: number;
22
+ /**
23
+ * Distance from the row, in pixels.
24
+ * @default 8
25
+ */
26
+ sideOffset?: number;
27
+ /**
28
+ * The row's height and type scale.
29
+ * @default 'md'
30
+ */
31
+ size?: MPSize;
32
+ /**
33
+ * Which accent family an open item's label reads. The panel itself stays
34
+ * neutral, as MD3's menu surface does.
35
+ * @default 'primary'
36
+ */
37
+ color?: MPColor;
38
+ /**
39
+ * The name the `<nav>` is announced by, through `aria-label` in the rest
40
+ * props.
41
+ *
42
+ * There is deliberately no default. A generic one would say nothing a screen
43
+ * reader was not already saying — it announces an unnamed `<nav>` as
44
+ * "navigation" on its own — so a name is only worth having when it
45
+ * distinguishes this bar from another region on the page.
46
+ *
47
+ * Which is exactly when it becomes necessary: a page with a main bar, a
48
+ * footer's links and a table of contents offers three regions called
49
+ * "navigation" and no way to tell them apart. Name them the moment there is
50
+ * more than one.
51
+ */
52
+ children?: React.ReactNode;
53
+ }
54
+ export interface MPNavigationMenuItemProps {
55
+ /** The word in the row. */
56
+ label: React.ReactNode;
57
+ /**
58
+ * Makes the item a plain link rather than something that opens a panel.
59
+ *
60
+ * An item with an `href` and no children is a **destination**, and it is
61
+ * announced as one — which is the whole reason a site's navigation is not an
62
+ * [MPMenu](../inputs/menu).
63
+ */
64
+ href?: string;
65
+ /** Where the link opens. Ignored without `href`. */
66
+ target?: string;
67
+ /**
68
+ * The link's relationship to the page. Ignored without `href`.
69
+ *
70
+ * Left unset, a `target="_blank"` destination gets `noopener noreferrer` —
71
+ * the pair that stops the opened page reaching back through `window.opener`.
72
+ * Setting it replaces that rather than adding to it, so a destination that
73
+ * also needs `nofollow` should say `rel="noopener noreferrer nofollow"`.
74
+ */
75
+ rel?: string;
76
+ /** A glyph before the label. */
77
+ startIcon?: React.ReactNode;
78
+ /**
79
+ * Identifies the item, for a controlled menu. Base UI gives each item an
80
+ * identity of its own, so an uncontrolled menu needs none.
81
+ */
82
+ value?: string;
83
+ /** Unavailable. The word stays in the row and opens nothing. */
84
+ disabled?: boolean;
85
+ /**
86
+ * How many columns the panel lays its links out in.
87
+ * @default 1
88
+ */
89
+ columns?: number;
90
+ /** The panel's contents — usually `MPNavigationMenuLink`s. */
91
+ children?: React.ReactNode;
92
+ /**
93
+ * Added to the word in the row — the link, or the trigger that opens the panel
94
+ * — rather than to the panel. The panel is portalled out of this element and
95
+ * carries `mp-navigation-menu__panel`.
96
+ */
97
+ className?: string;
98
+ style?: React.CSSProperties;
99
+ }
100
+ export interface MPNavigationMenuLinkProps extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color' | 'title'> {
101
+ /** Where it goes. */
102
+ href: string;
103
+ /** The row's name. */
104
+ title: React.ReactNode;
105
+ /** A second line under it, one step down the scale and muted. */
106
+ description?: React.ReactNode;
107
+ /** A glyph before the title. */
108
+ startIcon?: React.ReactNode;
109
+ }
110
+ /**
111
+ * One row inside a panel: where it goes, what it is called, and a line saying
112
+ * what is there.
113
+ *
114
+ * A real `<a>`, which is the point of the whole component — a site's navigation
115
+ * is a list of destinations, and a destination that is a `<div>` with a click
116
+ * handler is not in the link list, not on the status bar and not in a crawler's
117
+ * index.
118
+ */
119
+ export declare const MPNavigationMenuLink: React.ForwardRefExoticComponent<MPNavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
120
+ /**
121
+ * One word in the row, and what opens under it.
122
+ *
123
+ * With children it is a trigger and a panel; with an `href` and nothing else it
124
+ * is a link — and the difference is not cosmetic. The second is announced as a
125
+ * destination and the first as something that expands.
126
+ */
127
+ export declare function MPNavigationMenuItem({ label, href, target, rel, startIcon, value, disabled, columns, children, className, style }: MPNavigationMenuItemProps): React.JSX.Element;
128
+ /**
129
+ * A site's navigation: a row of destinations, some of which open a panel of more
130
+ * of them.
131
+ *
132
+ * ## Why this is not an MPMenu
133
+ *
134
+ * Because of what the rows **are**.
135
+ *
136
+ * An [MPMenu](../inputs/menu) holds actions, so its rows are `menuitem`s and the
137
+ * whole thing is a widget that takes the arrow keys. This holds links, so it is
138
+ * a `<nav>` full of real `<a>`s — which is what puts each destination in a
139
+ * screen reader's link list, on the browser's status bar, on the middle-click
140
+ * menu and in a crawler's index.
141
+ *
142
+ * The rule is short: reach for a menu when the row **does** something, and for
143
+ * this when the row **goes** somewhere.
144
+ *
145
+ * ## One panel, resized
146
+ *
147
+ * One panel is open at a time and it resizes between items rather than closing
148
+ * and reopening, which is Base UI's doing. It is also why the popup animates its
149
+ * width and height as well as its opacity: crossing the row should read as one
150
+ * surface following the pointer, not as three sheets flashing.
151
+ *
152
+ * ## Where it goes
153
+ *
154
+ * In an [MPHeader](../layout/header)'s middle slot, which is what that slot is
155
+ * for. Down the side of a page it is `orientation="vertical"`, which is a rail
156
+ * whose panels open beside it.
157
+ */
158
+ export declare const MPNavigationMenu: React.ForwardRefExoticComponent<MPNavigationMenuProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as n,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{MPIcon as r}from"../icon/MPIcon.js";import{ChevronDownIcon as o}from"../../constants/icons.js";import{accentSlots as s}from"../../internal/accent.js";import{linkRel as l}from"../../internal/link.js";import{MPStateLayer as c}from"../../internal/StateLayer.js";import{CONTROL_GAP as m,CONTROL_HEIGHT as p,CONTROL_ICON as d,CONTROL_PAD_X as u,CONTROL_TEXT as f,hasContent as h,META_TEXT as g}from"../../internal/scale.js";import{PORTAL_LAYER as x}from"../../internal/surface.js";const v=/*@__PURE__*/t.createContext({size:"md"}),y=/*@__PURE__*/["mp-navigation-menu__popup rounded-mp-xs shadow-mp-2","bg-mp-surface-container text-mp-on-surface box-border overflow-hidden outline-none","transition-[opacity,width,height] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard data-starting-style:opacity-0 data-ending-style:opacity-0"].join(" "),N={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"};export const MPNavigationMenuLink=/*@__PURE__*/t.forwardRef(function({href:a,title:r,description:o,startIcon:s,target:p,rel:d,className:x,children:y,...N},j){const{size:b}=t.useContext(v);return n(i.Link,{ref:j,href:a,target:p,rel:l(p,d),className:["mp-navigation-menu__link group text-mp-on-surface rounded-mp-xs relative flex","min-w-0 cursor-pointer items-start bg-transparent py-2 no-underline outline-none",m[b],u[b],x??""].filter(Boolean).join(" "),...N,children:[e(c,{}),h(s)?e("span",{className:"relative flex h-[1lh] shrink-0 items-center",children:s}):null,n("span",{className:"relative flex min-w-0 flex-col gap-0.5",children:[e("span",{className:`font-medium ${f[b]}`,children:r}),h(o)?e("span",{className:`text-mp-on-surface-variant ${g}`,children:o}):null,y]})]})});export function MPNavigationMenuItem({label:s,href:g,target:x,rel:y,startIcon:j,value:b,disabled:w=!1,columns:M=1,children:P,className:_,style:z}){const{size:k}=t.useContext(v),C=void 0!==g&&!h(P),I=Number.isFinite(M)?Math.max(1,Math.round(M)):1,L=["mp-navigation-menu__item group text-mp-on-surface relative inline-flex shrink-0","rounded-mp-full cursor-pointer items-center justify-center bg-transparent","appearance-none font-[inherit] whitespace-nowrap no-underline select-none","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none","transition-colors duration-(--mp-sys-motion-duration-short4)","data-popup-open:text-(--_mp-accent)","data-disabled:text-mp-on-surface/38 data-disabled:cursor-default",p[k],f[k],m[k],u[k],_??""].filter(Boolean).join(" ");return e(i.Item,{value:b,children:C?n(i.Link,{href:g,target:x,rel:l(x,y),className:L,style:z,children:[e(c,{}),h(j)?e("span",{className:"relative flex",children:j}):null,e("span",{className:"relative",children:s})]}):n(a,{children:[n(i.Trigger,{disabled:w,className:L,style:z,children:[w?null:e(c,{className:"group-data-popup-open:opacity-8"}),h(j)?e("span",{className:"relative flex",children:j}):null,e("span",{className:"relative",children:s}),e(i.Icon,{className:["relative flex items-center transition-transform","duration-(--mp-sys-motion-duration-short4) ease-mp-standard","data-popup-open:rotate-180"].join(" "),children:e(r,{icon:o,size:d[k]})})]}),e(i.Content,{className:`mp-navigation-menu__panel grid gap-1 ${N[k]}`,style:I>1?{gridTemplateColumns:`repeat(${I}, minmax(0, 1fr))`}:void 0,children:P})]})})}export const MPNavigationMenu=/*@__PURE__*/t.forwardRef(function({orientation:a="horizontal",value:r,defaultValue:o,onValueChange:l,delay:c,closeDelay:p,sideOffset:d=8,size:u="md",color:f="primary",className:h,style:g,children:N,...j},b){const w=t.useMemo(()=>({size:u}),[u]);return e(v.Provider,{value:w,children:n(i.Root,{ref:b,orientation:a,value:r,defaultValue:o,onValueChange:e=>l?.(e),delay:c,closeDelay:p,"data-mp-size":u,className:["mp-navigation-menu",h??""].filter(Boolean).join(" "),style:{...s(f),...g},...j,children:[e(i.List,{className:["flex items-center","vertical"===a?"flex-col items-stretch":"flex-row",m[u]].join(" "),children:N}),e(i.Portal,{children:e(i.Positioner,{className:x,sideOffset:d,collisionPadding:12,style:s(f),children:e(i.Popup,{className:y,children:e(i.Viewport,{})})})})]})})});
@@ -0,0 +1,2 @@
1
+ export { MPNavigationMenu, MPNavigationMenuItem, MPNavigationMenuLink } from './MPNavigationMenu.js';
2
+ export type { MPNavigationMenuItemProps, MPNavigationMenuLinkProps, MPNavigationMenuProps } from './MPNavigationMenu.js';
@@ -0,0 +1 @@
1
+ export{MPNavigationMenu,MPNavigationMenuItem,MPNavigationMenuLink}from"./MPNavigationMenu.js";
@@ -49,16 +49,25 @@ export interface MPNumberFieldProps extends MPStyleProps {
49
49
  * report `1240`.
50
50
  */
51
51
  format?: Intl.NumberFormatOptions;
52
- /** Which locale the number is written and parsed in. Defaults to the runtime's. */
52
+ /**
53
+ * Which locale the number is written and parsed in. Defaults to the runtime's.
54
+ *
55
+ * A plain BCP 47 string also names the language the two steppers are announced
56
+ * in; anything wider falls back to the nearest `MPLocaleProvider`, then to
57
+ * English.
58
+ */
53
59
  locale?: Intl.LocalesArgument;
54
60
  /**
55
61
  * Where the steppers sit, or `none` for a field without them.
56
62
  * @default 'end'
57
63
  */
58
64
  steppers?: MPNumberFieldSteppers;
59
- /** The accessible name of the increment button. @default 'Increase' */
65
+ /**
66
+ * The accessible name of the increment button. Defaults to the word for it in
67
+ * `locale`.
68
+ */
60
69
  incrementLabel?: string;
61
- /** The accessible name of the decrement button. @default 'Decrease' */
70
+ /** The same for the decrement button. */
62
71
  decrementLabel?: string;
63
72
  /**
64
73
  * Label for the field, drawn in the outline's notch and — while the field is
@@ -98,6 +107,12 @@ export interface MPNumberFieldProps extends MPStyleProps {
98
107
  name?: string;
99
108
  /** The id put on the control and pointed at by the label. */
100
109
  id?: string;
110
+ /**
111
+ * Added to the field's outermost element — the box around the control, its
112
+ * steppers and its supporting line, rather than to the `<input>` itself.
113
+ */
114
+ className?: string;
115
+ style?: React.CSSProperties;
101
116
  }
102
117
  /**
103
118
  * A Material Design field that only holds a number.
@@ -114,4 +129,4 @@ export interface MPNumberFieldProps extends MPStyleProps {
114
129
  * owns the parsing against the locale, the clamping, the press-and-hold repeat on
115
130
  * the steppers, and the hidden input that submits with a form.
116
131
  */
117
- export declare function MPNumberField({ value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, smallStep, allowWheelScrub, format, locale, steppers, incrementLabel, decrementLabel, label, floatingLabel, description, errorMessage, placeholder, startIcon, size, fullWidth, required, disabled, readOnly, name, id }: MPNumberFieldProps): React.JSX.Element;
132
+ export declare function MPNumberField({ value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, smallStep, allowWheelScrub, format, locale, steppers, incrementLabel, decrementLabel, label, floatingLabel, description, errorMessage, placeholder, startIcon, size, fullWidth, required, disabled, readOnly, name, id, className, style }: MPNumberFieldProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{NumberField as n}from"@base-ui/react/number-field";import{Field as r}from"@base-ui/react/field";import{MPIcon as t}from"../icon/MPIcon.js";import{AddIcon as i,RemoveIcon as s}from"../../constants/icons.js";import{MPFieldLabel as o,MPFieldOutline as p,useFloatingLabel as d}from"../../internal/FieldOutline.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{MPSupportingText as c}from"../../internal/SupportingText.js";import{CONTROL_ICON as u,PROSE_TEXT as f,hasContent as h}from"../../internal/scale.js";const x={xs:{padding:"px-2",height:"h-8",stepper:"size-6"},sm:{padding:"px-3",height:"h-10",stepper:"size-8"},md:{padding:"px-4",height:"h-14",stepper:"size-10"},lg:{padding:"px-4",height:"h-16",stepper:"size-11"},xl:{padding:"px-5",height:"h-18",stepper:"size-12"}};export function MPNumberField({value:g,defaultValue:b,onValueChange:j,onValueCommitted:v,min:N,max:z,step:y,largeStep:S,smallStep:w,allowWheelScrub:I=!1,format:V,locale:k,steppers:q="end",incrementLabel:C="Increase",decrementLabel:L="Decrease",label:M,floatingLabel:F=!0,description:O,errorMessage:P,placeholder:W,startIcon:D,size:R="md",fullWidth:_=!1,required:B=!1,disabled:G=!1,readOnly:T=!1,name:$,id:A}){const E=h(P),H=x[R],J=l.useId(),K=A??J,Q="none"!==q&&!T&&!G,[U,X]=l.useState(b??null),Y=void 0===g?U:g,{shrunk:Z,focusProps:ee}=d({floating:F&&h(M),filled:null!==Y,pinned:!!D||Q&&"split"===q}),ae=/*@__PURE__*/["mp-number-field__stepper group relative flex shrink-0 items-center justify-center","rounded-mp-full cursor-pointer appearance-none bg-transparent p-0 font-[inherit]","text-mp-on-surface-variant outline-none","disabled:text-mp-on-surface/38 disabled:cursor-default",H.stepper].join(" "),le=a(n.Decrement,{"aria-label":L,className:ae,children:[e(m,{}),e(t,{icon:s,size:u[R]})]}),ne=a(n.Increment,{"aria-label":C,className:ae,children:[e(m,{}),e(t,{icon:i,size:u[R]})]});return a(r.Root,{className:["mp-number-field group flex-col align-top",_?"flex w-full":"inline-flex w-fit"].join(" "),disabled:G,invalid:E,"data-mp-size":R,...ee,children:[e(n.Root,{id:K,name:$,className:"contents",value:g,defaultValue:b,onValueChange:e=>{X(e),j?.(e)},onValueCommitted:e=>v?.(e),min:N,max:z,step:y,largeStep:S,smallStep:w,allowWheelScrub:I,format:V,locale:k,disabled:G,readOnly:T,required:B,children:a("div",{className:"relative w-full",children:[a(n.Group,{className:["flex w-full items-center gap-2",H.height,Q&&"end"===q?`${H.padding} pe-1`:Q&&"split"===q?"px-1":H.padding].join(" "),children:[Q&&"split"===q?le:null,D?e("span",{className:["flex shrink-0 items-center",G?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:D}):null,e(n.Input,{placeholder:Z?W:void 0,className:["w-full min-w-0 flex-1 tabular-nums",f[R],"font-[family-name:var(--mp-sys-typescale-body-large-font)]","appearance-none border-0 bg-transparent px-0 outline-none","caret-mp-primary text-mp-on-surface","placeholder:text-mp-on-surface-variant","disabled:text-mp-on-surface/38 disabled:placeholder:text-mp-on-surface/38",Q&&"split"===q?"text-center":""].filter(Boolean).join(" ")}),Q&&"end"===q?a("span",{className:"flex shrink-0 items-center",children:[le,ne]}):null,Q&&"split"===q?ne:null]}),e(p,{label:M,required:B,notched:Z}),h(M)?e(o,{size:R,label:M,required:B,htmlFor:K,shrunk:Z}):null]})}),e(c,{description:O,errorMessage:P,className:H.padding})]})}
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{NumberField as r}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{MPIcon as t}from"../icon/MPIcon.js";import{AddIcon as i,RemoveIcon as s}from"../../constants/icons.js";import{MPFieldLabel as o,MPFieldOutline as p,useFloatingLabel as m}from"../../internal/FieldOutline.js";import{useMPLocale as d,useMPMessages as c}from"../../internal/locale.js";import{NUMBER_FIELD as u}from"../../internal/messages/number-field.js";import{MPStateLayer as f}from"../../internal/StateLayer.js";import{MPSupportingText as h}from"../../internal/SupportingText.js";import{CONTROL_ICON as g,PROSE_TEXT as x,hasContent as b}from"../../internal/scale.js";const j={xs:{padding:"px-2",height:"h-8",stepper:"size-6"},sm:{padding:"px-3",height:"h-10",stepper:"size-8"},md:{padding:"px-4",height:"h-14",stepper:"size-10"},lg:{padding:"px-4",height:"h-16",stepper:"size-11"},xl:{padding:"px-5",height:"h-18",stepper:"size-12"}};export function MPNumberField({value:v,defaultValue:y,onValueChange:N,onValueCommitted:z,min:S,max:w,step:V,largeStep:k,smallStep:I,allowWheelScrub:q=!1,format:C,locale:L,steppers:M="end",incrementLabel:F,decrementLabel:O,label:P,floatingLabel:W=!0,description:B,errorMessage:R,placeholder:_,startIcon:D,size:G="md",fullWidth:T=!1,required:$=!1,disabled:A=!1,readOnly:E=!1,name:H,id:J,className:K,style:Q}){const U=c(u,d("string"==typeof L?L:void 0)),X=b(R),Y=j[G],Z=a.useId(),ee=J??Z,le="none"!==M&&!E&&!A,[ae,re]=a.useState(y??null),ne=void 0===v?ae:v,{shrunk:te,focusProps:ie}=m({floating:W&&b(P),filled:null!==ne,pinned:!!D||le&&"split"===M}),se=/*@__PURE__*/["mp-number-field__stepper group relative flex shrink-0 items-center justify-center","rounded-mp-full cursor-pointer appearance-none bg-transparent p-0 font-[inherit]","text-mp-on-surface-variant outline-none","disabled:text-mp-on-surface/38 disabled:cursor-default",Y.stepper].join(" "),oe=l(r.Decrement,{"aria-label":O??U.decrease,className:se,children:[e(f,{}),e(t,{icon:s,size:g[G]})]}),pe=l(r.Increment,{"aria-label":F??U.increase,className:se,children:[e(f,{}),e(t,{icon:i,size:g[G]})]});return l(n.Root,{className:["mp-number-field group flex-col align-top",T?"flex w-full":"inline-flex w-fit",K??""].filter(Boolean).join(" "),style:Q,disabled:A,invalid:X,"data-mp-size":G,...ie,children:[e(r.Root,{id:ee,name:H,className:"contents",value:v,defaultValue:y,onValueChange:e=>{re(e),N?.(e)},onValueCommitted:e=>z?.(e),min:S,max:w,step:V,largeStep:k,smallStep:I,allowWheelScrub:q,format:C,locale:L,disabled:A,readOnly:E,required:$,children:l("div",{className:"relative w-full",children:[l(r.Group,{className:["flex w-full items-center gap-2",Y.height,le&&"end"===M?`${Y.padding} pe-1`:le&&"split"===M?"px-1":Y.padding].join(" "),children:[le&&"split"===M?oe:null,D?e("span",{className:["flex shrink-0 items-center",A?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:D}):null,e(r.Input,{placeholder:te?_:void 0,className:["w-full min-w-0 flex-1 tabular-nums",x[G],"font-[family-name:var(--mp-sys-typescale-body-large-font)]","appearance-none border-0 bg-transparent px-0 outline-none","caret-mp-primary text-mp-on-surface","placeholder:text-mp-on-surface-variant","disabled:text-mp-on-surface/38 disabled:placeholder:text-mp-on-surface/38",le&&"split"===M?"text-center":""].filter(Boolean).join(" ")}),le&&"end"===M?l("span",{className:"flex shrink-0 items-center",children:[oe,pe]}):null,le&&"split"===M?pe:null]}),e(p,{label:P,required:$,notched:te}),b(P)?e(o,{size:G,label:P,required:$,htmlFor:ee,shrunk:te}):null]})}),e(h,{description:B,errorMessage:R,className:Y.padding})]})}
@@ -73,9 +73,15 @@ export interface MPOverlayProps {
73
73
  * this library does: an overlay that holds nothing readable — a bare spinner, a
74
74
  * `clear` sheet — still has to say what it is, and the alternative is a modal
75
75
  * region a screen reader announces as nothing at all.
76
- * @default 'Overlay'
76
+ *
77
+ * Defaults to the word for it in `locale`.
77
78
  */
78
79
  label?: string;
80
+ /**
81
+ * Which language that default is written in. Falls back to the nearest
82
+ * `MPLocaleProvider`, then to English.
83
+ */
84
+ locale?: string;
79
85
  /** What sits on top — a spinner, a line of text, a small card. */
80
86
  children?: React.ReactNode;
81
87
  className?: string;
@@ -93,4 +99,4 @@ export interface MPOverlayProps {
93
99
  * else Base UI owns: the portal, the scroll lock, the focus held inside, the page
94
100
  * behind going inert, and focus returning to wherever it came from on close.
95
101
  */
96
- export declare function MPOverlay({ open, defaultOpen, onOpenChange, tone, dismissible, modal, align, size, label, className, style, children }: MPOverlayProps): React.JSX.Element;
102
+ export declare function MPOverlay({ open, defaultOpen, onOpenChange, tone, dismissible, modal, align, size, label, locale: localeProp, className, style, children }: MPOverlayProps): React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{FADE as s,PORTAL_LAYER as l,SCRIM as t}from"../../internal/surface.js";import{SHEET_PAD as i}from"../../internal/scale.js";const n={scrim:t,blur:"bg-mp-scrim/20 [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-mp-surface",clear:""},o={start:"items-start",center:"items-center",end:"items-end"};export function MPOverlay({open:t,defaultOpen:c,onOpenChange:m,tone:p="scrim",dismissible:d=!1,modal:f=!0,align:u="center",size:x="md",label:b="Overlay",className:j,style:h,children:y}){return e(r.Root,{open:t,defaultOpen:c,modal:f,disablePointerDismissal:!d,onOpenChange:(e,a)=>{d||e||"escape-key"!==a.reason?m?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:`${l} fixed inset-0 ${s} ${n[p]}`}),e(r.Viewport,{className:[l,"fixed inset-0 flex justify-center",o[u],i[x]].join(" "),children:e(r.Popup,{"aria-label":b,"data-mp-size":x,className:["mp-overlay flex max-h-full max-w-full flex-col items-center justify-center","text-mp-on-surface outline-none",s,j??""].filter(Boolean).join(" "),style:h,children:y})})]})})}
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{useMPLocale as l,useMPMessages as s}from"../../internal/locale.js";import{OVERLAY as t}from"../../internal/messages/overlay.js";import{FADE as n,PORTAL_LAYER as i,SCRIM as o}from"../../internal/surface.js";import{SHEET_PAD as m}from"../../internal/scale.js";const c={scrim:o,blur:"bg-mp-scrim/20 [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-mp-surface",clear:""},p={start:"items-start",center:"items-center",end:"items-end"};export function MPOverlay({open:o,defaultOpen:f,onOpenChange:d,tone:u="scrim",dismissible:x=!1,modal:b=!0,align:j="center",size:h="md",label:y,locale:g,className:O,style:N,children:P}){const k=s(t,l(g));return e(r.Root,{open:o,defaultOpen:f,modal:b,disablePointerDismissal:!x,onOpenChange:(e,a)=>{x||e||"escape-key"!==a.reason?d?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:`${i} fixed inset-0 ${n} ${c[u]}`}),e(r.Viewport,{className:[i,"fixed inset-0 flex justify-center",p[j],m[h]].join(" "),children:e(r.Popup,{"aria-label":y??k.label,"data-mp-size":h,className:["mp-overlay flex max-h-full max-w-full flex-col items-center justify-center","text-mp-on-surface outline-none",n,O??""].filter(Boolean).join(" "),style:N,children:P})})]})})}
@@ -0,0 +1,145 @@
1
+ import * as React from 'react';
2
+ import { type MPPageCollapse, type MPPageScroll, type MPPageSpan } from '../../internal/page-layout.js';
3
+ export type { MPPageCollapse, MPPageScroll, MPPageSpan, MPSidebarSide } from '../../internal/page-layout.js';
4
+ export interface MPPageLayoutProps extends React.ComponentPropsWithoutRef<'div'> {
5
+ /** The bar across the top. An [MPHeader](./header), usually. */
6
+ header?: React.ReactNode;
7
+ /** The sheet at the end. An [MPFooter](./footer), usually. */
8
+ footer?: React.ReactNode;
9
+ /**
10
+ * The leading column — the left of an English page, the right of an Arabic
11
+ * one. An [MPSidebar](./sidebar), which is told which end it is on and needs
12
+ * no `side` of its own here.
13
+ */
14
+ sidebar?: React.ReactNode;
15
+ /**
16
+ * The trailing column, for the layouts that have two: navigation down one
17
+ * side and a table of contents, an inspector or a filter panel down the
18
+ * other. Each is a sidebar with its own width, its own drawer and its own
19
+ * trigger.
20
+ */
21
+ endSidebar?: React.ReactNode;
22
+ /**
23
+ * Which of the header and the sidebars takes the top corner.
24
+ * @default 'full'
25
+ */
26
+ headerSpan?: MPPageSpan;
27
+ /**
28
+ * The same question for the footer, and worth answering separately: a
29
+ * dashboard with a full-height navigation drawer still usually wants its
30
+ * copyright line under the content rather than under the drawer.
31
+ * @default 'full'
32
+ */
33
+ footerSpan?: MPPageSpan;
34
+ /**
35
+ * What scrolls: the document, or only the region between the bars.
36
+ * @default 'page'
37
+ */
38
+ scroll?: MPPageScroll;
39
+ /**
40
+ * How tall the layout is.
41
+ *
42
+ * - `viewport` — the window's, which is what a page wants: a short page still
43
+ * pushes its footer to the bottom of the screen, and with `scroll="content"`
44
+ * the layout is exactly one screen tall. The default.
45
+ * - `auto` — its parent's, for a layout that is not the page: a shell inside a
46
+ * preview, a pane of a larger tool.
47
+ * - a length — a number in pixels, or any CSS length.
48
+ *
49
+ * It sets a floor while the page scrolls and an exact height while only the
50
+ * content does, which is the same difference `scroll` makes everywhere else.
51
+ * @default 'viewport'
52
+ */
53
+ height?: 'viewport' | 'auto' | number | string;
54
+ /**
55
+ * The window size class below which the sidebars stop being columns and
56
+ * become drawers, opened by an [MPSidebarTrigger](./sidebar#mpsidebartrigger).
57
+ * `none` keeps them columns at every width.
58
+ *
59
+ * `expanded` is the default because it is MD3's own answer: the specification
60
+ * gives a standard navigation drawer to an expanded window and puts the same
61
+ * destinations behind a modal drawer below one.
62
+ * @default 'expanded'
63
+ */
64
+ collapseBelow?: MPPageCollapse;
65
+ /**
66
+ * Whether the leading sidebar's drawer is open. Use with
67
+ * `onSidebarOpenChange` for a controlled layout — a route change that should
68
+ * close the drawer behind it, a state the application already holds.
69
+ */
70
+ sidebarOpen?: boolean;
71
+ /**
72
+ * Which state it starts in.
73
+ * @default false
74
+ */
75
+ defaultSidebarOpen?: boolean;
76
+ onSidebarOpenChange?: (open: boolean) => void;
77
+ /** The same three for the trailing sidebar. */
78
+ endSidebarOpen?: boolean;
79
+ /** @default false */
80
+ defaultEndSidebarOpen?: boolean;
81
+ onEndSidebarOpenChange?: (open: boolean) => void;
82
+ /**
83
+ * Puts a "Skip to content" link first in the document, drawn only while it
84
+ * holds the focus.
85
+ *
86
+ * On by default, and the one thing here that is not a style decision. A
87
+ * keyboard reader arriving on a page whose navigation holds forty links has to
88
+ * walk past all forty on every page before reaching the article; this is the
89
+ * one link that spares them, and it costs a sighted reader nothing because it
90
+ * is invisible until it is tabbed to.
91
+ * @default true
92
+ */
93
+ skipLink?: boolean;
94
+ /** What that link says. Defaults to the word for it in `locale`. */
95
+ skipLabel?: string;
96
+ /**
97
+ * The `id` the skip link jumps to, put on the `<main>`.
98
+ * @default 'main'
99
+ */
100
+ mainId?: string;
101
+ /** Anything else the `<main>` needs — a `className`, an `aria-label`. */
102
+ mainProps?: Omit<React.ComponentPropsWithoutRef<'main'>, 'id' | 'children'>;
103
+ /**
104
+ * Which language the layout's own words are in. Falls back to the nearest
105
+ * `MPLocaleProvider`, then to English. Inherited by every sidebar and trigger
106
+ * inside it, so it is written once per page.
107
+ */
108
+ locale?: string;
109
+ /** The page. Rendered inside the `<main>`. */
110
+ children?: React.ReactNode;
111
+ }
112
+ /**
113
+ * The skeleton a page is hung on: a header, a footer, one sidebar or two, and
114
+ * the content between them.
115
+ *
116
+ * What it is really for is the **landmarks**. A page assembled out of divs is a
117
+ * page a screen reader offers as one undifferentiated region and a crawler reads
118
+ * as one undifferentiated blob; the same page built out of `<header>`, `<nav>`,
119
+ * `<aside>`, `<main>` and `<footer>` has a table of contents. Those tags come
120
+ * from the components this one arranges — it contributes exactly one element of
121
+ * its own, plus the `<main>` and the link that jumps to it.
122
+ *
123
+ * ## The arrangement is CSS, and that is the design
124
+ *
125
+ * Everything that decides where a column goes is flexbox and a media query, so
126
+ * the layout is right in the first frame the browser paints and right on a page
127
+ * whose JavaScript never arrives. The only things measured are the header's and
128
+ * the footer's heights, and only because a column that holds its place has to
129
+ * start below a bar whose height nobody but the bar knows.
130
+ *
131
+ * ## Why it draws no gutter and no measure
132
+ *
133
+ * That is [MPContainer](./container)'s job, and a layout that also did it would
134
+ * be a second spelling of one idea. Put a container inside the `<main>`, where a
135
+ * page can hold a full-width dashboard on one route and a 600dp article on the
136
+ * next.
137
+ *
138
+ * ## Why it takes no surface
139
+ *
140
+ * No `variant`, no `color`, no shadow, for [MPContainer](./container)'s reason:
141
+ * the outermost element on a page is the one thing that must not decide what the
142
+ * page looks like. The bars and the columns paint themselves; between them is
143
+ * whatever the application's own background is.
144
+ */
145
+ export declare const MPPageLayout: React.ForwardRefExoticComponent<MPPageLayoutProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as o from"react";import{useMPLocale as t,useMPMessages as n}from"../../internal/locale.js";import{LAYOUT as r}from"../../internal/messages/layout.js";import{MPPageLayoutContext as a,MPSidebarSideContext as i}from"../../internal/page-layout.js";import{hasContent as s}from"../../internal/scale.js";import{cssLength as u}from"../../internal/length.js";const p=["header","footer"];export const MPPageLayout=/*@__PURE__*/o.forwardRef(function({header:c,footer:f,sidebar:d,endSidebar:m,headerSpan:h="full",footerSpan:v="full",scroll:y="page",height:x="viewport",collapseBelow:b="expanded",sidebarOpen:g,defaultSidebarOpen:w=!1,onSidebarOpenChange:j,endSidebarOpen:_,defaultEndSidebarOpen:k=!1,onEndSidebarOpenChange:S,skipLink:P=!0,skipLabel:C,mainId:O="main",mainProps:N,locale:B,className:$,style:R,children:z,...E},I){const L=t(B),M=n(r,L),[H,T]=o.useState(w),[q,A]=o.useState(k),D=o.useMemo(()=>({start:g??H,end:_??q}),[g,H,_,q]),F=o.useCallback((e,l)=>{if("start"===e)return void 0===g&&T(l),void j?.(l);void 0===_&&A(l),S?.(l)},[g,_,j,S]),G=o.useRef(null),J=o.useCallback(e=>{G.current=e,"function"==typeof I?I(e):I&&(I.current=e)},[I]),K=o.useRef({header:null,footer:null}),Q=o.useRef(null),U=o.useCallback(()=>{const e=G.current;if(e)for(const l of p){const o=K.current[l],t="header"===l?h:v;if(!o){e.style.setProperty(`--_mp-layout-${l}`,"0px"),e.style.setProperty(`--_mp-layout-${l}-inset`,"0px");continue}const n=getComputedStyle(o).position,r=`${o.offsetHeight}px`,a="sticky"===n||"fixed"===n;e.style.setProperty(`--_mp-layout-${l}`,a&&"full"===t?r:"0px"),e.style.setProperty(`--_mp-layout-${l}-inset`,"fixed"===n?r:"0px")}},[h,v]),V=o.useCallback(()=>{const e=Q.current;if(e){e.disconnect();for(const l of p){const o=K.current[l];o&&e.observe(o)}}U()},[U]);o.useEffect(()=>(Q.current=new ResizeObserver(()=>U()),V(),()=>{Q.current?.disconnect(),Q.current=null}),[U,V]);const W=o.useCallback((e,l)=>{K.current[e]=l,V()},[V]),X=o.useMemo(()=>({present:!0,register:W,collapseBelow:b,open:D,setOpen:F,scroll:y,locale:L}),[W,b,D,F,y,L]),Y="content"===y,Z=u("viewport"===x||"auto"===x?void 0:x),ee=void 0!==Z?"":"auto"===x?Y?"h-full":"min-h-full":Y?"h-dvh":"min-h-dvh",le=s(c)?c:null,oe=s(f)?f:null;return e(a.Provider,{value:X,children:l("div",{ref:J,"data-mp-scroll":y,className:["mp-page-layout relative flex w-full flex-col",Y?"overflow-hidden":"",ee,"full"===h?"[padding-top:var(--_mp-layout-header-inset,0px)]":"","full"===v?"[padding-bottom:var(--_mp-layout-footer-inset,0px)]":"",$??""].filter(Boolean).join(" "),style:void 0===Z?R:{...Y?{height:Z}:{minHeight:Z},...R},...E,children:[P?e("a",{href:`#${O}`,className:["mp-page-layout__skip absolute start-3 top-3 z-50 size-px overflow-hidden","whitespace-nowrap [clip-path:inset(50%)]","focus:size-auto focus:overflow-visible focus:[clip-path:none]","focus:bg-mp-primary focus:text-mp-on-primary focus:rounded-mp-full","focus:shadow-mp-2 focus:text-mp-label-large focus:px-4 focus:py-2.5","focus:no-underline focus:outline-none"].join(" "),children:C??M.skipToContent}):null,"full"===h?le:null,l("div",{className:["flex w-full flex-1",Y?"min-h-0":""].filter(Boolean).join(" "),children:[s(d)?e(i.Provider,{value:"start",children:d}):null,l("div",{className:["flex min-w-0 flex-1 flex-col",Y?"min-h-0":"","content"===h?"[padding-top:var(--_mp-layout-header-inset,0px)]":"","content"===v?"[padding-bottom:var(--_mp-layout-footer-inset,0px)]":""].filter(Boolean).join(" "),children:["content"===h?le:null,e("main",{...N,id:O,tabIndex:N?.tabIndex??-1,className:["mp-page-layout__main min-w-0 flex-1",Y?"min-h-0 overflow-y-auto":"",N?.className??""].filter(Boolean).join(" "),children:z}),"content"===v?oe:null]}),s(m)?e(i.Provider,{value:"end",children:m}):null]}),"full"===v?oe:null]})})});
@@ -0,0 +1,2 @@
1
+ export { MPPageLayout } from './MPPageLayout.js';
2
+ export type { MPPageCollapse, MPPageLayoutProps, MPPageScroll, MPPageSpan, MPSidebarSide } from './MPPageLayout.js';
@@ -0,0 +1 @@
1
+ export{MPPageLayout}from"./MPPageLayout.js";
@@ -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{accentSlots as r}from"../../internal/accent.js";const o=/*@__PURE__*/n.createContext({basis:null,id:null}),i={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},a={xs:4,sm:6,md:8,lg:10,xl:12};function s(e,t,n){if(null==e)return;if("number"==typeof e)return t*e/100;const r=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!r)return;const o=Number(r[1]);if(!Number.isNaN(o))switch(r[2]){case"px":return o;case"%":return t*o/100;case"rem":return o*Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");case"em":return o*Number.parseFloat(n&&getComputedStyle(n).fontSize||"16");default:return}}export const MPPanes=/*@__PURE__*/n.forwardRef(function({orientation:l="horizontal",resizable:u=!0,color:c="primary",size:m="md",onResize:d,onResizeEnd:f,className:p,style:h,children:g,...v},b){const x=n.Children.toArray(g).filter(n.isValidElement),y=x.length,z=n.useId(),w=n.useRef(null),S=n.useCallback(e=>{w.current=e,"function"==typeof b?b(e):b&&(b.current=e)},[b]),E=n.useRef([]),N=x.map(e=>e.props),[R,j]=n.useState(null),M=R&&R.length===y?R:null,C=n.useRef(null);n.useLayoutEffect(()=>{E.current=N,C.current=M});const k=n.useRef(null);n.useEffect(()=>()=>{null!==k.current&&(document.body.style.userSelect=k.current,k.current=null)},[]);const L="horizontal"===l,$=a[m]*Math.max(0,y-1);function P(e){const t=w.current,n=C.current;if(!u||!t||!n||void 0===n[e+1])return null;const r=t.getBoundingClientRect(),o=(L?r.width:r.height)-$;if(o<=0)return null;const i=E.current[e],a=E.current[e+1],l=n[e]*o,c=l+n[e+1]*o,m=Math.max(s(i?.minSize,o,t)??0,c-(s(a?.maxSize,o,t)??c)),f=Math.min(s(i?.maxSize,o,t)??c,c-(s(a?.minSize,o,t)??0));return f<m?null:{root:t,current:n,lower:m,upper:f,start:l,resize(t){const r=Math.min(f,Math.max(m,l+t)),i=[...n];return i[e]=r/o,i[e+1]=(c-r)/o,j(i),d?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{const e=w.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect(),n=(L?t.width:t.height)-$;n<=0||j(t=>t&&t.length===y?t:function(e,t,n){const r=e.map(e=>s(e.defaultSize,t,n)),o=r.reduce((e,t)=>e+(t??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,t-o)/i:0,l=r.map(e=>Math.max(0,e??a)),u=l.reduce((e,t)=>e+t,0);return u<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/u)}(E.current,n,e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[y,L,$]);const _=["mp-panes__handle group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",i[m],"transition-colors duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-0","focus-visible:outline-solid outline-none",u?[L?"cursor-col-resize":"cursor-row-resize","hover:bg-(--_mp-accent)/8 data-[dragging]:bg-(--_mp-accent)/10"].join(" "):""].filter(Boolean).join(" ");return e("div",{ref:S,"data-mp-size":m,className:["mp-panes flex h-full w-full",L?"flex-row":"flex-col","min-h-0 min-w-0",p??""].filter(Boolean).join(" "),style:{...r(c),...h},...v,children:x.map((r,i)=>t(n.Fragment,{children:[i>0?e("div",{role:"separator","aria-orientation":L?"vertical":"horizontal","aria-valuenow":M?Math.round(100*M[i-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!u||void 0,"aria-controls":`${z}-${i-1}`,tabIndex:u?0:-1,className:_,onPointerDown:e=>{0===e.button&&function(e,t){const n=P(e);if(!n)return;const r=t.currentTarget;try{r.setPointerCapture(t.pointerId)}catch{}r.dataset.dragging="true";const o=document.body.style.userSelect;k.current=o,document.body.style.userSelect="none";const i=L?t.clientX:t.clientY,a=L&&"rtl"===getComputedStyle(n.root).direction?-1:1;let s=n.current;const l=e=>{const t=L?e.clientX:e.clientY;s=n.resize((t-i)*a)},u=()=>{r.removeEventListener("pointermove",l),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",u),delete r.dataset.dragging,document.body.style.userSelect=o,k.current=null,f?.(s.map(e=>100*e))};r.addEventListener("pointermove",l),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",u)}(i-1,e)},onKeyDown:e=>{const t=L?"ArrowLeft":"ArrowUp",n=L?"ArrowRight":"ArrowDown";if(e.key===t||e.key===n)return e.preventDefault(),void function(e,t){const n=P(e);if(!n)return;const r=n.resize(t);f?.(r.map(e=>100*e))}(i-1,e.key===n?16:-16);"Home"!==e.key&&"End"!==e.key||(e.preventDefault(),function(e,t){const n=P(e);if(!n)return;const r=n.resize(n[t]-n.start);f?.(r.map(e=>100*e))}(i-1,"Home"===e.key?"lower":"upper"))},children:e("span",{"aria-hidden":"true",className:["bg-mp-outline-variant pointer-events-none","transition-colors duration-(--mp-sys-motion-duration-short4)",L?"h-full w-px":"h-px w-full",u?["group-hover/handle:bg-(--_mp-accent)","group-focus-visible/handle:bg-(--_mp-accent)","group-data-[dragging]/handle:bg-(--_mp-accent)"].join(" "):""].filter(Boolean).join(" ")})}):null,e(o.Provider,{value:{basis:M?`calc((100% - ${$}px) * ${M[i].toFixed(6)})`:null,id:`${z}-${i}`},children:r})]},r.key??i))})});export const MPPane=/*@__PURE__*/n.forwardRef(function({defaultSize:t,minSize:r,maxSize:i,className:a,style:s,children:l,...u},c){const{basis:m,id:d}=n.useContext(o);return e("div",{ref:c,id:d??void 0,className:["mp-pane relative min-h-0 min-w-0 overflow-auto",a??""].filter(Boolean).join(" "),style:{flex:m?`0 0 ${m}`:"1 1 0%",...s},...u,children:l})});
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{accentSlots as r}from"../../internal/accent.js";import{pixelsIn as o}from"../../internal/length.js";const i=/*@__PURE__*/n.createContext({basis:null,id:null}),a={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},s={xs:4,sm:6,md:8,lg:10,xl:12};function l(e,t,n){if(null!=e)return"number"==typeof e?t*e/100:o(e,t,n)}export const MPPanes=/*@__PURE__*/n.forwardRef(function({orientation:o="horizontal",resizable:c=!0,color:u="primary",size:d="md",onResize:m,onResizeEnd:f,className:p,style:h,children:g,...v},y){const x=n.Children.toArray(g).filter(n.isValidElement),b=x.length,w=n.useId(),z=n.useRef(null),S=n.useCallback(e=>{z.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),j=n.useRef([]),E=x.map(e=>e.props),[R,M]=n.useState(null),k=R&&R.length===b?R:null,C=n.useRef(null);n.useLayoutEffect(()=>{j.current=E,C.current=k});const L=n.useRef(null);n.useEffect(()=>()=>{null!==L.current&&(document.body.style.userSelect=L.current,L.current=null)},[]);const P="horizontal"===o,$=s[d]*Math.max(0,b-1);function _(e){const t=z.current,n=C.current;if(!c||!t||!n||void 0===n[e+1])return null;const r=t.getBoundingClientRect(),o=(P?r.width:r.height)-$;if(o<=0)return null;const i=j.current[e],a=j.current[e+1],s=n[e]*o,u=s+n[e+1]*o,d=Math.max(l(i?.minSize,o,t)??0,u-(l(a?.maxSize,o,t)??u)),f=Math.min(l(i?.maxSize,o,t)??u,u-(l(a?.minSize,o,t)??0));return f<d?null:{root:t,current:n,lower:d,upper:f,start:s,resize(t){const r=Math.min(f,Math.max(d,s+t)),i=[...n];return i[e]=r/o,i[e+1]=(u-r)/o,M(i),m?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{const e=z.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect(),n=(P?t.width:t.height)-$;n<=0||M(t=>t&&t.length===b?t:function(e,t,n){const r=e.map(e=>l(e.defaultSize,t,n)),o=r.reduce((e,t)=>e+(t??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,t-o)/i:0,s=r.map(e=>Math.max(0,e??a)),c=s.reduce((e,t)=>e+t,0);return c<=0?s.map(()=>1/Math.max(1,s.length)):s.map(e=>e/c)}(j.current,n,e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[b,P,$]);const B=["mp-panes__handle group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",a[d],"transition-colors duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-0","focus-visible:outline-solid outline-none",c?[P?"cursor-col-resize":"cursor-row-resize","hover:bg-(--_mp-accent)/8 data-[dragging]:bg-(--_mp-accent)/10"].join(" "):""].filter(Boolean).join(" ");return e("div",{ref:S,"data-mp-size":d,className:["mp-panes flex h-full w-full",P?"flex-row":"flex-col","min-h-0 min-w-0",p??""].filter(Boolean).join(" "),style:{...r(u),...h},...v,children:x.map((r,o)=>t(n.Fragment,{children:[o>0?e("div",{role:"separator","aria-orientation":P?"vertical":"horizontal","aria-valuenow":k?Math.round(100*k[o-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!c||void 0,"aria-controls":`${w}-${o-1}`,tabIndex:c?0:-1,className:B,onPointerDown:e=>{0===e.button&&function(e,t){const n=_(e);if(!n)return;const r=t.currentTarget;try{r.setPointerCapture(t.pointerId)}catch{}r.dataset.dragging="true";const o=document.body.style.userSelect;L.current=o,document.body.style.userSelect="none";const i=P?t.clientX:t.clientY,a=P&&"rtl"===getComputedStyle(n.root).direction?-1:1;let s=n.current;const l=e=>{const t=P?e.clientX:e.clientY;s=n.resize((t-i)*a)},c=()=>{r.removeEventListener("pointermove",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointercancel",c),delete r.dataset.dragging,document.body.style.userSelect=o,L.current=null,f?.(s.map(e=>100*e))};r.addEventListener("pointermove",l),r.addEventListener("pointerup",c),r.addEventListener("pointercancel",c)}(o-1,e)},onKeyDown:e=>{const t=P?"ArrowLeft":"ArrowUp",n=P?"ArrowRight":"ArrowDown";if(e.key===t||e.key===n){e.preventDefault();const t=P&&"rtl"===getComputedStyle(e.currentTarget).direction?-1:1;return void function(e,t){const n=_(e);if(!n)return;const r=n.resize(t);f?.(r.map(e=>100*e))}(o-1,(e.key===n?16:-16)*t)}"Home"!==e.key&&"End"!==e.key||(e.preventDefault(),function(e,t){const n=_(e);if(!n)return;const r=n.resize(n[t]-n.start);f?.(r.map(e=>100*e))}(o-1,"Home"===e.key?"lower":"upper"))},children:e("span",{"aria-hidden":"true",className:["bg-mp-outline-variant pointer-events-none","transition-colors duration-(--mp-sys-motion-duration-short4)",P?"h-full w-px":"h-px w-full",c?["group-hover/handle:bg-(--_mp-accent)","group-focus-visible/handle:bg-(--_mp-accent)","group-data-[dragging]/handle:bg-(--_mp-accent)"].join(" "):""].filter(Boolean).join(" ")})}):null,e(i.Provider,{value:{basis:k?`calc((100% - ${$}px) * ${k[o].toFixed(6)})`:null,id:`${w}-${o}`},children:r})]},r.key??o))})});export const MPPane=/*@__PURE__*/n.forwardRef(function({defaultSize:t,minSize:r,maxSize:o,className:a,style:s,children:l,...c},u){const{basis:d,id:m}=n.useContext(i);return e("div",{ref:u,id:m??void 0,className:["mp-pane relative min-h-0 min-w-0 overflow-auto",a??""].filter(Boolean).join(" "),style:{flex:d?`0 0 ${d}`:"1 1 0%",...s},...c,children:l})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Popover as s}from"@base-ui/react/popover";import{MPIcon as t}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{useMPLocale as a,useMPMessages as l}from"../../internal/locale.js";import{COMMON as r}from"../../internal/messages/common.js";import{MPStateLayer as n}from"../../internal/StateLayer.js";import{hasContent as m,META_TEXT as c,PROSE_TEXT as d,SHEET_GAP as p,SHEET_PAD as f,SHEET_TITLE as u}from"../../internal/scale.js";import{FADE as x,PORTAL_LAYER as h}from"../../internal/surface.js";const g={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},v={xs:8,sm:9,md:10,lg:11,xl:12};export const MPPopoverClose=s.Close;export function MPPopover({trigger:b,title:j,description:w,side:N="bottom",align:O="center",sideOffset:P=8,alignOffset:y=0,arrow:C=!1,open:z,defaultOpen:k,onOpenChange:M,modal:L=!1,dismissible:$=!0,showClose:B=!1,closeLabel:T,locale:A,width:D,size:I="md",className:R,style:S,children:W}){const _=a(A),q=l(r,_),E=m(j)||m(w),F=v[I];return o(s.Root,{open:z,defaultOpen:k,modal:L,onOpenChange:(e,o)=>{$||e||"escape-key"!==o.reason&&"outside-press"!==o.reason&&"focus-out"!==o.reason?M?.(e):o.cancel()},children:[b?e(s.Trigger,{render:b}):null,e(s.Portal,{children:e(s.Positioner,{className:h,side:N,align:O,sideOffset:P,alignOffset:y,children:o(s.Popup,{"data-mp-size":I,className:["mp-popover rounded-mp-md relative flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-2","box-border",f[I],p[I],d[I],void 0===D?g[I]:"",x,R??""].filter(Boolean).join(" "),style:{...void 0===D?null:{maxWidth:"number"==typeof D?`${D}px`:D},...S},children:[C?e(s.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:e("svg",{width:F,height:F/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:e("path",{d:"M0 0h10L5 5z",fill:"var(--_mp-color-surface-container)"})})}):null,E||B?o("div",{className:"flex shrink-0 items-start gap-3",children:[o("div",{className:"flex min-w-0 flex-1 flex-col",children:[m(j)?e(s.Title,{className:`m-0 ${u[I]}`,children:j}):null,m(w)?e(s.Description,{className:`text-mp-on-surface-variant m-0 ${c}`,children:w}):null]}),B?o(s.Close,{"aria-label":T??q.close,className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","rounded-mp-full -m-1 cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(n,{}),e(t,{icon:i,size:18})]}):null]}):null,m(W)?e("div",{className:"min-w-0",children:W}):null]})})})]})}
2
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Popover as s}from"@base-ui/react/popover";import{MPIcon as t}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{useMPLocale as a,useMPMessages as l}from"../../internal/locale.js";import{cssLength as r}from"../../internal/length.js";import{COMMON as n}from"../../internal/messages/common.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{hasContent as c,META_TEXT as d,PROSE_TEXT as p,SHEET_GAP as f,SHEET_PAD as u,SHEET_TITLE as h}from"../../internal/scale.js";import{FADE as x,PORTAL_LAYER as g}from"../../internal/surface.js";const v={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},b={xs:8,sm:9,md:10,lg:11,xl:12};export const MPPopoverClose=s.Close;export function MPPopover({trigger:j,title:w,description:N,side:O="bottom",align:P="center",sideOffset:y=8,alignOffset:C=0,arrow:z=!1,open:k,defaultOpen:M,onOpenChange:L,modal:B=!1,dismissible:T=!0,showClose:$=!1,closeLabel:A,locale:D,width:I,size:R="md",className:S,style:W,children:_}){const q=a(D),E=l(n,q),F=c(w)||c(N),G=b[R];return o(s.Root,{open:k,defaultOpen:M,modal:B,onOpenChange:(e,o)=>{T||e||"escape-key"!==o.reason&&"outside-press"!==o.reason&&"focus-out"!==o.reason?L?.(e):o.cancel()},children:[j?e(s.Trigger,{render:j}):null,e(s.Portal,{children:e(s.Positioner,{className:g,side:O,align:P,sideOffset:y,alignOffset:C,children:o(s.Popup,{"data-mp-size":R,className:["mp-popover rounded-mp-md relative flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-2","box-border",u[R],f[R],p[R],void 0===I?v[R]:"",x,S??""].filter(Boolean).join(" "),style:{...void 0===I?null:{maxWidth:r(I)},...W},children:[z?e(s.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:e("svg",{width:G,height:G/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:e("path",{d:"M0 0h10L5 5z",fill:"var(--_mp-color-surface-container)"})})}):null,F||$?o("div",{className:"flex shrink-0 items-start gap-3",children:[o("div",{className:"flex min-w-0 flex-1 flex-col",children:[c(w)?e(s.Title,{className:`m-0 ${h[R]}`,children:w}):null,c(N)?e(s.Description,{className:`text-mp-on-surface-variant m-0 ${d}`,children:N}):null]}),$?o(s.Close,{"aria-label":A??E.close,className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","rounded-mp-full -m-1 cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(m,{}),e(t,{icon:i,size:18})]}):null]}):null,c(_)?e("div",{className:"min-w-0",children:_}):null]})})})]})}
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as t}from"../../internal/accent.js";import{META_TEXT as n,STACK_GAP as l}from"../../internal/scale.js";import{SEGMENT_GAP as o,SEGMENT_RADIUS as i,SEGMENT_SIZE as m,progressAriaText as c,progressFraction as u,progressText as f}from"../../internal/progress.js";export const MPProgressBox=/*@__PURE__*/r.forwardRef(function({size:r="md",color:p="primary",count:d=4,value:x=null,min:h=0,max:g=100,label:b,showValue:j=!1,format:y,className:v,style:w},N){const M=u(x,h,g),B=null===M,V=void 0!==y,_=Math.max(1,Math.floor(d));return a(s.Root,{ref:N,value:x??null,min:h,max:g,format:y,getAriaValueText:c(M,V),"data-mp-size":r,className:["mp-progress-box inline-flex flex-col",l[r],v??""].filter(Boolean).join(" "),style:{...t(p),...w},children:[b||j?a("div",{className:["flex items-baseline gap-2",b?"justify-between":"justify-end",n].join(" "),children:[b?e(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:b}):null,j?e(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>f(M,e,V)}):null]}):null,e(s.Track,{className:`flex ${o[r]}`,children:Array.from({length:_},(a,s)=>e("span",{className:["bg-mp-on-surface/12 relative overflow-hidden",m[r],i[r],B?"mp-progress-segment-wave bg-(--_mp-accent)":""].filter(Boolean).join(" "),style:B?{"--_mp-index":s}:void 0,children:B?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--_mp-accent) transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",style:{width:`${Math.min(100,Math.max(0,100*(M*_-s)))}%`}})},s))})]})});
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as l}from"../../internal/accent.js";import{META_TEXT as t,STACK_GAP as n}from"../../internal/scale.js";import{SEGMENT_GAP as o,SEGMENT_RADIUS as i,SEGMENT_SIZE as m,progressAriaText as c,progressFraction as u,progressText as f}from"../../internal/progress.js";export const MPProgressBox=/*@__PURE__*/r.forwardRef(function({size:r="md",color:p="primary",count:d=4,value:x=null,min:h=0,max:g=100,label:b,showValue:j=!1,format:y,className:v,style:w},N){const M=u(x,h,g),B=null===M,V=void 0!==y,_=Math.max(1,Math.floor(d));return a(s.Root,{ref:N,value:null===M?null:x??null,min:h,max:g,format:y,getAriaValueText:c(M,V),"data-mp-size":r,className:["mp-progress-box inline-flex flex-col",n[r],v??""].filter(Boolean).join(" "),style:{...l(p),...w},children:[b||j?a("div",{className:["flex items-baseline gap-2",b?"justify-between":"justify-end",t].join(" "),children:[b?e(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:b}):null,j?e(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>f(M,e,V)}):null]}):null,e(s.Track,{className:`flex ${o[r]}`,children:Array.from({length:_},(a,s)=>e("span",{className:["bg-mp-on-surface/12 relative overflow-hidden",m[r],i[r],B?"mp-progress-segment-wave bg-(--_mp-accent)":""].filter(Boolean).join(" "),style:B?{"--_mp-index":s}:void 0,children:B?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--_mp-accent) transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",style:{width:`${Math.min(100,Math.max(0,100*(M*_-s)))}%`}})},s))})]})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as t}from"../../internal/accent.js";import{CONTROL_GAP as o,META_TEXT as n}from"../../internal/scale.js";import{RING_DIAMETER as i,RING_STROKE as l,progressAriaText as c,progressFraction as m,progressText as u}from"../../internal/progress.js";export const MPProgressCircular=/*@__PURE__*/a.forwardRef(function({size:a="md",color:p="primary",value:f=null,min:h=0,max:d=100,label:x,showValue:k=!1,format:g,className:v,style:y},j){const N=m(f,h,d),w=null===N,b=void 0!==g,$=i[a],L=l[a],V=$/2,z=V-L/2;return e(s.Root,{ref:j,value:f??null,min:h,max:d,format:g,getAriaValueText:c(N,b),"data-mp-size":a,className:["mp-progress-circular inline-flex items-center",o[a],n,v??""].filter(Boolean).join(" "),style:{...t(p),...y},children:[e("svg",{className:w?"mp-progress-circular-turn shrink-0":"shrink-0",width:$,height:$,viewBox:`0 0 ${$} ${$}`,fill:"none","aria-hidden":"true",children:[r("circle",{cx:V,cy:V,r:z,stroke:"var(--_mp-color-on-surface)",strokeOpacity:.12,strokeWidth:L}),r("circle",{cx:V,cy:V,r:z,pathLength:100,stroke:"var(--_mp-accent)",strokeWidth:L,strokeLinecap:"round",className:w?"mp-progress-circular-arc":"transition-[stroke-dashoffset] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",transform:`rotate(-90 ${V} ${V})`,...w?null:{strokeDasharray:100,strokeDashoffset:100*(1-N)}})]}),x?r(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:x}):null,k?r(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:r=>u(N,r,b)}):null]})});
2
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as t}from"../../internal/accent.js";import{CONTROL_GAP as o,META_TEXT as n}from"../../internal/scale.js";import{RING_DIAMETER as l,RING_STROKE as i,progressAriaText as c,progressFraction as m,progressText as u}from"../../internal/progress.js";export const MPProgressCircular=/*@__PURE__*/a.forwardRef(function({size:a="md",color:p="primary",value:f=null,min:h=0,max:d=100,label:x,showValue:k=!1,format:g,className:v,style:y},j){const N=m(f,h,d),w=null===N,b=void 0!==g,$=l[a],L=i[a],V=$/2,z=V-L/2;return e(s.Root,{ref:j,value:null===N?null:f??null,min:h,max:d,format:g,getAriaValueText:c(N,b),"data-mp-size":a,className:["mp-progress-circular inline-flex items-center",o[a],n,v??""].filter(Boolean).join(" "),style:{...t(p),...y},children:[e("svg",{className:w?"mp-progress-circular-turn shrink-0":"shrink-0",width:$,height:$,viewBox:`0 0 ${$} ${$}`,fill:"none","aria-hidden":"true",children:[r("circle",{cx:V,cy:V,r:z,stroke:"var(--_mp-color-on-surface)",strokeOpacity:.12,strokeWidth:L}),r("circle",{cx:V,cy:V,r:z,pathLength:100,stroke:"var(--_mp-accent)",strokeWidth:L,strokeLinecap:"round",className:w?"mp-progress-circular-arc":"transition-[stroke-dashoffset] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",transform:`rotate(-90 ${V} ${V})`,...w?null:{strokeDasharray:100,strokeDashoffset:100*(1-N)}})]}),x?r(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:x}):null,k?r(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:r=>u(N,r,b)}):null]})});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as l}from"../../internal/accent.js";import{META_TEXT as n,STACK_GAP as t}from"../../internal/scale.js";import{BAR_THICKNESS as i,progressAriaText as o,progressFraction as m,progressText as c}from"../../internal/progress.js";export const MPProgressLinear=/*@__PURE__*/r.forwardRef(function({size:u="md",color:p="primary",value:f=null,min:d=0,max:x=100,label:g,showValue:h=!1,format:j,className:b,style:N},w){const v=m(f,d,x),y=null===v,V=void 0!==j,$="absolute inset-y-0 rounded-mp-full bg-(--_mp-accent)";return a(s.Root,{ref:w,value:f??null,min:d,max:x,format:j,getAriaValueText:o(v,V),"data-mp-size":u,className:["mp-progress-linear flex w-full flex-col",t[u],b??""].filter(Boolean).join(" "),style:{...l(p),...N},children:[g||h?a("div",{className:["flex items-baseline gap-2",g?"justify-between":"justify-end",n].join(" "),children:[g?e(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:g}):null,h?e(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>c(v,e,V)}):null]}):null,e(s.Track,{className:["rounded-mp-full bg-mp-on-surface/12 relative w-full overflow-hidden",i[u]].join(" "),children:y?a(r.Fragment,{children:[e("span",{className:`${$} mp-progress-linear-lead`}),e("span",{className:`${$} mp-progress-linear-trail`})]}):e(s.Indicator,{className:`${$} start-0 transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard`})})]})});
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as l}from"@base-ui/react/progress";import{accentSlots as s}from"../../internal/accent.js";import{META_TEXT as n,STACK_GAP as t}from"../../internal/scale.js";import{BAR_THICKNESS as i,progressAriaText as o,progressFraction as m,progressText as c}from"../../internal/progress.js";export const MPProgressLinear=/*@__PURE__*/r.forwardRef(function({size:u="md",color:p="primary",value:f=null,min:d=0,max:x=100,label:g,showValue:h=!1,format:j,className:b,style:N},w){const v=m(f,d,x),y=null===v,V=void 0!==j,$="absolute inset-y-0 rounded-mp-full bg-(--_mp-accent)";return a(l.Root,{ref:w,value:null===v?null:f??null,min:d,max:x,format:j,getAriaValueText:o(v,V),"data-mp-size":u,className:["mp-progress-linear flex w-full flex-col",t[u],b??""].filter(Boolean).join(" "),style:{...s(p),...N},children:[g||h?a("div",{className:["flex items-baseline gap-2",g?"justify-between":"justify-end",n].join(" "),children:[g?e(l.Label,{className:"text-mp-on-surface min-w-0 truncate",children:g}):null,h?e(l.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>c(v,e,V)}):null]}):null,e(l.Track,{className:["rounded-mp-full bg-mp-on-surface/12 relative w-full overflow-hidden",i[u]].join(" "),children:y?a(r.Fragment,{children:[e("span",{className:`${$} mp-progress-linear-lead`}),e("span",{className:`${$} mp-progress-linear-trail`})]}):e(l.Indicator,{className:`${$} start-0 transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard`})})]})});
@@ -11,6 +11,12 @@ export interface MPRadioProps {
11
11
  disabled?: boolean;
12
12
  /** The id put on the control and pointed at by the label. */
13
13
  id?: string;
14
+ /**
15
+ * Added to the option's outermost element — the box around the dot, its label
16
+ * and its description, rather than to the dot itself.
17
+ */
18
+ className?: string;
19
+ style?: React.CSSProperties;
14
20
  }
15
21
  /**
16
22
  * One option in an `MPRadioGroup`.
@@ -64,6 +70,12 @@ export interface MPRadioGroupProps {
64
70
  name?: string;
65
71
  /** The `MPRadio`s. */
66
72
  children?: React.ReactNode;
73
+ /**
74
+ * Added to the group's outermost element — the box around the set's label, the
75
+ * options and the supporting line, rather than to the run of options.
76
+ */
77
+ className?: string;
78
+ style?: React.CSSProperties;
67
79
  }
68
80
  /**
69
81
  * A Material Design radio group: a set of options where exactly one is chosen.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as i}from"@base-ui/react/radio";import{RadioGroup as n}from"@base-ui/react/radio-group";import{Field as l}from"@base-ui/react/field";import{accentSlots as o}from"../../internal/accent.js";import{MPStateLayer as t}from"../../internal/StateLayer.js";import{MPSupportingText as s}from"../../internal/SupportingText.js";import{META_TEXT as d,PROSE_TEXT as c,hasContent as p}from"../../internal/scale.js";const m={xs:{ring:"size-4",fill:"size-2",halo:"size-8"},sm:{ring:"size-[18px]",fill:"size-[9px]",halo:"size-9"},md:{ring:"size-5",fill:"size-2.5",halo:"size-10"},lg:{ring:"size-[22px]",fill:"size-[11px]",halo:"size-11"},xl:{ring:"size-6",fill:"size-3",halo:"size-12"}},u=/*@__PURE__*/r.createContext({size:"md",readOnly:!1,invalid:!1});export const MPRadio=/*@__PURE__*/r.forwardRef(function({value:n,label:o,description:s,disabled:f=!1,id:x},g){const h=r.useContext(u),b=m[h.size],y=r.useId(),z=x??`mp-radio-${y}`;return e(l.Root,{className:"mp-radio inline-block align-top",disabled:f,"data-mp-value":n,children:a("div",{className:["flex items-start gap-3",c[h.size]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(i.Root,{ref:g,id:z,value:n,disabled:f,className:["mp-radio__dot group relative inline-flex shrink-0 items-center justify-center","box-border rounded-full border-2 p-0","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color] duration-(--mp-sys-motion-duration-short4)",b.ring,f?"border-mp-on-surface/38 cursor-default":[h.readOnly?"cursor-default":"cursor-pointer",h.invalid?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-(--_mp-accent)"].join(" ")].join(" "),children:[f?null:e(t,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",b.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)"].join(" ")}),e(i.Indicator,{className:["rounded-full",b.fill,"transition-[opacity,scale] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:scale-0 data-starting-style:opacity-0","data-ending-style:scale-0 data-ending-style:opacity-0",f?"bg-mp-on-surface/38":"bg-(--_mp-accent)"].join(" ")})]})}),p(o)||p(s)?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(o)?e(l.Label,{htmlFor:z,className:["leading-[1.4]",f?"text-mp-on-surface/38 cursor-default":h.readOnly?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:o}):null,p(s)?e(l.Description,{className:`${d} text-mp-on-surface-variant data-disabled:text-mp-on-surface/38`,children:s}):null]}):null]})})});export const MPRadioGroup=/*@__PURE__*/r.forwardRef(function({value:i,defaultValue:t,onValueChange:c,label:m,description:f,errorMessage:x,orientation:g="vertical",size:h="md",color:b="primary",required:y=!1,disabled:z=!1,readOnly:v=!1,name:j,children:N},R){const O=p(x),k=O?"error":b,w=r.useId(),M=r.useMemo(()=>({size:h,readOnly:v,invalid:O}),[h,v,O]);return e(u.Provider,{value:M,children:a(l.Root,{className:"mp-radio-group flex flex-col gap-2",disabled:z,invalid:O,"data-mp-size":h,"data-mp-orientation":g,style:o(k),children:[p(m)?a("span",{id:w,className:[d,z?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:[m,y?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(n,{ref:R,"aria-labelledby":p(m)?w:void 0,value:i,defaultValue:t,onValueChange:e=>c?.(String(e??"")),disabled:z,readOnly:v,required:y,name:j,className:["flex","horizontal"===g?"flex-row flex-wrap gap-x-6 gap-y-2":"flex-col gap-2"].join(" "),children:N}),e(s,{description:f,errorMessage:x})]})})});
2
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as i}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as n}from"@base-ui/react/field";import{accentSlots as o}from"../../internal/accent.js";import{MPStateLayer as t}from"../../internal/StateLayer.js";import{MPSupportingText as s}from"../../internal/SupportingText.js";import{META_TEXT as d,PROSE_TEXT as c,hasContent as p}from"../../internal/scale.js";const m={xs:{ring:"size-4",fill:"size-2",halo:"size-8"},sm:{ring:"size-[18px]",fill:"size-[9px]",halo:"size-9"},md:{ring:"size-5",fill:"size-2.5",halo:"size-10"},lg:{ring:"size-[22px]",fill:"size-[11px]",halo:"size-11"},xl:{ring:"size-6",fill:"size-3",halo:"size-12"}},u=/*@__PURE__*/r.createContext({size:"md",readOnly:!1,invalid:!1});export const MPRadio=/*@__PURE__*/r.forwardRef(function({value:l,label:o,description:s,disabled:f=!1,id:x,className:g,style:h},b){const y=r.useContext(u),z=m[y.size],j=r.useId(),v=x??j;return e(n.Root,{className:["mp-radio inline-block align-top",g??""].filter(Boolean).join(" "),style:h,disabled:f,"data-mp-value":l,children:a("div",{className:["flex items-start gap-3",c[y.size]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(i.Root,{ref:b,id:v,value:l,disabled:f,className:["mp-radio__dot group relative inline-flex shrink-0 items-center justify-center","box-border rounded-full border-2 p-0","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color] duration-(--mp-sys-motion-duration-short4)",z.ring,f?"border-mp-on-surface/38 cursor-default":[y.readOnly?"cursor-default":"cursor-pointer",y.invalid?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-(--_mp-accent)"].join(" ")].join(" "),children:[f?null:e(t,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",z.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)"].join(" ")}),e(i.Indicator,{className:["rounded-full",z.fill,"transition-[opacity,scale] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:scale-0 data-starting-style:opacity-0","data-ending-style:scale-0 data-ending-style:opacity-0",f?"bg-mp-on-surface/38":"bg-(--_mp-accent)"].join(" ")})]})}),p(o)||p(s)?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(o)?e(n.Label,{htmlFor:v,className:["leading-[1.4]",f?"text-mp-on-surface/38 cursor-default":y.readOnly?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:o}):null,p(s)?e(n.Description,{className:`${d} text-mp-on-surface-variant data-disabled:text-mp-on-surface/38`,children:s}):null]}):null]})})});export const MPRadioGroup=/*@__PURE__*/r.forwardRef(function({value:i,defaultValue:t,onValueChange:c,label:m,description:f,errorMessage:x,orientation:g="vertical",size:h="md",color:b="primary",required:y=!1,disabled:z=!1,readOnly:j=!1,name:v,children:N,className:R,style:O},k){const w=p(x),M=w?"error":b,_=r.useId(),C=r.useMemo(()=>({size:h,readOnly:j,invalid:w}),[h,j,w]);return e(u.Provider,{value:C,children:a(n.Root,{className:["mp-radio-group flex flex-col gap-2",R??""].filter(Boolean).join(" "),disabled:z,invalid:w,"data-mp-size":h,"data-mp-orientation":g,style:{...o(M),...O},children:[p(m)?a("span",{id:_,className:[d,z?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:[m,y?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(l,{ref:k,"aria-labelledby":p(m)?_:void 0,value:i,defaultValue:t,onValueChange:e=>c?.(String(e??"")),disabled:z,readOnly:j,required:y,name:v,className:["flex","horizontal"===g?"flex-row flex-wrap gap-x-6 gap-y-2":"flex-col gap-2"].join(" "),children:N}),e(s,{description:f,errorMessage:x})]})})});