@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
@@ -242,6 +242,53 @@ describe("AppShell on a phone", () => {
242
242
  });
243
243
  });
244
244
 
245
+ describe("AppShell destination sections and counts (LC-175, FZ-8912)", () => {
246
+ const grouped: AppShellDestination[] = [
247
+ { key: "/", label: "Home", icon: HouseIcon },
248
+ { key: "/inbox", label: "Inbox", icon: SparkleIcon, section: "Operations", count: 8 },
249
+ { key: "/setup", label: "Setup", icon: LightningIcon, section: "Setup", placement: "more" },
250
+ { key: "/recs", label: "Recs", icon: LightningIcon, section: "Operations", count: 0 },
251
+ { key: "/races", label: "Races", icon: HouseIcon },
252
+ ];
253
+
254
+ function groups() {
255
+ const sidebar = screen.getByTestId("app-shell-sidebar");
256
+ return [...sidebar.querySelectorAll('[role="group"]')].map((group) => {
257
+ const titleId = group.getAttribute("aria-labelledby");
258
+ return {
259
+ title: titleId ? (document.getElementById(titleId)?.textContent ?? null) : null,
260
+ rows: [...group.querySelectorAll("[data-sidebar-row]")].map((row) => row.textContent),
261
+ };
262
+ });
263
+ }
264
+
265
+ it("builds one titled sidebar section per title in declaration order, untitled ones leading", () => {
266
+ size.value = "expanded";
267
+ shell("/inbox", { destinations: grouped });
268
+ expect(groups()).toEqual([
269
+ { title: null, rows: ["Home", "Races"] },
270
+ { title: "Operations", rows: ["Inbox(8)", "Recs(0)"] },
271
+ { title: "Setup", rows: ["Setup"] },
272
+ ]);
273
+ });
274
+
275
+ it("shows a count as a plain number in the row's meta ink, never a badge (LC-118)", () => {
276
+ size.value = "expanded";
277
+ shell("/", { destinations: grouped });
278
+ const inbox = [
279
+ ...screen.getByTestId("app-shell-sidebar").querySelectorAll("[data-sidebar-row]"),
280
+ ].find((row) => row.textContent?.startsWith("Inbox"))!;
281
+ expect(inbox.querySelector('[role="status"], [aria-live], [data-badge]')).toBeNull();
282
+ });
283
+
284
+ it("leaves the phone's tab bar and pull-down as they were: sections are a sidebar grouping", () => {
285
+ shell("/", { destinations: grouped });
286
+ const tabs = screen.getAllByRole("tab").map((tab) => tab.textContent);
287
+ expect(tabs).toEqual(["Home", "Inbox", "Recs", "Races"]);
288
+ expect(screen.getByTestId("app-shell-more")).toBeTruthy();
289
+ });
290
+ });
291
+
245
292
  describe("AppShell at regular width", () => {
246
293
  it("lists every destination in the sidebar, under the app's name, and no tab bar", () => {
247
294
  size.value = "expanded";
@@ -0,0 +1,27 @@
1
+ /**
2
+ * FZ-9215: TabHost keeps the MPO TabBar when any tab lacks its platform's
3
+ * glyph, so the Components/AppShell stories need an SF Symbol on every tab
4
+ * for Kitchen Sink on iOS to draw the native tabs One ships.
5
+ */
6
+ import { describe, expect, it } from "vitest";
7
+ import { destinations } from "./AppShell.stories";
8
+
9
+ const tabs = destinations.filter((item) => (item.placement ?? "tab") === "tab");
10
+
11
+ describe("Components/AppShell stories draw native tabs on iOS (FZ-9215)", () => {
12
+ it("gives every tab an SF Symbol and a filled selected glyph where One has one", () => {
13
+ expect(tabs.length).toBeGreaterThanOrEqual(3);
14
+ for (const tab of tabs) expect(tab.nativeIcon?.sfSymbol, tab.label).toMatch(/\S/);
15
+ });
16
+
17
+ it("uses One's glyphs for the same destinations", () => {
18
+ const symbols = Object.fromEntries(tabs.map((tab) => [tab.key, tab.nativeIcon]));
19
+ expect(symbols["/"]).toMatchObject({ sfSymbol: "house", sfSymbolSelected: "house.fill" });
20
+ expect(symbols["/pokemon"]).toMatchObject({ sfSymbol: "sparkles" });
21
+ expect(symbols["/moves"]).toMatchObject({ sfSymbol: "bolt", sfSymbolSelected: "bolt.fill" });
22
+ expect(symbols["/backoffice"]).toMatchObject({
23
+ sfSymbol: "square.grid.2x2",
24
+ sfSymbolSelected: "square.grid.2x2.fill",
25
+ });
26
+ });
27
+ });
@@ -16,11 +16,26 @@ import { Pagination } from "../Pagination";
16
16
  import { Text } from "../Text";
17
17
  import { AppShell, type AppShellDestination } from "./AppShell";
18
18
 
19
- const destinations: AppShellDestination[] = [
20
- { key: "/", label: "Home", icon: HouseIcon },
21
- { key: "/pokemon", label: "Pokemon", icon: SparkleIcon },
22
- { key: "/moves", label: "Moves", icon: LightningIcon },
23
- { key: "/backoffice", label: "Backoffice", icon: SquaresFourIcon },
19
+ export const destinations: AppShellDestination[] = [
20
+ {
21
+ key: "/",
22
+ label: "Home",
23
+ icon: HouseIcon,
24
+ nativeIcon: { sfSymbol: "house", sfSymbolSelected: "house.fill" },
25
+ },
26
+ { key: "/pokemon", label: "Pokemon", icon: SparkleIcon, nativeIcon: { sfSymbol: "sparkles" } },
27
+ {
28
+ key: "/moves",
29
+ label: "Moves",
30
+ icon: LightningIcon,
31
+ nativeIcon: { sfSymbol: "bolt", sfSymbolSelected: "bolt.fill" },
32
+ },
33
+ {
34
+ key: "/backoffice",
35
+ label: "Backoffice",
36
+ icon: SquaresFourIcon,
37
+ nativeIcon: { sfSymbol: "square.grid.2x2", sfSymbolSelected: "square.grid.2x2.fill" },
38
+ },
24
39
  { key: "/settings", label: "Settings", icon: GearIcon, placement: "more" },
25
40
  ];
26
41
 
@@ -40,10 +55,18 @@ function Mark() {
40
55
  );
41
56
  }
42
57
 
43
- function DemoPage({ path, open }: { path: string; open: (path: string) => void }) {
58
+ function DemoPage({
59
+ path,
60
+ open,
61
+ items,
62
+ }: {
63
+ path: string;
64
+ open: (path: string) => void;
65
+ items: AppShellDestination[];
66
+ }) {
44
67
  const pushed = path.split("/").filter(Boolean).length > 1;
45
- const name = destinations.find((item) => path.startsWith(item.key) && item.key !== "/");
46
- const title = pushed ? "Pikachu" : (name?.label ?? "Home");
68
+ const name = items.find((item) => path.startsWith(item.key) && item.key !== "/");
69
+ const title = pushed ? "Pikachu" : (name?.label ?? items[0]?.label ?? "Home");
47
70
  return (
48
71
  <Screen>
49
72
  <PageHeader title={title} subtitle={pushed ? "#025 · Electric" : "1,025 entries"} />
@@ -67,11 +90,50 @@ function DemoPage({ path, open }: { path: string; open: (path: string) => void }
67
90
  );
68
91
  }
69
92
 
70
- function Demo({ initialPath, accessory }: { initialPath: string; accessory?: boolean }) {
93
+ const grouped: AppShellDestination[] = [
94
+ { key: "/", label: "Races", icon: HouseIcon },
95
+ { key: "/edge", label: "Edge", icon: LightningIcon },
96
+ { key: "/market", label: "The market", icon: SparkleIcon },
97
+ ...["Positions", "Timeline", "Caps", "Alerts", "Feeds"].map((label) => ({
98
+ key: `/${label.toLowerCase()}`,
99
+ label,
100
+ icon: StackIcon,
101
+ section: "Operations",
102
+ placement: "more" as const,
103
+ })),
104
+ {
105
+ key: "/inbox",
106
+ label: "Inbox",
107
+ icon: StackIcon,
108
+ section: "Operations",
109
+ placement: "more",
110
+ count: 3,
111
+ },
112
+ {
113
+ key: "/recommendations",
114
+ label: "Recommendations",
115
+ icon: SparkleIcon,
116
+ section: "Operations",
117
+ placement: "more",
118
+ count: 12,
119
+ },
120
+ { key: "/settings", label: "Settings", icon: GearIcon, section: "Setup", placement: "more" },
121
+ { key: "/enroll", label: "Enroll device", icon: GearIcon, section: "Setup", placement: "more" },
122
+ ];
123
+
124
+ function Demo({
125
+ initialPath,
126
+ accessory,
127
+ items = destinations,
128
+ }: {
129
+ initialPath: string;
130
+ accessory?: boolean;
131
+ items?: AppShellDestination[];
132
+ }) {
71
133
  const [path, setPath] = useState(initialPath);
72
134
  return (
73
135
  <AppShell
74
- destinations={destinations}
136
+ destinations={items}
75
137
  path={path}
76
138
  onNavigate={setPath}
77
139
  onBack={setPath}
@@ -81,7 +143,7 @@ function Demo({ initialPath, accessory }: { initialPath: string; accessory?: boo
81
143
  accessory={accessory ? <Pagination total={41} defaultPage={1} variant="dots" /> : undefined}
82
144
  ownChrome={["/backoffice"]}
83
145
  >
84
- <DemoPage path={path} open={setPath} />
146
+ <DemoPage path={path} open={setPath} items={items} />
85
147
  </AppShell>
86
148
  );
87
149
  }
@@ -110,3 +172,12 @@ export const Pushed: Story = { render: () => <Demo initialPath="/pokemon/pikachu
110
172
  export const WithAccessory: Story = {
111
173
  render: () => <Demo initialPath="/pokemon" accessory />,
112
174
  };
175
+
176
+ /**
177
+ * Titled sidebar sections and counts (LC-175 amendment, FZ-8912): untitled
178
+ * destinations lead, each `section` is one titled group, a `count` is a plain
179
+ * number after the label. The phone keeps its tab bar and pull-down.
180
+ */
181
+ export const GroupedSidebar: Story = {
182
+ render: () => <Demo initialPath="/" items={grouped} />,
183
+ };
@@ -45,7 +45,7 @@ import {
45
45
  type ShellSidebarPanel,
46
46
  } from "../layouts/shellSidebarSlot";
47
47
  import { BottomAccessory } from "../layouts/bottomAccessory";
48
- import { Sidebar } from "../layouts/sidebar";
48
+ import { Sidebar, type SidebarItem, type SidebarSection } from "../layouts/sidebar";
49
49
  import { useTranslation } from "../shared/i18n";
50
50
  import type { TabBarIcon, TabBarItem } from "./TabBar";
51
51
  import { TabHost } from "./TabHost";
@@ -66,6 +66,33 @@ export interface AppShellDestination {
66
66
  placement?: "tab" | "more";
67
67
  /** Runs instead of `onNavigate(key)`, e.g. an external link. */
68
68
  onPress?: () => void;
69
+ /**
70
+ * The regular-width sidebar's group title. Untitled destinations lead in one
71
+ * untitled group; each title is one section, in first-appearance order. The
72
+ * phone's tab bar and pull-down ignore it (LC-175).
73
+ */
74
+ section?: string;
75
+ /** A plain number after the sidebar row's label, e.g. unread items (LC-118). */
76
+ count?: number;
77
+ }
78
+
79
+ function sidebarSections(
80
+ destinations: readonly AppShellDestination[],
81
+ row: (item: AppShellDestination) => SidebarItem,
82
+ ): SidebarSection[] {
83
+ const untitled: SidebarItem[] = [];
84
+ const titled = new Map<string, SidebarItem[]>();
85
+ for (const item of destinations) {
86
+ if (!item.section) {
87
+ untitled.push(row(item));
88
+ continue;
89
+ }
90
+ const rows = titled.get(item.section) ?? [];
91
+ rows.push(row(item));
92
+ titled.set(item.section, rows);
93
+ }
94
+ const sections: SidebarSection[] = [...titled].map(([title, items]) => ({ title, items }));
95
+ return untitled.length ? [{ items: untitled }, ...sections] : sections;
69
96
  }
70
97
 
71
98
  export interface AppShellProps {
@@ -504,17 +531,14 @@ export function AppShell({
504
531
  </XStack>
505
532
  ) : undefined
506
533
  }
507
- sections={[
508
- {
509
- items: destinations.map((item) => ({
510
- label: item.label,
511
- value: item.key,
512
- icon: createElement(item.icon),
513
- active: item === destination,
514
- onPress: () => go(item),
515
- })),
516
- },
517
- ]}
534
+ sections={sidebarSections(destinations, (item) => ({
535
+ label: item.label,
536
+ value: item.key,
537
+ icon: createElement(item.icon),
538
+ count: item.count,
539
+ active: item === destination,
540
+ onPress: () => go(item),
541
+ }))}
518
542
  >
519
543
  {sidebarSlot.panel ? <StackedPanel panel={sidebarSlot.panel} /> : null}
520
544
  </Sidebar>
@@ -28,7 +28,7 @@ import {
28
28
  import { useCallback, useEffect, useRef, type ReactNode } from "react";
29
29
  import { useTranslation } from "../shared/i18n";
30
30
  import { Paragraph, XStack, YStack, isWeb, type TamaguiElement } from "tamagui";
31
- import { Dialog } from "../Dialog";
31
+ import { Dialog, type DialogPhonePresentation } from "../Dialog";
32
32
  import { countActionsInTree } from "../shared/actionScan";
33
33
  import { useReturnFocusOnClose } from "../shared/useReturnFocusOnClose";
34
34
  import { useKeyboardInset } from "../shared/useKeyboardInset";
@@ -125,6 +125,24 @@ export interface ConfirmDialogProps {
125
125
  * `dialog-too-many-actions` DEV warn.
126
126
  */
127
127
  allowManyActions?: boolean;
128
+ /**
129
+ * LC-269. A confirm with a title, at most one line of `body` and its two
130
+ * actions is alert-shaped and stays a centred alert at every width, as
131
+ * UIAlertController does. One whose `children` hold content (a form, a
132
+ * picker, a list, a search) is a content dialog and presents as a sheet at
133
+ * phone width. Pass `"dialog"` to keep the centred dialog, `"sheet"` to
134
+ * force the sheet.
135
+ */
136
+ phonePresentation?: DialogPhonePresentation;
137
+ }
138
+
139
+ /** LC-269: content in `children` (not a string `body`) makes a content dialog. */
140
+ export function confirmDialogPresentation({
141
+ body,
142
+ children,
143
+ }: Pick<ConfirmDialogProps, "body" | "children">): DialogPhonePresentation {
144
+ if (body != null || children == null || typeof children === "boolean") return "dialog";
145
+ return typeof children === "string" || typeof children === "number" ? "dialog" : "sheet";
128
146
  }
129
147
 
130
148
  export function ConfirmDialog({
@@ -143,6 +161,7 @@ export function ConfirmDialog({
143
161
  confirmDisabledReason,
144
162
  cancelDisabled = false,
145
163
  allowManyActions = false,
164
+ phonePresentation,
146
165
  }: ConfirmDialogProps) {
147
166
  const { t } = useTranslation();
148
167
  const { knobProps } = useResolvedKnobs();
@@ -217,7 +236,12 @@ export function ConfirmDialog({
217
236
  }, [open]);
218
237
 
219
238
  return (
220
- <Dialog modal open={open} onOpenChange={handleOpenChange}>
239
+ <Dialog
240
+ modal
241
+ open={open}
242
+ onOpenChange={handleOpenChange}
243
+ phonePresentation={phonePresentation ?? confirmDialogPresentation({ body, children })}
244
+ >
221
245
  <Dialog.Portal paddingBottom={keyboardInset || undefined}>
222
246
  <DialogOverlay key="overlay" />
223
247
  <DialogContent
@@ -10,7 +10,7 @@ export {
10
10
  } from "./route";
11
11
  export { notify } from "./notify";
12
12
  export { NotifyHost, NotifyRegion, type NotifyHostProps } from "./NotifyHost";
13
- export { ConfirmDialog, type ConfirmDialogProps } from "./ConfirmDialog";
13
+ export { ConfirmDialog, confirmDialogPresentation, type ConfirmDialogProps } from "./ConfirmDialog";
14
14
  export {
15
15
  dismissFeedback,
16
16
  dismissFeedbackByRegion,
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
  export * from "./Badge";
21
21
  export * from "./Carousel";
22
22
  export * from "./Chip";
23
+ export * from "./ChoiceChips";
23
24
  export * from "./Kbd";
24
25
  export * from "./CopyField";
25
26
  export * from "./Diff";
@@ -0,0 +1,161 @@
1
+ /**
2
+ * @vitest-environment jsdom
3
+ */
4
+
5
+ import { cleanup, fireEvent, screen } from "@testing-library/react";
6
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
7
+ import { afterEach, describe, expect, it, vi } from "vitest";
8
+ import { Text } from "tamagui";
9
+ import { AsyncBoundary } from "./AsyncBoundary";
10
+ import { asyncFailure } from "./asyncFailure";
11
+
12
+ afterEach(() => {
13
+ cleanup();
14
+ });
15
+
16
+ describe("asyncFailure copy from a reason (FZ-8045, LC-204)", () => {
17
+ it("names the subject, the cause and the next step", () => {
18
+ expect(asyncFailure({ subject: "Races", reason: "query_timeout", retry: true })).toEqual({
19
+ title: "Races didn't load",
20
+ description: "The server took too long to answer. Tap Retry to try again.",
21
+ retry: true,
22
+ refusal: false,
23
+ });
24
+ });
25
+
26
+ it("tells a live view it retries by itself", () => {
27
+ expect(
28
+ asyncFailure({ subject: "Races", reason: "source_busy", retry: true, live: true })
29
+ .description,
30
+ ).toBe("The server is busy. It will retry; tap Retry to try now.");
31
+ });
32
+
33
+ it("states there is no action when the view has no Retry", () => {
34
+ expect(asyncFailure({ subject: "Races", reason: "source_down" }).description).toBe(
35
+ "The server is down. Try again later.",
36
+ );
37
+ });
38
+
39
+ it("never lets a bare code stand as the description", () => {
40
+ for (const reason of ["click_house_timeout", "weird_code_42", "failed"]) {
41
+ const copy = asyncFailure({ subject: "Races", reason, retry: true });
42
+ expect(copy.description).not.toContain(reason);
43
+ expect(copy.description).toMatch(/\. Tap Retry to try again\.$/);
44
+ }
45
+ });
46
+
47
+ it.each([
48
+ ["query_too_large", "The response is too large to load."],
49
+ ["credentials_refused", "The server turned down its login."],
50
+ ["session_expired", "Your session ended."],
51
+ ])("drops Retry for %s, which retrying can't fix", (reason, cause) => {
52
+ const copy = asyncFailure({ subject: "Races", reason, retry: true });
53
+ expect(copy.retry).toBe(false);
54
+ expect(copy.description.startsWith(cause)).toBe(true);
55
+ expect(copy.description).not.toContain("Tap Retry");
56
+ });
57
+
58
+ it("routes a permission refusal to a neutral state", () => {
59
+ expect(
60
+ asyncFailure({ subject: "Approvals", reason: "permission_denied", retry: true }),
61
+ ).toEqual({
62
+ title: "Approvals isn't open to this account",
63
+ description: "Ask an admin for access.",
64
+ retry: false,
65
+ refusal: true,
66
+ });
67
+ });
68
+
69
+ it("lets an app add its own reason words over the defaults", () => {
70
+ const copy = asyncFailure({
71
+ subject: "Races",
72
+ reason: "source_unreachable",
73
+ retry: true,
74
+ reasons: { source_unreachable: { cause: "Pelt can't reach its database." } },
75
+ });
76
+ expect(copy.description).toBe("Pelt can't reach its database. Tap Retry to try again.");
77
+ });
78
+ });
79
+
80
+ describe("AsyncBoundary reason (FZ-8045, LC-204)", () => {
81
+ it("renders the reason's title and line, never the raw code", () => {
82
+ renderWithProviders(
83
+ <AsyncBoundary error reason="click_house_timeout" subject="Races" onRetry={() => {}} />,
84
+ );
85
+ expect(screen.getByText("Races didn't load")).toBeInTheDocument();
86
+ expect(
87
+ screen.getByText("The server took too long to answer. Tap Retry to try again."),
88
+ ).toBeInTheDocument();
89
+ expect(screen.queryByText(/click_house_timeout/)).toBeNull();
90
+ });
91
+
92
+ it("reads a code-shaped error string as its reason", () => {
93
+ renderWithProviders(<AsyncBoundary error="click_house_timeout" onRetry={() => {}} />);
94
+ expect(screen.queryByText("click_house_timeout")).toBeNull();
95
+ expect(
96
+ screen.getByText("The server took too long to answer. Tap Retry to try again."),
97
+ ).toBeInTheDocument();
98
+ });
99
+
100
+ it("keeps a one-word message that names no reason as the description", () => {
101
+ renderWithProviders(<AsyncBoundary error="boom" />);
102
+ expect(screen.getByText("boom")).toBeInTheDocument();
103
+ });
104
+
105
+ it("keeps a sentence error as the server's own words", () => {
106
+ renderWithProviders(<AsyncBoundary error="The report needs a date range." />);
107
+ expect(screen.getByText("The report needs a date range.")).toBeInTheDocument();
108
+ });
109
+
110
+ it("renders no Retry for a non-retryable reason", () => {
111
+ const onRetry = vi.fn();
112
+ renderWithProviders(
113
+ <AsyncBoundary error reason="credentials_refused" subject="Races" onRetry={onRetry} />,
114
+ );
115
+ expect(screen.getByText("Races didn't load")).toBeInTheDocument();
116
+ expect(screen.queryByText("Retry")).toBeNull();
117
+ });
118
+
119
+ it("renders a permission refusal as a neutral EmptyState with no Retry (LC-165)", () => {
120
+ renderWithProviders(
121
+ <AsyncBoundary error reason="forbidden" subject="Approvals" onRetry={() => {}} />,
122
+ );
123
+ expect(screen.getByText("Approvals isn't open to this account")).toBeInTheDocument();
124
+ expect(document.querySelector('[data-async-state="refused"]')).toBeTruthy();
125
+ expect(document.querySelector('[data-empty-intent="neutral"]')).toBeTruthy();
126
+ expect(document.querySelector('[data-empty-intent="error"]')).toBeNull();
127
+ expect(screen.queryByText("Retry")).toBeNull();
128
+ });
129
+
130
+ it("keeps Retry on a retryable reason over stale data", () => {
131
+ const onRetry = vi.fn();
132
+ const { rerender } = renderWithProviders(
133
+ <AsyncBoundary>
134
+ <Text>Ready rows</Text>
135
+ </AsyncBoundary>,
136
+ );
137
+ rerender(
138
+ <AsyncBoundary error reason="source_busy" subject="Races" onRetry={onRetry}>
139
+ <Text>Ready rows</Text>
140
+ </AsyncBoundary>,
141
+ );
142
+ expect(screen.getByText("Ready rows")).toBeInTheDocument();
143
+ expect(screen.getByText("Races didn't load")).toBeInTheDocument();
144
+ fireEvent.click(screen.getByText("Retry"));
145
+ expect(onRetry).toHaveBeenCalledTimes(1);
146
+ });
147
+
148
+ it("lets explicit errorTitle and errorDescription win", () => {
149
+ renderWithProviders(
150
+ <AsyncBoundary
151
+ error
152
+ reason="query_timeout"
153
+ subject="Races"
154
+ errorTitle="Custom title"
155
+ errorDescription="Custom line."
156
+ />,
157
+ );
158
+ expect(screen.getByText("Custom title")).toBeInTheDocument();
159
+ expect(screen.getByText("Custom line.")).toBeInTheDocument();
160
+ });
161
+ });
@@ -185,3 +185,29 @@ export const KeepPreviousOnRefetch: Story = {
185
185
  );
186
186
  },
187
187
  };
188
+
189
+ /** A failure reason becomes a title plus the cause and next step; refusals go neutral with no Retry (FZ-8045, LC-204, LC-165). */
190
+ export const FailureReasons: Story = {
191
+ render: () => (
192
+ <YStack gap="$4" padding="$3">
193
+ {(
194
+ [
195
+ ["query_timeout", false],
196
+ ["source_busy", true],
197
+ ["query_too_large", false],
198
+ ["session_expired", false],
199
+ ["permission_denied", false],
200
+ ] as const
201
+ ).map(([reason, live]) => (
202
+ <AsyncBoundary
203
+ key={reason}
204
+ error={reason}
205
+ subject="Races"
206
+ live={live}
207
+ size="$3"
208
+ onRetry={action("retry")}
209
+ />
210
+ ))}
211
+ </YStack>
212
+ ),
213
+ };