@multiplatform.one/components 7.59.0 → 7.61.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 (308) hide show
  1. package/dist/cjs/appShell/BottomAccessory.cjs +43 -0
  2. package/dist/cjs/appShell/BottomAccessory.native.js +53 -0
  3. package/dist/cjs/appShell/BottomAccessory.native.js.map +1 -0
  4. package/dist/cjs/appShell/TabBar.cjs +99 -17
  5. package/dist/cjs/appShell/TabBar.native.js +109 -17
  6. package/dist/cjs/appShell/TabBar.native.js.map +1 -1
  7. package/dist/cjs/appShell/bottomChrome.cjs +76 -0
  8. package/dist/cjs/appShell/bottomChrome.native.js +110 -0
  9. package/dist/cjs/appShell/bottomChrome.native.js.map +1 -0
  10. package/dist/cjs/appShell/bottomInset.cjs +30 -0
  11. package/dist/cjs/appShell/bottomInset.native.js +34 -0
  12. package/dist/cjs/appShell/bottomInset.native.js.map +1 -0
  13. package/dist/cjs/appShell/index.cjs +13 -1
  14. package/dist/cjs/appShell/index.native.js +12 -0
  15. package/dist/cjs/appShell/index.native.js.map +1 -1
  16. package/dist/cjs/formLayouts/FormLayouts.cjs +540 -0
  17. package/dist/cjs/formLayouts/FormLayouts.native.js +571 -0
  18. package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -0
  19. package/dist/cjs/formLayouts/PreferencePanel.cjs +215 -0
  20. package/dist/cjs/formLayouts/PreferencePanel.native.js +237 -0
  21. package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -0
  22. package/dist/cjs/formLayouts/index.cjs +36 -0
  23. package/dist/cjs/formLayouts/index.native.js +39 -0
  24. package/dist/cjs/formLayouts/index.native.js.map +1 -0
  25. package/dist/cjs/index.cjs +1 -0
  26. package/dist/cjs/index.native.js +1 -0
  27. package/dist/cjs/index.native.js.map +1 -1
  28. package/dist/cjs/layouts/page.cjs +11 -3
  29. package/dist/cjs/layouts/page.native.js +11 -3
  30. package/dist/cjs/layouts/page.native.js.map +1 -1
  31. package/dist/esm/Accordion/index.native.js.map +1 -1
  32. package/dist/esm/AnimateHeight/index.native.js.map +1 -1
  33. package/dist/esm/Avatar/getInitials.native.js.map +1 -1
  34. package/dist/esm/Avatar/index.native.js.map +1 -1
  35. package/dist/esm/Badge/index.native.js.map +1 -1
  36. package/dist/esm/Button.native.js.map +1 -1
  37. package/dist/esm/Carousel/index.native.js.map +1 -1
  38. package/dist/esm/Chip/index.native.js.map +1 -1
  39. package/dist/esm/Collapsible.native.js.map +1 -1
  40. package/dist/esm/ContextMenu/index.native.js.map +1 -1
  41. package/dist/esm/CopyField/index.native.js.map +1 -1
  42. package/dist/esm/Dialog.native.js.map +1 -1
  43. package/dist/esm/DotIndicator/index.native.js.map +1 -1
  44. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  45. package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
  46. package/dist/esm/Heading.native.js.map +1 -1
  47. package/dist/esm/Meter/index.native.js.map +1 -1
  48. package/dist/esm/Meter/meter.native.js.map +1 -1
  49. package/dist/esm/OverflowRow/index.native.js.map +1 -1
  50. package/dist/esm/Pagination.native.js.map +1 -1
  51. package/dist/esm/Popover.native.js.map +1 -1
  52. package/dist/esm/ProgressSteps/index.native.js.map +1 -1
  53. package/dist/esm/Quote/index.native.js.map +1 -1
  54. package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
  55. package/dist/esm/Separator/index.native.js.map +1 -1
  56. package/dist/esm/Sheet.native.js.map +1 -1
  57. package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
  58. package/dist/esm/SheetModal/detents.native.js.map +1 -1
  59. package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
  60. package/dist/esm/Skeleton/index.native.js.map +1 -1
  61. package/dist/esm/SkipLink/index.native.js.map +1 -1
  62. package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
  63. package/dist/esm/SortableList/index.native.js.map +1 -1
  64. package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
  65. package/dist/esm/Tabs/index.native.js.map +1 -1
  66. package/dist/esm/Text.native.js.map +1 -1
  67. package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
  68. package/dist/esm/Toast/index.native.js.map +1 -1
  69. package/dist/esm/Toast/store.native.js.map +1 -1
  70. package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
  71. package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
  72. package/dist/esm/TreeSelect/index.native.js.map +1 -1
  73. package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
  74. package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
  75. package/dist/esm/Video/VideoFrame.native.js.map +1 -1
  76. package/dist/esm/Video/types.native.js.map +1 -1
  77. package/dist/esm/Wheel/index.native.js.map +1 -1
  78. package/dist/esm/Wizard/index.native.js.map +1 -1
  79. package/dist/esm/actions/ActionBar.native.js.map +1 -1
  80. package/dist/esm/actions/DangerSection.native.js.map +1 -1
  81. package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
  82. package/dist/esm/actions/HeaderActions.native.js.map +1 -1
  83. package/dist/esm/actions/devWarn.native.js.map +1 -1
  84. package/dist/esm/actions/index.native.js.map +1 -1
  85. package/dist/esm/actions/severity.native.js.map +1 -1
  86. package/dist/esm/appShell/BottomAccessory.mjs +18 -0
  87. package/dist/esm/appShell/BottomAccessory.mjs.map +1 -0
  88. package/dist/esm/appShell/BottomAccessory.native.js +25 -0
  89. package/dist/esm/appShell/BottomAccessory.native.js.map +1 -0
  90. package/dist/esm/appShell/Dock.native.js.map +1 -1
  91. package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
  92. package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
  93. package/dist/esm/appShell/Springboard.native.js.map +1 -1
  94. package/dist/esm/appShell/SystemBar.native.js.map +1 -1
  95. package/dist/esm/appShell/TabBar.mjs +99 -20
  96. package/dist/esm/appShell/TabBar.mjs.map +1 -1
  97. package/dist/esm/appShell/TabBar.native.js +109 -20
  98. package/dist/esm/appShell/TabBar.native.js.map +1 -1
  99. package/dist/esm/appShell/appTile.native.js.map +1 -1
  100. package/dist/esm/appShell/bottomChrome.mjs +46 -0
  101. package/dist/esm/appShell/bottomChrome.mjs.map +1 -0
  102. package/dist/esm/appShell/bottomChrome.native.js +77 -0
  103. package/dist/esm/appShell/bottomChrome.native.js.map +1 -0
  104. package/dist/esm/appShell/bottomInset.mjs +5 -0
  105. package/dist/esm/appShell/bottomInset.mjs.map +1 -0
  106. package/dist/esm/appShell/bottomInset.native.js +6 -0
  107. package/dist/esm/appShell/bottomInset.native.js.map +1 -0
  108. package/dist/esm/appShell/index.mjs +3 -0
  109. package/dist/esm/appShell/index.mjs.map +1 -1
  110. package/dist/esm/appShell/index.native.js +3 -0
  111. package/dist/esm/appShell/index.native.js.map +1 -1
  112. package/dist/esm/charts/Axis.native.js.map +1 -1
  113. package/dist/esm/charts/BarChart.native.js.map +1 -1
  114. package/dist/esm/charts/ChartDataView.native.js.map +1 -1
  115. package/dist/esm/charts/ChartSurface.native.js.map +1 -1
  116. package/dist/esm/charts/LineChart.native.js.map +1 -1
  117. package/dist/esm/charts/PieChart.native.js.map +1 -1
  118. package/dist/esm/charts/Sparkline.native.js.map +1 -1
  119. package/dist/esm/charts/accessibility.native.js.map +1 -1
  120. package/dist/esm/charts/chartHeight.native.js.map +1 -1
  121. package/dist/esm/charts/composeChart.native.js.map +1 -1
  122. package/dist/esm/charts/index.native.js.map +1 -1
  123. package/dist/esm/charts/math.native.js.map +1 -1
  124. package/dist/esm/charts/series.native.js.map +1 -1
  125. package/dist/esm/charts/svg.native.js.map +1 -1
  126. package/dist/esm/charts/types.native.js.map +1 -1
  127. package/dist/esm/charts/useChartTheme.native.js.map +1 -1
  128. package/dist/esm/code/Code/index.native.js.map +1 -1
  129. package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
  130. package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
  131. package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
  132. package/dist/esm/code/Highlighter/index.native.js.map +1 -1
  133. package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
  134. package/dist/esm/code/Pre/index.native.js.map +1 -1
  135. package/dist/esm/code/index.native.js.map +1 -1
  136. package/dist/esm/componentColors.native.js.map +1 -1
  137. package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
  138. package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
  139. package/dist/esm/feedback/copy.native.js.map +1 -1
  140. package/dist/esm/feedback/index.native.js.map +1 -1
  141. package/dist/esm/feedback/notify.native.js.map +1 -1
  142. package/dist/esm/feedback/route.native.js.map +1 -1
  143. package/dist/esm/feedback/store.native.js.map +1 -1
  144. package/dist/esm/formLayouts/FormLayouts.mjs +509 -0
  145. package/dist/esm/formLayouts/FormLayouts.mjs.map +1 -0
  146. package/dist/esm/formLayouts/FormLayouts.native.js +537 -0
  147. package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -0
  148. package/dist/esm/formLayouts/PreferencePanel.mjs +190 -0
  149. package/dist/esm/formLayouts/PreferencePanel.mjs.map +1 -0
  150. package/dist/esm/formLayouts/PreferencePanel.native.js +209 -0
  151. package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -0
  152. package/dist/esm/formLayouts/index.mjs +4 -0
  153. package/dist/esm/formLayouts/index.mjs.map +1 -0
  154. package/dist/esm/formLayouts/index.native.js +4 -0
  155. package/dist/esm/formLayouts/index.native.js.map +1 -0
  156. package/dist/esm/hooks/index.native.js.map +1 -1
  157. package/dist/esm/hooks/useClipboard.native.js.map +1 -1
  158. package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
  159. package/dist/esm/icons/CheckRegular.native.js.map +1 -1
  160. package/dist/esm/icons/MinusRegular.native.js.map +1 -1
  161. package/dist/esm/icons/index.native.js.map +1 -1
  162. package/dist/esm/icons/lucide.native.js.map +1 -1
  163. package/dist/esm/icons/themed.native.js.map +1 -1
  164. package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
  165. package/dist/esm/images/Image/shared.native.js.map +1 -1
  166. package/dist/esm/images/Image/types.native.js.map +1 -1
  167. package/dist/esm/images/index.native.js.map +1 -1
  168. package/dist/esm/index.mjs +1 -0
  169. package/dist/esm/index.mjs.map +1 -1
  170. package/dist/esm/index.native.js +1 -0
  171. package/dist/esm/index.native.js.map +1 -1
  172. package/dist/esm/knobImmuneExports.native.js.map +1 -1
  173. package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
  174. package/dist/esm/layouts/Debug/index.native.js.map +1 -1
  175. package/dist/esm/layouts/EmptyState.native.js.map +1 -1
  176. package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
  177. package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
  178. package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
  179. package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
  180. package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
  181. package/dist/esm/layouts/StatusDot.native.js.map +1 -1
  182. package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
  183. package/dist/esm/layouts/attachments.native.js.map +1 -1
  184. package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
  185. package/dist/esm/layouts/index.native.js.map +1 -1
  186. package/dist/esm/layouts/page.mjs +11 -3
  187. package/dist/esm/layouts/page.mjs.map +1 -1
  188. package/dist/esm/layouts/page.native.js +11 -3
  189. package/dist/esm/layouts/page.native.js.map +1 -1
  190. package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
  191. package/dist/esm/layouts/screenScroll.native.js.map +1 -1
  192. package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
  193. package/dist/esm/layouts/sidebar.native.js.map +1 -1
  194. package/dist/esm/layouts/tags.native.js.map +1 -1
  195. package/dist/esm/layouts/timeline.native.js.map +1 -1
  196. package/dist/esm/layouts/toolbar.native.js.map +1 -1
  197. package/dist/esm/shared/actionScan.native.js.map +1 -1
  198. package/dist/esm/shared/i18n.native.js.map +1 -1
  199. package/dist/esm/shared/restoreRetries.native.js.map +1 -1
  200. package/dist/esm/shared/t.native.js.map +1 -1
  201. package/dist/esm/shared/textRidesText.native.js.map +1 -1
  202. package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
  203. package/dist/esm/surfaces.native.js.map +1 -1
  204. package/dist/esm/tamagui.native.js.map +1 -1
  205. package/dist/esm/testSetup.native.js.map +1 -1
  206. package/dist/esm/utils/setTinted.native.js.map +1 -1
  207. package/dist/esm/utils/unwrapText.native.js.map +1 -1
  208. package/dist/esm/views/Calendar.native.js.map +1 -1
  209. package/dist/esm/views/Dashboard.native.js.map +1 -1
  210. package/dist/esm/views/Gantt.native.js.map +1 -1
  211. package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
  212. package/dist/esm/views/ImageGrid.native.js.map +1 -1
  213. package/dist/esm/views/List.native.js.map +1 -1
  214. package/dist/esm/views/Matrix.native.js.map +1 -1
  215. package/dist/esm/views/ReportBuilder.native.js.map +1 -1
  216. package/dist/esm/views/TreeView.native.js.map +1 -1
  217. package/dist/esm/views/calendarMath.native.js.map +1 -1
  218. package/dist/esm/views/ganttIntervals.native.js.map +1 -1
  219. package/dist/esm/views/ganttMath.native.js.map +1 -1
  220. package/dist/esm/views/index.native.js.map +1 -1
  221. package/dist/esm/views/kanbanDnd.native.js.map +1 -1
  222. package/dist/esm/views/matrixMath.native.js.map +1 -1
  223. package/dist/esm/views/treeViewDnd.native.js.map +1 -1
  224. package/dist/esm/views/treeViewLayout.native.js.map +1 -1
  225. package/dist/esm/views/treeViewMotion.native.js.map +1 -1
  226. package/dist/esm/views/treeViewReveal.native.js.map +1 -1
  227. package/dist/jsx/appShell/BottomAccessory.mjs +18 -0
  228. package/dist/jsx/appShell/BottomAccessory.mjs.map +1 -0
  229. package/dist/jsx/appShell/BottomAccessory.native.js +53 -0
  230. package/dist/jsx/appShell/BottomAccessory.native.js.map +1 -0
  231. package/dist/jsx/appShell/TabBar.mjs +99 -20
  232. package/dist/jsx/appShell/TabBar.mjs.map +1 -1
  233. package/dist/jsx/appShell/TabBar.native.js +109 -17
  234. package/dist/jsx/appShell/TabBar.native.js.map +1 -1
  235. package/dist/jsx/appShell/bottomChrome.mjs +46 -0
  236. package/dist/jsx/appShell/bottomChrome.mjs.map +1 -0
  237. package/dist/jsx/appShell/bottomChrome.native.js +110 -0
  238. package/dist/jsx/appShell/bottomChrome.native.js.map +1 -0
  239. package/dist/jsx/appShell/bottomInset.mjs +5 -0
  240. package/dist/jsx/appShell/bottomInset.mjs.map +1 -0
  241. package/dist/jsx/appShell/bottomInset.native.js +34 -0
  242. package/dist/jsx/appShell/bottomInset.native.js.map +1 -0
  243. package/dist/jsx/appShell/index.mjs +3 -0
  244. package/dist/jsx/appShell/index.mjs.map +1 -1
  245. package/dist/jsx/appShell/index.native.js +12 -0
  246. package/dist/jsx/appShell/index.native.js.map +1 -1
  247. package/dist/jsx/formLayouts/FormLayouts.mjs +509 -0
  248. package/dist/jsx/formLayouts/FormLayouts.mjs.map +1 -0
  249. package/dist/jsx/formLayouts/FormLayouts.native.js +571 -0
  250. package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -0
  251. package/dist/jsx/formLayouts/PreferencePanel.mjs +190 -0
  252. package/dist/jsx/formLayouts/PreferencePanel.mjs.map +1 -0
  253. package/dist/jsx/formLayouts/PreferencePanel.native.js +237 -0
  254. package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -0
  255. package/dist/jsx/formLayouts/index.mjs +4 -0
  256. package/dist/jsx/formLayouts/index.mjs.map +1 -0
  257. package/dist/jsx/formLayouts/index.native.js +39 -0
  258. package/dist/jsx/formLayouts/index.native.js.map +1 -0
  259. package/dist/jsx/index.js +1 -0
  260. package/dist/jsx/index.js.map +1 -1
  261. package/dist/jsx/index.mjs +1 -0
  262. package/dist/jsx/index.mjs.map +1 -1
  263. package/dist/jsx/index.native.js +1 -0
  264. package/dist/jsx/index.native.js.map +1 -1
  265. package/dist/jsx/layouts/page.mjs +11 -3
  266. package/dist/jsx/layouts/page.mjs.map +1 -1
  267. package/dist/jsx/layouts/page.native.js +11 -3
  268. package/dist/jsx/layouts/page.native.js.map +1 -1
  269. package/package.json +9 -9
  270. package/src/appShell/BottomAccessory.tsx +18 -0
  271. package/src/appShell/TabBar.spec.tsx +97 -26
  272. package/src/appShell/TabBar.stories.tsx +24 -6
  273. package/src/appShell/TabBar.tsx +158 -32
  274. package/src/appShell/bottomChrome.ts +68 -0
  275. package/src/appShell/bottomInset.native.ts +6 -0
  276. package/src/appShell/bottomInset.ts +7 -0
  277. package/src/appShell/index.ts +2 -0
  278. package/src/formLayouts/FormLayouts.spec.tsx +85 -0
  279. package/src/formLayouts/FormLayouts.stories.tsx +128 -0
  280. package/src/formLayouts/FormLayouts.tsx +530 -0
  281. package/src/formLayouts/PreferencePanel.spec.tsx +45 -0
  282. package/src/formLayouts/PreferencePanel.tsx +263 -0
  283. package/src/formLayouts/formLayouts.designLaw.spec.ts +78 -0
  284. package/src/formLayouts/index.ts +26 -0
  285. package/src/index.ts +1 -0
  286. package/src/layouts/Screen.chromeClearance.spec.tsx +41 -0
  287. package/src/layouts/page.tsx +16 -0
  288. package/types/appShell/BottomAccessory.d.ts +11 -0
  289. package/types/appShell/BottomAccessory.d.ts.map +1 -0
  290. package/types/appShell/TabBar.d.ts +32 -10
  291. package/types/appShell/TabBar.d.ts.map +1 -1
  292. package/types/appShell/bottomChrome.d.ts +22 -0
  293. package/types/appShell/bottomChrome.d.ts.map +1 -0
  294. package/types/appShell/bottomInset.d.ts +6 -0
  295. package/types/appShell/bottomInset.d.ts.map +1 -0
  296. package/types/appShell/bottomInset.native.d.ts +3 -0
  297. package/types/appShell/bottomInset.native.d.ts.map +1 -0
  298. package/types/appShell/index.d.ts +2 -0
  299. package/types/appShell/index.d.ts.map +1 -1
  300. package/types/formLayouts/FormLayouts.d.ts +74 -0
  301. package/types/formLayouts/FormLayouts.d.ts.map +1 -0
  302. package/types/formLayouts/PreferencePanel.d.ts +74 -0
  303. package/types/formLayouts/PreferencePanel.d.ts.map +1 -0
  304. package/types/formLayouts/index.d.ts +5 -0
  305. package/types/formLayouts/index.d.ts.map +1 -0
  306. package/types/index.d.ts +1 -0
  307. package/types/index.d.ts.map +1 -1
  308. package/types/layouts/page.d.ts.map +1 -1
@@ -1,22 +1,32 @@
1
1
  /**
2
2
  * TabBar — a phone app's bottom section switcher (LC-150 TAB-BAR-ANATOMY,
3
- * iOS UITabBar parity).
3
+ * the iOS 26 floating tab bar).
4
4
  *
5
5
  * The bar owns the whole anatomy, so an app hands over an icon component and
6
- * a label and nothing else. The geometry is UITabBar's own and no theme moves
7
- * it: a 49pt row above the home indicator, a 25pt glyph set 7pt below the top
8
- * hairline, a 10pt medium caption under it. A theme changes the colours and
9
- * the bar material only. The active item is the theme's accent as readable
10
- * ink on icon and label (orange under an orange tint, the preset's accent
11
- * otherwise), so every MPO app selects in the same colour. Inactive items are
12
- * the secondary text ink. The accent never marks an inactive tab.
6
+ * a label and nothing else. It floats: a capsule of translucent material
7
+ * inset 16pt from the sides, 8pt above the home indicator, with content
8
+ * scrolling under it and no band or hairline across the screen. A Screen
9
+ * pads its scroll content by the height the capsule covers
10
+ * (`useBottomChromeInset`), so the last row clears it. The bottom accessory
11
+ * (LC-174, e.g. a pager) floats as its own smaller capsule above it. A theme
12
+ * changes the colours only: the active item is the theme's accent as
13
+ * readable ink on an accent-wash pill, inactive items are the secondary text
14
+ * ink.
13
15
  */
14
- import { hairline, useAccentOnSurface, useGlyphColor } from "@multiplatform.one/theme";
15
- import type { ComponentType } from "react";
16
+ import {
17
+ hairlineWidth,
18
+ normalizeToHex,
19
+ useAccentOnSurface,
20
+ useAccentTintedSurface,
21
+ useGlyphColor,
22
+ } from "@multiplatform.one/theme";
23
+ import { zIndex } from "@multiplatform.one/forms";
16
24
  import { isWeb } from "@multiplatform.one/platform";
17
- import { XStack, YStack } from "tamagui";
18
- import { SafeAreaWrapper } from "../layouts/SafeAreaWrapper";
25
+ import { type ComponentType, type ReactNode, useEffect, useState } from "react";
26
+ import { XStack, YStack, useTheme } from "tamagui";
19
27
  import { Text } from "../Text";
28
+ import { setBottomChromeInset, setFloatingBarMounted, useBottomAccessory } from "./bottomChrome";
29
+ import { useBottomInset } from "./bottomInset";
20
30
 
21
31
  /** A phosphor-style glyph: the bar sets its size, colour and weight. */
22
32
  export type TabBarIcon = ComponentType<{
@@ -36,21 +46,35 @@ export interface TabBarProps {
36
46
  items: readonly TabBarItem[];
37
47
  activeKey?: string;
38
48
  onTabPress?: (key: string) => void;
49
+ /**
50
+ * The bottom accessory (LC-174): its own capsule floating above the bar. A
51
+ * page's `BottomAccessory` lands here when this prop is unset.
52
+ */
53
+ accessory?: ReactNode;
54
+ /**
55
+ * Default true: the bar floats over the screen and pads every Screen. False
56
+ * draws the same capsule in flow (a demo inside a page).
57
+ */
58
+ floating?: boolean;
39
59
  /** Accessible name of the tab list. Default "Tabs". */
40
60
  label?: string;
41
61
  testID?: string;
42
62
  }
43
63
 
44
64
  /**
45
- * UITabBar's compact (iPhone portrait) metrics in points. They are fixed
46
- * like the platform's: a preset's scale or a large Dynamic Type size never
47
- * grows the bar, which is why they are not scale tokens. The column is
48
- * top-aligned: 7 + 25 + 2 + 12 leaves 3pt under the caption inside the 49pt
49
- * row, and the safe-area inset below it is the only other height.
65
+ * The iOS 26 floating tab bar's metrics in points, fixed like the
66
+ * platform's: a preset's scale or a large Dynamic Type size never moves
67
+ * them. The capsule is 4 + 53 + 4 tall; each item is a pill of 7 + 25 + 2 +
68
+ * 12 + 7. Its bottom edge sits 8pt above the home indicator, whose band is
69
+ * the lowest 13pt of the device's bottom inset, or 8pt above the viewport
70
+ * edge where there is none.
50
71
  */
51
72
  export const tabBarMetrics = {
52
- rowHeight: 49,
53
- iconTop: 7,
73
+ sideInset: 16,
74
+ indicatorClearance: 8,
75
+ homeIndicatorBand: 13,
76
+ capsulePadding: 4,
77
+ itemPaddingY: 7,
54
78
  iconSize: 25,
55
79
  labelGap: 2,
56
80
  labelSize: 10,
@@ -58,7 +82,23 @@ export const tabBarMetrics = {
58
82
  labelWeight: "500",
59
83
  /** A label that does not fit shrinks to 9pt at most, then clips. */
60
84
  labelMinScale: 0.9,
85
+ accessoryGap: 8,
86
+ accessoryHeight: 44,
61
87
  } as const;
88
+
89
+ /** The capsule's height: its padding around one item pill. */
90
+ export const tabBarCapsuleHeight =
91
+ 2 * tabBarMetrics.capsulePadding +
92
+ 2 * tabBarMetrics.itemPaddingY +
93
+ tabBarMetrics.iconSize +
94
+ tabBarMetrics.labelGap +
95
+ tabBarMetrics.labelLineHeight;
96
+
97
+ /** The capsule's bottom edge above the screen's bottom edge. */
98
+ export function tabBarBottomOffset(bottomInset: number): number {
99
+ return (bottomInset > 0 ? tabBarMetrics.homeIndicatorBand : 0) + tabBarMetrics.indicatorClearance;
100
+ }
101
+
62
102
  /**
63
103
  * Inactive ink: the theme's secondary text ink (LC-152), whatever the
64
104
  * preset's textAccent. Bold sets textAccent "high", whose text colour is the
@@ -66,8 +106,39 @@ export const tabBarMetrics = {
66
106
  * body text.
67
107
  */
68
108
  export const tabBarInactiveInk = "$textMuted";
69
- /** The bar material: the chrome step one off the page, as the SystemBar paints. */
109
+ /** The material's base: the chrome step one off the page, as the SystemBar paints. */
70
110
  export const tabBarMaterial = "$color2";
111
+ /** How much of the material shows through: web blurs what is behind it, native cannot. */
112
+ export const tabBarMaterialOpacity = isWeb ? 0.72 : 0.94;
113
+
114
+ function translucent(color: string | undefined, opacity: number): string | undefined {
115
+ const hex = color ? normalizeToHex(color) : null;
116
+ if (!hex) return color;
117
+ const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));
118
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
119
+ }
120
+
121
+ function useMaterial() {
122
+ const theme = useTheme() as unknown as Record<string, { val?: unknown } | undefined>;
123
+ const base = theme[tabBarMaterial.slice(1)]?.val;
124
+ return {
125
+ backgroundColor:
126
+ translucent(typeof base === "string" ? base : undefined, tabBarMaterialOpacity) ??
127
+ tabBarMaterial,
128
+ borderWidth: hairlineWidth,
129
+ borderColor: "$borderColor",
130
+ shadowColor: "$shadow3",
131
+ shadowOffset: { width: 0, height: 4 },
132
+ shadowRadius: 16,
133
+ elevation: 6,
134
+ ...(isWeb
135
+ ? {
136
+ backdropFilter: "blur(20px) saturate(180%)",
137
+ WebkitBackdropFilter: "blur(20px) saturate(180%)",
138
+ }
139
+ : null),
140
+ };
141
+ }
71
142
 
72
143
  function TabBarButton({
73
144
  item,
@@ -81,6 +152,7 @@ function TabBarButton({
81
152
  testID: string;
82
153
  }) {
83
154
  const accent = useAccentOnSurface();
155
+ const wash = useAccentTintedSurface();
84
156
  const secondaryInk = useGlyphColor(tabBarInactiveInk);
85
157
  const ink = active ? accent : secondaryInk;
86
158
  const Icon = item.icon;
@@ -95,8 +167,10 @@ function TabBarButton({
95
167
  alignItems="center"
96
168
  justifyContent="flex-start"
97
169
  gap={tabBarMetrics.labelGap}
98
- paddingTop={tabBarMetrics.iconTop}
170
+ paddingVertical={tabBarMetrics.itemPaddingY}
99
171
  paddingHorizontal="$1"
172
+ borderRadius={1000}
173
+ backgroundColor={active ? (wash ?? "$color4") : "transparent"}
100
174
  cursor="pointer"
101
175
  onPress={onPress}
102
176
  data-testid={testID}
@@ -142,26 +216,78 @@ export function TabBar({
142
216
  items,
143
217
  activeKey,
144
218
  onTabPress,
219
+ accessory: ownAccessory,
220
+ floating = true,
145
221
  label = "Tabs",
146
222
  testID = "tab-bar",
147
223
  }: TabBarProps) {
224
+ const material = useMaterial();
225
+ const pageAccessory = useBottomAccessory();
226
+ const accessory = ownAccessory ?? (floating ? pageAccessory : null);
227
+ const deviceInset = useBottomInset();
228
+ const bottom = floating ? tabBarBottomOffset(deviceInset) : 0;
229
+ const [id] = useState(() => Symbol("tab-bar"));
230
+ const [accessoryHeight, setAccessoryHeight] = useState(0);
231
+ const covered =
232
+ bottom +
233
+ tabBarCapsuleHeight +
234
+ (accessory ? tabBarMetrics.accessoryGap + accessoryHeight : 0) +
235
+ tabBarMetrics.indicatorClearance;
236
+
237
+ useEffect(() => {
238
+ setBottomChromeInset(id, floating ? covered : null);
239
+ }, [covered, floating, id]);
240
+ useEffect(() => {
241
+ setFloatingBarMounted(id, floating);
242
+ }, [floating, id]);
243
+ useEffect(
244
+ () => () => {
245
+ setBottomChromeInset(id, null);
246
+ setFloatingBarMounted(id, false);
247
+ },
248
+ [id],
249
+ );
250
+
148
251
  return (
149
- <SafeAreaWrapper
150
- edges={["bottom"]}
151
- flex={0}
152
- flexShrink={0}
153
- flexBasis="auto"
154
- backgroundColor={tabBarMaterial}
155
- {...hairline.top}
156
- borderColor="$borderColor"
252
+ <YStack
253
+ {...(floating
254
+ ? {
255
+ position: (isWeb ? "fixed" : "absolute") as "absolute",
256
+ left: 0,
257
+ right: 0,
258
+ bottom: 0,
259
+ zIndex: zIndex.stickyHeader,
260
+ paddingHorizontal: tabBarMetrics.sideInset,
261
+ }
262
+ : null)}
263
+ paddingBottom={bottom}
264
+ gap={tabBarMetrics.accessoryGap}
265
+ pointerEvents="box-none"
157
266
  data-testid={testID}
158
267
  >
268
+ {accessory ? (
269
+ <XStack
270
+ alignSelf="center"
271
+ alignItems="center"
272
+ minHeight={tabBarMetrics.accessoryHeight}
273
+ paddingHorizontal="$3"
274
+ borderRadius={1000}
275
+ {...material}
276
+ onLayout={(event) => setAccessoryHeight(Math.round(event.nativeEvent.layout.height))}
277
+ data-testid={`${testID}-accessory`}
278
+ >
279
+ {accessory}
280
+ </XStack>
281
+ ) : null}
159
282
  <XStack
160
283
  role="tablist"
161
284
  aria-label={label}
162
- height={tabBarMetrics.rowHeight}
285
+ height={tabBarCapsuleHeight}
286
+ padding={tabBarMetrics.capsulePadding}
163
287
  alignItems="stretch"
164
- overflow="hidden"
288
+ borderRadius={1000}
289
+ {...material}
290
+ data-testid={`${testID}-capsule`}
165
291
  >
166
292
  {items.map((item) => (
167
293
  <TabBarButton
@@ -173,6 +299,6 @@ export function TabBar({
173
299
  />
174
300
  ))}
175
301
  </XStack>
176
- </SafeAreaWrapper>
302
+ </YStack>
177
303
  );
178
304
  }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The floating bottom chrome's shared state. A mounted floating TabBar
3
+ * publishes the height it covers, so a Screen pads its scroll content by it
4
+ * and its last row clears the capsule. A page publishes its bottom accessory
5
+ * (LC-174, e.g. a pager) here, so the bar floats it as its own capsule. The
6
+ * bar and the page are siblings in every host, so both live in a store, not
7
+ * a context a host would have to wire.
8
+ */
9
+ import { type ReactNode, useSyncExternalStore } from "react";
10
+
11
+ function createStore<T>(empty: T) {
12
+ const entries = new Map<symbol, T>();
13
+ const listeners = new Set<() => void>();
14
+ let current = empty;
15
+ return {
16
+ set(id: symbol, value: T | null, pick: (values: T[]) => T) {
17
+ if (value === null) entries.delete(id);
18
+ else entries.set(id, value);
19
+ const next = entries.size ? pick([...entries.values()]) : empty;
20
+ if (Object.is(next, current)) return;
21
+ current = next;
22
+ for (const listener of listeners) listener();
23
+ },
24
+ subscribe(listener: () => void) {
25
+ listeners.add(listener);
26
+ return () => {
27
+ listeners.delete(listener);
28
+ };
29
+ },
30
+ get: () => current,
31
+ empty: () => empty,
32
+ };
33
+ }
34
+
35
+ const insets = createStore(0);
36
+
37
+ /** Publish (or with null, withdraw) one floating bar's covered height. */
38
+ export function setBottomChromeInset(id: symbol, next: number | null) {
39
+ insets.set(id, next, (values) => Math.max(...values));
40
+ }
41
+
42
+ /** Points of screen the bottom chrome covers; 0 when no floating tab bar is mounted. */
43
+ export function useBottomChromeInset(): number {
44
+ return useSyncExternalStore(insets.subscribe, insets.get, insets.empty);
45
+ }
46
+
47
+ const accessories = createStore<ReactNode>(null);
48
+ const bars = createStore(false);
49
+
50
+ /** Publish (or with null, withdraw) a page's bottom accessory. The latest wins. */
51
+ export function setBottomAccessory(id: symbol, node: ReactNode | null) {
52
+ accessories.set(id, node, (values) => values[values.length - 1]);
53
+ }
54
+
55
+ /** The accessory a page published, for the floating TabBar to host. */
56
+ export function useBottomAccessory(): ReactNode {
57
+ return useSyncExternalStore(accessories.subscribe, accessories.get, accessories.empty);
58
+ }
59
+
60
+ /** A floating TabBar announces itself so accessories move into it. */
61
+ export function setFloatingBarMounted(id: symbol, mounted: boolean) {
62
+ bars.set(id, mounted ? true : null, () => true);
63
+ }
64
+
65
+ /** True while a floating TabBar is mounted and hosts the accessory. */
66
+ export function useFloatingBarMounted(): boolean {
67
+ return useSyncExternalStore(bars.subscribe, bars.get, bars.empty);
68
+ }
@@ -0,0 +1,6 @@
1
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
2
+
3
+ /** Native: the device's bottom safe-area inset (the home-indicator band). */
4
+ export function useBottomInset(): number {
5
+ return useSafeAreaInsets().bottom;
6
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Web: no home indicator inside the page, so the floating tab bar measures
3
+ * its clearance from the viewport's bottom edge.
4
+ */
5
+ export function useBottomInset(): number {
6
+ return 0;
7
+ }
@@ -5,3 +5,5 @@ export * from "./TabBar";
5
5
  export * from "./Springboard";
6
6
  export type { AppEntry } from "./appTile";
7
7
  export * from "./SettingsSplit";
8
+ export { useBottomChromeInset } from "./bottomChrome";
9
+ export { BottomAccessory } from "./BottomAccessory";
@@ -0,0 +1,85 @@
1
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
2
+ import { cleanup, screen } from "@testing-library/react";
3
+ import { afterEach, describe, expect, it, vi } from "vitest";
4
+ import * as components from "../index";
5
+ import { FormCard, LoginLayout, SettingsFormLayout, SignUpLayout } from "./FormLayouts";
6
+ import { PreferencePanel } from "./PreferencePanel";
7
+
8
+ afterEach(cleanup);
9
+
10
+ describe("form layouts ride the MPO Card (FZ-8001, LC-175)", () => {
11
+ it("the components barrel exports every former @package/ui form layout", () => {
12
+ for (const name of [
13
+ "FormCard",
14
+ "LoginLayout",
15
+ "SignUpLayout",
16
+ "SettingsFormLayout",
17
+ "SocialButton",
18
+ "GithubButton",
19
+ "Hide",
20
+ "PreferencePanel",
21
+ ])
22
+ expect((components as Record<string, unknown>)[name], name).toBeDefined();
23
+ });
24
+
25
+ it("FormCard paints the Card content tier as a form", () => {
26
+ const { container } = renderWithProviders(
27
+ <FormCard testID="form-card">
28
+ <span>child</span>
29
+ </FormCard>,
30
+ );
31
+ const card = container.querySelector('[data-tier="content"]');
32
+ expect(card).not.toBeNull();
33
+ expect(card?.tagName).toBe("FORM");
34
+ expect(card?.textContent).toBe("child");
35
+ });
36
+
37
+ it("LoginLayout and SignUpLayout sit in one Card each", () => {
38
+ renderWithProviders(<LoginLayout title="Sign in" onSignUp={vi.fn()} />);
39
+ expect(screen.getByText("Sign in")).toBeTruthy();
40
+ expect(document.querySelectorAll('[data-tier="content"]')).toHaveLength(1);
41
+ cleanup();
42
+ renderWithProviders(<SignUpLayout title="Create an account" onSignIn={vi.fn()} />);
43
+ expect(screen.getByText("Create an account")).toBeTruthy();
44
+ expect(document.querySelectorAll('[data-tier="content"]')).toHaveLength(1);
45
+ });
46
+
47
+ it("SettingsFormLayout is one Card holding every section", () => {
48
+ renderWithProviders(
49
+ <SettingsFormLayout
50
+ title="Account"
51
+ sections={[
52
+ { title: "Profile", content: <span>profile</span> },
53
+ { title: "Notifications", content: <span>notifications</span> },
54
+ ]}
55
+ />,
56
+ );
57
+ const cards = document.querySelectorAll('[data-tier="content"]');
58
+ expect(cards).toHaveLength(1);
59
+ expect(cards[0]?.textContent).toContain("profile");
60
+ expect(cards[0]?.textContent).toContain("notifications");
61
+ });
62
+
63
+ it("a PreferencePanel section banner is the MPO Alert with the banner's intent", () => {
64
+ renderWithProviders(
65
+ <PreferencePanel
66
+ sections={[
67
+ {
68
+ title: "Sync",
69
+ banner: { message: "Saved to every device" },
70
+ items: [],
71
+ },
72
+ {
73
+ title: "Danger",
74
+ banner: { message: "Signing out clears drafts", theme: "warning" },
75
+ items: [],
76
+ },
77
+ ]}
78
+ />,
79
+ );
80
+ const saved = screen.getByText("Saved to every device").closest("[data-accent-stripe]");
81
+ const warning = screen.getByText("Signing out clears drafts").closest("[data-accent-stripe]");
82
+ expect(saved, "success banner renders Alert").not.toBeNull();
83
+ expect(warning, "warning banner renders Alert").not.toBeNull();
84
+ });
85
+ });
@@ -0,0 +1,128 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
2
+ import { Input, Switch } from "@multiplatform.one/forms";
3
+ import { useState } from "react";
4
+ import { YStack } from "tamagui";
5
+ import {
6
+ FormCard,
7
+ GithubButton,
8
+ LoginLayout,
9
+ SettingsFormLayout,
10
+ SignUpLayout,
11
+ } from "./FormLayouts";
12
+ import { PreferencePanel } from "./PreferencePanel";
13
+
14
+ const meta: Meta<typeof FormCard> = {
15
+ title: "Components/FormLayouts",
16
+ component: FormCard,
17
+ parameters: {
18
+ status: { type: "stable" },
19
+ docs: {
20
+ description: {
21
+ component:
22
+ "Sign-in, sign-up, settings and preference panels for every MPO app, built on the MPO Card and Alert (LC-175). The app template re-exports them from @package/ui.",
23
+ },
24
+ },
25
+ },
26
+ };
27
+ export default meta;
28
+
29
+ type Story = StoryObj<typeof meta>;
30
+
31
+ export const Card: Story = {
32
+ render: () => (
33
+ <FormCard>
34
+ <YStack gap="$3">
35
+ <Input label="Name" placeholder="Enter name" />
36
+ <Input label="Email" placeholder="Enter email" />
37
+ </YStack>
38
+ </FormCard>
39
+ ),
40
+ };
41
+
42
+ export const SignIn: Story = {
43
+ render: () => (
44
+ <LoginLayout
45
+ title="Sign in"
46
+ onSubmit={() => {}}
47
+ onForgotPassword={() => {}}
48
+ onSignUp={() => {}}
49
+ socialButtons={<GithubButton onPress={() => {}} />}
50
+ />
51
+ ),
52
+ };
53
+
54
+ export const SignUp: Story = {
55
+ render: () => <SignUpLayout title="Create an account" onSubmit={() => {}} onSignIn={() => {}} />,
56
+ };
57
+
58
+ export const Settings: Story = {
59
+ render: () => (
60
+ <SettingsFormLayout
61
+ title="Account Settings"
62
+ sections={[
63
+ {
64
+ title: "Personal Information",
65
+ description: "Update your personal details",
66
+ content: (
67
+ <YStack gap="$3">
68
+ <Input label="Display Name" defaultValue="John Doe" />
69
+ <Input label="Email" defaultValue="john@example.com" />
70
+ </YStack>
71
+ ),
72
+ },
73
+ {
74
+ title: "Notifications",
75
+ description: "Configure your notification preferences",
76
+ content: <Switch label="Email notifications" />,
77
+ },
78
+ ]}
79
+ />
80
+ ),
81
+ };
82
+
83
+ function PreferencesDemo() {
84
+ const [sync, setSync] = useState(true);
85
+ const [language, setLanguage] = useState("en");
86
+ return (
87
+ <PreferencePanel
88
+ title="Settings"
89
+ subtitle="Manage your preferences"
90
+ sections={[
91
+ {
92
+ title: "Sync",
93
+ description: "Keep settings the same on every device",
94
+ banner: { message: "Synced a minute ago" },
95
+ items: [
96
+ {
97
+ type: "toggle",
98
+ key: "sync",
99
+ label: "Sync settings",
100
+ value: sync,
101
+ onValueChange: setSync,
102
+ },
103
+ ],
104
+ },
105
+ {
106
+ title: "Language",
107
+ items: [
108
+ {
109
+ type: "radio",
110
+ key: "lang",
111
+ label: "Language",
112
+ value: language,
113
+ onValueChange: setLanguage,
114
+ options: [
115
+ { label: "English", value: "en" },
116
+ { label: "Spanish", value: "es" },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ ]}
122
+ />
123
+ );
124
+ }
125
+
126
+ export const Preferences: Story = {
127
+ render: () => <PreferencesDemo />,
128
+ };