@multiplatform.one/components 7.71.0 → 7.73.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 (264) hide show
  1. package/dist/cjs/ContextMenu/index.cjs +5 -3
  2. package/dist/cjs/ContextMenu/index.native.js +8 -3
  3. package/dist/cjs/ContextMenu/index.native.js.map +1 -1
  4. package/dist/cjs/DropdownMenu/index.cjs +6 -2
  5. package/dist/cjs/DropdownMenu/index.native.js +10 -3
  6. package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
  7. package/dist/cjs/Popover.cjs +16 -1
  8. package/dist/cjs/Popover.native.js +16 -1
  9. package/dist/cjs/Popover.native.js.map +1 -1
  10. package/dist/cjs/TreeSelect/index.cjs +1 -0
  11. package/dist/cjs/TreeSelect/index.native.js +1 -0
  12. package/dist/cjs/TreeSelect/index.native.js.map +1 -1
  13. package/dist/cjs/appShell/ScopeMenu.cjs +13 -6
  14. package/dist/cjs/appShell/ScopeMenu.native.js +19 -6
  15. package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
  16. package/dist/esm/ContextMenu/index.mjs +5 -3
  17. package/dist/esm/ContextMenu/index.mjs.map +1 -1
  18. package/dist/esm/ContextMenu/index.native.js +8 -3
  19. package/dist/esm/ContextMenu/index.native.js.map +1 -1
  20. package/dist/esm/DropdownMenu/index.mjs +6 -2
  21. package/dist/esm/DropdownMenu/index.mjs.map +1 -1
  22. package/dist/esm/DropdownMenu/index.native.js +10 -3
  23. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  24. package/dist/esm/Popover.mjs +17 -2
  25. package/dist/esm/Popover.mjs.map +1 -1
  26. package/dist/esm/Popover.native.js +17 -2
  27. package/dist/esm/Popover.native.js.map +1 -1
  28. package/dist/esm/TreeSelect/index.mjs +1 -0
  29. package/dist/esm/TreeSelect/index.mjs.map +1 -1
  30. package/dist/esm/TreeSelect/index.native.js +1 -0
  31. package/dist/esm/TreeSelect/index.native.js.map +1 -1
  32. package/dist/esm/appShell/ScopeMenu.mjs +13 -6
  33. package/dist/esm/appShell/ScopeMenu.mjs.map +1 -1
  34. package/dist/esm/appShell/ScopeMenu.native.js +19 -6
  35. package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
  36. package/dist/jsx/Accordion/index.native.js.map +1 -1
  37. package/dist/jsx/Alert/index.native.js.map +1 -1
  38. package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
  39. package/dist/jsx/Avatar/getInitials.native.js.map +1 -1
  40. package/dist/jsx/Avatar/index.native.js.map +1 -1
  41. package/dist/jsx/Badge/index.native.js.map +1 -1
  42. package/dist/jsx/Button.native.js.map +1 -1
  43. package/dist/jsx/Card.native.js.map +1 -1
  44. package/dist/jsx/CardFooter.native.js.map +1 -1
  45. package/dist/jsx/CardHeader.native.js.map +1 -1
  46. package/dist/jsx/Carousel/index.native.js.map +1 -1
  47. package/dist/jsx/Chip/index.native.js.map +1 -1
  48. package/dist/jsx/Collapsible.native.js.map +1 -1
  49. package/dist/jsx/ContextMenu/index.mjs +5 -3
  50. package/dist/jsx/ContextMenu/index.mjs.map +1 -1
  51. package/dist/jsx/ContextMenu/index.native.js +8 -3
  52. package/dist/jsx/ContextMenu/index.native.js.map +1 -1
  53. package/dist/jsx/CopyField/index.native.js.map +1 -1
  54. package/dist/jsx/Dialog.native.js.map +1 -1
  55. package/dist/jsx/DotIndicator/index.native.js.map +1 -1
  56. package/dist/jsx/DropdownMenu/index.mjs +6 -2
  57. package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
  58. package/dist/jsx/DropdownMenu/index.native.js +10 -3
  59. package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
  60. package/dist/jsx/DropdownMenu/menuSettle.native.js.map +1 -1
  61. package/dist/jsx/ErrorBoundary/index.native.js.map +1 -1
  62. package/dist/jsx/Heading.native.js.map +1 -1
  63. package/dist/jsx/Kbd/index.native.js.map +1 -1
  64. package/dist/jsx/Kbd/keys.native.js.map +1 -1
  65. package/dist/jsx/Lightbox/MediaControl.native.js.map +1 -1
  66. package/dist/jsx/Lightbox/index.gnome.native.js.map +1 -1
  67. package/dist/jsx/Lightbox/shared.native.js.map +1 -1
  68. package/dist/jsx/Lightbox/useLightbox.native.js.map +1 -1
  69. package/dist/jsx/Material/index.native.js.map +1 -1
  70. package/dist/jsx/Meter/index.native.js.map +1 -1
  71. package/dist/jsx/Meter/meter.native.js.map +1 -1
  72. package/dist/jsx/OverflowRow/index.native.js.map +1 -1
  73. package/dist/jsx/Pagination.native.js.map +1 -1
  74. package/dist/jsx/Popover.mjs +17 -2
  75. package/dist/jsx/Popover.mjs.map +1 -1
  76. package/dist/jsx/Popover.native.js +16 -1
  77. package/dist/jsx/Popover.native.js.map +1 -1
  78. package/dist/jsx/ProgressSteps/index.native.js.map +1 -1
  79. package/dist/jsx/Quote/index.native.js.map +1 -1
  80. package/dist/jsx/SchemeToggle/index.native.js.map +1 -1
  81. package/dist/jsx/ScrollView/revealFocusedField.native.js.map +1 -1
  82. package/dist/jsx/Separator/index.native.js.map +1 -1
  83. package/dist/jsx/Sheet.native.js.map +1 -1
  84. package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
  85. package/dist/jsx/SheetModal/SheetNavigation.native.js.map +1 -1
  86. package/dist/jsx/SheetModal/detents.native.js.map +1 -1
  87. package/dist/jsx/SheetModal/useSheetFrameFocus.native.js.map +1 -1
  88. package/dist/jsx/Skeleton/index.native.js.map +1 -1
  89. package/dist/jsx/SkipLink/index.native.js.map +1 -1
  90. package/dist/jsx/SortableList/SortableHandle.native.js.map +1 -1
  91. package/dist/jsx/SortableList/index.native.js.map +1 -1
  92. package/dist/jsx/SortableList/useSortableRows.native.js.map +1 -1
  93. package/dist/jsx/Tabs/index.native.js.map +1 -1
  94. package/dist/jsx/Text.native.js.map +1 -1
  95. package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
  96. package/dist/jsx/Toast/index.native.js.map +1 -1
  97. package/dist/jsx/Toast/store.native.js.map +1 -1
  98. package/dist/jsx/Tooltip/nativePress.native.js.map +1 -1
  99. package/dist/jsx/Tooltip/tooltipShared.native.js.map +1 -1
  100. package/dist/jsx/TreeSelect/index.mjs +1 -0
  101. package/dist/jsx/TreeSelect/index.mjs.map +1 -1
  102. package/dist/jsx/TreeSelect/index.native.js +1 -0
  103. package/dist/jsx/TreeSelect/index.native.js.map +1 -1
  104. package/dist/jsx/TreeSelect/treeSelectModel.native.js.map +1 -1
  105. package/dist/jsx/Video/PlayerChrome.native.js.map +1 -1
  106. package/dist/jsx/Video/VideoFrame.native.js.map +1 -1
  107. package/dist/jsx/Video/types.native.js.map +1 -1
  108. package/dist/jsx/Wheel/index.native.js.map +1 -1
  109. package/dist/jsx/Wizard/index.native.js.map +1 -1
  110. package/dist/jsx/actions/ActionBar.native.js.map +1 -1
  111. package/dist/jsx/actions/DangerSection.native.js.map +1 -1
  112. package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
  113. package/dist/jsx/actions/HeaderActions.native.js.map +1 -1
  114. package/dist/jsx/actions/StandardAction.native.js.map +1 -1
  115. package/dist/jsx/actions/devWarn.native.js.map +1 -1
  116. package/dist/jsx/actions/index.native.js.map +1 -1
  117. package/dist/jsx/actions/severity.native.js.map +1 -1
  118. package/dist/jsx/appShell/Dock.native.js.map +1 -1
  119. package/dist/jsx/appShell/MpoTabHost.native.js.map +1 -1
  120. package/dist/jsx/appShell/ScopeMenu.mjs +13 -6
  121. package/dist/jsx/appShell/ScopeMenu.mjs.map +1 -1
  122. package/dist/jsx/appShell/ScopeMenu.native.js +19 -6
  123. package/dist/jsx/appShell/ScopeMenu.native.js.map +1 -1
  124. package/dist/jsx/appShell/SettingsSplit.native.js.map +1 -1
  125. package/dist/jsx/appShell/Springboard.native.js.map +1 -1
  126. package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
  127. package/dist/jsx/appShell/TabBar.native.js.map +1 -1
  128. package/dist/jsx/appShell/appTile.native.js.map +1 -1
  129. package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
  130. package/dist/jsx/appShell/index.native.js.map +1 -1
  131. package/dist/jsx/charts/Axis.native.js.map +1 -1
  132. package/dist/jsx/charts/BarChart.native.js.map +1 -1
  133. package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
  134. package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
  135. package/dist/jsx/charts/LineChart.native.js.map +1 -1
  136. package/dist/jsx/charts/PieChart.native.js.map +1 -1
  137. package/dist/jsx/charts/Sparkline.native.js.map +1 -1
  138. package/dist/jsx/charts/accessibility.native.js.map +1 -1
  139. package/dist/jsx/charts/chartHeight.native.js.map +1 -1
  140. package/dist/jsx/charts/composeChart.native.js.map +1 -1
  141. package/dist/jsx/charts/index.native.js.map +1 -1
  142. package/dist/jsx/charts/math.native.js.map +1 -1
  143. package/dist/jsx/charts/series.native.js.map +1 -1
  144. package/dist/jsx/charts/svg.native.js.map +1 -1
  145. package/dist/jsx/charts/types.native.js.map +1 -1
  146. package/dist/jsx/charts/useChartTheme.native.js.map +1 -1
  147. package/dist/jsx/code/Code/index.native.js.map +1 -1
  148. package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
  149. package/dist/jsx/code/HighlightedCode/index.native.js.map +1 -1
  150. package/dist/jsx/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
  151. package/dist/jsx/code/Highlighter/index.native.js.map +1 -1
  152. package/dist/jsx/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
  153. package/dist/jsx/code/Pre/index.native.js.map +1 -1
  154. package/dist/jsx/code/index.native.js.map +1 -1
  155. package/dist/jsx/componentColors.native.js.map +1 -1
  156. package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
  157. package/dist/jsx/feedback/NotifyHost.native.js +1 -1
  158. package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
  159. package/dist/jsx/feedback/copy.native.js.map +1 -1
  160. package/dist/jsx/feedback/index.native.js.map +1 -1
  161. package/dist/jsx/feedback/notify.native.js.map +1 -1
  162. package/dist/jsx/feedback/route.native.js.map +1 -1
  163. package/dist/jsx/feedback/store.native.js.map +1 -1
  164. package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
  165. package/dist/jsx/formLayouts/PreferencePanel.native.js +1 -1
  166. package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
  167. package/dist/jsx/formLayouts/index.native.js.map +1 -1
  168. package/dist/jsx/hooks/index.native.js.map +1 -1
  169. package/dist/jsx/hooks/useClipboard.native.js.map +1 -1
  170. package/dist/jsx/hooks/useDocumentTitle.native.js.map +1 -1
  171. package/dist/jsx/hooks/useHoldCue.native.js.map +1 -1
  172. package/dist/jsx/icons/CheckRegular.native.js.map +1 -1
  173. package/dist/jsx/icons/MinusRegular.native.js.map +1 -1
  174. package/dist/jsx/icons/index.native.js.map +1 -1
  175. package/dist/jsx/icons/lucide.native.js.map +1 -1
  176. package/dist/jsx/icons/themed.native.js.map +1 -1
  177. package/dist/jsx/images/Image/ImageFrame.native.js.map +1 -1
  178. package/dist/jsx/images/Image/framing.native.js.map +1 -1
  179. package/dist/jsx/images/Image/mediaRadius.native.js.map +1 -1
  180. package/dist/jsx/images/Image/shared.native.js.map +1 -1
  181. package/dist/jsx/images/Image/types.native.js.map +1 -1
  182. package/dist/jsx/images/index.native.js.map +1 -1
  183. package/dist/jsx/index.native.js +1 -1
  184. package/dist/jsx/index.native.js.map +1 -1
  185. package/dist/jsx/knobImmuneExports.native.js.map +1 -1
  186. package/dist/jsx/layouts/AsyncBoundary.native.js +1 -1
  187. package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
  188. package/dist/jsx/layouts/Debug/index.native.js.map +1 -1
  189. package/dist/jsx/layouts/EmptyState.native.js.map +1 -1
  190. package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
  191. package/dist/jsx/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
  192. package/dist/jsx/layouts/PageTemplates.native.js.map +1 -1
  193. package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
  194. package/dist/jsx/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
  195. package/dist/jsx/layouts/StatusDot.native.js.map +1 -1
  196. package/dist/jsx/layouts/ViewSwitcher.native.js.map +1 -1
  197. package/dist/jsx/layouts/attachments.native.js.map +1 -1
  198. package/dist/jsx/layouts/bottomAccessory.native.js.map +1 -1
  199. package/dist/jsx/layouts/breadcrumbs.native.js.map +1 -1
  200. package/dist/jsx/layouts/index.native.js.map +1 -1
  201. package/dist/jsx/layouts/page.native.js.map +1 -1
  202. package/dist/jsx/layouts/pageHeadingScope.native.js.map +1 -1
  203. package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
  204. package/dist/jsx/layouts/shellSidebarSlot.native.js.map +1 -1
  205. package/dist/jsx/layouts/sidebar.native.js.map +1 -1
  206. package/dist/jsx/layouts/tags.native.js.map +1 -1
  207. package/dist/jsx/layouts/timeline.native.js.map +1 -1
  208. package/dist/jsx/layouts/toolbar.native.js.map +1 -1
  209. package/dist/jsx/shared/actionScan.native.js.map +1 -1
  210. package/dist/jsx/shared/i18n.native.js.map +1 -1
  211. package/dist/jsx/shared/restoreRetries.native.js.map +1 -1
  212. package/dist/jsx/shared/t.native.js.map +1 -1
  213. package/dist/jsx/shared/textRidesText.native.js.map +1 -1
  214. package/dist/jsx/shared/useReturnFocusOnClose.native.js.map +1 -1
  215. package/dist/jsx/surfaces.native.js.map +1 -1
  216. package/dist/jsx/tamagui.native.js.map +1 -1
  217. package/dist/jsx/testSetup.native.js.map +1 -1
  218. package/dist/jsx/utils/setTinted.native.js.map +1 -1
  219. package/dist/jsx/utils/unwrapText.native.js.map +1 -1
  220. package/dist/jsx/views/Calendar.native.js.map +1 -1
  221. package/dist/jsx/views/Dashboard.native.js.map +1 -1
  222. package/dist/jsx/views/Gantt.native.js.map +1 -1
  223. package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
  224. package/dist/jsx/views/ImageGrid.native.js.map +1 -1
  225. package/dist/jsx/views/List.native.js.map +1 -1
  226. package/dist/jsx/views/ListGroup.native.js.map +1 -1
  227. package/dist/jsx/views/ListRow.native.js.map +1 -1
  228. package/dist/jsx/views/Matrix.native.js.map +1 -1
  229. package/dist/jsx/views/ReportBuilder.native.js.map +1 -1
  230. package/dist/jsx/views/ShortcutCard.native.js.map +1 -1
  231. package/dist/jsx/views/TreeView.native.js.map +1 -1
  232. package/dist/jsx/views/calendarMath.native.js.map +1 -1
  233. package/dist/jsx/views/ganttIntervals.native.js.map +1 -1
  234. package/dist/jsx/views/ganttMath.native.js.map +1 -1
  235. package/dist/jsx/views/index.native.js.map +1 -1
  236. package/dist/jsx/views/kanbanDnd.native.js.map +1 -1
  237. package/dist/jsx/views/matrixMath.native.js.map +1 -1
  238. package/dist/jsx/views/treeViewDnd.native.js.map +1 -1
  239. package/dist/jsx/views/treeViewLayout.native.js.map +1 -1
  240. package/dist/jsx/views/treeViewMotion.native.js.map +1 -1
  241. package/dist/jsx/views/treeViewReveal.native.js.map +1 -1
  242. package/dist/jsx/views/widgetChrome.native.js.map +1 -1
  243. package/package.json +9 -9
  244. package/src/ContextMenu/index.tsx +16 -6
  245. package/src/DropdownMenu/DropdownMenu.avatarTrigger.spec.tsx +38 -3
  246. package/src/DropdownMenu/DropdownMenu.stories.tsx +5 -3
  247. package/src/DropdownMenu/index.tsx +22 -7
  248. package/src/Popover.coverTrigger.spec.tsx +21 -1
  249. package/src/Popover.tsx +40 -3
  250. package/src/SchemeToggle/SchemeToggle.spec.tsx +23 -1
  251. package/src/SheetModal/SheetModal.menus.spec.tsx +78 -0
  252. package/src/TreeSelect/index.tsx +1 -0
  253. package/src/appShell/ScopeMenu.spec.tsx +7 -0
  254. package/src/appShell/ScopeMenu.tsx +15 -3
  255. package/src/layouts/PageHeader.stories.tsx +49 -6
  256. package/types/ContextMenu/index.d.ts +3 -3
  257. package/types/ContextMenu/index.d.ts.map +1 -1
  258. package/types/DropdownMenu/index.d.ts +9 -1
  259. package/types/DropdownMenu/index.d.ts.map +1 -1
  260. package/types/Popover.d.ts +13 -0
  261. package/types/Popover.d.ts.map +1 -1
  262. package/types/TreeSelect/index.d.ts.map +1 -1
  263. package/types/appShell/ScopeMenu.d.ts +22 -1
  264. package/types/appShell/ScopeMenu.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","widgetChrome_exports","NestedIconWell","splitNestedControl","useWidgetChrome","module","exports","import_jsx_runtime","require","import_theme","import_tamagui","nested","px","hitSlop","box","onPress","resolved","useResolvedKnobs","knobProps","control","nestedControl","interactive","cursor","hoverStyle","hoverKnobProps","pressStyle","pressKnobProps","focusVisibleStyle","focusVisibleKnobProps","role","param","color","radius","children","identity","useChartPalette","single","fill","ink","useReadableTextOn","jsx","YStack","alignItems","justifyContent","backgroundColor","overflow","IconSlot","icon"],"sources":["widgetChrome.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar widgetChrome_exports = {};\n__export(widgetChrome_exports, {\n NestedIconWell: () => NestedIconWell,\n splitNestedControl: () => splitNestedControl,\n useWidgetChrome: () => useWidgetChrome\n});\nmodule.exports = __toCommonJS(widgetChrome_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_theme = require(\"@multiplatform.one/theme\");\nvar import_tamagui = require(\"tamagui\");\nfunction splitNestedControl(nested) {\n var { px, hitSlop, ...box } = nested;\n return {\n px,\n hitSlop,\n box\n };\n}\nfunction useWidgetChrome(onPress) {\n var resolved = (0, import_theme.useResolvedKnobs)();\n var { knobProps, control } = resolved;\n var nested = splitNestedControl(knobProps.nestedControl);\n var interactive = onPress ? {\n cursor: \"pointer\",\n hoverStyle: control.hoverKnobProps,\n pressStyle: control.pressKnobProps,\n focusVisibleStyle: control.focusVisibleKnobProps,\n onPress,\n role: \"button\"\n } : void 0;\n return {\n knobProps,\n control,\n nested,\n interactive\n };\n}\nfunction NestedIconWell(param) {\n var { color, box, px, radius, children } = param;\n var identity = (0, import_theme.useChartPalette)().single;\n var fill = color || identity;\n var ink = (0, import_theme.useReadableTextOn)(fill);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ...box,\n ...radius,\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: fill,\n color: ink,\n overflow: \"hidden\",\n \"data-nested-px\": px,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.IconSlot, {\n icon: children,\n color: ink\n })\n });\n}\n//# sourceMappingURL=widgetChrome.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IA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,EAAE;IACxE,GAAG3B,GAAG;IACN,GAAGkB,MAAM;IACTU,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,eAAe,EAAEP,IAAI;IACrBN,KAAK,EAAEO,GAAG;IACVO,QAAQ,EAAE,QAAQ;IAClB,gBAAgB,EAAEjC,EAAE;IACpBqB,QAAQ,EAAE,eAAgB,CAAC,CAAC,EAAE1B,kBAAkB,CAACiC,GAAG,EAAE/B,YAAY,CAACqC,QAAQ,EAAE;MAC3EC,IAAI,EAAEd,QAAQ;MACdF,KAAK,EAAEO;IACT,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","widgetChrome_exports","NestedIconWell","splitNestedControl","useWidgetChrome","module","exports","import_jsx_runtime","require","import_theme","import_tamagui","nested","px","hitSlop","box","onPress","resolved","useResolvedKnobs","knobProps","control","nestedControl","interactive","cursor","hoverStyle","hoverKnobProps","pressStyle","pressKnobProps","focusVisibleStyle","focusVisibleKnobProps","role"],"sources":["../../../src/views/widgetChrome.tsx"],"sourcesContent":[null],"mappings":"AAAA;;AAAA,IACEA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAAA,IACAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACAC,iBAAA,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACAC,YAAA,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IAAAC,QACK,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EAEP,SAASC,IAAA,IAAAD,GAAA,EA8DHZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AA3DC;A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AA,CAAAE,aAAA;EAAA,IACHC,WAAG,GAAAN,OAAA;IAAAO,MACJ,WAAW;IAAAC,UACX,EAAAJ,OAAe,CAAAK,cAAA;IAAAC,UACf,EAAAN,OAAiB,CAAAO,cAAA;IAAAC,iBACJ,EAAIR,OAAA,CAAAS,qBAAA;IAAAb,OACjB;IAASc,IACT;EAAgB,IAEhB;EAAsC;IACxCX,SAAA;IAEJC,OAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/components",
3
- "version": "7.71.0",
3
+ "version": "7.73.0",
4
4
  "description": "multiplatform.one ui components",
5
5
  "keywords": [
6
6
  "components",
@@ -58,11 +58,11 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@floating-ui/react": "^0.27.20",
61
- "@multiplatform.one/forms": "^7.71.0",
62
- "@multiplatform.one/i18n": "^7.71.0",
63
- "@multiplatform.one/platform": "^7.71.0",
64
- "@multiplatform.one/router": "^7.71.0",
65
- "@multiplatform.one/theme": "^7.71.0",
61
+ "@multiplatform.one/forms": "^7.73.0",
62
+ "@multiplatform.one/i18n": "^7.73.0",
63
+ "@multiplatform.one/platform": "^7.73.0",
64
+ "@multiplatform.one/router": "^7.73.0",
65
+ "@multiplatform.one/theme": "^7.73.0",
66
66
  "@phosphor-icons/react": "^2.1.10",
67
67
  "@shopify/flash-list": "^2.3.1",
68
68
  "@tamagui/colors": "2.7.6",
@@ -89,9 +89,9 @@
89
89
  "tamagui": "2.7.6"
90
90
  },
91
91
  "devDependencies": {
92
- "@multiplatform.one/config": "7.71.0",
93
- "@multiplatform.one/storybook": "7.71.0",
94
- "@multiplatform.one/test-utils": "7.71.0",
92
+ "@multiplatform.one/config": "7.73.0",
93
+ "@multiplatform.one/storybook": "7.73.0",
94
+ "@multiplatform.one/test-utils": "7.73.0",
95
95
  "@tamagui/build": "2.7.6",
96
96
  "@testing-library/jest-dom": "^7.0.1",
97
97
  "@testing-library/react": "^16.3.3",
@@ -13,7 +13,8 @@ import { IconSlot } from "@multiplatform.one/theme";
13
13
  * start or up where the viewport runs out. A keyboard open opens from the
14
14
  * target's bottom start corner. Native tablets (window > 640) open at the
15
15
  * long-press point; phones keep the sheet. `anchor="trigger"` opens it on
16
- * native as the pull-down under its trigger instead (a bar button, FZ-8158).
16
+ * its trigger instead, on the web and native at every width, with the button
17
+ * drawn again in its spot (a bar button, FZ-8158, LC-112 and FZ-8480).
17
18
  *
18
19
  * Rows: 44 tall, padX 13 (`menuRowFrame` $3), leading glyph where the row has
19
20
  * one, the chosen row on the checked fill under its check (`menuRowChecked`,
@@ -89,9 +90,9 @@ export interface ContextMenuProps {
89
90
  */
90
91
  triggerSizing?: "stretch" | "content";
91
92
  /**
92
- * Where a native long-press opens the menu: `"point"` (default) at the press
93
- * on a tablet and as a sheet on a phone, `"trigger"` as the pull-down under
94
- * the trigger at every width. The web always opens at the pointer.
93
+ * Where the menu opens: `"point"` (default) at the right-click or the
94
+ * long-press, a sheet on a phone; `"trigger"` over the trigger at every
95
+ * width on the web and native, the button drawn again in its spot.
95
96
  */
96
97
  anchor?: "point" | "trigger";
97
98
  }
@@ -256,8 +257,17 @@ function ContextMenuRoot({
256
257
  contentPadding="none"
257
258
  triggerSizing={triggerSizing}
258
259
  {...freeOverlay}
259
- {...(anchor === "trigger" && !isWeb
260
- ? { compactFace: "menu" as const, anchorMode: "attach" as const, triggerEcho: false }
260
+ // LC-112 (FZ-8480 Round 37): a bar button's menu opens ON the button
261
+ // at every width and draws the button again in place as an X, so
262
+ // pressing the button's spot closes the menu.
263
+ {...(anchor === "trigger"
264
+ ? {
265
+ compactFace: "menu" as const,
266
+ anchorMode: "cover-trigger" as const,
267
+ coverAlign: "auto" as const,
268
+ triggerEcho: false,
269
+ iconEcho: "menu" as const,
270
+ }
261
271
  : null)}
262
272
  >
263
273
  <ContextMenuList maxHeight={maxHeight}>{body}</ContextMenuList>
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * FZ-8220, LC-112, LC-262: an avatar trigger is an icon trigger. The account
3
- * menu opens attached under it with no echo row, the avatar alone or inside
4
- * the press boxes an app wraps around it.
3
+ * menu opens on it (FZ-8438) with no text echo row, the avatar alone or inside
4
+ * the press boxes an app wraps around it, and draws the avatar again in its
5
+ * own spot as an X in the avatar's circle, where a press closes the menu
6
+ * (FZ-8480 Round 37).
5
7
  */
6
8
  import { renderWithProviders } from "@multiplatform.one/test-utils";
7
9
  import { waitFor } from "@testing-library/react";
@@ -36,7 +38,7 @@ describe("DropdownMenu avatar trigger (FZ-8220)", () => {
36
38
  expect(isIconTrigger(<XStack>{"Account"}</XStack>)).toBe(false);
37
39
  });
38
40
 
39
- it("opens the account menu with no echo row, its identity row intact", async () => {
41
+ it("opens the account menu with no text echo row, its identity row intact", async () => {
40
42
  renderWithProviders(
41
43
  <DropdownMenu defaultOpen placement="bottom-end">
42
44
  <DropdownMenu.Trigger>{avatarInPressBox}</DropdownMenu.Trigger>
@@ -59,4 +61,37 @@ describe("DropdownMenu avatar trigger (FZ-8220)", () => {
59
61
  expect(identity?.textContent).toContain("Clay Risser");
60
62
  expect(identity?.textContent).toContain("clayrisser@gmail.com");
61
63
  });
64
+
65
+ it("draws the avatar again in place as an X at phone width, a menu and not a sheet (FZ-8480)", async () => {
66
+ const width = window.innerWidth;
67
+ Object.defineProperty(window, "innerWidth", { configurable: true, writable: true, value: 390 });
68
+ try {
69
+ renderWithProviders(
70
+ <DropdownMenu defaultOpen>
71
+ <DropdownMenu.Trigger>{avatarInPressBox}</DropdownMenu.Trigger>
72
+ <DropdownMenu.Content aria-label="Account">
73
+ <DropdownMenu.Item>Sign out</DropdownMenu.Item>
74
+ </DropdownMenu.Content>
75
+ </DropdownMenu>,
76
+ );
77
+ const panel = await waitFor(() => {
78
+ const found = document.querySelector<HTMLElement>(
79
+ '[data-testid="floating-panel-viewport"]',
80
+ );
81
+ expect(found?.querySelector('[role="menu"]')).toBeTruthy();
82
+ return found as HTMLElement;
83
+ });
84
+ const echo = panel.querySelector<HTMLElement>('[data-testid="floating-panel-icon-echo"]');
85
+ expect(echo?.getAttribute("aria-label")).toBe("Close");
86
+ // The avatar turns into an X: no initials, an X glyph.
87
+ expect(echo?.textContent).toBe("");
88
+ expect(echo?.querySelector("svg")).toBeTruthy();
89
+ } finally {
90
+ Object.defineProperty(window, "innerWidth", {
91
+ configurable: true,
92
+ writable: true,
93
+ value: width,
94
+ });
95
+ }
96
+ });
62
97
  });
@@ -257,15 +257,17 @@ export const Controlled: Story = {
257
257
 
258
258
  /**
259
259
  * FZ-8220: the account menu at phone width (390). The avatar is an icon
260
- * trigger, so the menu opens attached under it with no echo row (LC-112,
261
- * LC-262), and on native it opens at least the platform pull-down's width,
260
+ * trigger, so the menu opens on it and draws the avatar again in its own
261
+ * spot, where a press closes the menu (LC-112, FZ-8480), and on native it opens at least the platform pull-down's width,
262
262
  * so the identity row's fill-width text reads in full. Light and dark come
263
263
  * from the theme toolbar (web) or the theme picker (Kitchen Sink).
264
264
  */
265
265
  export const AccountMenu: Story = {
266
266
  args: { defaultOpen: true },
267
267
  render: (args) => (
268
- <YStack width={390} maxWidth="100%" minHeight={360}>
268
+ // The bar spans the page, so the avatar sits in its end zone (LC-162) and
269
+ // its menu opens from the avatar's top trailing corner, as in an app.
270
+ <YStack width="100%" minHeight={360}>
269
271
  <XStack
270
272
  paddingHorizontal="$3"
271
273
  paddingVertical="$2"
@@ -5,8 +5,8 @@ import { IconSlot } from "@multiplatform.one/theme";
5
5
  * Trigger + elevated overlay of action rows on the FloatingPanel stack
6
6
  * (cover contract: the panel opens OVER its trigger, top edge on the
7
7
  * trigger's top edge, trigger label as its first row, `at-least-trigger`
8
- * width — Clay 2026-10-23; an icon-only trigger instead opens the menu
9
- * attached under it with no echo row, LC-262). Do not fork
8
+ * width — Clay 2026-10-23; an icon-only trigger's menu also opens on its
9
+ * button, with no echo row, LC-262 and rv_d86cc201997dffd4). Do not fork
10
10
  * a second overlay. SF-OVERLAY via elevatedSurface, SP-EDGE rows (container
11
11
  * owns only its 1px border; items own ALL padding), LC-21 COMMIT/COMPOSE,
12
12
  * and the APG keyboard layer (ArrowUp/Down + Home/End, Enter/Space, Escape,
@@ -54,7 +54,7 @@ import {
54
54
  } from "react";
55
55
 
56
56
  import { CheckIcon } from "@phosphor-icons/react";
57
- import { FloatingPanel } from "@multiplatform.one/forms";
57
+ import { FloatingPanel, type PanelWidth } from "@multiplatform.one/forms";
58
58
  import type { GetProps, SizeTokens, TamaguiElement } from "tamagui";
59
59
  import {
60
60
  Text,
@@ -165,6 +165,13 @@ export interface DropdownMenuProps {
165
165
  * width beside other bar actions (FZ-7374); `"stretch"` fills the row.
166
166
  */
167
167
  triggerSizing?: "stretch" | "content";
168
+ /**
169
+ * How wide the menu opens over its trigger (LC-112, FZ-8438 r3):
170
+ * `"content"`, `"trigger"`, `"screen"` or a fixed width. Unset keeps the
171
+ * default: at least the trigger on the web, the 250pt pull-down floor on
172
+ * native.
173
+ */
174
+ panelWidth?: PanelWidth;
168
175
  }
169
176
 
170
177
  // ── Context ───────────────────────────────────────────────────
@@ -340,6 +347,7 @@ function DropdownMenuRoot({
340
347
  closeOnSelect,
341
348
  size,
342
349
  triggerSizing = "content",
350
+ panelWidth,
343
351
  anchorMode,
344
352
  triggerRow,
345
353
  }: DropdownMenuProps) {
@@ -433,9 +441,10 @@ function DropdownMenuRoot({
433
441
  }
434
442
 
435
443
  // LC-262: an icon trigger (a ⋯) is not echoed as the menu's first row, which
436
- // reads as junk; the menu opens under it instead, the UIMenu pull-down.
444
+ // reads as junk. LC-112 (rv_d86cc201997dffd4): its menu still opens ON the
445
+ // button, a top corner on the button's, the way an iOS menu grows out of it.
437
446
  const iconTrigger = triggerRow == null && isIconTrigger(trigger);
438
- const resolvedAnchorMode = anchorMode ?? (iconTrigger ? "attach" : "cover-trigger");
447
+ const resolvedAnchorMode = anchorMode ?? "cover-trigger";
439
448
 
440
449
  return (
441
450
  <Surface size={size}>
@@ -447,14 +456,20 @@ function DropdownMenuRoot({
447
456
  trigger={decorateTrigger(trigger, open, onArrow)}
448
457
  anchorMode={resolvedAnchorMode}
449
458
  triggerEcho={!iconTrigger}
459
+ coverAlign={iconTrigger ? "auto" : "start"}
460
+ // LC-112 (FZ-8480 Round 37): the menu covers its button and draws
461
+ // it again in place as an X that closes the menu.
462
+ iconEcho={iconTrigger ? "menu" : undefined}
450
463
  triggerRow={triggerRow}
451
464
  contentPadding="none"
452
465
  triggerSizing={triggerSizing}
466
+ panelWidth={panelWidth}
453
467
  // FZ-7830, LC-112: a menu is a menu over its trigger on native, the
454
468
  // UIMenu pull-down, never a bottom sheet. The phone-width web keeps
455
469
  // its sheet at page level and opens the menu inside an overlay, so a
456
- // sheet never stacks on a sheet.
457
- compactFace={isWeb ? "auto" : "menu"}
470
+ // sheet never stacks on a sheet. A bar button's menu (an icon
471
+ // trigger) is the UIMenu pull-down on the phone web too (FZ-8480).
472
+ compactFace={isWeb && !iconTrigger ? "auto" : "menu"}
458
473
  {...coverContract}
459
474
  {...(placement ? { placement } : {})}
460
475
  >
@@ -1,7 +1,8 @@
1
1
  import { afterEach, describe, expect, it, vi } from "vitest";
2
2
  import { fireEvent, waitFor, within } from "@testing-library/react";
3
3
  import { renderWithProviders } from "@multiplatform.one/test-utils";
4
- import { Button } from "@multiplatform.one/forms";
4
+ import { Button, IconButton } from "@multiplatform.one/forms";
5
+ import { PlusIcon } from "@phosphor-icons/react";
5
6
  import { Popover } from "./index";
6
7
  import { PopoverContent } from "./surfaces";
7
8
  import { Popover as TamaguiPopover } from "tamagui";
@@ -96,4 +97,23 @@ describe("Popover cover-trigger adapter", () => {
96
97
  fireEvent.click(result.getByRole("button", { name: "Apply filters" }));
97
98
  await waitFor(() => expect(result.queryByTestId("floating-panel-viewport")).toBeNull());
98
99
  });
100
+ it("an icon trigger's panel covers the button and draws it again as an X that closes it (FZ-8480)", async () => {
101
+ const result = renderWithProviders(
102
+ <Popover anchorMode="cover-trigger">
103
+ <Popover.Trigger asChild>
104
+ <IconButton icon={PlusIcon} aria-label="Add node" />
105
+ </Popover.Trigger>
106
+ <PopoverContent>
107
+ <Button>Copy</Button>
108
+ </PopoverContent>
109
+ </Popover>,
110
+ );
111
+ fireEvent.click(result.getByRole("button", { name: "Add node" }), { detail: 0 });
112
+ const panel = await result.findByTestId("floating-panel-viewport");
113
+ expect(within(panel).queryByRole("button", { name: "Add node" })).toBeNull();
114
+ expect(panel.querySelector("[data-fp-trigger-row]")).toBeNull();
115
+ const close = within(panel).getByRole("button", { name: "Close" });
116
+ fireEvent.click(close);
117
+ await waitFor(() => expect(result.queryByTestId("floating-panel-viewport")).toBeNull());
118
+ });
99
119
  });
package/src/Popover.tsx CHANGED
@@ -14,7 +14,13 @@ import {
14
14
  type ReactElement,
15
15
  type ReactNode,
16
16
  } from "react";
17
- import { FloatingPanel, useOverlayZIndex, withOverlayStack } from "@multiplatform.one/forms";
17
+ import {
18
+ FloatingPanel,
19
+ PanelHeader,
20
+ type PanelWidth,
21
+ useOverlayZIndex,
22
+ withOverlayStack,
23
+ } from "@multiplatform.one/forms";
18
24
  import {
19
25
  Popover as TamaguiPopover,
20
26
  View,
@@ -22,11 +28,17 @@ import {
22
28
  withStaticProperties,
23
29
  } from "tamagui";
24
30
  import type { PopoverProps as TamaguiPopoverProps } from "tamagui";
31
+ import { isIconTrigger } from "./DropdownMenu";
25
32
  import { PopoverContent } from "./surfaces";
26
33
 
27
34
  export type PopoverProps = TamaguiPopoverProps & {
28
35
  anchorMode?: "cover-trigger" | "attach";
29
36
  triggerRow?: ReactNode;
37
+ /**
38
+ * Cover-trigger only (LC-112, FZ-8438 r3): how wide the popover opens over
39
+ * its trigger, `"content"`, `"trigger"`, `"screen"` or a fixed width.
40
+ */
41
+ panelWidth?: PanelWidth;
30
42
  };
31
43
 
32
44
  export type Popover = {
@@ -78,6 +90,7 @@ const CoverPopover = forwardRef<Popover, PopoverProps>(function CoverPopover(
78
90
  onOpenChange,
79
91
  triggerRow,
80
92
  anchorMode: _anchorMode,
93
+ panelWidth,
81
94
  ..._props
82
95
  },
83
96
  ref,
@@ -130,6 +143,10 @@ const CoverPopover = forwardRef<Popover, PopoverProps>(function CoverPopover(
130
143
  }
131
144
  }, [content.length, unsupportedContent]);
132
145
  const trigger = triggerPart?.props.children ?? triggerRow;
146
+ // LC-112 (FZ-8480): a glyph trigger (the "+") is covered by its panel and
147
+ // drawn again in its spot as an X that closes it, the iOS + to X morph. The
148
+ // panel stays a panel at phone width, sized by its content.
149
+ const iconTrigger = triggerRow == null && isIconTrigger(trigger);
133
150
  const decorated = isValidElement(trigger)
134
151
  ? cloneElement(trigger as ReactElement<Record<string, unknown>>, {
135
152
  "aria-haspopup": "dialog",
@@ -147,6 +164,16 @@ const CoverPopover = forwardRef<Popover, PopoverProps>(function CoverPopover(
147
164
  anchorRect={anchorRect}
148
165
  triggerSizing="content"
149
166
  contentPadding="none"
167
+ panelWidth={panelWidth}
168
+ {...(iconTrigger
169
+ ? {
170
+ triggerEcho: false,
171
+ iconEcho: "close" as const,
172
+ coverAlign: "auto" as const,
173
+ compactFace: "menu" as const,
174
+ widthMode: "fit-content" as const,
175
+ }
176
+ : null)}
150
177
  >
151
178
  {content.map((child, index) => {
152
179
  const { children: body, ...contentProps } = child.props;
@@ -165,12 +192,20 @@ const CoverPopover = forwardRef<Popover, PopoverProps>(function CoverPopover(
165
192
  });
166
193
 
167
194
  const PopoverRoot = forwardRef<Popover, PopoverProps>(function PopoverRoot(
168
- { anchorMode, triggerRow, ...props },
195
+ { anchorMode, triggerRow, panelWidth, ...props },
169
196
  ref,
170
197
  ) {
171
198
  const stacked = useOverlayZIndex("dropdown");
172
199
  if (anchorMode === "cover-trigger")
173
- return <CoverPopover ref={ref} {...props} anchorMode={anchorMode} triggerRow={triggerRow} />;
200
+ return (
201
+ <CoverPopover
202
+ ref={ref}
203
+ {...props}
204
+ anchorMode={anchorMode}
205
+ triggerRow={triggerRow}
206
+ panelWidth={panelWidth}
207
+ />
208
+ );
174
209
  // FZ-7869: tamagui hands the root's zIndex to the content's portal, so a
175
210
  // popover opened in a sheet or a dialog sits above it on native too. The
176
211
  // content parts carry the stack to what opens inside them.
@@ -185,6 +220,8 @@ export const Popover = withStaticProperties(PopoverRoot, {
185
220
  Trigger: TamaguiPopover.Trigger,
186
221
  Content: StackedPopoverContent,
187
222
  Close: PopoverClose,
223
+ /** A panel's title row; over a + panel it shares the X's line (LC-112). */
224
+ Header: PanelHeader,
188
225
  Anchor: TamaguiPopover.Anchor,
189
226
  Adapt: TamaguiPopover.Adapt,
190
227
  FocusScope: TamaguiPopover.FocusScope,
@@ -1,4 +1,4 @@
1
- import { CircleHalfIcon, MoonIcon, SunIcon } from "@phosphor-icons/react";
1
+ import { CircleHalfIcon, MoonIcon, SunIcon, XIcon } from "@phosphor-icons/react";
2
2
  import { fireEvent, render, waitFor } from "@testing-library/react";
3
3
  import { describe, expect, it, vi } from "vitest";
4
4
  import { renderWithProviders } from "@multiplatform.one/test-utils";
@@ -43,6 +43,28 @@ describe("SchemeToggle (FZ-8158)", () => {
43
43
  expect(set).toHaveBeenCalledWith("system");
44
44
  });
45
45
 
46
+ it("opens its menu on the button and draws the button again in place as an X, a press there closing it (FZ-8480)", async () => {
47
+ const { useUserScheme } = preference("dark", "dark");
48
+ const { getByRole } = renderWithProviders(<SchemeToggle useUserScheme={useUserScheme} />);
49
+ const live = getByRole("button", { name: "Appearance: Dark" });
50
+ fireEvent.contextMenu(live);
51
+ const panel = await waitFor(() => {
52
+ const found = document.querySelector<HTMLElement>('[data-testid="floating-panel-viewport"]');
53
+ expect(found?.querySelector('[role="menu"]')).toBeTruthy();
54
+ return found as HTMLElement;
55
+ });
56
+ const echo = panel.querySelector<HTMLElement>('[data-testid="floating-panel-icon-echo"]');
57
+ expect(echo?.getAttribute("aria-label")).toBe("Close");
58
+ const pathOf = (node: ParentNode | null | undefined) =>
59
+ node?.querySelector("svg path")?.getAttribute("d");
60
+ const x = render(<XIcon weight="bold" />);
61
+ expect(pathOf(echo)).toBe(pathOf(x.container));
62
+ expect(pathOf(echo)).not.toBe(pathOf(live));
63
+ x.unmount();
64
+ fireEvent.click(echo as HTMLElement);
65
+ await waitFor(() => expect(document.querySelector('[role="menu"]')).toBeFalsy());
66
+ });
67
+
46
68
  it("its glyph names the setting: sun for Light, moon for Dark, circle-half for System (FZ-8158 r5)", () => {
47
69
  const pathOf = (node: ParentNode) => node.querySelector("svg path")?.getAttribute("d");
48
70
  const cases = [
@@ -137,6 +137,84 @@ describe("menus inside a SheetModal at 390 (FZ-7830)", () => {
137
137
  expect(result.queryByTestId("select-dropdown")).toBeNull();
138
138
  });
139
139
 
140
+ // FZ-8438 r3: the width setting changes how wide a menu opens, never which
141
+ // face it takes at phone width.
142
+ it.each(["content", "trigger", "screen", 300] as const)(
143
+ "a short Select with panelWidth %s still opens over its trigger at page level",
144
+ async (panelWidth) => {
145
+ const result = renderWithProviders(
146
+ <Select
147
+ aria-label="Region"
148
+ options={regions.slice(0, 7)}
149
+ defaultValue="helsinki"
150
+ panelWidth={panelWidth}
151
+ />,
152
+ );
153
+ const trigger = result.getByTestId("select-trigger");
154
+ fireEvent.pointerDown(trigger);
155
+ fireEvent.mouseDown(trigger);
156
+ fireEvent.click(trigger);
157
+ await result.findByTestId("select-dropdown");
158
+ expect(panelSheets().length).toBe(0);
159
+ },
160
+ );
161
+
162
+ it.each(["content", "trigger", "screen", 300] as const)(
163
+ "a long Select with panelWidth %s keeps its sheet at page level",
164
+ async (panelWidth) => {
165
+ const result = renderWithProviders(
166
+ <Select
167
+ aria-label="Region"
168
+ options={regions}
169
+ defaultValue="helsinki"
170
+ panelWidth={panelWidth}
171
+ />,
172
+ );
173
+ fireEvent.click(result.getByTestId("select-trigger"));
174
+ await waitFor(() => expect(panelSheets().length).toBeGreaterThan(0));
175
+ expect(result.queryByTestId("select-dropdown")).toBeNull();
176
+ },
177
+ );
178
+
179
+ it.each(["trigger", "screen"] as const)(
180
+ "a long Select with panelWidth %s in the sheet opens over its trigger, not a second sheet",
181
+ async (panelWidth) => {
182
+ const result = renderWithProviders(
183
+ <SheetModal open onOpenChange={() => {}}>
184
+ <Select
185
+ aria-label="Region"
186
+ options={regions}
187
+ defaultValue="helsinki"
188
+ panelWidth={panelWidth}
189
+ />
190
+ </SheetModal>,
191
+ );
192
+ const trigger = (await result.findAllByTestId("select-trigger"))[0];
193
+ fireEvent.pointerDown(trigger);
194
+ fireEvent.mouseDown(trigger);
195
+ fireEvent.click(trigger);
196
+ await result.findByTestId("select-dropdown");
197
+ expect(panelSheets().length).toBe(0);
198
+ },
199
+ );
200
+
201
+ it("a DropdownMenu with panelWidth screen in the sheet opens over its trigger", async () => {
202
+ renderWithProviders(
203
+ <SheetModal open onOpenChange={() => {}}>
204
+ <DropdownMenu
205
+ defaultOpen
206
+ panelWidth="screen"
207
+ items={[{ label: "Stop" }, { label: "Restart" }]}
208
+ >
209
+ <Button>Stack actions</Button>
210
+ </DropdownMenu>
211
+ </SheetModal>,
212
+ );
213
+ await waitFor(() => expect(document.querySelector('[role="menu"]')).toBeTruthy());
214
+ expect(document.querySelector('[data-testid="floating-panel-viewport"]')).toBeTruthy();
215
+ expect(panelSheets().length).toBe(0);
216
+ });
217
+
140
218
  it("the Menus in a sheet stories mount", () => {
141
219
  for (const story of [MenusInSheet, MenusInOpenSheet]) {
142
220
  const result = renderWithProviders(<>{story.render?.({} as never, {} as never)}</>);
@@ -765,6 +765,7 @@ function FloatingTreeSelect({
765
765
  pointerEvents={panel.visible ? "auto" : "none"}
766
766
  {...panel.knobProps.elevatedSurface}
767
767
  borderRadius={panel.dropdownRadius}
768
+ paddingBottom={panel.coverCornerInset || undefined}
768
769
  overflow="hidden"
769
770
  style={
770
771
  {
@@ -71,6 +71,13 @@ describe("ScopeMenu (LC-105 COVER-TRIGGER)", () => {
71
71
  spy.mockRestore();
72
72
  });
73
73
 
74
+ it("rounds the bar trigger's own box, so the menu covering it is not square (FZ-8438)", () => {
75
+ renderWithProviders(<Tenant />);
76
+ const trigger = screen.getByTestId("tenant-trigger");
77
+ expect(trigger.className).toMatch(/_btlr-/);
78
+ expect(trigger.className).not.toMatch(/_btlr-0px/);
79
+ });
80
+
74
81
  it("keeps the pressed item as the first row with its chevron flipped", async () => {
75
82
  renderWithProviders(<Tenant />);
76
83
  const trigger = screen.getByTestId("tenant-trigger");
@@ -16,7 +16,7 @@
16
16
  * Narrow viewports and native get FloatingPanel's sheet (phones take
17
17
  * sheets); the first-row contract holds there too.
18
18
  */
19
- import { FloatingPanel } from "@multiplatform.one/forms";
19
+ import { FloatingPanel, type PanelWidth } from "@multiplatform.one/forms";
20
20
  import { useMenuRowCheckInk, menuRowChecked, useResolvedKnobs } from "@multiplatform.one/theme";
21
21
  import { CaretDownIcon, CaretUpIcon, CheckIcon } from "@phosphor-icons/react";
22
22
  import { useState } from "react";
@@ -37,6 +37,8 @@ export interface ScopeMenuProps {
37
37
  /** Controlled open state (optional). */
38
38
  open?: boolean;
39
39
  onOpenChange?: (open: boolean) => void;
40
+ /** How wide the menu opens (LC-112): default `"content"`, at least the trigger. */
41
+ panelWidth?: PanelWidth;
40
42
  testID?: string;
41
43
  }
42
44
 
@@ -73,12 +75,20 @@ function ScopeRow({
73
75
  paddingHorizontal="$2.5"
74
76
  cursor="pointer"
75
77
  onPress={onPress}
76
- hoverStyle={{ ...control.hoverKnobProps }}
77
- pressStyle={{ ...control.pressKnobProps }}
78
+ // The echo row is the trigger itself, laid on the panel (LC-112): the
79
+ // pointer that opened the menu rests on it, and a wash there split the
80
+ // panel into two tones (FZ-8438 r3).
81
+ {...(chevron === "up"
82
+ ? undefined
83
+ : { hoverStyle: { ...control.hoverKnobProps }, pressStyle: { ...control.pressKnobProps } })}
78
84
  focusVisibleStyle={{ ...control.focusVisibleKnobProps }}
79
85
  {...(checked ? menuRowChecked(knobProps.scheme) : undefined)}
80
86
  data-testid={testID}
81
87
  data-chevron={chevron}
88
+ // LC-112 seamless cover (FZ-8438): the bar trigger's hover wash has the
89
+ // theme's control arc, so the menu that covers it measures a rounded box
90
+ // instead of a square one. Rows inside the menu stay square.
91
+ {...(chevron === "down" ? { borderRadius: knobProps.borderRadius.borderRadius } : undefined)}
82
92
  >
83
93
  {role === "menuitemradio" ? (
84
94
  <YStack width={iconSize} alignItems="center" aria-hidden>
@@ -100,6 +110,7 @@ export function ScopeMenu({
100
110
  onChange,
101
111
  open: openProp,
102
112
  onOpenChange,
113
+ panelWidth,
103
114
  testID = "scope-menu",
104
115
  }: ScopeMenuProps) {
105
116
  const [openState, setOpenState] = useState(false);
@@ -117,6 +128,7 @@ export function ScopeMenu({
117
128
  onOpenChange={setOpen}
118
129
  cover
119
130
  widthMode="at-least-trigger"
131
+ panelWidth={panelWidth}
120
132
  contentPadding="none"
121
133
  triggerSizing="content"
122
134
  triggerEcho={false}