@multiplatform.one/components 7.85.1 → 7.87.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 (431) hide show
  1. package/dist/cjs/Chip/index.cjs +1 -1
  2. package/dist/cjs/Chip/index.native.js +1 -1
  3. package/dist/cjs/Chip/index.native.js.map +1 -1
  4. package/dist/cjs/ChoiceChips/index.cjs +63 -0
  5. package/dist/cjs/ChoiceChips/index.native.js +71 -0
  6. package/dist/cjs/ChoiceChips/index.native.js.map +1 -0
  7. package/dist/cjs/Dialog.cjs +86 -3
  8. package/dist/cjs/Dialog.native.js +94 -3
  9. package/dist/cjs/Dialog.native.js.map +1 -1
  10. package/dist/cjs/ThemePresetPicker/index.cjs +15 -32
  11. package/dist/cjs/ThemePresetPicker/index.native.js +17 -32
  12. package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
  13. package/dist/cjs/appShell/AppShell.cjs +28 -9
  14. package/dist/cjs/appShell/AppShell.native.js +55 -13
  15. package/dist/cjs/appShell/AppShell.native.js.map +1 -1
  16. package/dist/cjs/feedback/ConfirmDialog.cjs +15 -2
  17. package/dist/cjs/feedback/ConfirmDialog.native.js +16 -2
  18. package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
  19. package/dist/cjs/feedback/index.cjs +1 -0
  20. package/dist/cjs/feedback/index.native.js +1 -0
  21. package/dist/cjs/feedback/index.native.js.map +1 -1
  22. package/dist/cjs/index.cjs +1 -0
  23. package/dist/cjs/index.native.js +1 -0
  24. package/dist/cjs/index.native.js.map +1 -1
  25. package/dist/cjs/layouts/AsyncBoundary.cjs +70 -21
  26. package/dist/cjs/layouts/AsyncBoundary.native.js +72 -21
  27. package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
  28. package/dist/cjs/layouts/IdentityPlate.cjs +17 -16
  29. package/dist/cjs/layouts/IdentityPlate.native.js +19 -18
  30. package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
  31. package/dist/cjs/layouts/asyncFailure.cjs +104 -0
  32. package/dist/cjs/layouts/asyncFailure.native.js +133 -0
  33. package/dist/cjs/layouts/asyncFailure.native.js.map +1 -0
  34. package/dist/cjs/layouts/index.cjs +4 -1
  35. package/dist/cjs/layouts/index.native.js +3 -0
  36. package/dist/cjs/layouts/index.native.js.map +1 -1
  37. package/dist/cjs/tamagui.cjs +1 -0
  38. package/dist/cjs/tamagui.native.js +1 -0
  39. package/dist/cjs/tamagui.native.js.map +1 -1
  40. package/dist/cjs/views/CardGrid.cjs +106 -0
  41. package/dist/cjs/views/CardGrid.native.js +116 -0
  42. package/dist/cjs/views/CardGrid.native.js.map +1 -0
  43. package/dist/cjs/views/ImageGrid.cjs +9 -2
  44. package/dist/cjs/views/ImageGrid.native.js +9 -2
  45. package/dist/cjs/views/ImageGrid.native.js.map +1 -1
  46. package/dist/cjs/views/index.cjs +2 -0
  47. package/dist/cjs/views/index.native.js +2 -0
  48. package/dist/cjs/views/index.native.js.map +1 -1
  49. package/dist/esm/Accordion/index.native.js.map +1 -1
  50. package/dist/esm/AnimateHeight/index.native.js.map +1 -1
  51. package/dist/esm/Avatar/getInitials.native.js.map +1 -1
  52. package/dist/esm/Avatar/index.native.js.map +1 -1
  53. package/dist/esm/Badge/index.native.js.map +1 -1
  54. package/dist/esm/Button.native.js.map +1 -1
  55. package/dist/esm/Carousel/geometry.native.js.map +1 -1
  56. package/dist/esm/Carousel/index.native.js.map +1 -1
  57. package/dist/esm/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
  58. package/dist/esm/CheckGlyph/index.native.js.map +1 -1
  59. package/dist/esm/Chip/index.mjs +1 -1
  60. package/dist/esm/Chip/index.mjs.map +1 -1
  61. package/dist/esm/Chip/index.native.js +1 -1
  62. package/dist/esm/Chip/index.native.js.map +1 -1
  63. package/dist/esm/ChoiceChips/index.mjs +38 -0
  64. package/dist/esm/ChoiceChips/index.mjs.map +1 -0
  65. package/dist/esm/ChoiceChips/index.native.js +43 -0
  66. package/dist/esm/ChoiceChips/index.native.js.map +1 -0
  67. package/dist/esm/Collapsible.native.js.map +1 -1
  68. package/dist/esm/ContextMenu/index.native.js.map +1 -1
  69. package/dist/esm/CopyField/CopyMenuButton.native.js.map +1 -1
  70. package/dist/esm/CopyField/index.native.js.map +1 -1
  71. package/dist/esm/Dialog.mjs +88 -6
  72. package/dist/esm/Dialog.mjs.map +1 -1
  73. package/dist/esm/Dialog.native.js +96 -6
  74. package/dist/esm/Dialog.native.js.map +1 -1
  75. package/dist/esm/Diff/diff.native.js.map +1 -1
  76. package/dist/esm/Diff/index.native.js.map +1 -1
  77. package/dist/esm/DotIndicator/index.native.js.map +1 -1
  78. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  79. package/dist/esm/DropdownMenu/menuSettle.native.js.map +1 -1
  80. package/dist/esm/ElapsedProgress/index.native.js.map +1 -1
  81. package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
  82. package/dist/esm/Heading.native.js.map +1 -1
  83. package/dist/esm/Kbd/index.native.js.map +1 -1
  84. package/dist/esm/Kbd/keys.native.js.map +1 -1
  85. package/dist/esm/Lightbox/MediaControl.native.js.map +1 -1
  86. package/dist/esm/Lightbox/index.gnome.native.js.map +1 -1
  87. package/dist/esm/Lightbox/shared.native.js.map +1 -1
  88. package/dist/esm/Lightbox/useLightbox.native.js.map +1 -1
  89. package/dist/esm/MachineLiteral/index.native.js.map +1 -1
  90. package/dist/esm/Material/index.native.js.map +1 -1
  91. package/dist/esm/Meter/index.native.js.map +1 -1
  92. package/dist/esm/Meter/meter.native.js.map +1 -1
  93. package/dist/esm/OverflowRow/index.native.js.map +1 -1
  94. package/dist/esm/Pagination.native.js.map +1 -1
  95. package/dist/esm/Popover.native.js.map +1 -1
  96. package/dist/esm/ProgressSteps/index.native.js.map +1 -1
  97. package/dist/esm/Quote/index.native.js.map +1 -1
  98. package/dist/esm/SchemeToggle/index.native.js.map +1 -1
  99. package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
  100. package/dist/esm/Separator/index.native.js.map +1 -1
  101. package/dist/esm/Sheet.native.js.map +1 -1
  102. package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
  103. package/dist/esm/SheetModal/SheetNavigation.native.js.map +1 -1
  104. package/dist/esm/SheetModal/detents.native.js.map +1 -1
  105. package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
  106. package/dist/esm/Skeleton/index.native.js.map +1 -1
  107. package/dist/esm/SkipLink/index.native.js.map +1 -1
  108. package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
  109. package/dist/esm/SortableList/index.native.js.map +1 -1
  110. package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
  111. package/dist/esm/SortableList/useUserOrder.native.js.map +1 -1
  112. package/dist/esm/Tabs/index.native.js.map +1 -1
  113. package/dist/esm/Text.native.js.map +1 -1
  114. package/dist/esm/ThemePresetPicker/index.mjs +16 -33
  115. package/dist/esm/ThemePresetPicker/index.mjs.map +1 -1
  116. package/dist/esm/ThemePresetPicker/index.native.js +18 -33
  117. package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
  118. package/dist/esm/Toast/index.native.js.map +1 -1
  119. package/dist/esm/Toast/store.native.js.map +1 -1
  120. package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
  121. package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
  122. package/dist/esm/TreeSelect/index.native.js.map +1 -1
  123. package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
  124. package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
  125. package/dist/esm/Video/VideoFrame.native.js.map +1 -1
  126. package/dist/esm/Video/types.native.js.map +1 -1
  127. package/dist/esm/Wheel/index.native.js.map +1 -1
  128. package/dist/esm/Wizard/index.native.js.map +1 -1
  129. package/dist/esm/actions/ActionBar.native.js.map +1 -1
  130. package/dist/esm/actions/DangerSection.native.js.map +1 -1
  131. package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
  132. package/dist/esm/actions/HeaderActions.native.js.map +1 -1
  133. package/dist/esm/actions/StandardAction.native.js.map +1 -1
  134. package/dist/esm/actions/devWarn.native.js.map +1 -1
  135. package/dist/esm/actions/index.native.js.map +1 -1
  136. package/dist/esm/actions/severity.native.js.map +1 -1
  137. package/dist/esm/appShell/AppShell.mjs +28 -9
  138. package/dist/esm/appShell/AppShell.mjs.map +1 -1
  139. package/dist/esm/appShell/AppShell.native.js +55 -13
  140. package/dist/esm/appShell/AppShell.native.js.map +1 -1
  141. package/dist/esm/appShell/BottomChromeClearance.native.js.map +1 -1
  142. package/dist/esm/appShell/Dock.native.js.map +1 -1
  143. package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
  144. package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
  145. package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
  146. package/dist/esm/appShell/Springboard.native.js.map +1 -1
  147. package/dist/esm/appShell/SystemBar.native.js.map +1 -1
  148. package/dist/esm/appShell/TabBar.native.js.map +1 -1
  149. package/dist/esm/appShell/appTile.native.js.map +1 -1
  150. package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
  151. package/dist/esm/appShell/index.native.js.map +1 -1
  152. package/dist/esm/charts/Axis.native.js.map +1 -1
  153. package/dist/esm/charts/BarChart.native.js.map +1 -1
  154. package/dist/esm/charts/ChartDataView.native.js.map +1 -1
  155. package/dist/esm/charts/ChartSurface.native.js.map +1 -1
  156. package/dist/esm/charts/LineChart.native.js.map +1 -1
  157. package/dist/esm/charts/PieChart.native.js.map +1 -1
  158. package/dist/esm/charts/Sparkline.native.js.map +1 -1
  159. package/dist/esm/charts/accessibility.native.js.map +1 -1
  160. package/dist/esm/charts/chartHeight.native.js.map +1 -1
  161. package/dist/esm/charts/composeChart.native.js.map +1 -1
  162. package/dist/esm/charts/index.native.js.map +1 -1
  163. package/dist/esm/charts/math.native.js.map +1 -1
  164. package/dist/esm/charts/series.native.js.map +1 -1
  165. package/dist/esm/charts/svg.native.js.map +1 -1
  166. package/dist/esm/charts/types.native.js.map +1 -1
  167. package/dist/esm/charts/useChartTheme.native.js.map +1 -1
  168. package/dist/esm/code/Code/index.native.js.map +1 -1
  169. package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
  170. package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
  171. package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
  172. package/dist/esm/code/Highlighter/index.native.js.map +1 -1
  173. package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
  174. package/dist/esm/code/LogView.native.js.map +1 -1
  175. package/dist/esm/code/Pre/index.native.js.map +1 -1
  176. package/dist/esm/code/index.native.js.map +1 -1
  177. package/dist/esm/componentColors.native.js.map +1 -1
  178. package/dist/esm/feedback/ConfirmDialog.mjs +14 -2
  179. package/dist/esm/feedback/ConfirmDialog.mjs.map +1 -1
  180. package/dist/esm/feedback/ConfirmDialog.native.js +15 -2
  181. package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
  182. package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
  183. package/dist/esm/feedback/copy.native.js.map +1 -1
  184. package/dist/esm/feedback/index.mjs +2 -2
  185. package/dist/esm/feedback/index.mjs.map +1 -1
  186. package/dist/esm/feedback/index.native.js +2 -2
  187. package/dist/esm/feedback/index.native.js.map +1 -1
  188. package/dist/esm/feedback/notify.native.js.map +1 -1
  189. package/dist/esm/feedback/route.native.js.map +1 -1
  190. package/dist/esm/feedback/store.native.js.map +1 -1
  191. package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
  192. package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
  193. package/dist/esm/formLayouts/index.native.js.map +1 -1
  194. package/dist/esm/hooks/index.native.js.map +1 -1
  195. package/dist/esm/hooks/useClipboard.native.js.map +1 -1
  196. package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
  197. package/dist/esm/hooks/useHoldCue.native.js.map +1 -1
  198. package/dist/esm/icons/CheckRegular.native.js.map +1 -1
  199. package/dist/esm/icons/MinusRegular.native.js.map +1 -1
  200. package/dist/esm/icons/index.native.js.map +1 -1
  201. package/dist/esm/icons/lucide.native.js.map +1 -1
  202. package/dist/esm/icons/themed.native.js.map +1 -1
  203. package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
  204. package/dist/esm/images/Image/framing.native.js.map +1 -1
  205. package/dist/esm/images/Image/mediaRadius.native.js.map +1 -1
  206. package/dist/esm/images/Image/shared.native.js.map +1 -1
  207. package/dist/esm/images/Image/types.native.js.map +1 -1
  208. package/dist/esm/images/index.native.js.map +1 -1
  209. package/dist/esm/index.mjs +1 -0
  210. package/dist/esm/index.mjs.map +1 -1
  211. package/dist/esm/index.native.js +1 -0
  212. package/dist/esm/index.native.js.map +1 -1
  213. package/dist/esm/knobImmuneExports.native.js.map +1 -1
  214. package/dist/esm/layouts/AsyncBoundary.mjs +70 -21
  215. package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
  216. package/dist/esm/layouts/AsyncBoundary.native.js +72 -21
  217. package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
  218. package/dist/esm/layouts/Debug/index.native.js.map +1 -1
  219. package/dist/esm/layouts/EmptyState.native.js.map +1 -1
  220. package/dist/esm/layouts/IdentityPlate.mjs +17 -16
  221. package/dist/esm/layouts/IdentityPlate.mjs.map +1 -1
  222. package/dist/esm/layouts/IdentityPlate.native.js +19 -18
  223. package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
  224. package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
  225. package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
  226. package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
  227. package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
  228. package/dist/esm/layouts/StatusDot.native.js.map +1 -1
  229. package/dist/esm/layouts/StatusGlyphStrip.native.js.map +1 -1
  230. package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
  231. package/dist/esm/layouts/asyncFailure.mjs +78 -0
  232. package/dist/esm/layouts/asyncFailure.mjs.map +1 -0
  233. package/dist/esm/layouts/asyncFailure.native.js +104 -0
  234. package/dist/esm/layouts/asyncFailure.native.js.map +1 -0
  235. package/dist/esm/layouts/attachments.native.js.map +1 -1
  236. package/dist/esm/layouts/barTitleSpan.native.js.map +1 -1
  237. package/dist/esm/layouts/bottomAccessory.native.js.map +1 -1
  238. package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
  239. package/dist/esm/layouts/index.mjs +2 -1
  240. package/dist/esm/layouts/index.mjs.map +1 -1
  241. package/dist/esm/layouts/index.native.js +2 -1
  242. package/dist/esm/layouts/index.native.js.map +1 -1
  243. package/dist/esm/layouts/page.native.js.map +1 -1
  244. package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
  245. package/dist/esm/layouts/screenScroll.native.js.map +1 -1
  246. package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
  247. package/dist/esm/layouts/sidebar.native.js.map +1 -1
  248. package/dist/esm/layouts/tags.native.js.map +1 -1
  249. package/dist/esm/layouts/timeline.native.js.map +1 -1
  250. package/dist/esm/layouts/toolbar.native.js.map +1 -1
  251. package/dist/esm/shared/actionScan.native.js.map +1 -1
  252. package/dist/esm/shared/i18n.native.js.map +1 -1
  253. package/dist/esm/shared/restoreRetries.native.js.map +1 -1
  254. package/dist/esm/shared/t.native.js.map +1 -1
  255. package/dist/esm/shared/textRidesText.native.js.map +1 -1
  256. package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
  257. package/dist/esm/surfaces.native.js.map +1 -1
  258. package/dist/esm/tamagui.mjs +2 -2
  259. package/dist/esm/tamagui.mjs.map +1 -1
  260. package/dist/esm/tamagui.native.js +2 -2
  261. package/dist/esm/tamagui.native.js.map +1 -1
  262. package/dist/esm/testSetup.native.js.map +1 -1
  263. package/dist/esm/utils/setTinted.native.js.map +1 -1
  264. package/dist/esm/utils/unwrapText.native.js.map +1 -1
  265. package/dist/esm/views/Calendar.native.js.map +1 -1
  266. package/dist/esm/views/CardGrid.mjs +70 -0
  267. package/dist/esm/views/CardGrid.mjs.map +1 -0
  268. package/dist/esm/views/CardGrid.native.js +77 -0
  269. package/dist/esm/views/CardGrid.native.js.map +1 -0
  270. package/dist/esm/views/Dashboard.native.js.map +1 -1
  271. package/dist/esm/views/Gantt.native.js.map +1 -1
  272. package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
  273. package/dist/esm/views/ImageGrid.mjs +9 -3
  274. package/dist/esm/views/ImageGrid.mjs.map +1 -1
  275. package/dist/esm/views/ImageGrid.native.js +9 -3
  276. package/dist/esm/views/ImageGrid.native.js.map +1 -1
  277. package/dist/esm/views/List.native.js.map +1 -1
  278. package/dist/esm/views/ListGroup.native.js.map +1 -1
  279. package/dist/esm/views/ListRow.native.js.map +1 -1
  280. package/dist/esm/views/Matrix.native.js.map +1 -1
  281. package/dist/esm/views/ReportBuilder.native.js.map +1 -1
  282. package/dist/esm/views/ShortcutCard.native.js.map +1 -1
  283. package/dist/esm/views/TreeView.native.js.map +1 -1
  284. package/dist/esm/views/calendarMath.native.js.map +1 -1
  285. package/dist/esm/views/ganttIntervals.native.js.map +1 -1
  286. package/dist/esm/views/ganttMath.native.js.map +1 -1
  287. package/dist/esm/views/index.mjs +2 -1
  288. package/dist/esm/views/index.mjs.map +1 -1
  289. package/dist/esm/views/index.native.js +2 -1
  290. package/dist/esm/views/index.native.js.map +1 -1
  291. package/dist/esm/views/kanbanDnd.native.js.map +1 -1
  292. package/dist/esm/views/matrixMath.native.js.map +1 -1
  293. package/dist/esm/views/sameNameScope.native.js.map +1 -1
  294. package/dist/esm/views/treeViewDnd.native.js.map +1 -1
  295. package/dist/esm/views/treeViewLayout.native.js.map +1 -1
  296. package/dist/esm/views/treeViewMotion.native.js.map +1 -1
  297. package/dist/esm/views/treeViewReveal.native.js.map +1 -1
  298. package/dist/esm/views/usePageFlowLoadMore.native.js.map +1 -1
  299. package/dist/esm/views/widgetChrome.native.js.map +1 -1
  300. package/dist/jsx/Chip/index.mjs +1 -1
  301. package/dist/jsx/Chip/index.mjs.map +1 -1
  302. package/dist/jsx/Chip/index.native.js +1 -1
  303. package/dist/jsx/Chip/index.native.js.map +1 -1
  304. package/dist/jsx/ChoiceChips/index.mjs +38 -0
  305. package/dist/jsx/ChoiceChips/index.mjs.map +1 -0
  306. package/dist/jsx/ChoiceChips/index.native.js +71 -0
  307. package/dist/jsx/ChoiceChips/index.native.js.map +1 -0
  308. package/dist/jsx/Dialog.mjs +88 -6
  309. package/dist/jsx/Dialog.mjs.map +1 -1
  310. package/dist/jsx/Dialog.native.js +94 -3
  311. package/dist/jsx/Dialog.native.js.map +1 -1
  312. package/dist/jsx/ThemePresetPicker/index.mjs +16 -33
  313. package/dist/jsx/ThemePresetPicker/index.mjs.map +1 -1
  314. package/dist/jsx/ThemePresetPicker/index.native.js +17 -32
  315. package/dist/jsx/ThemePresetPicker/index.native.js.map +1 -1
  316. package/dist/jsx/appShell/AppShell.mjs +28 -9
  317. package/dist/jsx/appShell/AppShell.mjs.map +1 -1
  318. package/dist/jsx/appShell/AppShell.native.js +55 -13
  319. package/dist/jsx/appShell/AppShell.native.js.map +1 -1
  320. package/dist/jsx/feedback/ConfirmDialog.mjs +14 -2
  321. package/dist/jsx/feedback/ConfirmDialog.mjs.map +1 -1
  322. package/dist/jsx/feedback/ConfirmDialog.native.js +16 -2
  323. package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
  324. package/dist/jsx/feedback/index.mjs +2 -2
  325. package/dist/jsx/feedback/index.mjs.map +1 -1
  326. package/dist/jsx/feedback/index.native.js +1 -0
  327. package/dist/jsx/feedback/index.native.js.map +1 -1
  328. package/dist/jsx/index.js +1 -0
  329. package/dist/jsx/index.js.map +1 -1
  330. package/dist/jsx/index.mjs +1 -0
  331. package/dist/jsx/index.mjs.map +1 -1
  332. package/dist/jsx/index.native.js +1 -0
  333. package/dist/jsx/index.native.js.map +1 -1
  334. package/dist/jsx/layouts/AsyncBoundary.mjs +70 -21
  335. package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
  336. package/dist/jsx/layouts/AsyncBoundary.native.js +72 -21
  337. package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
  338. package/dist/jsx/layouts/IdentityPlate.mjs +17 -16
  339. package/dist/jsx/layouts/IdentityPlate.mjs.map +1 -1
  340. package/dist/jsx/layouts/IdentityPlate.native.js +19 -18
  341. package/dist/jsx/layouts/IdentityPlate.native.js.map +1 -1
  342. package/dist/jsx/layouts/asyncFailure.mjs +78 -0
  343. package/dist/jsx/layouts/asyncFailure.mjs.map +1 -0
  344. package/dist/jsx/layouts/asyncFailure.native.js +133 -0
  345. package/dist/jsx/layouts/asyncFailure.native.js.map +1 -0
  346. package/dist/jsx/layouts/index.mjs +2 -1
  347. package/dist/jsx/layouts/index.mjs.map +1 -1
  348. package/dist/jsx/layouts/index.native.js +3 -0
  349. package/dist/jsx/layouts/index.native.js.map +1 -1
  350. package/dist/jsx/tamagui.mjs +2 -2
  351. package/dist/jsx/tamagui.mjs.map +1 -1
  352. package/dist/jsx/tamagui.native.js +1 -0
  353. package/dist/jsx/tamagui.native.js.map +1 -1
  354. package/dist/jsx/views/CardGrid.mjs +70 -0
  355. package/dist/jsx/views/CardGrid.mjs.map +1 -0
  356. package/dist/jsx/views/CardGrid.native.js +116 -0
  357. package/dist/jsx/views/CardGrid.native.js.map +1 -0
  358. package/dist/jsx/views/ImageGrid.mjs +9 -3
  359. package/dist/jsx/views/ImageGrid.mjs.map +1 -1
  360. package/dist/jsx/views/ImageGrid.native.js +9 -2
  361. package/dist/jsx/views/ImageGrid.native.js.map +1 -1
  362. package/dist/jsx/views/index.mjs +2 -1
  363. package/dist/jsx/views/index.mjs.map +1 -1
  364. package/dist/jsx/views/index.native.js +2 -0
  365. package/dist/jsx/views/index.native.js.map +1 -1
  366. package/package.json +9 -9
  367. package/src/Chip/index.tsx +5 -2
  368. package/src/ChoiceChips/ChoiceChips.spec.tsx +58 -0
  369. package/src/ChoiceChips/ChoiceChips.stories.tsx +49 -0
  370. package/src/ChoiceChips/index.tsx +57 -0
  371. package/src/Dialog.phoneSheet.spec.tsx +186 -0
  372. package/src/Dialog.tsx +143 -5
  373. package/src/ThemePresetPicker/ThemePresetPicker.spec.tsx +5 -13
  374. package/src/ThemePresetPicker/index.tsx +16 -41
  375. package/src/appShell/AppShell.spec.tsx +47 -0
  376. package/src/appShell/AppShell.stories.spec.tsx +27 -0
  377. package/src/appShell/AppShell.stories.tsx +82 -11
  378. package/src/appShell/AppShell.tsx +36 -12
  379. package/src/feedback/ConfirmDialog.tsx +26 -2
  380. package/src/feedback/index.ts +1 -1
  381. package/src/index.ts +1 -0
  382. package/src/layouts/AsyncBoundary.reason.spec.tsx +161 -0
  383. package/src/layouts/AsyncBoundary.stories.tsx +26 -0
  384. package/src/layouts/AsyncBoundary.tsx +107 -25
  385. package/src/layouts/IdentityPlate.native-press.spec.tsx +71 -0
  386. package/src/layouts/IdentityPlate.spec.tsx +69 -0
  387. package/src/layouts/IdentityPlate.tsx +14 -17
  388. package/src/layouts/asyncFailure.ts +110 -0
  389. package/src/layouts/index.tsx +7 -0
  390. package/src/layouts/pageTitleOneLine.spec.tsx +26 -0
  391. package/src/overlayStack.native-press.spec.tsx +34 -0
  392. package/src/surfaces.spec.tsx +42 -0
  393. package/src/tamagui.ts +8 -2
  394. package/src/testUtilsTimeouts.spec.ts +8 -0
  395. package/src/views/CardGrid.spec.tsx +95 -0
  396. package/src/views/CardGrid.stories.tsx +70 -0
  397. package/src/views/CardGrid.tsx +85 -0
  398. package/src/views/ImageGrid.tsx +13 -5
  399. package/src/views/index.ts +1 -0
  400. package/types/Chip/index.d.ts +4 -1
  401. package/types/Chip/index.d.ts.map +1 -1
  402. package/types/ChoiceChips/index.d.ts +24 -0
  403. package/types/ChoiceChips/index.d.ts.map +1 -0
  404. package/types/Dialog.d.ts +262 -2
  405. package/types/Dialog.d.ts.map +1 -1
  406. package/types/ThemePresetPicker/index.d.ts +1 -3
  407. package/types/ThemePresetPicker/index.d.ts.map +1 -1
  408. package/types/appShell/AppShell.d.ts +8 -0
  409. package/types/appShell/AppShell.d.ts.map +1 -1
  410. package/types/feedback/ConfirmDialog.d.ts +13 -1
  411. package/types/feedback/ConfirmDialog.d.ts.map +1 -1
  412. package/types/feedback/index.d.ts +1 -1
  413. package/types/feedback/index.d.ts.map +1 -1
  414. package/types/index.d.ts +1 -0
  415. package/types/index.d.ts.map +1 -1
  416. package/types/layouts/AsyncBoundary.d.ts +16 -1
  417. package/types/layouts/AsyncBoundary.d.ts.map +1 -1
  418. package/types/layouts/IdentityPlate.d.ts +1 -1
  419. package/types/layouts/IdentityPlate.d.ts.map +1 -1
  420. package/types/layouts/asyncFailure.d.ts +21 -0
  421. package/types/layouts/asyncFailure.d.ts.map +1 -0
  422. package/types/layouts/index.d.ts +1 -0
  423. package/types/layouts/index.d.ts.map +1 -1
  424. package/types/tamagui.d.ts +2 -2
  425. package/types/tamagui.d.ts.map +1 -1
  426. package/types/views/CardGrid.d.ts +10 -0
  427. package/types/views/CardGrid.d.ts.map +1 -0
  428. package/types/views/ImageGrid.d.ts +10 -1
  429. package/types/views/ImageGrid.d.ts.map +1 -1
  430. package/types/views/index.d.ts +1 -0
  431. package/types/views/index.d.ts.map +1 -1
@@ -0,0 +1,58 @@
1
+ import { fireEvent, render, screen } from "@testing-library/react";
2
+ import { TamaguiProvider } from "tamagui";
3
+ import { describe, expect, it, vi } from "vitest";
4
+ import { createDefaultThemeConfig } from "@multiplatform.one/theme";
5
+ import { ChoiceChips } from "./index";
6
+
7
+ const config = createDefaultThemeConfig({});
8
+ const colors = [
9
+ { value: "", label: "(default)", swatch: "$color12" as const },
10
+ { value: "blue", label: "blue", swatch: "$blue9" as const },
11
+ { value: "green", label: "green", swatch: "$green9" as const },
12
+ ];
13
+
14
+ function renderChoices(value: string, onChange = vi.fn()) {
15
+ render(
16
+ <TamaguiProvider config={config.tamagui} defaultTheme="light">
17
+ <ChoiceChips label="Color" options={colors} value={value} onChange={onChange} />
18
+ </TamaguiProvider>,
19
+ );
20
+ return onChange;
21
+ }
22
+
23
+ describe("ChoiceChips", () => {
24
+ it("labels the row with visible text that also names the group", () => {
25
+ renderChoices("blue");
26
+ const group = screen.getByRole("group", { name: "Color" });
27
+ expect(group.previousElementSibling?.textContent).toBe("Color");
28
+ });
29
+
30
+ it("wraps the chips inside the row instead of scrolling them past its edge", () => {
31
+ renderChoices("blue");
32
+ const group = screen.getByRole("group", { name: "Color" });
33
+ expect(group.className).toContain("_fwr-wrap");
34
+ expect(group.className).toContain("_rowGap-c-space-2");
35
+ });
36
+
37
+ it("marks the chosen chip once: the only tinted chip, its check in the swatch's place", () => {
38
+ renderChoices("blue");
39
+ const picked = screen.getByRole("button", { name: "Color: blue" });
40
+ expect(picked.getAttribute("aria-pressed")).toBe("true");
41
+ expect(picked.className).toContain("_bg-selectedBac");
42
+ expect(picked.querySelector("[data-chip-swatch]")).toBeNull();
43
+ expect(picked.querySelectorAll("svg")).toHaveLength(1);
44
+ for (const name of ["Color: (default)", "Color: green"]) {
45
+ const other = screen.getByRole("button", { name });
46
+ expect(other.getAttribute("aria-pressed")).toBe("false");
47
+ expect(other.className).toContain("_bg-transparent");
48
+ expect(other.querySelector("[data-chip-swatch]")).not.toBeNull();
49
+ expect(other.querySelectorAll("svg")).toHaveLength(0);
50
+ }
51
+ });
52
+
53
+ it("reports the pressed option's value", () => {
54
+ const onChange = renderChoices("blue");
55
+ fireEvent.click(screen.getByRole("button", { name: "Color: green" }));
56
+ expect(onChange).toHaveBeenCalledWith("green");
57
+ });
58
+ });
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
2
+ import { useState } from "react";
3
+ import { YStack } from "tamagui";
4
+ import { ChoiceChips, type ChoiceChipsOption } from "./index";
5
+
6
+ const colors: ChoiceChipsOption[] = [
7
+ "blue",
8
+ "green",
9
+ "orange",
10
+ "pink",
11
+ "purple",
12
+ "red",
13
+ "teal",
14
+ "yellow",
15
+ "gray",
16
+ ].map((hue) => ({ value: hue, label: hue, swatch: `$${hue}9` as ChoiceChipsOption["swatch"] }));
17
+
18
+ const sizes: ChoiceChipsOption[] = ["None", "Small", "Medium", "Large", "Full"].map((label) => ({
19
+ value: label.toLowerCase(),
20
+ label,
21
+ }));
22
+
23
+ function Choices({
24
+ options,
25
+ label,
26
+ initial,
27
+ }: {
28
+ options: ChoiceChipsOption[];
29
+ label: string;
30
+ initial: string;
31
+ }) {
32
+ const [value, setValue] = useState(initial);
33
+ return <ChoiceChips label={label} options={options} value={value} onChange={setValue} />;
34
+ }
35
+
36
+ const meta: Meta<typeof ChoiceChips> = {
37
+ title: "Components/ChoiceChips",
38
+ component: ChoiceChips,
39
+ render: () => (
40
+ <YStack gap="$3" maxWidth={358}>
41
+ <Choices label="Color" options={colors} initial="purple" />
42
+ <Choices label="Border Radius" options={sizes} initial="medium" />
43
+ </YStack>
44
+ ),
45
+ };
46
+ export default meta;
47
+
48
+ type Story = StoryObj<typeof ChoiceChips>;
49
+ export const Default: Story = {};
@@ -0,0 +1,57 @@
1
+ import { XStack, YStack, type ColorTokens } from "tamagui";
2
+ import { Chip } from "../Chip";
3
+ import { Paragraph } from "../Text";
4
+
5
+ export interface ChoiceChipsOption {
6
+ value: string;
7
+ label: string;
8
+ /** A colour sample for the option; the selected chip's check takes its place. */
9
+ swatch?: ColorTokens;
10
+ }
11
+
12
+ export interface ChoiceChipsProps {
13
+ /** The row's visible label, also the group's accessible name. */
14
+ label: string;
15
+ options: ReadonlyArray<ChoiceChipsOption>;
16
+ value: string | undefined;
17
+ onChange: (value: string) => void;
18
+ testID?: string;
19
+ }
20
+
21
+ /**
22
+ * A labelled single-choice row of chips (FZ-8440). The chips wrap inside the
23
+ * row's width instead of scrolling past the edge, at the `$2` row pitch the
24
+ * chip's press slop is sized for (K12). Unchosen chips rest outlined so the
25
+ * chosen one stands out by its selection tint alone, the way a checked menu
26
+ * row does (LC-262).
27
+ */
28
+ export function ChoiceChips({ label, options, value, onChange, testID }: ChoiceChipsProps) {
29
+ return (
30
+ <YStack testID={testID} gap="$1.5">
31
+ <Paragraph fontSize="$2" color="$color11">
32
+ {label}
33
+ </Paragraph>
34
+ <XStack
35
+ role="group"
36
+ aria-label={label}
37
+ flexWrap="wrap"
38
+ columnGap="$1.5"
39
+ rowGap="$2"
40
+ data-choice-chips=""
41
+ >
42
+ {options.map((option) => (
43
+ <Chip
44
+ key={option.value || "(default)"}
45
+ aria-label={`${label}: ${option.label}`}
46
+ variant="outlined"
47
+ selected={(value ?? "") === option.value}
48
+ swatch={option.swatch}
49
+ onPress={() => onChange(option.value)}
50
+ >
51
+ {option.label}
52
+ </Chip>
53
+ ))}
54
+ </XStack>
55
+ </YStack>
56
+ );
57
+ }
@@ -0,0 +1,186 @@
1
+ /**
2
+ * LC-269 PHONE-DIALOG-AS-SHEET. At the overlay pivot and below a content
3
+ * dialog presents as a bottom sheet (SheetModal); an alert-shaped confirm
4
+ * stays a centred alert; desktop, an explicit eject and a dialog opened inside
5
+ * another overlay keep the centred dialog.
6
+ */
7
+ import { OverlayStackProvider } from "@multiplatform.one/forms";
8
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
9
+ import { cleanup, fireEvent, waitFor } from "@testing-library/react";
10
+ import { useState, type ReactNode } from "react";
11
+ import { afterEach, describe, expect, it, vi } from "vitest";
12
+ import { Dialog, type DialogPhonePresentation } from "./Dialog";
13
+ import { ConfirmDialog, confirmDialogPresentation } from "./feedback/ConfirmDialog";
14
+ import { DialogContent, DialogOverlay } from "./surfaces";
15
+ import { Paragraph } from "./Text";
16
+
17
+ const originalInnerWidth = window.innerWidth;
18
+
19
+ function setViewportWidth(width: number) {
20
+ Object.defineProperty(window, "innerWidth", {
21
+ configurable: true,
22
+ writable: true,
23
+ value: width,
24
+ });
25
+ window.dispatchEvent(new Event("resize"));
26
+ }
27
+
28
+ afterEach(() => {
29
+ cleanup();
30
+ setViewportWidth(originalInnerWidth);
31
+ });
32
+
33
+ function ContentDialog({
34
+ phonePresentation,
35
+ onOpenChange,
36
+ }: {
37
+ phonePresentation?: DialogPhonePresentation;
38
+ onOpenChange?: (open: boolean) => void;
39
+ }) {
40
+ const [open, setOpen] = useState(true);
41
+ return (
42
+ <Dialog
43
+ modal
44
+ open={open}
45
+ onOpenChange={(next) => {
46
+ setOpen(next);
47
+ onOpenChange?.(next);
48
+ }}
49
+ phonePresentation={phonePresentation}
50
+ >
51
+ <Dialog.Portal>
52
+ <DialogOverlay key="overlay" />
53
+ <DialogContent key="content" maxWidth={480}>
54
+ <Dialog.Title>Edit profile</Dialog.Title>
55
+ <Paragraph>Content dialog body</Paragraph>
56
+ </DialogContent>
57
+ </Dialog.Portal>
58
+ </Dialog>
59
+ );
60
+ }
61
+
62
+ const sheetFace = () => document.querySelector("[data-mp-dialog-face='sheet']");
63
+ const grabber = () => document.querySelector("[aria-label='Resize']");
64
+ const confirmFrame = () => document.querySelector("[data-mp-confirm-dialog]");
65
+
66
+ function centredFrameWith(text: string) {
67
+ return Array.from(document.querySelectorAll("[role='dialog'], [role='alertdialog']")).find(
68
+ (el) => el.textContent?.includes(text) && !el.closest("[data-mp-dialog-face]"),
69
+ );
70
+ }
71
+
72
+ async function expectSheetHolding(text: string) {
73
+ await waitFor(() => expect(sheetFace()?.textContent).toContain(text));
74
+ expect(grabber()).not.toBeNull();
75
+ }
76
+
77
+ async function expectCentredHolding(text: string) {
78
+ await waitFor(() => expect(document.body.textContent).toContain(text));
79
+ expect(sheetFace()).toBeNull();
80
+ expect(grabber()).toBeNull();
81
+ }
82
+
83
+ describe("LC-269 a content dialog is a sheet at phone width", () => {
84
+ it("at 390 a house Dialog presents its content in the bottom sheet", async () => {
85
+ setViewportWidth(390);
86
+ renderWithProviders(<ContentDialog />);
87
+ await expectSheetHolding("Content dialog body");
88
+ });
89
+
90
+ it("at 640, the pivot, it is still the sheet", async () => {
91
+ setViewportWidth(640);
92
+ renderWithProviders(<ContentDialog />);
93
+ await expectSheetHolding("Content dialog body");
94
+ });
95
+
96
+ it("at 1440 the same dialog is the centred dialog (desktop unchanged)", async () => {
97
+ setViewportWidth(1440);
98
+ renderWithProviders(<ContentDialog />);
99
+ await expectCentredHolding("Content dialog body");
100
+ expect(centredFrameWith("Content dialog body")).toBeDefined();
101
+ });
102
+
103
+ it('phonePresentation="dialog" ejects: centred at 390', async () => {
104
+ setViewportWidth(390);
105
+ renderWithProviders(<ContentDialog phonePresentation="dialog" />);
106
+ await expectCentredHolding("Content dialog body");
107
+ expect(centredFrameWith("Content dialog body")).toBeDefined();
108
+ });
109
+
110
+ it("a dialog opened inside another overlay stays centred (LC-164: no sheet on a sheet)", async () => {
111
+ setViewportWidth(390);
112
+ renderWithProviders(
113
+ <OverlayStackProvider zIndex={100_000}>
114
+ <ContentDialog />
115
+ </OverlayStackProvider>,
116
+ );
117
+ await expectCentredHolding("Content dialog body");
118
+ });
119
+
120
+ it("Escape closes the sheet once", async () => {
121
+ setViewportWidth(390);
122
+ const onOpenChange = vi.fn();
123
+ renderWithProviders(<ContentDialog onOpenChange={onOpenChange} />);
124
+ await expectSheetHolding("Content dialog body");
125
+ fireEvent.keyDown(window, { key: "Escape" });
126
+ await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false));
127
+ expect(onOpenChange.mock.calls.filter(([next]) => next === false)).toHaveLength(1);
128
+ });
129
+ });
130
+
131
+ function Confirm({ children, body }: { children?: ReactNode; body?: ReactNode }) {
132
+ return (
133
+ <ConfirmDialog
134
+ open
135
+ title="Jump to field"
136
+ body={body}
137
+ confirmLabel="Jump"
138
+ allowManyActions
139
+ onOpenChange={() => {}}
140
+ >
141
+ {children}
142
+ </ConfirmDialog>
143
+ );
144
+ }
145
+
146
+ describe("LC-269 ConfirmDialog: alert-shaped stays an alert, content is a sheet", () => {
147
+ it("at 390 a title, one line and two actions stay a centred alert", async () => {
148
+ setViewportWidth(390);
149
+ renderWithProviders(<Confirm body="Your unsaved edits will be discarded." />);
150
+ await expectCentredHolding("Your unsaved edits will be discarded.");
151
+ expect(confirmFrame()?.getAttribute("role")).toBe("alertdialog");
152
+ });
153
+
154
+ it("at 390 a confirm holding a search and a list presents as the sheet", async () => {
155
+ setViewportWidth(390);
156
+ renderWithProviders(
157
+ <Confirm>
158
+ <input aria-label="Search fields" />
159
+ <Paragraph>Customer name</Paragraph>
160
+ </Confirm>,
161
+ );
162
+ await expectSheetHolding("Customer name");
163
+ expect(confirmFrame()).toBeNull();
164
+ });
165
+
166
+ it("at 1440 the content confirm is still the centred dialog", async () => {
167
+ setViewportWidth(1440);
168
+ renderWithProviders(
169
+ <Confirm>
170
+ <Paragraph>Customer name</Paragraph>
171
+ </Confirm>,
172
+ );
173
+ await expectCentredHolding("Customer name");
174
+ expect(confirmFrame()).not.toBeNull();
175
+ });
176
+
177
+ it("classifies by shape", () => {
178
+ expect(confirmDialogPresentation({})).toBe("dialog");
179
+ expect(confirmDialogPresentation({ body: "One line." })).toBe("dialog");
180
+ expect(confirmDialogPresentation({ children: "One line." })).toBe("dialog");
181
+ expect(confirmDialogPresentation({ children: <Paragraph>List</Paragraph> })).toBe("sheet");
182
+ expect(confirmDialogPresentation({ body: "Wins", children: <Paragraph>List</Paragraph> })).toBe(
183
+ "dialog",
184
+ );
185
+ });
186
+ });
package/src/Dialog.tsx CHANGED
@@ -16,17 +16,51 @@
16
16
  * Their Portal binds the overlay stack (FZ-7869): a dialog opened from a sheet
17
17
  * or another dialog sits one `$zIndex` step above it, and on native it would
18
18
  * otherwise reach the root host with no zIndex and mount under the sheet.
19
- * Every other part is the tamagui one.
19
+ *
20
+ * LC-269 PHONE-DIALOG-AS-SHEET: at the overlay pivot and below (web 640, and
21
+ * every native window) the house Dialog is a content dialog, so its Portal
22
+ * presents in SheetModal: the bottom sheet on a phone, the width-capped panel
23
+ * at an iPad's regular width (FZ-8116). Desktop keeps the centred dialog.
24
+ * AlertDialog is the alert-shaped one and stays centred everywhere, as
25
+ * UIAlertController does. A dialog opened inside another overlay stays
26
+ * centred (LC-164: no sheet on a sheet), and `phonePresentation="dialog"`
27
+ * ejects. No tamagui Adapt: its content portal does not survive SheetModal's
28
+ * native window (a nested PortalProvider), so the Portal itself swaps hosts
29
+ * and the house DialogContent renders as the sheet's column and the house
30
+ * DialogOverlay as nothing (`DialogSheetFaceProvider`, theme). The raw
31
+ * tamagui Content and Overlay parts stay tamagui's.
20
32
  */
21
- import { withOverlayStack } from "@multiplatform.one/forms";
22
- import { isValidElement, type ComponentType, type ReactNode } from "react";
33
+ import {
34
+ OverlayStackProvider,
35
+ overlayStackStep,
36
+ useOverlayParentZIndex,
37
+ useOverlayZIndex,
38
+ useViewportGtSm,
39
+ withOverlayStack,
40
+ } from "@multiplatform.one/forms";
41
+ import { DialogSheetFaceProvider } from "@multiplatform.one/theme";
42
+ import {
43
+ createContext,
44
+ forwardRef,
45
+ isValidElement,
46
+ useCallback,
47
+ useContext,
48
+ useImperativeHandle,
49
+ useRef,
50
+ useState,
51
+ type ComponentType,
52
+ type ReactNode,
53
+ } from "react";
23
54
  import {
24
55
  AlertDialog as TamaguiAlertDialog,
25
56
  Dialog as TamaguiDialog,
57
+ SheetControllerContext,
26
58
  withStaticProperties,
59
+ type DialogProps as TamaguiDialogProps,
27
60
  type GetProps,
28
61
  } from "tamagui";
29
62
  import { useTranslation } from "./shared/i18n";
63
+ import { SheetModal } from "./SheetModal";
30
64
 
31
65
  type Labelled = {
32
66
  "aria-label"?: unknown;
@@ -75,9 +109,113 @@ function namedByContent<C extends ComponentType<any>>(Part: C, displayName: stri
75
109
  return Close;
76
110
  }
77
111
 
78
- export const Dialog: typeof TamaguiDialog = withStaticProperties(TamaguiDialog, {
112
+ /**
113
+ * How a house Dialog presents at phone width (LC-269). `"sheet"`, the
114
+ * default, is a content dialog: SheetModal at the overlay pivot and below.
115
+ * `"dialog"` ejects and keeps the centred dialog at every width.
116
+ */
117
+ export type DialogPhonePresentation = "sheet" | "dialog";
118
+
119
+ export type DialogProps = TamaguiDialogProps & {
120
+ phonePresentation?: DialogPhonePresentation;
121
+ };
122
+
123
+ type DialogHandle = { open: (open: boolean) => void };
124
+
125
+ /** True where a house Dialog with this presentation draws as a sheet (LC-269). */
126
+ export function useDialogPresentsAsSheet(presentation: DialogPhonePresentation = "sheet"): boolean {
127
+ const wide = useViewportGtSm();
128
+ const nested = useOverlayParentZIndex() !== undefined;
129
+ return presentation === "sheet" && !wide && !nested;
130
+ }
131
+
132
+ type SheetPresentation = { open: boolean; dismiss: (open: boolean) => void };
133
+
134
+ const DialogSheetContext = createContext<SheetPresentation | null>(null);
135
+
136
+ const RootDialog = TamaguiDialog as unknown as ComponentType<
137
+ TamaguiDialogProps & { ref?: unknown }
138
+ >;
139
+
140
+ const DialogRoot = forwardRef<DialogHandle, DialogProps>(function Dialog(
141
+ { phonePresentation = "sheet", children, open, defaultOpen, onOpenChange, ...props },
142
+ ref,
143
+ ) {
144
+ const asSheet = useDialogPresentsAsSheet(phonePresentation);
145
+ const tamaguiRef = useRef<DialogHandle | null>(null);
146
+ useImperativeHandle(ref, () => ({ open: (next) => tamaguiRef.current?.open(next) }), []);
147
+ const [ownOpen, setOwnOpen] = useState(defaultOpen ?? false);
148
+ const isOpen = open ?? ownOpen;
149
+ // The web sheet reports one close from its Sheet and can report another
150
+ // from Escape; only the first may close it, or a consumer's onOpenChange
151
+ // (ConfirmDialog's onCancel) fires twice.
152
+ const openRef = useRef(isOpen);
153
+ openRef.current = isOpen;
154
+ const handleOpenChange = useCallback(
155
+ (next: boolean) => {
156
+ openRef.current = next;
157
+ setOwnOpen(next);
158
+ onOpenChange?.(next);
159
+ },
160
+ [onOpenChange],
161
+ );
162
+ const dismiss = useCallback((next: boolean) => {
163
+ if (next || !openRef.current) return;
164
+ tamaguiRef.current?.open(false);
165
+ }, []);
166
+ return (
167
+ <RootDialog
168
+ ref={tamaguiRef}
169
+ open={open}
170
+ defaultOpen={defaultOpen}
171
+ onOpenChange={handleOpenChange}
172
+ {...props}
173
+ >
174
+ <DialogSheetContext.Provider value={asSheet ? { open: isOpen, dismiss } : null}>
175
+ {children}
176
+ </DialogSheetContext.Provider>
177
+ </RootDialog>
178
+ );
179
+ });
180
+
181
+ const StackedPortal = withOverlayStack(TamaguiDialog.Portal, "dropdown", "DialogPortal");
182
+
183
+ function DialogPortal(props: GetProps<typeof TamaguiDialog.Portal>) {
184
+ const sheet = useContext(DialogSheetContext);
185
+ const dialogZIndex = useOverlayZIndex("dropdown");
186
+ const [opened, setOpened] = useState(false);
187
+ if (sheet?.open && !opened) setOpened(true);
188
+ if (!sheet) return <StackedPortal {...props} />;
189
+ // A closed Sheet still mounts its frame off screen; a dialog that never
190
+ // opened mounts nothing, as tamagui's closed Dialog does.
191
+ if (!opened) return null;
192
+ // The sheet keeps the dialog's rung: SheetModal binds one step above the
193
+ // z it is opened from, so it lands on the dialog tier, covers a page sheet
194
+ // as a dialog does, and what it opens stacks one step above it (FZ-7869).
195
+ // tamagui's Dialog hands its subtree a hidden sheet controller while it is
196
+ // open and not adapted, which renders every Sheet under it as nothing; the
197
+ // null controller gives SheetModal (and any sheet in the content) its own.
198
+ return (
199
+ <SheetControllerContext.Provider value={null}>
200
+ <OverlayStackProvider zIndex={dialogZIndex - overlayStackStep()}>
201
+ <SheetModal open={sheet.open} onOpenChange={sheet.dismiss}>
202
+ <DialogSheetFaceProvider value>{props.children}</DialogSheetFaceProvider>
203
+ </SheetModal>
204
+ </OverlayStackProvider>
205
+ </SheetControllerContext.Provider>
206
+ );
207
+ }
208
+ DialogPortal.displayName = "DialogPortal";
209
+
210
+ export const Dialog = withStaticProperties(DialogRoot, {
211
+ Trigger: TamaguiDialog.Trigger,
212
+ Portal: DialogPortal as unknown as typeof TamaguiDialog.Portal,
213
+ Overlay: TamaguiDialog.Overlay,
214
+ Content: TamaguiDialog.Content,
215
+ Title: TamaguiDialog.Title,
216
+ Description: TamaguiDialog.Description,
79
217
  Close: namedByContent(TamaguiDialog.Close, "DialogClose"),
80
- Portal: withOverlayStack(TamaguiDialog.Portal, "dropdown", "DialogPortal"),
218
+ FocusScope: TamaguiDialog.FocusScope,
81
219
  });
82
220
 
83
221
  export const AlertDialog: typeof TamaguiAlertDialog = withStaticProperties(TamaguiAlertDialog, {
@@ -50,24 +50,16 @@ function Fixture({
50
50
  }
51
51
 
52
52
  describe("ThemePresetPicker", () => {
53
- it("draws the LC-131 selected recipe and exposes scroll cues when preset choices overflow", async () => {
53
+ it("draws the LC-131 selected recipe and wraps the preset chips under a visible label (FZ-8440)", () => {
54
54
  render(<Fixture />);
55
55
  const selected = screen.getByRole("button", { name: "Preset: Default" });
56
56
  expect(selected.className).toContain("_bg-selectedBac");
57
57
  expect(selected.className).toContain("_btc-transparent");
58
58
  expect(selected.className).not.toContain("_btc-accentColor");
59
- const row = screen.getByLabelText("Preset");
60
- Object.defineProperties(row, {
61
- scrollWidth: { value: 900, configurable: true },
62
- offsetWidth: { value: 300, configurable: true },
63
- scrollHeight: { value: 40, configurable: true },
64
- offsetHeight: { value: 40, configurable: true },
65
- });
66
- await act(async () => {
67
- fireEvent.scroll(row, { target: { scrollLeft: 0 } });
68
- await new Promise((resolve) => setTimeout(resolve, 120));
69
- });
70
- expect(screen.getByTestId("overflow-row-end-fade")).toBeDefined();
59
+ const row = screen.getByRole("group", { name: "Preset" });
60
+ expect(row.previousElementSibling?.textContent).toBe("Preset");
61
+ expect(row.className).toContain("_fwr-wrap");
62
+ expect(screen.queryByTestId("overflow-row-end-fade")).toBeNull();
71
63
  });
72
64
 
73
65
  it("lists registered presets at render time, including later registrations", () => {
@@ -5,10 +5,8 @@ import {
5
5
  type SchemePreference,
6
6
  } from "@multiplatform.one/theme";
7
7
  import { useTranslation } from "react-i18next";
8
- import { YStack, type ColorTokens } from "tamagui";
9
- import { Chip } from "../Chip";
10
- import { OverflowRow } from "../OverflowRow";
11
- import { Paragraph } from "../Text";
8
+ import { YStack } from "tamagui";
9
+ import { ChoiceChips } from "../ChoiceChips";
12
10
 
13
11
  export interface ThemePresetPickerProps {
14
12
  rows?: ReadonlyArray<"scheme" | "preset">;
@@ -16,7 +14,6 @@ export interface ThemePresetPickerProps {
16
14
  /** Signed-in owner; none records this device's signed-out choice. */
17
15
  userId?: string | null;
18
16
  testID?: string;
19
- fadeColor?: ColorTokens;
20
17
  }
21
18
 
22
19
  const titleCase = (name: string) =>
@@ -30,7 +27,6 @@ export function ThemePresetPicker({
30
27
  useUserScheme = useSchemePreference,
31
28
  userId,
32
29
  testID = "theme-preset-picker",
33
- fadeColor,
34
30
  }: ThemePresetPickerProps) {
35
31
  const { t } = useTranslation();
36
32
  const scheme = useUserScheme();
@@ -40,43 +36,22 @@ export function ThemePresetPicker({
40
36
  return (
41
37
  <YStack testID={testID} gap="$3">
42
38
  {rows.map((row) => {
43
- const label = t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) });
44
39
  const options = row === "scheme" ? (["system", "light", "dark"] as const) : presets;
45
40
  return (
46
- <YStack key={row} gap="$1.5">
47
- <Paragraph fontSize="$2" color="$color11">
48
- {label}
49
- </Paragraph>
50
- <OverflowRow
51
- gap="$1.5"
52
- fadeColor={fadeColor}
53
- keyboardShouldPersistTaps="handled"
54
- accessibilityLabel={label}
55
- >
56
- {options.map((name) => {
57
- const optionLabel = t(`themePresetPicker.${row}s.${name}`, {
58
- defaultValue: titleCase(name),
59
- });
60
- return (
61
- <Chip
62
- key={name}
63
- aria-label={`${label}: ${optionLabel}`}
64
- selected={(row === "scheme" ? scheme.setting : selectedPreset) === name}
65
- onPress={() => {
66
- if (
67
- row === "scheme" &&
68
- (name === "system" || name === "light" || name === "dark")
69
- )
70
- scheme.set(name);
71
- else preset.choosePreset(name, userId ?? null);
72
- }}
73
- >
74
- {optionLabel}
75
- </Chip>
76
- );
77
- })}
78
- </OverflowRow>
79
- </YStack>
41
+ <ChoiceChips
42
+ key={row}
43
+ label={t(`themePresetPicker.${row}`, { defaultValue: titleCase(row) })}
44
+ options={options.map((name) => ({
45
+ value: name,
46
+ label: t(`themePresetPicker.${row}s.${name}`, { defaultValue: titleCase(name) }),
47
+ }))}
48
+ value={row === "scheme" ? scheme.setting : selectedPreset}
49
+ onChange={(name) => {
50
+ if (row === "scheme" && (name === "system" || name === "light" || name === "dark"))
51
+ scheme.set(name);
52
+ else preset.choosePreset(name, userId ?? null);
53
+ }}
54
+ />
80
55
  );
81
56
  })}
82
57
  </YStack>