@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
@@ -20,6 +20,7 @@ import { type SizeTokens, XStack, YStack, type YStackProps } from "tamagui";
20
20
  import { Alert } from "../Alert";
21
21
  import { Skeleton } from "../Skeleton";
22
22
  import { Text } from "../Text";
23
+ import { asyncFailure, isReasonCode, type AsyncFailureReason } from "./asyncFailure";
23
24
  import { EmptyState } from "./page";
24
25
 
25
26
  // ---------------------------------------------------------------------------
@@ -106,6 +107,20 @@ export interface AsyncBoundaryProps extends Omit<YStackProps, "children"> {
106
107
  emptyDescription?: string;
107
108
  /** Default error description (overrides Error.message when set). */
108
109
  errorDescription?: string;
110
+ /**
111
+ * Failure reason code from the server (`query_timeout`, `forbidden`, ...).
112
+ * The boundary turns it into a title plus one line naming the cause and
113
+ * the next step, drops Retry when retrying can't help, and routes a
114
+ * permission refusal to a neutral state (LC-204, LC-165). A code-shaped
115
+ * `error` string is read as the reason.
116
+ */
117
+ reason?: string | null;
118
+ /** What failed to load, for the reason copy: "Races" → "Races didn't load". */
119
+ subject?: string;
120
+ /** The view refetches on its own, so the copy says it will retry. */
121
+ live?: boolean;
122
+ /** App reason words, merged over the MPO defaults. */
123
+ reasons?: Record<string, AsyncFailureReason>;
109
124
  /**
110
125
  * Size token for the default empty / error chrome (Tamagui's own `size`).
111
126
  * Below `$true` it draws inline, for table and column use.
@@ -157,7 +172,60 @@ export function resolveAsyncStatus(opts: {
157
172
  return "data";
158
173
  }
159
174
 
175
+ interface ErrorCopy {
176
+ title: string;
177
+ description?: string;
178
+ retry: boolean;
179
+ refusal: boolean;
180
+ }
181
+
182
+ interface ReasonCopyOptions {
183
+ reason?: string | null;
184
+ subject?: string;
185
+ live?: boolean;
186
+ reasons?: Record<string, AsyncFailureReason>;
187
+ canRetry: boolean;
188
+ errorTitle?: string;
189
+ errorDescription?: string;
190
+ }
191
+
192
+ function errorMessage(error: AsyncBoundaryProps["error"]): string | undefined {
193
+ if (typeof error === "string") return error;
194
+ if (error instanceof Error) return error.message;
195
+ return undefined;
196
+ }
197
+
160
198
  function errorCopy(
199
+ error: AsyncBoundaryProps["error"],
200
+ errorTitle: string,
201
+ errorDescription: string | undefined,
202
+ opts: ReasonCopyOptions,
203
+ ): ErrorCopy {
204
+ const message = errorMessage(error);
205
+ const reason = opts.reason ?? (isReasonCode(message) ? message : undefined);
206
+ if (reason) {
207
+ const failure = asyncFailure({
208
+ subject: opts.subject,
209
+ reason,
210
+ retry: opts.canRetry,
211
+ live: opts.live,
212
+ reasons: opts.reasons,
213
+ });
214
+ return {
215
+ title: opts.errorTitle ?? failure.title,
216
+ description: errorDescription ?? failure.description,
217
+ retry: failure.retry,
218
+ refusal: failure.refusal,
219
+ };
220
+ }
221
+ return {
222
+ ...plainErrorCopy(error, errorTitle, errorDescription),
223
+ retry: opts.canRetry,
224
+ refusal: false,
225
+ };
226
+ }
227
+
228
+ function plainErrorCopy(
161
229
  error: AsyncBoundaryProps["error"],
162
230
  errorTitle: string,
163
231
  errorDescription?: string,
@@ -425,24 +493,29 @@ function defaultEmptyBody({
425
493
  }
426
494
 
427
495
  function defaultErrorBody({
428
- error,
429
- errorTitle,
430
- errorDescription,
496
+ copy,
431
497
  onRetry,
432
498
  retryLabel,
433
499
  size,
434
500
  small,
435
501
  }: {
436
- error: AsyncBoundaryProps["error"];
437
- errorTitle: string;
438
- errorDescription?: string;
502
+ copy: ErrorCopy;
439
503
  onRetry?: () => void;
440
504
  retryLabel: string;
441
505
  size?: SizeTokens;
442
506
  small: boolean;
443
507
  }): ReactNode {
444
- if (isReactNodeSlot(error)) return error;
445
- const copy = errorCopy(error, errorTitle, errorDescription);
508
+ if (copy.refusal) {
509
+ return (
510
+ <EmptyState
511
+ size={size}
512
+ intent="neutral"
513
+ data-async-state="refused"
514
+ title={copy.title}
515
+ description={copy.description}
516
+ />
517
+ );
518
+ }
446
519
  return (
447
520
  <EmptyState
448
521
  size={size}
@@ -452,7 +525,7 @@ function defaultErrorBody({
452
525
  description={copy.description}
453
526
  icon={<WarningCircleIcon size={small ? 24 : 32} />}
454
527
  action={
455
- onRetry ? (
528
+ onRetry && copy.retry ? (
456
529
  <Button size={small ? "$3" : "$4"} onPress={onRetry}>
457
530
  <Text fontWeight="400">{retryLabel}</Text>
458
531
  </Button>
@@ -506,10 +579,14 @@ export function AsyncBoundary({
506
579
  children,
507
580
  layout = "generic",
508
581
  onRetry,
509
- errorTitle = "Couldn't load data",
582
+ errorTitle,
510
583
  emptyTitle = "No items found",
511
584
  emptyDescription,
512
585
  errorDescription,
586
+ reason,
587
+ subject,
588
+ live,
589
+ reasons,
513
590
  chrome,
514
591
  keepPrevious = true,
515
592
  size,
@@ -523,6 +600,18 @@ export function AsyncBoundary({
523
600
  // MPO-48 / R7: Retry is a §6.1 label — weight 400 on the TEXT NODE via
524
601
  // house Text. Alert's actionLabel hardcodes 600; the action slot does not.
525
602
  const retryLabel = t("Retry");
603
+ const copy =
604
+ status === "error" && !isReactNodeSlot(error)
605
+ ? errorCopy(error, errorTitle ?? "Couldn't load data", errorDescription, {
606
+ reason,
607
+ subject,
608
+ live,
609
+ reasons,
610
+ canRetry: !!onRetry,
611
+ errorTitle,
612
+ errorDescription,
613
+ })
614
+ : null;
526
615
 
527
616
  const emptyBody = defaultEmptyBody({ empty, emptyTitle, emptyDescription, size });
528
617
  const settledRef = useRef<{ kind: "data" | "empty"; body: ReactNode } | null>(null);
@@ -559,14 +648,13 @@ export function AsyncBoundary({
559
648
  showChrome = true;
560
649
  if (isReactNodeSlot(error)) {
561
650
  notice = error;
562
- } else {
563
- const copy = errorCopy(error, errorTitle, errorDescription);
651
+ } else if (copy) {
564
652
  notice = (
565
653
  <Alert
566
- intent="error"
654
+ intent={copy.refusal ? "info" : "error"}
567
655
  title={copy.title}
568
656
  action={
569
- onRetry ? (
657
+ onRetry && copy.retry ? (
570
658
  <Text
571
659
  fontWeight="400"
572
660
  color="$color12"
@@ -587,17 +675,11 @@ export function AsyncBoundary({
587
675
  }
588
676
  body = content ?? settled.body;
589
677
  } else if (status === "error") {
590
- body = isReactNodeSlot(error)
591
- ? error
592
- : defaultErrorBody({
593
- error,
594
- errorTitle,
595
- errorDescription,
596
- onRetry,
597
- retryLabel,
598
- size,
599
- small,
600
- });
678
+ if (isReactNodeSlot(error)) {
679
+ body = error;
680
+ } else if (copy) {
681
+ body = defaultErrorBody({ copy, onRetry, retryLabel, size, small });
682
+ }
601
683
  } else if (refetching && settled) {
602
684
  pending = true;
603
685
  displayStatus = settled.kind;
@@ -0,0 +1,71 @@
1
+ import { createDefaultThemeConfig } from "@multiplatform.one/theme";
2
+ import { cleanup, render, screen } from "@testing-library/react";
3
+ import { createElement, forwardRef, type ComponentProps } from "react";
4
+ import { TamaguiProvider, isWeb } from "tamagui";
5
+ import { afterEach, describe, expect, it, vi } from "vitest";
6
+ import { IdentityPlate } from "./IdentityPlate";
7
+
8
+ vi.mock("@multiplatform.one/platform", async (importOriginal) => ({
9
+ ...(await importOriginal<typeof import("@multiplatform.one/platform")>()),
10
+ isWeb: false,
11
+ isNative: true,
12
+ }));
13
+ const scrollers = vi.hoisted(() => [] as { horizontal?: boolean }[]);
14
+ vi.mock("../ScrollView", async () => {
15
+ const native = await import("../ScrollView/index.native");
16
+ const ScrollView = forwardRef<unknown, ComponentProps<typeof native.ScrollView>>((props, ref) => {
17
+ scrollers.push(props as { horizontal?: boolean });
18
+ return createElement(
19
+ "div",
20
+ { "data-testid": "facts-scroller" },
21
+ createElement(native.ScrollView, { ...props, ref } as never),
22
+ );
23
+ });
24
+ return { ...native, ScrollView };
25
+ });
26
+
27
+ const config = createDefaultThemeConfig();
28
+ const labels = ["16", "corp", "incus03", "incus", "Private", "3 days ago"];
29
+
30
+ afterEach(() => {
31
+ cleanup();
32
+ scrollers.length = 0;
33
+ });
34
+
35
+ function plate(facts: string[]) {
36
+ return render(
37
+ <TamaguiProvider config={config.tamagui} defaultTheme="light" disableInjectCSS>
38
+ <IdentityPlate
39
+ title="affine"
40
+ status="Running"
41
+ statusTone="positive"
42
+ facts={facts.map((label) => ({ label }))}
43
+ />
44
+ </TamaguiProvider>,
45
+ );
46
+ }
47
+
48
+ describe("IdentityPlate's facts on native (FZ-8074)", () => {
49
+ it("runs tamagui's native build", () => {
50
+ expect(isWeb).toBe(false);
51
+ });
52
+
53
+ it("keeps every fact on one sideways-scrolling line", () => {
54
+ const { container } = plate(labels);
55
+ const scroller = screen.getByTestId("facts-scroller");
56
+ expect(scrollers.at(-1)?.horizontal).toBe(true);
57
+ for (const label of labels) {
58
+ const fact = screen.getByText(label);
59
+ expect(scroller.contains(fact)).toBe(true);
60
+ for (let el: HTMLElement | null = fact; el && el !== container; el = el.parentElement) {
61
+ expect(el.style.flexWrap).not.toBe("wrap");
62
+ }
63
+ }
64
+ });
65
+
66
+ it("draws no scroller without facts", () => {
67
+ plate([]);
68
+ expect(screen.queryByTestId("facts-scroller")).toBeNull();
69
+ expect(scrollers).toHaveLength(0);
70
+ });
71
+ });
@@ -0,0 +1,69 @@
1
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
2
+ import { act, cleanup, fireEvent, screen } from "@testing-library/react";
3
+ import { afterEach, describe, expect, it } from "vitest";
4
+ import { IdentityPlate } from "./IdentityPlate";
5
+
6
+ afterEach(cleanup);
7
+
8
+ const facts = ["16", "corp", "incus03", "incus", "Private", "3 days ago"].map((label) => ({
9
+ label,
10
+ }));
11
+
12
+ function factsSlot() {
13
+ const slot = document.querySelector<HTMLElement>("[data-slot='facts']");
14
+ if (!slot) throw new Error("no facts slot");
15
+ return slot;
16
+ }
17
+
18
+ function between(fact: HTMLElement, slot: HTMLElement): HTMLElement[] {
19
+ const chain: HTMLElement[] = [];
20
+ for (
21
+ let node = fact.parentElement;
22
+ node && node !== slot.parentElement;
23
+ node = node.parentElement
24
+ )
25
+ chain.push(node);
26
+ return chain;
27
+ }
28
+
29
+ describe("IdentityPlate facts (FZ-8074)", () => {
30
+ it("lays every fact on one line: nothing between a fact and the plate wraps", () => {
31
+ renderWithProviders(<IdentityPlate title="postgres" status="Running" facts={facts} />);
32
+ const slot = factsSlot();
33
+ for (const label of facts.map((fact) => fact.label)) {
34
+ const wraps = between(screen.getByText(label), slot).filter(
35
+ (node) => getComputedStyle(node).flexWrap === "wrap",
36
+ );
37
+ expect(wraps, label).toEqual([]);
38
+ }
39
+ });
40
+
41
+ it("scrolls the facts sideways and fades only the hidden edge when they overflow", async () => {
42
+ renderWithProviders(<IdentityPlate title="postgres" status="Running" facts={facts} />);
43
+ const slot = factsSlot();
44
+ const scroller = [...slot.querySelectorAll<HTMLElement>("*")].find(
45
+ (node) =>
46
+ getComputedStyle(node).overflowX === "auto" ||
47
+ getComputedStyle(node).overflowX === "scroll",
48
+ );
49
+ expect(scroller, "no horizontal scroller in the facts slot").toBeTruthy();
50
+ expect(slot.querySelector("[data-testid='overflow-row-end-fade']")).toBeNull();
51
+ Object.defineProperties(scroller!, {
52
+ scrollWidth: { configurable: true, value: 520 },
53
+ offsetWidth: { configurable: true, value: 360 },
54
+ scrollHeight: { configurable: true, value: 20 },
55
+ offsetHeight: { configurable: true, value: 20 },
56
+ });
57
+ await act(async () => {
58
+ fireEvent.scroll(scroller!, { target: { scrollLeft: 0 } });
59
+ await new Promise((resolve) => setTimeout(resolve, 120));
60
+ });
61
+ expect(slot.querySelector("[data-testid='overflow-row-end-fade']")).toBeTruthy();
62
+ expect(slot.querySelector("[data-testid='overflow-row-start-fade']")).toBeNull();
63
+ });
64
+
65
+ it("draws no facts row without facts", () => {
66
+ renderWithProviders(<IdentityPlate title="postgres" status="Running" />);
67
+ expect(document.querySelector("[data-slot='facts']")).toBeNull();
68
+ });
69
+ });
@@ -11,6 +11,7 @@ import { IconSlot, useGlyphColor, useResolvedKnobs } from "@multiplatform.one/th
11
11
  import type { ReactNode } from "react";
12
12
  import { SizableText, Text, View, XStack, YStack, isWeb } from "tamagui";
13
13
  import { sectionHeading } from "../componentColors";
14
+ import { OverflowRow } from "../OverflowRow";
14
15
  import { StatusMark, type StatusTone } from "./StatusDot";
15
16
 
16
17
  export type IdentityPlateTone = StatusTone;
@@ -31,7 +32,7 @@ export interface IdentityPlateProps {
31
32
  status?: string;
32
33
  /** The status dot's tone. Omitted: no dot. */
33
34
  statusTone?: IdentityPlateTone;
34
- /** Key facts, one wrapping line under the status. */
35
+ /** Key facts on one line under the status; it scrolls sideways when they overflow. */
35
36
  facts?: readonly IdentityPlateFact[];
36
37
  /** Header actions on the name's row (close, menu). */
37
38
  trailing?: ReactNode;
@@ -95,22 +96,18 @@ export function IdentityPlate({
95
96
  ) : null}
96
97
  </XStack>
97
98
  {facts.length > 0 ? (
98
- <XStack
99
- flexWrap="wrap"
100
- alignItems="center"
101
- columnGap={knobProps.gap.gap as never}
102
- rowGap={knobProps.gapSm.gap as never}
103
- data-slot="facts"
104
- >
105
- {facts.map((fact) => (
106
- <XStack key={fact.key ?? fact.label} alignItems="center" gap="$1.5">
107
- {fact.icon ? <FactGlyph icon={fact.icon} /> : null}
108
- <Text {...knobProps.textRole.meta} numberOfLines={1}>
109
- {fact.label}
110
- </Text>
111
- </XStack>
112
- ))}
113
- </XStack>
99
+ <YStack minWidth={0} data-slot="facts">
100
+ <OverflowRow>
101
+ {facts.map((fact) => (
102
+ <XStack key={fact.key ?? fact.label} alignItems="center" gap="$1.5" flexShrink={0}>
103
+ {fact.icon ? <FactGlyph icon={fact.icon} /> : null}
104
+ <Text {...knobProps.textRole.meta} numberOfLines={1}>
105
+ {fact.label}
106
+ </Text>
107
+ </XStack>
108
+ ))}
109
+ </OverflowRow>
110
+ </YStack>
114
111
  ) : null}
115
112
  </YStack>
116
113
  );
@@ -0,0 +1,110 @@
1
+ export interface AsyncFailureReason {
2
+ cause: string;
3
+ retry?: boolean;
4
+ next?: string;
5
+ }
6
+
7
+ export interface AsyncFailure {
8
+ title: string;
9
+ description: string;
10
+ retry: boolean;
11
+ refusal: boolean;
12
+ }
13
+
14
+ export interface AsyncFailureOptions {
15
+ subject?: string;
16
+ reason?: string | null;
17
+ retry?: boolean;
18
+ live?: boolean;
19
+ reasons?: Record<string, AsyncFailureReason>;
20
+ }
21
+
22
+ const defaultReasons: Record<string, AsyncFailureReason> = {
23
+ timeout: { cause: "The server took too long to answer." },
24
+ busy: { cause: "The server is busy." },
25
+ unreachable: { cause: "Can't reach the server." },
26
+ down: { cause: "The server is down." },
27
+ failed: { cause: "The server couldn't finish the request." },
28
+ too_large: {
29
+ cause: "The response is too large to load.",
30
+ retry: false,
31
+ next: "Retrying won't help until the view asks for less.",
32
+ },
33
+ credentials_refused: {
34
+ cause: "The server turned down its login.",
35
+ retry: false,
36
+ next: "Retrying won't help until its login is fixed.",
37
+ },
38
+ session_ended: {
39
+ cause: "Your session ended.",
40
+ retry: false,
41
+ next: "Sign out and back in.",
42
+ },
43
+ };
44
+
45
+ const families: [RegExp, string][] = [
46
+ [/timeout|timed_out/, "timeout"],
47
+ [/too_large|payload_large/, "too_large"],
48
+ [/denied_login|credentials|source_denied/, "credentials_refused"],
49
+ [/authentication|session_expired|session_ended|unauthori[sz]ed|login_required/, "session_ended"],
50
+ [/unreachable|connection_refused|network/, "unreachable"],
51
+ [/busy|overloaded|rate_limit/, "busy"],
52
+ [/_down$|^down$|unavailable/, "down"],
53
+ ];
54
+
55
+ const refusals = /permission|forbidden|not_permitted|not_allowed/;
56
+
57
+ const codeShape = /^[a-z0-9_.:-]+$/;
58
+
59
+ export function isReasonCode(value: unknown): value is string {
60
+ if (typeof value !== "string" || !codeShape.test(value)) return false;
61
+ if (/[_.:-]/.test(value) || value in defaultReasons) return true;
62
+ return refusals.test(value) || families.some(([pattern]) => pattern.test(value));
63
+ }
64
+
65
+ function lookup(
66
+ code: string,
67
+ reasons: Record<string, AsyncFailureReason> | undefined,
68
+ ): AsyncFailureReason {
69
+ const own = reasons?.[code];
70
+ if (own) return own;
71
+ const exact = defaultReasons[code];
72
+ if (exact) return exact;
73
+ for (const [pattern, family] of families) {
74
+ if (pattern.test(code)) return reasons?.[family] ?? defaultReasons[family]!;
75
+ }
76
+ return reasons?.failed ?? defaultReasons.failed!;
77
+ }
78
+
79
+ export function asyncFailure({
80
+ subject,
81
+ reason,
82
+ retry = false,
83
+ live = false,
84
+ reasons,
85
+ }: AsyncFailureOptions): AsyncFailure {
86
+ const code = typeof reason === "string" && codeShape.test(reason) ? reason : "failed";
87
+ if (refusals.test(code) && !reasons?.[code]) {
88
+ return {
89
+ title: subject ? `${subject} isn't open to this account` : "This isn't open to this account",
90
+ description: "Ask an admin for access.",
91
+ retry: false,
92
+ refusal: true,
93
+ };
94
+ }
95
+ const entry = lookup(code, reasons);
96
+ const retryable = entry.retry !== false;
97
+ const next =
98
+ entry.next ??
99
+ (retryable && retry
100
+ ? live
101
+ ? "It will retry; tap Retry to try now."
102
+ : "Tap Retry to try again."
103
+ : "Try again later.");
104
+ return {
105
+ title: subject ? `${subject} didn't load` : "Couldn't load data",
106
+ description: `${entry.cause} ${next}`,
107
+ retry: retryable && retry,
108
+ refusal: false,
109
+ };
110
+ }
@@ -54,3 +54,10 @@ export {
54
54
  type AsyncBoundaryContextValue,
55
55
  type AsyncStatus,
56
56
  } from "./AsyncBoundary";
57
+ export {
58
+ asyncFailure,
59
+ isReasonCode,
60
+ type AsyncFailure,
61
+ type AsyncFailureOptions,
62
+ type AsyncFailureReason,
63
+ } from "./asyncFailure";
@@ -4,6 +4,12 @@
4
4
  * once squeezed the title column until it broke one letter per line.
5
5
  */
6
6
  import { renderWithProviders } from "@multiplatform.one/test-utils";
7
+ import {
8
+ dynamicTypeFit,
9
+ effectiveFontScale,
10
+ headingMaxFontScale,
11
+ Preset,
12
+ } from "@multiplatform.one/theme";
7
13
  import { cleanup, screen } from "@testing-library/react";
8
14
  import { afterEach, describe, expect, it, vi } from "vitest";
9
15
  import { PageHeader } from "./page";
@@ -34,6 +40,26 @@ describe("page title width (LC-143)", () => {
34
40
  expect(style.whiteSpace).toBe("nowrap");
35
41
  });
36
42
 
43
+ // FZ-9027: Kitchen Sink's "Wheel" broke "Whee / l" under hero at iOS
44
+ // accessibility-extra-large (font scale 3.118) on a 390pt phone.
45
+ it("keeps hero's display title on one line at accessibility-extra-large", () => {
46
+ layout.size = "compact";
47
+ renderWithProviders(
48
+ <Preset preset="hero">
49
+ <PageHeader title="Wheel" />
50
+ </Preset>,
51
+ );
52
+ const style = getComputedStyle(screen.getByRole("heading", { name: "Wheel" }));
53
+ expect(style.whiteSpace).toBe("nowrap");
54
+ expect(style.textOverflow).toBe("ellipsis");
55
+ });
56
+
57
+ it("caps the page title's Dynamic Type growth at the large-title curve", () => {
58
+ const cap = headingMaxFontScale(52, 52);
59
+ expect(cap).toBe(dynamicTypeFit.titleMaxScale);
60
+ expect(effectiveFontScale(3.118, cap)).toBe(1.5);
61
+ });
62
+
37
63
  it("lets a wide screen's page title wrap", () => {
38
64
  renderWithProviders(header());
39
65
  const style = getComputedStyle(screen.getByRole("heading", { name: "Pokemon" }));
@@ -175,6 +175,40 @@ describe("an overlay opened from another stacks above it on native (FZ-7869)", (
175
175
  ).toBe(true);
176
176
  });
177
177
 
178
+ it("a confirm opened from a phone content dialog, a sheet under LC-269, stacks one step above it", () => {
179
+ const onConfirm = vi.fn();
180
+ function ApplyInDialog() {
181
+ const [confirming, setConfirming] = useState(false);
182
+ return (
183
+ <Dialog modal open>
184
+ <Dialog.Portal>
185
+ <DialogContent>
186
+ <SizableText>Content dialog body</SizableText>
187
+ <Button onPress={() => setConfirming(true)}>Apply</Button>
188
+ <ConfirmDialog
189
+ open={confirming}
190
+ onOpenChange={setConfirming}
191
+ title="Apply from the dialog sheet?"
192
+ body="Sure?"
193
+ confirmLabel="Apply now"
194
+ onConfirm={onConfirm}
195
+ />
196
+ </DialogContent>
197
+ </Dialog.Portal>
198
+ </Dialog>
199
+ );
200
+ }
201
+ mount(<ApplyInDialog />);
202
+ const body = screen.getByText("Content dialog body");
203
+ tap(screen.getByText("Apply"));
204
+ const title = screen.getByText("Apply from the dialog sheet?");
205
+ expect(paintsAbove(title, body)).toBe(true);
206
+ const { upper, lower } = branches(title, body);
207
+ expect(zOf(upper) - zOf(lower)).toBe(overlayStackStep());
208
+ tap(screen.getByText("Apply now"));
209
+ expect(onConfirm).toHaveBeenCalledTimes(1);
210
+ });
211
+
178
212
  it("a dialog over a plain page still shows above the page", () => {
179
213
  mount(
180
214
  <View>
@@ -365,6 +365,48 @@ describe("DialogContent keeps the sheet's content inset on a phone (FZ-8020)", (
365
365
  });
366
366
  });
367
367
 
368
+ // FZ-8924: the window fit replaced a caller's narrower maxWidth with the
369
+ // window's room, so ConfirmDialog's 420pt alert (and Jump to field) spread to
370
+ // 90% of a 1440 window.
371
+ describe("DialogContent keeps a caller's narrower maxWidth on a wide window (FZ-8924)", () => {
372
+ let savedWidth = 0;
373
+ beforeEach(() => {
374
+ savedWidth = window.innerWidth;
375
+ Object.defineProperty(window, "innerWidth", { configurable: true, value: 1440 });
376
+ Object.defineProperty(document.documentElement, "clientWidth", {
377
+ configurable: true,
378
+ value: 1440,
379
+ });
380
+ window.dispatchEvent(new Event("resize"));
381
+ });
382
+ afterEach(() => {
383
+ cleanup();
384
+ Object.defineProperty(window, "innerWidth", { configurable: true, value: savedWidth });
385
+ delete (document.documentElement as { clientWidth?: number }).clientWidth;
386
+ window.dispatchEvent(new Event("resize"));
387
+ });
388
+
389
+ it("an alert asking 420 stays 420 at 1440", () => {
390
+ render(
391
+ <TamaguiProvider config={overlayCapConfig} defaultTheme="light">
392
+ <Preset>
393
+ <Dialog modal open>
394
+ <Dialog.Portal>
395
+ <DialogContent testID="alert-width" width="90%" maxWidth={420}>
396
+ alert
397
+ </DialogContent>
398
+ </Dialog.Portal>
399
+ </Dialog>
400
+ </Preset>
401
+ </TamaguiProvider>,
402
+ );
403
+ const dialog = getComputedStyle(
404
+ document.querySelector('[data-testid="alert-width"]') as Element,
405
+ );
406
+ expect(dialog.maxWidth).toBe("420px");
407
+ });
408
+ });
409
+
368
410
  // MPO-452: tamagui's FocusScope checks "focus already inside?" before an idle
369
411
  // wait of up to 200 ms, then focuses the first tabbable that does not hold
370
412
  // focus. A click into the name field during that wait had focus moved on to
package/src/tamagui.ts CHANGED
@@ -84,7 +84,14 @@ export { Sheet } from "./Sheet";
84
84
  export { Popover, type PopoverProps } from "./Popover";
85
85
  // Dialog and AlertDialog are the tamagui roots with house close parts: raw
86
86
  // Close names every button it wraps "Dialog Close" (MPO-476, ./Dialog.tsx).
87
- export { AlertDialog, Dialog } from "./Dialog";
87
+ // The house Dialog is a content dialog: a sheet at phone width (LC-269).
88
+ export {
89
+ AlertDialog,
90
+ Dialog,
91
+ useDialogPresentsAsSheet,
92
+ type DialogPhonePresentation,
93
+ type DialogProps,
94
+ } from "./Dialog";
88
95
 
89
96
  // Providers / theme / animation
90
97
  export { AnimatePresence, TamaguiProvider, Theme } from "tamagui";
@@ -118,7 +125,6 @@ export {
118
125
  export type {
119
126
  CircleProps,
120
127
  ColorTokens,
121
- DialogProps,
122
128
  FontSizeTokens,
123
129
  GetProps,
124
130
  GetRef,