@soroush.tech/design-system 2.1.0-alpha.0 → 2.1.0-alpha.1

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 (277) hide show
  1. package/dist/Accordion/Accordion.d.cts +2 -2
  2. package/dist/Accordion/Accordion.d.mts +2 -2
  3. package/dist/Accordion/AccordionGroup.d.cts +1 -1
  4. package/dist/Accordion/AccordionGroup.d.mts +1 -1
  5. package/dist/Alert/Alert.d.cts +1 -1
  6. package/dist/Alert/Alert.d.mts +1 -1
  7. package/dist/AppBar.d.cts +1 -1
  8. package/dist/AppBar.d.mts +1 -1
  9. package/dist/Autocomplete.d.cts +1 -1
  10. package/dist/Autocomplete.d.mts +1 -1
  11. package/dist/Avatar.d.cts +1 -1
  12. package/dist/Avatar.d.mts +1 -1
  13. package/dist/Backdrop.d.cts +1 -1
  14. package/dist/Backdrop.d.mts +1 -1
  15. package/dist/Badge.d.cts +1 -1
  16. package/dist/Badge.d.mts +1 -1
  17. package/dist/Breadcrumbs.d.cts +3 -3
  18. package/dist/Breadcrumbs.d.mts +3 -3
  19. package/dist/Button.d.cts +1 -1
  20. package/dist/Button.d.mts +1 -1
  21. package/dist/ButtonGroup.d.cts +1 -1
  22. package/dist/ButtonGroup.d.mts +1 -1
  23. package/dist/Card.d.cts +4 -4
  24. package/dist/Card.d.mts +4 -4
  25. package/dist/Checkbox.d.cts +1 -1
  26. package/dist/Checkbox.d.mts +1 -1
  27. package/dist/Chip.d.cts +1 -1
  28. package/dist/Chip.d.mts +1 -1
  29. package/dist/CircularProgress.d.cts +2 -2
  30. package/dist/CircularProgress.d.mts +2 -2
  31. package/dist/Collapse.d.cts +1 -1
  32. package/dist/Collapse.d.mts +1 -1
  33. package/dist/Drawer.d.cts +3 -3
  34. package/dist/Drawer.d.mts +3 -3
  35. package/dist/Fab.d.cts +1 -1
  36. package/dist/Fab.d.mts +1 -1
  37. package/dist/FabMenu/FabMenu.d.cts +1 -1
  38. package/dist/FabMenu/FabMenu.d.mts +1 -1
  39. package/dist/FabMenu/FabMenuItem.d.cts +1 -1
  40. package/dist/FabMenu/FabMenuItem.d.mts +1 -1
  41. package/dist/Fade.d.cts +1 -1
  42. package/dist/Fade.d.mts +1 -1
  43. package/dist/Flex.d.cts +1 -1
  44. package/dist/Flex.d.mts +1 -1
  45. package/dist/Form.d.cts +1 -1
  46. package/dist/Form.d.mts +1 -1
  47. package/dist/FormControl.d.cts +1 -1
  48. package/dist/FormControl.d.mts +1 -1
  49. package/dist/FormHelperText.d.cts +1 -1
  50. package/dist/FormHelperText.d.mts +1 -1
  51. package/dist/FormLabel.d.cts +1 -1
  52. package/dist/FormLabel.d.mts +1 -1
  53. package/dist/Grid.d.cts +1 -1
  54. package/dist/Grid.d.mts +1 -1
  55. package/dist/Grow.d.cts +1 -1
  56. package/dist/Grow.d.mts +1 -1
  57. package/dist/Icon.d.cts +1 -1
  58. package/dist/Icon.d.mts +1 -1
  59. package/dist/Image.d.cts +1 -1
  60. package/dist/Image.d.mts +1 -1
  61. package/dist/LinearProgress.d.cts +2 -2
  62. package/dist/LinearProgress.d.mts +2 -2
  63. package/dist/Link.d.cts +1 -1
  64. package/dist/Link.d.mts +1 -1
  65. package/dist/Menu/ContextMenu.cjs +23 -14
  66. package/dist/Menu/ContextMenu.d.cts +18 -8
  67. package/dist/Menu/ContextMenu.d.mts +18 -8
  68. package/dist/Menu/ContextMenu.mjs +24 -15
  69. package/dist/Menu/Menu.cjs +1 -1
  70. package/dist/Menu/Menu.d.cts +1 -1
  71. package/dist/Menu/Menu.d.mts +1 -1
  72. package/dist/Menu/Menu.mjs +1 -1
  73. package/dist/Menu/MenuItems.cjs +1 -1
  74. package/dist/Menu/MenuItems.d.cts +1 -1
  75. package/dist/Menu/MenuItems.d.mts +1 -1
  76. package/dist/Menu/MenuItems.mjs +1 -1
  77. package/dist/Menu/MenuList.cjs +1 -1
  78. package/dist/Menu/MenuList.d.cts +3 -36
  79. package/dist/Menu/MenuList.d.mts +3 -36
  80. package/dist/Menu/MenuList.mjs +1 -1
  81. package/dist/{Menu-BfJF32J2.cjs → Menu-C6eIdA1J.cjs} +8 -5
  82. package/dist/{Menu-CX9V2DAu.mjs → Menu-C_4jYHWE.mjs} +8 -5
  83. package/dist/Menu.cjs +2 -2
  84. package/dist/Menu.d.cts +5 -5
  85. package/dist/Menu.d.mts +5 -5
  86. package/dist/Menu.mjs +2 -2
  87. package/dist/{MenuItem-CvCMGXuL.cjs → MenuItem-Bg4iRvVe.cjs} +28 -25
  88. package/dist/{MenuItem-DdPzSWZY.mjs → MenuItem-kRGVRI6G.mjs} +28 -25
  89. package/dist/MenuItem.cjs +1 -1
  90. package/dist/MenuItem.d.cts +1 -1
  91. package/dist/MenuItem.d.mts +1 -1
  92. package/dist/MenuItem.mjs +1 -1
  93. package/dist/{MenuList-DsJmxNPu.cjs → MenuList-CSaaR3jt.cjs} +2 -1
  94. package/dist/{MenuList-CGZgfBno.mjs → MenuList-D7Pvpn_K.mjs} +2 -1
  95. package/dist/{MenuListContext-DJ_qJ1Uo.d.cts → MenuListContext-AnAxu0he.d.cts} +2 -2
  96. package/dist/{MenuListContext-DiZAVDCb.d.mts → MenuListContext-DURKFg_T.d.mts} +2 -2
  97. package/dist/Modal.d.cts +1 -1
  98. package/dist/Modal.d.mts +1 -1
  99. package/dist/NativeSelect.d.cts +2 -2
  100. package/dist/NativeSelect.d.mts +2 -2
  101. package/dist/NavTree/NavLink.d.cts +1 -1
  102. package/dist/NavTree/NavLink.d.mts +1 -1
  103. package/dist/NavTree/NavTree.d.cts +1 -1
  104. package/dist/NavTree/NavTree.d.mts +1 -1
  105. package/dist/NumberInput.d.cts +1 -1
  106. package/dist/NumberInput.d.mts +1 -1
  107. package/dist/Pagination/PaginationItem.d.cts +1 -1
  108. package/dist/Pagination/PaginationItem.d.mts +1 -1
  109. package/dist/Pagination.d.cts +2 -2
  110. package/dist/Pagination.d.mts +2 -2
  111. package/dist/Paper.d.cts +2 -2
  112. package/dist/Paper.d.mts +2 -2
  113. package/dist/Popover.d.cts +3 -3
  114. package/dist/Popover.d.mts +3 -3
  115. package/dist/Pressable.d.cts +1 -1
  116. package/dist/Pressable.d.mts +1 -1
  117. package/dist/Quote.d.cts +2 -2
  118. package/dist/Quote.d.mts +2 -2
  119. package/dist/Radio.d.cts +1 -1
  120. package/dist/Radio.d.mts +1 -1
  121. package/dist/RangeInput.d.cts +1 -1
  122. package/dist/RangeInput.d.mts +1 -1
  123. package/dist/Rating.d.cts +1 -1
  124. package/dist/Rating.d.mts +1 -1
  125. package/dist/ScrollArea.d.cts +1 -1
  126. package/dist/ScrollArea.d.mts +1 -1
  127. package/dist/Select.d.cts +2 -2
  128. package/dist/Select.d.mts +2 -2
  129. package/dist/Sidebar/Sidebar.d.cts +1 -1
  130. package/dist/Sidebar/Sidebar.d.mts +1 -1
  131. package/dist/Sidebar/SidebarItem.d.cts +3 -3
  132. package/dist/Sidebar/SidebarItem.d.mts +3 -3
  133. package/dist/Skeleton.d.cts +1 -1
  134. package/dist/Skeleton.d.mts +1 -1
  135. package/dist/Slide.d.cts +1 -1
  136. package/dist/Slide.d.mts +1 -1
  137. package/dist/Snackbar.d.cts +2 -2
  138. package/dist/Snackbar.d.mts +2 -2
  139. package/dist/Switch.d.cts +1 -1
  140. package/dist/Switch.d.mts +1 -1
  141. package/dist/Table/Table.d.cts +2 -2
  142. package/dist/Table/Table.d.mts +2 -2
  143. package/dist/Table/TableBody.d.cts +1 -1
  144. package/dist/Table/TableBody.d.mts +1 -1
  145. package/dist/Table/TableCell.d.cts +1 -1
  146. package/dist/Table/TableCell.d.mts +1 -1
  147. package/dist/Table/TableContainer.d.cts +1 -1
  148. package/dist/Table/TableContainer.d.mts +1 -1
  149. package/dist/Table/TableControl.d.cts +1 -1
  150. package/dist/Table/TableControl.d.mts +1 -1
  151. package/dist/Table/TableFooter.d.cts +1 -1
  152. package/dist/Table/TableFooter.d.mts +1 -1
  153. package/dist/Table/TableHead.d.cts +1 -1
  154. package/dist/Table/TableHead.d.mts +1 -1
  155. package/dist/Table/TablePagination.d.cts +2 -2
  156. package/dist/Table/TablePagination.d.mts +2 -2
  157. package/dist/Table/TablePaginationActions.d.cts +1 -1
  158. package/dist/Table/TablePaginationActions.d.mts +1 -1
  159. package/dist/Table/TableRow.d.cts +1 -1
  160. package/dist/Table/TableRow.d.mts +1 -1
  161. package/dist/Table/TableSortLabel.d.cts +1 -1
  162. package/dist/Table/TableSortLabel.d.mts +1 -1
  163. package/dist/Table/hooks.d.cts +1 -1
  164. package/dist/Table/hooks.d.mts +1 -1
  165. package/dist/Table.d.cts +5 -5
  166. package/dist/Table.d.mts +5 -5
  167. package/dist/{TableContext-4sJdk84N.d.cts → TableContext-CPxH920f.d.mts} +1 -1
  168. package/dist/{TableContext-BCW5av9c.d.mts → TableContext-VuMFtVNr.d.cts} +1 -1
  169. package/dist/Tabs/Tab.cjs +18 -14
  170. package/dist/Tabs/Tab.d.cts +2 -2
  171. package/dist/Tabs/Tab.d.mts +2 -2
  172. package/dist/Tabs/Tab.mjs +18 -14
  173. package/dist/Tabs/TabContext.d.cts +1 -1
  174. package/dist/Tabs/TabContext.d.mts +1 -1
  175. package/dist/Tabs/TabList.cjs +1 -1
  176. package/dist/Tabs/TabList.d.cts +1 -1
  177. package/dist/Tabs/TabList.d.mts +1 -1
  178. package/dist/Tabs/TabList.mjs +1 -1
  179. package/dist/Tabs/TabPanel.d.cts +2 -2
  180. package/dist/Tabs/TabPanel.d.mts +2 -2
  181. package/dist/Tabs/TabScrollButton.d.cts +1 -1
  182. package/dist/Tabs/TabScrollButton.d.mts +1 -1
  183. package/dist/Tabs/Tabs.cjs +1 -1
  184. package/dist/Tabs/Tabs.d.cts +2 -2
  185. package/dist/Tabs/Tabs.d.mts +2 -2
  186. package/dist/Tabs/Tabs.mjs +1 -1
  187. package/dist/{Tabs-CG-hRs9L.mjs → Tabs-C_qe9d4p.mjs} +28 -21
  188. package/dist/{Tabs-CPH0H6yp.cjs → Tabs-DmiA1J--.cjs} +28 -21
  189. package/dist/Tabs.cjs +1 -1
  190. package/dist/Tabs.d.cts +3 -3
  191. package/dist/Tabs.d.mts +3 -3
  192. package/dist/Tabs.mjs +1 -1
  193. package/dist/{TabsContext-CsiW5MOp.d.mts → TabsContext-DeP8oJpC.d.cts} +1 -1
  194. package/dist/{TabsContext-DrmDtBqA.d.cts → TabsContext-VJcdZQOf.d.mts} +1 -1
  195. package/dist/TextInput.d.cts +1 -1
  196. package/dist/TextInput.d.mts +1 -1
  197. package/dist/ToggleButton/ToggleButton.d.cts +1 -1
  198. package/dist/ToggleButton/ToggleButton.d.mts +1 -1
  199. package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
  200. package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
  201. package/dist/Tooltip-CrPRvmj3.cjs +338 -0
  202. package/dist/Tooltip-CwbuEQzf.mjs +332 -0
  203. package/dist/Tooltip.cjs +2 -311
  204. package/dist/Tooltip.d.cts +18 -5
  205. package/dist/Tooltip.d.mts +18 -5
  206. package/dist/Tooltip.mjs +1 -310
  207. package/dist/TransferList.d.cts +1 -1
  208. package/dist/TransferList.d.mts +1 -1
  209. package/dist/Typography.d.cts +2 -2
  210. package/dist/Typography.d.mts +2 -2
  211. package/dist/View.d.cts +1 -1
  212. package/dist/View.d.mts +1 -1
  213. package/dist/Zoom.d.cts +1 -1
  214. package/dist/Zoom.d.mts +1 -1
  215. package/dist/catalog.cjs +4 -0
  216. package/dist/catalog.d.cts +1 -1
  217. package/dist/catalog.d.mts +1 -1
  218. package/dist/catalog.mjs +4 -0
  219. package/dist/engine.d.cts +1 -1
  220. package/dist/engine.d.mts +1 -1
  221. package/dist/{index-Dt-ZNTnC.d.cts → index-2jMSUeji.d.cts} +1 -1
  222. package/dist/{index-5TAVgzbU.d.mts → index-3Xe5X6Ny.d.mts} +2 -2
  223. package/dist/{index-BYAtunSZ.d.cts → index-B-p51b0z.d.cts} +2 -2
  224. package/dist/index-B2XL_zZY.d.mts +44 -0
  225. package/dist/{index-YKXzINGk.d.mts → index-B5_-Bxoo.d.cts} +3 -3
  226. package/dist/{index-DKNvADeE.d.mts → index-BFUn2EWp.d.mts} +2 -2
  227. package/dist/{index-CeFExef3.d.cts → index-BKM4d_F4.d.cts} +2 -2
  228. package/dist/index-BL5Kj3Ka.d.mts +1 -0
  229. package/dist/{index-Biqn5xUs.d.mts → index-BLypGp0N.d.mts} +4 -4
  230. package/dist/{index-D24iFgwR.d.cts → index-BVDN2XbT.d.mts} +3 -3
  231. package/dist/{index-D--R4_5H.d.mts → index-Bhb0bFxe.d.mts} +2 -2
  232. package/dist/index-Biqpy7c9.d.cts +44 -0
  233. package/dist/{index-BgmEVOSj.d.mts → index-C-ebcNOc.d.mts} +1 -1
  234. package/dist/{index-DvVQLBZc.d.cts → index-C6a3kDn2.d.cts} +1 -0
  235. package/dist/{index-DQYhGgbl.d.cts → index-C9nnnfhd.d.cts} +2 -2
  236. package/dist/{index-DWon54cO.d.cts → index-CBHCGizS.d.mts} +1 -1
  237. package/dist/{index-Bx-4KmJU.d.mts → index-CCEfrBNN.d.mts} +1 -1
  238. package/dist/{index-DhTzn0mf.d.cts → index-CHWMSBhQ.d.cts} +1 -1
  239. package/dist/index-CJMvoc8h.d.cts +1 -0
  240. package/dist/{index-DtVrZFJI.d.mts → index-COgZvhXQ.d.mts} +1 -1
  241. package/dist/{index-DtK3SaKA.d.mts → index-CP55_Zs2.d.mts} +1 -1
  242. package/dist/{index-DhzjNAzv.d.mts → index-CgyyM3ty.d.cts} +10 -5
  243. package/dist/{index-Buu5MtRG.d.mts → index-CtwlReZi.d.cts} +1 -1
  244. package/dist/{index-Dudkopvi.d.mts → index-D0skdQEK.d.mts} +1 -1
  245. package/dist/{index-fRyMPKtY.d.cts → index-D2tfsNPw.d.cts} +1 -1
  246. package/dist/{index-DrfJt7W6.d.cts → index-D7h8qFS1.d.cts} +2 -2
  247. package/dist/{index-DR76LcSz.d.mts → index-DACdQ7-d.d.cts} +1 -1
  248. package/dist/{index-C3TrdOpQ.d.cts → index-DAJ5DVHh.d.cts} +2 -2
  249. package/dist/{index-CyOSmefH.d.cts → index-DMysZsti.d.cts} +1 -1
  250. package/dist/{index-BWiDilH8.d.mts → index-DOH6uskj.d.mts} +1 -0
  251. package/dist/{index-DM7HHa4V.d.mts → index-DQo4XtH4.d.mts} +2 -2
  252. package/dist/{index-CBOtkDdX.d.cts → index-DTJN6JL2.d.cts} +1 -1
  253. package/dist/{index-Bp9ECTzr.d.mts → index-DbKYSbLs.d.mts} +2 -2
  254. package/dist/{index-CW0DW6Aq.d.mts → index-Dg0FPoms.d.mts} +2 -2
  255. package/dist/{index-D_azfqsX.d.mts → index-DlNBgVwb.d.mts} +1 -1
  256. package/dist/{index-HAVWK7RM.d.cts → index-DsBOpK8T.d.mts} +3 -3
  257. package/dist/{index-BlHFb150.d.cts → index-Dvx5TRET.d.cts} +2 -2
  258. package/dist/{index-m1RGSQlP.d.mts → index-Sq75GwA2.d.cts} +3 -3
  259. package/dist/{index-Ba39mhDf.d.cts → index-ZyigJMkV.d.mts} +10 -5
  260. package/dist/{index-HLDMvfb2.d.cts → index-gHMydoIS.d.cts} +4 -4
  261. package/dist/{index-DgLjcrkG.d.cts → index-gxBafJdz.d.cts} +1 -1
  262. package/dist/{index-DjmWIzXF.d.mts → index-hTgl9zwe.d.mts} +2 -2
  263. package/dist/{index-CAICXdTA.d.cts → index-i8BxMDEC.d.mts} +1 -1
  264. package/dist/{index-Bo8Og0oC.d.cts → index-v1I6VA9w.d.cts} +2 -2
  265. package/dist/index.d.cts +1 -1
  266. package/dist/index.d.mts +1 -1
  267. package/dist/style.d.cts +2 -2
  268. package/dist/style.d.mts +2 -2
  269. package/dist/theme.d.cts +2 -2
  270. package/dist/theme.d.mts +2 -2
  271. package/dist/{useTablePagination-BOzuKUnF.d.mts → useTablePagination-CUsagS5T.d.mts} +1 -1
  272. package/dist/{useTablePagination-CraL2Mux.d.cts → useTablePagination-jpEfHKUh.d.cts} +1 -1
  273. package/dist/{useTransition-B-hzi7Sm.d.mts → useTransition-BJ375Sto.d.cts} +1 -1
  274. package/dist/{useTransition-CF_Zy_tM.d.cts → useTransition-DDGpvgci.d.mts} +1 -1
  275. package/package.json +1 -1
  276. package/dist/index-6zQ2VUlM.d.cts +0 -1
  277. package/dist/index-B1qv6yGM.d.mts +0 -1
@@ -1,16 +1,22 @@
1
- import { cn as PaperElevation, nt as Theme } from "../index-DvVQLBZc.cjs";
2
- import "../index-6zQ2VUlM.cjs";
3
- import { t as MenuItemValue } from "../MenuListContext-DJ_qJ1Uo.cjs";
4
- import { n as MenuItemData } from "../index-BlHFb150.cjs";
5
- import { n as MenuCloseReason } from "../index-Ba39mhDf.cjs";
1
+ import { cn as PaperElevation, nt as Theme } from "../index-C6a3kDn2.cjs";
2
+ import "../index-CJMvoc8h.cjs";
3
+ import { n as PopoverPosition } from "../computePopoverPosition-JgOwCM7k.cjs";
4
+ import { t as MenuItemValue } from "../MenuListContext-AnAxu0he.cjs";
5
+ import { r as MenuListSlotProps } from "../index-Biqpy7c9.cjs";
6
+ import { n as MenuItemData } from "../index-Dvx5TRET.cjs";
7
+ import { n as MenuCloseReason } from "../index-CgyyM3ty.cjs";
6
8
  import { KeyboardEvent, MouseEvent, ReactElement, ReactNode, SyntheticEvent } from "react";
7
9
  interface TargetProps {
8
10
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
9
11
  onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
10
12
  }
11
13
  interface ContextMenuProps {
12
- /** The element whose right-click opens the menu - the canvas, a row, a card. Its own `onContextMenu` / `onKeyDown` still run. */
13
- target: ReactElement<TargetProps>;
14
+ /** The element whose right-click opens the menu - the canvas, a row, a card. Its own `onContextMenu` / `onKeyDown` still run. Optional when the app opens the menu itself, with `isOpen` and `anchorPosition`. */
15
+ target?: ReactElement<TargetProps>;
16
+ /** Whether the menu is open, when the app decides: it then opens at `anchorPosition` - from a hit test, a shortcut, a toolbar button - and asks to close through `onClose`, whatever was right-clicked. Without it, the menu opens at the target's right-click or context-menu key, as before. */
17
+ isOpen?: boolean;
18
+ /** With `isOpen`: where the menu opens - a point in the window, client coordinates, as Popover's. A changed point moves the open list. Without one, the menu stays closed. */
19
+ anchorPosition?: PopoverPosition;
14
20
  /** `MenuItem` rows and `MenuDivider`s. */
15
21
  children?: ReactNode;
16
22
  /** The rows as data, in place of `children`. */
@@ -40,6 +46,10 @@ interface ContextMenuProps {
40
46
  /** Names the list. */
41
47
  'aria-label'?: string;
42
48
  className?: string;
49
+ /** Props for a part: `list` is the `role="menu"` list - and every submenu's - for the app's `data-*`, class and `aria-*`. The menu's own `role`, `id` and name win. */
50
+ slotProps?: {
51
+ list?: MenuListSlotProps;
52
+ };
43
53
  'data-testid'?: string;
44
54
  }
45
55
  /**
@@ -48,5 +58,5 @@ interface ContextMenuProps {
48
58
  * `Menu` does - Escape, a chosen row or focus leaving - and gives focus back to where it
49
59
  * was. The browser's own menu is held back only when this one opens.
50
60
  */
51
- declare function ContextMenu({ target, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, 'aria-label': ariaLabel, className, 'data-testid': dataTestid }: Readonly<ContextMenuProps>): import("react").JSX.Element;
61
+ declare function ContextMenu({ target, isOpen: isOpenProp, anchorPosition, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, 'aria-label': ariaLabel, className, slotProps, 'data-testid': dataTestid }: Readonly<ContextMenuProps>): import("react").JSX.Element;
52
62
  export { ContextMenu, ContextMenuProps };
@@ -1,16 +1,22 @@
1
- import { cn as PaperElevation, nt as Theme } from "../index-BWiDilH8.mjs";
2
- import "../index-B1qv6yGM.mjs";
3
- import { t as MenuItemValue } from "../MenuListContext-DiZAVDCb.mjs";
4
- import { n as MenuItemData } from "../index-CW0DW6Aq.mjs";
5
- import { n as MenuCloseReason } from "../index-DhzjNAzv.mjs";
1
+ import { cn as PaperElevation, nt as Theme } from "../index-DOH6uskj.mjs";
2
+ import "../index-BL5Kj3Ka.mjs";
3
+ import { n as PopoverPosition } from "../computePopoverPosition-JgOwCM7k.mjs";
4
+ import { t as MenuItemValue } from "../MenuListContext-DURKFg_T.mjs";
5
+ import { r as MenuListSlotProps } from "../index-B2XL_zZY.mjs";
6
+ import { n as MenuItemData } from "../index-Dg0FPoms.mjs";
7
+ import { n as MenuCloseReason } from "../index-ZyigJMkV.mjs";
6
8
  import { KeyboardEvent, MouseEvent, ReactElement, ReactNode, SyntheticEvent } from "react";
7
9
  interface TargetProps {
8
10
  onContextMenu?: (event: MouseEvent<HTMLElement>) => void;
9
11
  onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
10
12
  }
11
13
  interface ContextMenuProps {
12
- /** The element whose right-click opens the menu - the canvas, a row, a card. Its own `onContextMenu` / `onKeyDown` still run. */
13
- target: ReactElement<TargetProps>;
14
+ /** The element whose right-click opens the menu - the canvas, a row, a card. Its own `onContextMenu` / `onKeyDown` still run. Optional when the app opens the menu itself, with `isOpen` and `anchorPosition`. */
15
+ target?: ReactElement<TargetProps>;
16
+ /** Whether the menu is open, when the app decides: it then opens at `anchorPosition` - from a hit test, a shortcut, a toolbar button - and asks to close through `onClose`, whatever was right-clicked. Without it, the menu opens at the target's right-click or context-menu key, as before. */
17
+ isOpen?: boolean;
18
+ /** With `isOpen`: where the menu opens - a point in the window, client coordinates, as Popover's. A changed point moves the open list. Without one, the menu stays closed. */
19
+ anchorPosition?: PopoverPosition;
14
20
  /** `MenuItem` rows and `MenuDivider`s. */
15
21
  children?: ReactNode;
16
22
  /** The rows as data, in place of `children`. */
@@ -40,6 +46,10 @@ interface ContextMenuProps {
40
46
  /** Names the list. */
41
47
  'aria-label'?: string;
42
48
  className?: string;
49
+ /** Props for a part: `list` is the `role="menu"` list - and every submenu's - for the app's `data-*`, class and `aria-*`. The menu's own `role`, `id` and name win. */
50
+ slotProps?: {
51
+ list?: MenuListSlotProps;
52
+ };
43
53
  'data-testid'?: string;
44
54
  }
45
55
  /**
@@ -48,5 +58,5 @@ interface ContextMenuProps {
48
58
  * `Menu` does - Escape, a chosen row or focus leaving - and gives focus back to where it
49
59
  * was. The browser's own menu is held back only when this one opens.
50
60
  */
51
- declare function ContextMenu({ target, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, 'aria-label': ariaLabel, className, 'data-testid': dataTestid }: Readonly<ContextMenuProps>): import("react").JSX.Element;
61
+ declare function ContextMenu({ target, isOpen: isOpenProp, anchorPosition, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, 'aria-label': ariaLabel, className, slotProps, 'data-testid': dataTestid }: Readonly<ContextMenuProps>): import("react").JSX.Element;
52
62
  export { ContextMenu, ContextMenuProps };
@@ -1,9 +1,9 @@
1
1
  import { o as styled } from "../src-B-rNjHIL.mjs";
2
2
  import { n as useDefaultProps, r as useTheme } from "../theme-DyyZQFzQ.mjs";
3
- import { o as MenuActivationContext, t as MenuList } from "../MenuList-CGZgfBno.mjs";
4
- import { i as MenuPaper, n as useMenuPlacement, r as MenuContext, t as MenuItem } from "../MenuItem-DdPzSWZY.mjs";
3
+ import { o as MenuActivationContext, t as MenuList } from "../MenuList-D7Pvpn_K.mjs";
4
+ import { i as MenuPaper, n as useMenuPlacement, r as MenuContext, t as MenuItem } from "../MenuItem-kRGVRI6G.mjs";
5
5
  import { MenuItems } from "./MenuItems.mjs";
6
- import { Children, cloneElement, useCallback, useId, useMemo, useRef, useState } from "react";
6
+ import { Children, cloneElement, useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  // src/Menu/ContextMenu/ContextMenu.tsx
9
9
  const ContextMenuPaper = styled(MenuPaper, {
@@ -29,7 +29,7 @@ function ContextMenuTarget({ element, onContextMenu, onKeyDown }) {
29
29
  * `Menu` does - Escape, a chosen row or focus leaving - and gives focus back to where it
30
30
  * was. The browser's own menu is held back only when this one opens.
31
31
  */
32
- function ContextMenu({ target, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, "data-testid": dataTestid }) {
32
+ function ContextMenu({ target, isOpen: isOpenProp, anchorPosition, children, items, onClose, onSelect, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, slotProps, "data-testid": dataTestid }) {
33
33
  const dp = useDefaultProps("ContextMenu");
34
34
  const marginThreshold = marginThresholdProp ?? dp.marginThreshold ?? 2;
35
35
  const elevation = elevationProp ?? dp.elevation ?? 8;
@@ -40,7 +40,9 @@ function ContextMenu({ target, children, items, onClose, onSelect, marginThresho
40
40
  const size = sizeProp ?? dp.size;
41
41
  const dense = denseProp ?? dp.dense;
42
42
  const theme = useTheme();
43
- const [point, setPoint] = useState(null);
43
+ const [openPoint, setOpenPoint] = useState(null);
44
+ const isControlled = isOpenProp !== void 0;
45
+ const point = isControlled ? isOpenProp && anchorPosition || null : openPoint;
44
46
  const isOpen = point !== null;
45
47
  const rootRef = useRef(null);
46
48
  const surfaceRef = useRef(null);
@@ -51,11 +53,13 @@ function ContextMenu({ target, children, items, onClose, onSelect, marginThresho
51
53
  align: "start",
52
54
  margin,
53
55
  elevation,
54
- layer
56
+ layer,
57
+ listProps: slotProps?.list
55
58
  }), [
56
59
  margin,
57
60
  elevation,
58
- layer
61
+ layer,
62
+ slotProps?.list
59
63
  ]);
60
64
  useMenuPlacement({
61
65
  isOpen,
@@ -66,27 +70,31 @@ function ContextMenu({ target, children, items, onClose, onSelect, marginThresho
66
70
  align: "start",
67
71
  margin
68
72
  });
73
+ useLayoutEffect(() => {
74
+ if (isControlled && isOpen) returnFocusRef.current = document.activeElement;
75
+ }, [isControlled, isOpen]);
69
76
  const openAt = (top, left) => {
70
77
  returnFocusRef.current = document.activeElement;
71
- setPoint({
78
+ setOpenPoint({
72
79
  top,
73
80
  left
74
81
  });
75
82
  };
76
83
  const close = useCallback((event, reason) => {
77
- setPoint(null);
84
+ if (!isControlled) setOpenPoint(null);
78
85
  onClose?.(event, reason);
79
- if (reason !== "blur") returnFocusRef.current.focus();
80
- }, [onClose]);
86
+ if (reason !== "blur") returnFocusRef.current?.focus();
87
+ }, [isControlled, onClose]);
81
88
  const handleActivate = useCallback((_value, event) => close(event, "select"), [close]);
82
89
  const handleContextMenu = (event) => {
83
- target.props.onContextMenu?.(event);
90
+ target?.props.onContextMenu?.(event);
91
+ if (isControlled) return;
84
92
  event.preventDefault();
85
93
  openAt(event.clientY, event.clientX);
86
94
  };
87
95
  const handleKeyDown = (event) => {
88
- target.props.onKeyDown?.(event);
89
- if (!isMenuKey(event)) return;
96
+ target?.props.onKeyDown?.(event);
97
+ if (isControlled || !isMenuKey(event)) return;
90
98
  event.preventDefault();
91
99
  const { bottom, left } = event.target.getBoundingClientRect();
92
100
  openAt(bottom, left);
@@ -108,7 +116,7 @@ function ContextMenu({ target, children, items, onClose, onSelect, marginThresho
108
116
  className,
109
117
  "data-testid": dataTestid,
110
118
  onBlur: handleBlur,
111
- children: [/* @__PURE__ */ jsx(ContextMenuTarget, {
119
+ children: [target && /* @__PURE__ */ jsx(ContextMenuTarget, {
112
120
  element: target,
113
121
  onContextMenu: handleContextMenu,
114
122
  onKeyDown: handleKeyDown
@@ -124,6 +132,7 @@ function ContextMenu({ target, children, items, onClose, onSelect, marginThresho
124
132
  children: /* @__PURE__ */ jsx(MenuActivationContext.Provider, {
125
133
  value: handleActivate,
126
134
  children: /* @__PURE__ */ jsx(MenuList, {
135
+ ...slotProps?.list,
127
136
  id: listId,
128
137
  "aria-label": ariaLabel,
129
138
  shouldAutoFocus: true,
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_Menu = require("../Menu-BfJF32J2.cjs");
2
+ const require_Menu = require("../Menu-C6eIdA1J.cjs");
3
3
  exports.Menu = require_Menu.Menu;
@@ -1,2 +1,2 @@
1
- import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "../index-Ba39mhDf.cjs";
1
+ import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "../index-CgyyM3ty.cjs";
2
2
  export { Menu, type MenuAlign, MenuCloseReason, MenuProps, MenuStep };
@@ -1,2 +1,2 @@
1
- import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "../index-DhzjNAzv.mjs";
1
+ import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "../index-ZyigJMkV.mjs";
2
2
  export { Menu, type MenuAlign, MenuCloseReason, MenuProps, MenuStep };
@@ -1 +1 @@
1
- export { t as Menu } from "../Menu-CX9V2DAu.mjs";
1
+ export { t as Menu } from "../Menu-C_4jYHWE.mjs";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_MenuItem = require("../MenuItem-CvCMGXuL.cjs");
2
+ const require_MenuItem = require("../MenuItem-Bg4iRvVe.cjs");
3
3
  const require_Menu_MenuDivider = require("./MenuDivider.cjs");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  // src/Menu/MenuItems/MenuItems.tsx
@@ -1,2 +1,2 @@
1
- import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "../index-BlHFb150.cjs";
1
+ import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "../index-Dvx5TRET.cjs";
2
2
  export { MenuDividerData, MenuItemData, MenuItemRowData, MenuItems, MenuItemsProps };
@@ -1,2 +1,2 @@
1
- import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "../index-CW0DW6Aq.mjs";
1
+ import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "../index-Dg0FPoms.mjs";
2
2
  export { MenuDividerData, MenuItemData, MenuItemRowData, MenuItems, MenuItemsProps };
@@ -1,4 +1,4 @@
1
- import { t as MenuItem } from "../MenuItem-DdPzSWZY.mjs";
1
+ import { t as MenuItem } from "../MenuItem-kRGVRI6G.mjs";
2
2
  import { MenuDivider } from "./MenuDivider.mjs";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  // src/Menu/MenuItems/MenuItems.tsx
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_MenuList = require("../MenuList-DsJmxNPu.cjs");
2
+ const require_MenuList = require("../MenuList-CSaaR3jt.cjs");
3
3
  exports.MenuList = require_MenuList.MenuList;
@@ -1,36 +1,3 @@
1
- import { nt as Theme } from "../index-DvVQLBZc.cjs";
2
- import { t as MenuItemValue } from "../MenuListContext-DJ_qJ1Uo.cjs";
3
- import { KeyboardEvent, ReactNode } from "react";
4
- import { LayoutProps, SpaceProps } from "@soroush.tech/styled-system";
5
- interface MenuListProps extends SpaceProps<Theme>, LayoutProps<Theme> {
6
- /** `MenuItem` rows and `MenuDivider`s. */
7
- children?: ReactNode;
8
- /** Fired with a row's `value` when a row that has one is chosen. */
9
- onSelect?: (value: MenuItemValue) => void;
10
- /** Carry the arrow keys past the last row to the first, and back. Default: `true`. */
11
- shouldWrap?: boolean;
12
- /** Focus the selected row, or the first enabled one, on mount. Default: `false`. */
13
- shouldAutoFocus?: boolean;
14
- /** Accent color for every row - resolves to `theme.palette[color]`. A row's own value wins. */
15
- color?: keyof Theme['palette'];
16
- /** Base text color for every row - resolves against `theme.text`. A row's own value wins. */
17
- textColor?: keyof Theme['text'];
18
- /** Density token for every row - resolves against `theme.sizes`. A row's own value wins. */
19
- size?: keyof Theme['sizes'];
20
- /** Compact vertical padding for every row. */
21
- dense?: boolean;
22
- onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
23
- id?: string;
24
- className?: string;
25
- 'aria-label'?: string;
26
- 'aria-labelledby'?: string;
27
- 'data-testid'?: string;
28
- }
29
- /**
30
- * @description A `role="menu"` list that owns the keyboard: the arrow keys, Home and End
31
- * move focus between its own rows, skipping disabled ones; typing jumps to a row by its
32
- * label. Rows are found in the DOM by their nearest `role="menu"`, so a nested submenu's
33
- * rows are never this list's. Renders in place - `Menu` floats one next to a trigger.
34
- */
35
- declare function MenuList({ children, onSelect, shouldWrap: shouldWrapProp, shouldAutoFocus, color, textColor, size, dense, onKeyDown, ...rest }: Readonly<MenuListProps>): import("react").JSX.Element;
36
- export { type MenuItemValue, MenuList, MenuListProps };
1
+ import { t as MenuItemValue } from "../MenuListContext-AnAxu0he.cjs";
2
+ import { n as MenuListProps, r as MenuListSlotProps, t as MenuList } from "../index-Biqpy7c9.cjs";
3
+ export { type MenuItemValue, MenuList, MenuListProps, MenuListSlotProps };
@@ -1,36 +1,3 @@
1
- import { nt as Theme } from "../index-BWiDilH8.mjs";
2
- import { t as MenuItemValue } from "../MenuListContext-DiZAVDCb.mjs";
3
- import { LayoutProps, SpaceProps } from "@soroush.tech/styled-system";
4
- import { KeyboardEvent, ReactNode } from "react";
5
- interface MenuListProps extends SpaceProps<Theme>, LayoutProps<Theme> {
6
- /** `MenuItem` rows and `MenuDivider`s. */
7
- children?: ReactNode;
8
- /** Fired with a row's `value` when a row that has one is chosen. */
9
- onSelect?: (value: MenuItemValue) => void;
10
- /** Carry the arrow keys past the last row to the first, and back. Default: `true`. */
11
- shouldWrap?: boolean;
12
- /** Focus the selected row, or the first enabled one, on mount. Default: `false`. */
13
- shouldAutoFocus?: boolean;
14
- /** Accent color for every row - resolves to `theme.palette[color]`. A row's own value wins. */
15
- color?: keyof Theme['palette'];
16
- /** Base text color for every row - resolves against `theme.text`. A row's own value wins. */
17
- textColor?: keyof Theme['text'];
18
- /** Density token for every row - resolves against `theme.sizes`. A row's own value wins. */
19
- size?: keyof Theme['sizes'];
20
- /** Compact vertical padding for every row. */
21
- dense?: boolean;
22
- onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
23
- id?: string;
24
- className?: string;
25
- 'aria-label'?: string;
26
- 'aria-labelledby'?: string;
27
- 'data-testid'?: string;
28
- }
29
- /**
30
- * @description A `role="menu"` list that owns the keyboard: the arrow keys, Home and End
31
- * move focus between its own rows, skipping disabled ones; typing jumps to a row by its
32
- * label. Rows are found in the DOM by their nearest `role="menu"`, so a nested submenu's
33
- * rows are never this list's. Renders in place - `Menu` floats one next to a trigger.
34
- */
35
- declare function MenuList({ children, onSelect, shouldWrap: shouldWrapProp, shouldAutoFocus, color, textColor, size, dense, onKeyDown, ...rest }: Readonly<MenuListProps>): import("react").JSX.Element;
36
- export { type MenuItemValue, MenuList, MenuListProps };
1
+ import { t as MenuItemValue } from "../MenuListContext-DURKFg_T.mjs";
2
+ import { n as MenuListProps, r as MenuListSlotProps, t as MenuList } from "../index-B2XL_zZY.mjs";
3
+ export { type MenuItemValue, MenuList, MenuListProps, MenuListSlotProps };
@@ -1 +1 @@
1
- export { t as MenuList } from "../MenuList-CGZgfBno.mjs";
1
+ export { t as MenuList } from "../MenuList-D7Pvpn_K.mjs";
@@ -1,8 +1,8 @@
1
1
  const require_src = require("./src-yC1f5WR2.cjs");
2
2
  const require_theme = require("./theme-XJvMdOnY.cjs");
3
3
  const require_isRtl = require("./isRtl-Dl6QQWib.cjs");
4
- const require_MenuList = require("./MenuList-DsJmxNPu.cjs");
5
- const require_MenuItem = require("./MenuItem-CvCMGXuL.cjs");
4
+ const require_MenuList = require("./MenuList-CSaaR3jt.cjs");
5
+ const require_MenuItem = require("./MenuItem-Bg4iRvVe.cjs");
6
6
  const require_Menu_MenuItems = require("./Menu/MenuItems.cjs");
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -36,7 +36,7 @@ function MenuTrigger({ element, id, elementRef, isOpen, listId, onClick, onKeyDo
36
36
  * can't clip it, but stays inside the menu's own box in the DOM. Escape or a chosen row
37
37
  * closes it and returns focus to the trigger; focus leaving it closes it where it went.
38
38
  */
39
- function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = false, onOpen, onClose, onStep, onSelect, align: alignProp, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, "data-testid": dataTestid }) {
39
+ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = false, onOpen, onClose, onStep, onSelect, align: alignProp, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, slotProps, "data-testid": dataTestid }) {
40
40
  const dp = require_theme.useDefaultProps("Menu");
41
41
  const align = alignProp ?? dp.align ?? "start";
42
42
  const marginThreshold = marginThresholdProp ?? dp.marginThreshold ?? 2;
@@ -62,12 +62,14 @@ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = fals
62
62
  align,
63
63
  margin,
64
64
  elevation,
65
- layer
65
+ layer,
66
+ listProps: slotProps?.list
66
67
  }), [
67
68
  align,
68
69
  margin,
69
70
  elevation,
70
- layer
71
+ layer,
72
+ slotProps?.list
71
73
  ]);
72
74
  require_MenuItem.useMenuPlacement({
73
75
  isOpen,
@@ -145,6 +147,7 @@ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = fals
145
147
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MenuList.MenuActivationContext.Provider, {
146
148
  value: handleActivate,
147
149
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MenuList.MenuList, {
150
+ ...slotProps?.list,
148
151
  id: listId,
149
152
  "aria-label": ariaLabel,
150
153
  "aria-labelledby": ariaLabel ? void 0 : triggerId,
@@ -1,8 +1,8 @@
1
1
  import { o as styled } from "./src-B-rNjHIL.mjs";
2
2
  import { n as useDefaultProps, r as useTheme } from "./theme-DyyZQFzQ.mjs";
3
3
  import { t as isRtl } from "./isRtl-DN-EdUlg.mjs";
4
- import { o as MenuActivationContext, t as MenuList } from "./MenuList-CGZgfBno.mjs";
5
- import { i as MenuPaper, n as useMenuPlacement, r as MenuContext, t as MenuItem } from "./MenuItem-DdPzSWZY.mjs";
4
+ import { o as MenuActivationContext, t as MenuList } from "./MenuList-D7Pvpn_K.mjs";
5
+ import { i as MenuPaper, n as useMenuPlacement, r as MenuContext, t as MenuItem } from "./MenuItem-kRGVRI6G.mjs";
6
6
  import { MenuItems } from "./Menu/MenuItems.mjs";
7
7
  import { Children, cloneElement, useCallback, useId, useMemo, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -36,7 +36,7 @@ function MenuTrigger({ element, id, elementRef, isOpen, listId, onClick, onKeyDo
36
36
  * can't clip it, but stays inside the menu's own box in the DOM. Escape or a chosen row
37
37
  * closes it and returns focus to the trigger; focus leaving it closes it where it went.
38
38
  */
39
- function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = false, onOpen, onClose, onStep, onSelect, align: alignProp, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, "data-testid": dataTestid }) {
39
+ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = false, onOpen, onClose, onStep, onSelect, align: alignProp, marginThreshold: marginThresholdProp, elevation: elevationProp, layer: layerProp, borderRadius: borderRadiusProp, emptyLabel, color: colorProp, textColor: textColorProp, size: sizeProp, dense: denseProp, "aria-label": ariaLabel, className, slotProps, "data-testid": dataTestid }) {
40
40
  const dp = useDefaultProps("Menu");
41
41
  const align = alignProp ?? dp.align ?? "start";
42
42
  const marginThreshold = marginThresholdProp ?? dp.marginThreshold ?? 2;
@@ -62,12 +62,14 @@ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = fals
62
62
  align,
63
63
  margin,
64
64
  elevation,
65
- layer
65
+ layer,
66
+ listProps: slotProps?.list
66
67
  }), [
67
68
  align,
68
69
  margin,
69
70
  elevation,
70
- layer
71
+ layer,
72
+ slotProps?.list
71
73
  ]);
72
74
  useMenuPlacement({
73
75
  isOpen,
@@ -145,6 +147,7 @@ function Menu({ trigger, children, items, isOpen: isOpenProp, defaultOpen = fals
145
147
  children: /* @__PURE__ */ jsx(MenuActivationContext.Provider, {
146
148
  value: handleActivate,
147
149
  children: /* @__PURE__ */ jsx(MenuList, {
150
+ ...slotProps?.list,
148
151
  id: listId,
149
152
  "aria-label": ariaLabel,
150
153
  "aria-labelledby": ariaLabel ? void 0 : triggerId,
package/dist/Menu.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_MenuList = require("./MenuList-DsJmxNPu.cjs");
2
+ const require_MenuList = require("./MenuList-CSaaR3jt.cjs");
3
3
  const require_Menu_MenuDivider = require("./Menu/MenuDivider.cjs");
4
4
  const require_Menu_MenuItems = require("./Menu/MenuItems.cjs");
5
5
  const require_Menu_ContextMenu = require("./Menu/ContextMenu.cjs");
6
- const require_Menu = require("./Menu-BfJF32J2.cjs");
6
+ const require_Menu = require("./Menu-C6eIdA1J.cjs");
7
7
  exports.ContextMenu = require_Menu_ContextMenu.ContextMenu;
8
8
  exports.Menu = require_Menu.Menu;
9
9
  exports.MenuDivider = require_Menu_MenuDivider.MenuDivider;
package/dist/Menu.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { i as useMenuListContext, n as MenuListContext, r as MenuListContextValue, t as MenuItemValue } from "./MenuListContext-DJ_qJ1Uo.cjs";
2
- import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "./index-BlHFb150.cjs";
3
- import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "./index-Ba39mhDf.cjs";
1
+ import { i as useMenuListContext, n as MenuListContext, r as MenuListContextValue, t as MenuItemValue } from "./MenuListContext-AnAxu0he.cjs";
2
+ import { n as MenuListProps, r as MenuListSlotProps, t as MenuList } from "./index-Biqpy7c9.cjs";
3
+ import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "./index-Dvx5TRET.cjs";
4
+ import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "./index-CgyyM3ty.cjs";
4
5
  import { ContextMenu, ContextMenuProps } from "./Menu/ContextMenu.cjs";
5
6
  import { MenuDivider, MenuDividerProps } from "./Menu/MenuDivider.cjs";
6
- import { MenuList, MenuListProps } from "./Menu/MenuList.cjs";
7
- export { ContextMenu, ContextMenuProps, Menu, type MenuAlign, MenuCloseReason, MenuDivider, MenuDividerData, MenuDividerProps, MenuItemData, MenuItemRowData, MenuItemValue, MenuItems, MenuItemsProps, MenuList, MenuListContext, MenuListContextValue, MenuListProps, MenuProps, MenuStep, useMenuListContext };
7
+ export { ContextMenu, ContextMenuProps, Menu, type MenuAlign, MenuCloseReason, MenuDivider, MenuDividerData, MenuDividerProps, MenuItemData, MenuItemRowData, MenuItemValue, MenuItems, MenuItemsProps, MenuList, MenuListContext, MenuListContextValue, MenuListProps, MenuListSlotProps, MenuProps, MenuStep, useMenuListContext };
package/dist/Menu.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { i as useMenuListContext, n as MenuListContext, r as MenuListContextValue, t as MenuItemValue } from "./MenuListContext-DiZAVDCb.mjs";
2
- import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "./index-CW0DW6Aq.mjs";
3
- import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "./index-DhzjNAzv.mjs";
1
+ import { i as useMenuListContext, n as MenuListContext, r as MenuListContextValue, t as MenuItemValue } from "./MenuListContext-DURKFg_T.mjs";
2
+ import { n as MenuListProps, r as MenuListSlotProps, t as MenuList } from "./index-B2XL_zZY.mjs";
3
+ import { a as MenuItemsProps, i as MenuItems, n as MenuItemData, r as MenuItemRowData, t as MenuDividerData } from "./index-Dg0FPoms.mjs";
4
+ import { a as MenuAlign, i as MenuStep, n as MenuCloseReason, r as MenuProps, t as Menu } from "./index-ZyigJMkV.mjs";
4
5
  import { ContextMenu, ContextMenuProps } from "./Menu/ContextMenu.mjs";
5
6
  import { MenuDivider, MenuDividerProps } from "./Menu/MenuDivider.mjs";
6
- import { MenuList, MenuListProps } from "./Menu/MenuList.mjs";
7
- export { ContextMenu, ContextMenuProps, Menu, type MenuAlign, MenuCloseReason, MenuDivider, MenuDividerData, MenuDividerProps, MenuItemData, MenuItemRowData, MenuItemValue, MenuItems, MenuItemsProps, MenuList, MenuListContext, MenuListContextValue, MenuListProps, MenuProps, MenuStep, useMenuListContext };
7
+ export { ContextMenu, ContextMenuProps, Menu, type MenuAlign, MenuCloseReason, MenuDivider, MenuDividerData, MenuDividerProps, MenuItemData, MenuItemRowData, MenuItemValue, MenuItems, MenuItemsProps, MenuList, MenuListContext, MenuListContextValue, MenuListProps, MenuListSlotProps, MenuProps, MenuStep, useMenuListContext };
package/dist/Menu.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { a as useMenuListContext, i as MenuListContext, t as MenuList } from "./MenuList-CGZgfBno.mjs";
1
+ import { a as useMenuListContext, i as MenuListContext, t as MenuList } from "./MenuList-D7Pvpn_K.mjs";
2
2
  import { MenuDivider } from "./Menu/MenuDivider.mjs";
3
3
  import { MenuItems } from "./Menu/MenuItems.mjs";
4
4
  import { ContextMenu } from "./Menu/ContextMenu.mjs";
5
- import { t as Menu } from "./Menu-CX9V2DAu.mjs";
5
+ import { t as Menu } from "./Menu-C_4jYHWE.mjs";
6
6
  export { ContextMenu, Menu, MenuDivider, MenuItems, MenuList, MenuListContext, useMenuListContext };
@@ -5,7 +5,8 @@ const require_getSurfaceRadius = require("./getSurfaceRadius-DwOn3ALC.cjs");
5
5
  const require_Icon = require("./Icon-C5Iz5ekp.cjs");
6
6
  const require_isRtl = require("./isRtl-Dl6QQWib.cjs");
7
7
  const require_useAnchoredPlacement = require("./useAnchoredPlacement-BSfjNMut.cjs");
8
- const require_MenuList = require("./MenuList-DsJmxNPu.cjs");
8
+ const require_MenuList = require("./MenuList-CSaaR3jt.cjs");
9
+ const require_Tooltip = require("./Tooltip-CrPRvmj3.cjs");
9
10
  let react = require("react");
10
11
  let react_jsx_runtime = require("react/jsx-runtime");
11
12
  let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
@@ -135,7 +136,7 @@ function useMenuPlacement({ isOpen, anchorRef, surfaceRef, placement, align, mar
135
136
  */
136
137
  function Submenu({ anchorRef, listId, labelledBy, children }) {
137
138
  const menu = useMenuContext();
138
- const { align, margin, elevation, layer } = menu;
139
+ const { align, margin, elevation, layer, listProps } = menu;
139
140
  const surfaceRef = (0, react.useRef)(null);
140
141
  const isFlipped = useMenuPlacement({
141
142
  isOpen: true,
@@ -163,6 +164,7 @@ function Submenu({ anchorRef, listId, labelledBy, children }) {
163
164
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuContext.Provider, {
164
165
  value: context,
165
166
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MenuList.MenuList, {
167
+ ...listProps,
166
168
  id: listId,
167
169
  "aria-labelledby": labelledBy,
168
170
  width: "100%",
@@ -413,10 +415,14 @@ const getRowAria = (state) => ({
413
415
  "aria-expanded": state.hasSubmenu ? state.isSubmenuOpen : void 0,
414
416
  "aria-controls": state.isSubmenuOpen ? state.submenuId : void 0,
415
417
  "aria-checked": state.role === "menuitem" ? void 0 : state.selected,
416
- "aria-keyshortcuts": state.keyShortcuts ?? (typeof state.shortcut === "string" ? state.shortcut : void 0),
417
- "aria-describedby": state.note ? state.noteId : void 0
418
+ "aria-keyshortcuts": state.keyShortcuts ?? (typeof state.shortcut === "string" ? state.shortcut : void 0)
418
419
  });
419
420
  const joinClassNames = (...names) => names.filter(Boolean).join(" ") || void 0;
421
+ const getTick = (role, selected) => role !== "menuitem" && selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
422
+ name: "check",
423
+ size: "sm",
424
+ color: "inherit"
425
+ }) : null;
420
426
  /**
421
427
  * @description A row of a list. Inside a `MenuList` it is a menu row - a `menuitem`
422
428
  * (or `menuitemradio` / `menuitemcheckbox`) with a leading icon column, its label and a
@@ -435,7 +441,6 @@ function MenuItem({ value, children, as, disabled = false, selected = false, hig
435
441
  }, menu);
436
442
  const rootRef = (0, react.useRef)(null);
437
443
  const [isFocusVisible, setIsFocusVisible] = (0, react.useState)(false);
438
- const noteId = (0, react.useId)();
439
444
  const fallbackId = (0, react.useId)();
440
445
  const hasSubmenu = isMenu && submenu !== void 0;
441
446
  const { isOpen: isSubmenuOpen, entryRef, listId: submenuId, handleRowFocus, handleRowKeyDown, handleEntryKeyDown, handleEntryBlur } = useSubmenu(rootRef, hasSubmenu && !disabled);
@@ -511,16 +516,13 @@ function MenuItem({ value, children, as, disabled = false, selected = false, hig
511
516
  })
512
517
  }), children]
513
518
  });
514
- const tick = role !== "menuitem" && selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
515
- name: "check",
516
- size: "sm",
517
- color: "inherit"
518
- }) : null;
519
519
  const rowId = id ?? fallbackId;
520
520
  const hasSecondaryAction = secondaryAction != null;
521
+ const hasNote = Boolean(note);
522
+ const isEntry = hasSubmenu || hasSecondaryAction || hasNote;
521
523
  const row = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MenuItemRoot, {
522
524
  ...rootProps,
523
- as: hasSubmenu || hasSecondaryAction ? "div" : as,
525
+ as: isEntry ? "div" : as,
524
526
  id: rowId,
525
527
  role,
526
528
  ...getRowAria({
@@ -530,18 +532,15 @@ function MenuItem({ value, children, as, disabled = false, selected = false, hig
530
532
  isSubmenuOpen,
531
533
  submenuId,
532
534
  shortcut,
533
- keyShortcuts,
534
- note,
535
- noteId
535
+ keyShortcuts
536
536
  }),
537
- title: note,
538
537
  onKeyDown: handleKeyDown,
539
538
  onKeyUp: handleKeyUp,
540
539
  onPointerMove: handlePointerMove,
541
540
  children: [
542
541
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StartIconSlot, {
543
542
  "aria-hidden": true,
544
- children: startIcon ?? tick
543
+ children: startIcon ?? getTick(role, selected)
545
544
  }),
546
545
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LabelSlot, {
547
546
  "data-menu-label": true,
@@ -558,19 +557,23 @@ function MenuItem({ value, children, as, disabled = false, selected = false, hig
558
557
  size: "sm",
559
558
  color: "inherit"
560
559
  })
561
- }),
562
- note && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
563
- id: noteId,
564
- hidden: true,
565
- children: note
566
560
  })
567
561
  ]
568
562
  });
569
- if (!hasSubmenu && !hasSecondaryAction) return row;
563
+ const noted = hasNote ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.Tooltip, {
564
+ title: note,
565
+ placement: "right",
566
+ isInteractive: false,
567
+ shouldDescribeChild: true,
568
+ isDescriptionPersistent: true,
569
+ shouldWrapDisabledChild: false,
570
+ children: row
571
+ }) : row;
572
+ if (!isEntry) return row;
570
573
  if (!hasSubmenu) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(EntrySlot, {
571
574
  role: "none",
572
- hasSecondaryAction: true,
573
- children: [row, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SecondaryActionSlot, {
575
+ hasSecondaryAction,
576
+ children: [noted, hasSecondaryAction && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SecondaryActionSlot, {
574
577
  "aria-hidden": shouldAnnounceSecondaryAction ? void 0 : true,
575
578
  children: secondaryAction
576
579
  })]
@@ -583,7 +586,7 @@ function MenuItem({ value, children, as, disabled = false, selected = false, hig
583
586
  onKeyDown: handleEntryKeyDown,
584
587
  onBlur: handleEntryBlur,
585
588
  children: [
586
- row,
589
+ noted,
587
590
  hasSecondaryAction && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SecondaryActionSlot, {
588
591
  "aria-hidden": shouldAnnounceSecondaryAction ? void 0 : true,
589
592
  children: secondaryAction