@oxy.so/bloom 19.5.1 → 19.6.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 (403) hide show
  1. package/docs/activity-heatmap.mdx +7 -0
  2. package/docs/adoption-matrix.mdx +26 -26
  3. package/docs/announcement.mdx +7 -0
  4. package/docs/app-shell.mdx +18 -11
  5. package/docs/avatar.mdx +2 -0
  6. package/docs/badge.mdx +2 -0
  7. package/docs/chip.mdx +6 -2
  8. package/docs/compose-layouts.mdx +114 -2
  9. package/docs/composition-bar.mdx +4 -0
  10. package/docs/contact-card.mdx +5 -0
  11. package/docs/dialog.mdx +7 -0
  12. package/docs/divider.mdx +8 -0
  13. package/docs/empty-state.mdx +8 -0
  14. package/docs/engagement-bar.mdx +9 -0
  15. package/docs/icon-circle.mdx +2 -0
  16. package/docs/layout.mdx +1 -1
  17. package/docs/list.mdx +4 -3
  18. package/docs/page-header.mdx +7 -0
  19. package/docs/public-parts.mdx +39 -28
  20. package/docs/screen.mdx +4 -0
  21. package/docs/scroll.mdx +6 -3
  22. package/docs/sidebar.mdx +26 -5
  23. package/docs/task-catalog.json +1 -1
  24. package/docs/task-catalog.mdx +1 -1
  25. package/docs/typography.mdx +9 -0
  26. package/lib/commonjs/app-shell/AppShell.js +3 -3
  27. package/lib/commonjs/app-shell/AppShell.js.map +1 -1
  28. package/lib/commonjs/app-shell/AppShellEngine.js +2 -1
  29. package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
  30. package/lib/commonjs/app-shell/AppShellPanelLayout.js +345 -172
  31. package/lib/commonjs/app-shell/AppShellPanelLayout.js.map +1 -1
  32. package/lib/commonjs/app-shell/RetainedPanelLayout.js +6 -0
  33. package/lib/commonjs/app-shell/RetainedPanelLayout.js.map +1 -1
  34. package/lib/commonjs/app-shell/panel-layout-css.js +20 -13
  35. package/lib/commonjs/app-shell/panel-layout-css.js.map +1 -1
  36. package/lib/commonjs/app-shell/panel-layout.js +33 -185
  37. package/lib/commonjs/app-shell/panel-layout.js.map +1 -1
  38. package/lib/commonjs/app-shell/panel-motion.js +13 -36
  39. package/lib/commonjs/app-shell/panel-motion.js.map +1 -1
  40. package/lib/commonjs/app-shell/panel-transitions.js +26 -0
  41. package/lib/commonjs/app-shell/panel-transitions.js.map +1 -0
  42. package/lib/commonjs/app-shell/shell-layout-css.js +2 -2
  43. package/lib/commonjs/app-shell/shell-layout-css.js.map +1 -1
  44. package/lib/commonjs/app-shell/use-panel-exit-completion.js +100 -0
  45. package/lib/commonjs/app-shell/use-panel-exit-completion.js.map +1 -0
  46. package/lib/commonjs/app-shell/use-panel-resize.js +21 -7
  47. package/lib/commonjs/app-shell/use-panel-resize.js.map +1 -1
  48. package/lib/commonjs/app-shell/use-panel-reveal.js +2 -1
  49. package/lib/commonjs/app-shell/use-panel-reveal.js.map +1 -1
  50. package/lib/commonjs/bottom-sheet/BottomSheetBase.js +3 -2
  51. package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
  52. package/lib/commonjs/chip/Chip.js +10 -1
  53. package/lib/commonjs/chip/Chip.js.map +1 -1
  54. package/lib/commonjs/chip/shared.js +2 -2
  55. package/lib/commonjs/dialog/DialogBottomSheet.js +6 -3
  56. package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
  57. package/lib/commonjs/engagement-bar/EngagementAction.js +6 -5
  58. package/lib/commonjs/engagement-bar/EngagementAction.js.map +1 -1
  59. package/lib/commonjs/engagement-bar/EngagementBar.js +31 -7
  60. package/lib/commonjs/engagement-bar/EngagementBar.js.map +1 -1
  61. package/lib/commonjs/engagement-bar/EngagementPop.js +10 -3
  62. package/lib/commonjs/engagement-bar/EngagementPop.js.map +1 -1
  63. package/lib/commonjs/engagement-bar/context.js.map +1 -1
  64. package/lib/commonjs/engagement-bar/paint.js +59 -12
  65. package/lib/commonjs/engagement-bar/paint.js.map +1 -1
  66. package/lib/commonjs/hooks/use-border-box-size.js +46 -0
  67. package/lib/commonjs/hooks/use-border-box-size.js.map +1 -0
  68. package/lib/commonjs/layout/ScrollBar.web.js +62 -29
  69. package/lib/commonjs/layout/ScrollBar.web.js.map +1 -1
  70. package/lib/commonjs/layout/scroll-metrics.js.map +1 -1
  71. package/lib/commonjs/list/VirtualList.js +12 -0
  72. package/lib/commonjs/list/VirtualList.js.map +1 -1
  73. package/lib/commonjs/list/VirtualList.web.js +40 -19
  74. package/lib/commonjs/list/VirtualList.web.js.map +1 -1
  75. package/lib/commonjs/list/flash-list-module.js.map +1 -1
  76. package/lib/commonjs/page-header/EdgeScrim.js +14 -4
  77. package/lib/commonjs/page-header/EdgeScrim.js.map +1 -1
  78. package/lib/commonjs/page-header/PageHeader.js +19 -6
  79. package/lib/commonjs/page-header/PageHeader.js.map +1 -1
  80. package/lib/commonjs/screen/ScreenBase.js +15 -6
  81. package/lib/commonjs/screen/ScreenBase.js.map +1 -1
  82. package/lib/commonjs/screen/ScreenScrollViewBase.js +12 -2
  83. package/lib/commonjs/screen/ScreenScrollViewBase.js.map +1 -1
  84. package/lib/commonjs/screen/context.js.map +1 -1
  85. package/lib/commonjs/screen/use-intrinsic-content-height.js +53 -0
  86. package/lib/commonjs/screen/use-intrinsic-content-height.js.map +1 -0
  87. package/lib/commonjs/screen/use-screen-viewport.js +37 -6
  88. package/lib/commonjs/screen/use-screen-viewport.js.map +1 -1
  89. package/lib/commonjs/scroll/constants.js +4 -1
  90. package/lib/commonjs/scroll/constants.js.map +1 -1
  91. package/lib/commonjs/scroll/owner-handoff.js +27 -7
  92. package/lib/commonjs/scroll/owner-handoff.js.map +1 -1
  93. package/lib/commonjs/scroll/use-scroll-restoration.web.js +2 -11
  94. package/lib/commonjs/scroll/use-scroll-restoration.web.js.map +1 -1
  95. package/lib/commonjs/sidebar/Sidebar.js +121 -87
  96. package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
  97. package/lib/commonjs/sidebar/arrangement.js +36 -0
  98. package/lib/commonjs/sidebar/arrangement.js.map +1 -0
  99. package/lib/commonjs/sidebar/index.js.map +1 -1
  100. package/lib/commonjs/stay-filters/CountFilter.js +1 -1
  101. package/lib/commonjs/stay-filters/FilterChip.js +1 -1
  102. package/lib/commonjs/stay-filters/ToggleChipGroup.js +1 -1
  103. package/lib/module/app-shell/AppShell.js +3 -3
  104. package/lib/module/app-shell/AppShell.js.map +1 -1
  105. package/lib/module/app-shell/AppShellEngine.js +2 -1
  106. package/lib/module/app-shell/AppShellEngine.js.map +1 -1
  107. package/lib/module/app-shell/AppShellPanelLayout.js +319 -147
  108. package/lib/module/app-shell/AppShellPanelLayout.js.map +1 -1
  109. package/lib/module/app-shell/RetainedPanelLayout.js +7 -1
  110. package/lib/module/app-shell/RetainedPanelLayout.js.map +1 -1
  111. package/lib/module/app-shell/panel-layout-css.js +19 -12
  112. package/lib/module/app-shell/panel-layout-css.js.map +1 -1
  113. package/lib/module/app-shell/panel-layout.js +32 -183
  114. package/lib/module/app-shell/panel-layout.js.map +1 -1
  115. package/lib/module/app-shell/panel-motion.js +14 -36
  116. package/lib/module/app-shell/panel-motion.js.map +1 -1
  117. package/lib/module/app-shell/panel-transitions.js +21 -0
  118. package/lib/module/app-shell/panel-transitions.js.map +1 -0
  119. package/lib/module/app-shell/shell-layout-css.js +2 -2
  120. package/lib/module/app-shell/shell-layout-css.js.map +1 -1
  121. package/lib/module/app-shell/use-panel-exit-completion.js +97 -0
  122. package/lib/module/app-shell/use-panel-exit-completion.js.map +1 -0
  123. package/lib/module/app-shell/use-panel-resize.js +22 -8
  124. package/lib/module/app-shell/use-panel-resize.js.map +1 -1
  125. package/lib/module/app-shell/use-panel-reveal.js +2 -1
  126. package/lib/module/app-shell/use-panel-reveal.js.map +1 -1
  127. package/lib/module/bottom-sheet/BottomSheetBase.js +3 -2
  128. package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
  129. package/lib/module/chip/Chip.js +10 -1
  130. package/lib/module/chip/Chip.js.map +1 -1
  131. package/lib/module/chip/shared.js +2 -2
  132. package/lib/module/dialog/DialogBottomSheet.js +6 -3
  133. package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
  134. package/lib/module/engagement-bar/EngagementAction.js +7 -6
  135. package/lib/module/engagement-bar/EngagementAction.js.map +1 -1
  136. package/lib/module/engagement-bar/EngagementBar.js +29 -5
  137. package/lib/module/engagement-bar/EngagementBar.js.map +1 -1
  138. package/lib/module/engagement-bar/EngagementPop.js +10 -3
  139. package/lib/module/engagement-bar/EngagementPop.js.map +1 -1
  140. package/lib/module/engagement-bar/context.js.map +1 -1
  141. package/lib/module/engagement-bar/paint.js +60 -13
  142. package/lib/module/engagement-bar/paint.js.map +1 -1
  143. package/lib/module/hooks/use-border-box-size.js +42 -0
  144. package/lib/module/hooks/use-border-box-size.js.map +1 -0
  145. package/lib/module/layout/ScrollBar.web.js +64 -31
  146. package/lib/module/layout/ScrollBar.web.js.map +1 -1
  147. package/lib/module/layout/scroll-metrics.js.map +1 -1
  148. package/lib/module/list/VirtualList.js +12 -0
  149. package/lib/module/list/VirtualList.js.map +1 -1
  150. package/lib/module/list/VirtualList.web.js +41 -20
  151. package/lib/module/list/VirtualList.web.js.map +1 -1
  152. package/lib/module/list/flash-list-module.js.map +1 -1
  153. package/lib/module/page-header/EdgeScrim.js +14 -4
  154. package/lib/module/page-header/EdgeScrim.js.map +1 -1
  155. package/lib/module/page-header/PageHeader.js +19 -6
  156. package/lib/module/page-header/PageHeader.js.map +1 -1
  157. package/lib/module/screen/ScreenBase.js +15 -6
  158. package/lib/module/screen/ScreenBase.js.map +1 -1
  159. package/lib/module/screen/ScreenScrollViewBase.js +12 -2
  160. package/lib/module/screen/ScreenScrollViewBase.js.map +1 -1
  161. package/lib/module/screen/context.js.map +1 -1
  162. package/lib/module/screen/use-intrinsic-content-height.js +50 -0
  163. package/lib/module/screen/use-intrinsic-content-height.js.map +1 -0
  164. package/lib/module/screen/use-screen-viewport.js +39 -8
  165. package/lib/module/screen/use-screen-viewport.js.map +1 -1
  166. package/lib/module/scroll/constants.js +3 -0
  167. package/lib/module/scroll/constants.js.map +1 -1
  168. package/lib/module/scroll/owner-handoff.js +27 -8
  169. package/lib/module/scroll/owner-handoff.js.map +1 -1
  170. package/lib/module/scroll/use-scroll-restoration.web.js +1 -10
  171. package/lib/module/scroll/use-scroll-restoration.web.js.map +1 -1
  172. package/lib/module/sidebar/Sidebar.js +121 -87
  173. package/lib/module/sidebar/Sidebar.js.map +1 -1
  174. package/lib/module/sidebar/arrangement.js +32 -0
  175. package/lib/module/sidebar/arrangement.js.map +1 -0
  176. package/lib/module/sidebar/index.js.map +1 -1
  177. package/lib/module/stay-filters/CountFilter.js +1 -1
  178. package/lib/module/stay-filters/FilterChip.js +1 -1
  179. package/lib/module/stay-filters/ToggleChipGroup.js +1 -1
  180. package/lib/typescript/commonjs/app-shell/AppShell.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/app-shell/AppShellPanelLayout.d.ts.map +1 -1
  183. package/lib/typescript/commonjs/app-shell/RetainedPanelLayout.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts +2 -1
  185. package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts +11 -2
  187. package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts.map +1 -1
  188. package/lib/typescript/commonjs/app-shell/panel-layout.d.ts +13 -27
  189. package/lib/typescript/commonjs/app-shell/panel-layout.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/app-shell/panel-motion.d.ts +1 -12
  191. package/lib/typescript/commonjs/app-shell/panel-motion.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts +4 -0
  193. package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/app-shell/shell-layout-css.d.ts.map +1 -1
  195. package/lib/typescript/commonjs/app-shell/types.d.ts +4 -0
  196. package/lib/typescript/commonjs/app-shell/types.d.ts.map +1 -1
  197. package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts +14 -0
  198. package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts +2 -2
  200. package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts +4 -2
  202. package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts +2 -2
  204. package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts.map +1 -1
  205. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  206. package/lib/typescript/commonjs/bottom-sheet/types.d.ts +2 -0
  207. package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
  208. package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/chip/shared.d.ts +1 -1
  210. package/lib/typescript/commonjs/chip/types.d.ts +1 -1
  211. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
  212. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/dialog/types.d.ts +2 -0
  214. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  215. package/lib/typescript/commonjs/engagement-bar/EngagementAction.d.ts.map +1 -1
  216. package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts +3 -3
  217. package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts.map +1 -1
  218. package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts +2 -1
  219. package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/engagement-bar/context.d.ts +1 -0
  221. package/lib/typescript/commonjs/engagement-bar/context.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/engagement-bar/paint.d.ts +4 -2
  223. package/lib/typescript/commonjs/engagement-bar/paint.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/engagement-bar/types.d.ts +10 -1
  225. package/lib/typescript/commonjs/engagement-bar/types.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts +13 -0
  227. package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/layout/ScrollBar.web.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/layout/scroll-metrics.d.ts +2 -0
  230. package/lib/typescript/commonjs/layout/scroll-metrics.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/layout/types.d.ts +2 -2
  232. package/lib/typescript/commonjs/layout/types.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/list/VirtualList.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/list/VirtualList.web.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/list/flash-list-module.d.ts +1 -1
  236. package/lib/typescript/commonjs/list/flash-list-module.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +3 -1
  238. package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -1
  239. package/lib/typescript/commonjs/page-header/PageHeader.d.ts +1 -1
  240. package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/page-header/types.d.ts +2 -0
  242. package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/screen/ScreenBase.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/screen/ScreenScrollViewBase.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/screen/context.d.ts +3 -0
  246. package/lib/typescript/commonjs/screen/context.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts +3 -0
  248. package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/screen/use-screen-viewport.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/scroll/constants.d.ts +2 -0
  251. package/lib/typescript/commonjs/scroll/constants.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/scroll/owner-handoff.d.ts +3 -1
  253. package/lib/typescript/commonjs/scroll/owner-handoff.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/scroll/use-scroll-restoration.web.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/sidebar/arrangement.d.ts +32 -0
  257. package/lib/typescript/commonjs/sidebar/arrangement.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/sidebar/index.d.ts +1 -0
  259. package/lib/typescript/commonjs/sidebar/index.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/sidebar/types.d.ts +13 -1
  261. package/lib/typescript/commonjs/sidebar/types.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/stay-filters/CountFilter.d.ts +1 -1
  263. package/lib/typescript/commonjs/stay-filters/ToggleChipGroup.d.ts +1 -1
  264. package/lib/typescript/module/app-shell/AppShell.d.ts.map +1 -1
  265. package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
  266. package/lib/typescript/module/app-shell/AppShellPanelLayout.d.ts.map +1 -1
  267. package/lib/typescript/module/app-shell/RetainedPanelLayout.d.ts.map +1 -1
  268. package/lib/typescript/module/app-shell/panel-layout-css.d.ts +2 -1
  269. package/lib/typescript/module/app-shell/panel-layout-css.d.ts.map +1 -1
  270. package/lib/typescript/module/app-shell/panel-layout-types.d.ts +11 -2
  271. package/lib/typescript/module/app-shell/panel-layout-types.d.ts.map +1 -1
  272. package/lib/typescript/module/app-shell/panel-layout.d.ts +13 -27
  273. package/lib/typescript/module/app-shell/panel-layout.d.ts.map +1 -1
  274. package/lib/typescript/module/app-shell/panel-motion.d.ts +1 -12
  275. package/lib/typescript/module/app-shell/panel-motion.d.ts.map +1 -1
  276. package/lib/typescript/module/app-shell/panel-transitions.d.ts +4 -0
  277. package/lib/typescript/module/app-shell/panel-transitions.d.ts.map +1 -0
  278. package/lib/typescript/module/app-shell/shell-layout-css.d.ts.map +1 -1
  279. package/lib/typescript/module/app-shell/types.d.ts +4 -0
  280. package/lib/typescript/module/app-shell/types.d.ts.map +1 -1
  281. package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts +14 -0
  282. package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts.map +1 -0
  283. package/lib/typescript/module/app-shell/use-panel-reorder.d.ts +2 -2
  284. package/lib/typescript/module/app-shell/use-panel-reorder.d.ts.map +1 -1
  285. package/lib/typescript/module/app-shell/use-panel-resize.d.ts +4 -2
  286. package/lib/typescript/module/app-shell/use-panel-resize.d.ts.map +1 -1
  287. package/lib/typescript/module/app-shell/use-panel-reveal.d.ts +2 -2
  288. package/lib/typescript/module/app-shell/use-panel-reveal.d.ts.map +1 -1
  289. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  290. package/lib/typescript/module/bottom-sheet/types.d.ts +2 -0
  291. package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
  292. package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
  293. package/lib/typescript/module/chip/shared.d.ts +1 -1
  294. package/lib/typescript/module/chip/types.d.ts +1 -1
  295. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
  296. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
  297. package/lib/typescript/module/dialog/types.d.ts +2 -0
  298. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  299. package/lib/typescript/module/engagement-bar/EngagementAction.d.ts.map +1 -1
  300. package/lib/typescript/module/engagement-bar/EngagementBar.d.ts +3 -3
  301. package/lib/typescript/module/engagement-bar/EngagementBar.d.ts.map +1 -1
  302. package/lib/typescript/module/engagement-bar/EngagementPop.d.ts +2 -1
  303. package/lib/typescript/module/engagement-bar/EngagementPop.d.ts.map +1 -1
  304. package/lib/typescript/module/engagement-bar/context.d.ts +1 -0
  305. package/lib/typescript/module/engagement-bar/context.d.ts.map +1 -1
  306. package/lib/typescript/module/engagement-bar/paint.d.ts +4 -2
  307. package/lib/typescript/module/engagement-bar/paint.d.ts.map +1 -1
  308. package/lib/typescript/module/engagement-bar/types.d.ts +10 -1
  309. package/lib/typescript/module/engagement-bar/types.d.ts.map +1 -1
  310. package/lib/typescript/module/hooks/use-border-box-size.d.ts +13 -0
  311. package/lib/typescript/module/hooks/use-border-box-size.d.ts.map +1 -0
  312. package/lib/typescript/module/layout/ScrollBar.web.d.ts.map +1 -1
  313. package/lib/typescript/module/layout/scroll-metrics.d.ts +2 -0
  314. package/lib/typescript/module/layout/scroll-metrics.d.ts.map +1 -1
  315. package/lib/typescript/module/layout/types.d.ts +2 -2
  316. package/lib/typescript/module/layout/types.d.ts.map +1 -1
  317. package/lib/typescript/module/list/VirtualList.d.ts.map +1 -1
  318. package/lib/typescript/module/list/VirtualList.web.d.ts.map +1 -1
  319. package/lib/typescript/module/list/flash-list-module.d.ts +1 -1
  320. package/lib/typescript/module/list/flash-list-module.d.ts.map +1 -1
  321. package/lib/typescript/module/page-header/EdgeScrim.d.ts +3 -1
  322. package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -1
  323. package/lib/typescript/module/page-header/PageHeader.d.ts +1 -1
  324. package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
  325. package/lib/typescript/module/page-header/types.d.ts +2 -0
  326. package/lib/typescript/module/page-header/types.d.ts.map +1 -1
  327. package/lib/typescript/module/screen/ScreenBase.d.ts.map +1 -1
  328. package/lib/typescript/module/screen/ScreenScrollViewBase.d.ts.map +1 -1
  329. package/lib/typescript/module/screen/context.d.ts +3 -0
  330. package/lib/typescript/module/screen/context.d.ts.map +1 -1
  331. package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts +3 -0
  332. package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts.map +1 -0
  333. package/lib/typescript/module/screen/use-screen-viewport.d.ts.map +1 -1
  334. package/lib/typescript/module/scroll/constants.d.ts +2 -0
  335. package/lib/typescript/module/scroll/constants.d.ts.map +1 -1
  336. package/lib/typescript/module/scroll/owner-handoff.d.ts +3 -1
  337. package/lib/typescript/module/scroll/owner-handoff.d.ts.map +1 -1
  338. package/lib/typescript/module/scroll/use-scroll-restoration.web.d.ts.map +1 -1
  339. package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
  340. package/lib/typescript/module/sidebar/arrangement.d.ts +32 -0
  341. package/lib/typescript/module/sidebar/arrangement.d.ts.map +1 -0
  342. package/lib/typescript/module/sidebar/index.d.ts +1 -0
  343. package/lib/typescript/module/sidebar/index.d.ts.map +1 -1
  344. package/lib/typescript/module/sidebar/types.d.ts +13 -1
  345. package/lib/typescript/module/sidebar/types.d.ts.map +1 -1
  346. package/lib/typescript/module/stay-filters/CountFilter.d.ts +1 -1
  347. package/lib/typescript/module/stay-filters/ToggleChipGroup.d.ts +1 -1
  348. package/package.json +1 -1
  349. package/src/__tests__/support/public-part-classifications.json +169 -26
  350. package/src/__tests__/support/yoga-host-tree.ts +55 -2
  351. package/src/app-shell/AppShell.tsx +7 -3
  352. package/src/app-shell/AppShellEngine.tsx +6 -2
  353. package/src/app-shell/AppShellPanelLayout.tsx +466 -189
  354. package/src/app-shell/RetainedPanelLayout.tsx +7 -1
  355. package/src/app-shell/panel-layout-css.ts +41 -27
  356. package/src/app-shell/panel-layout-types.ts +11 -2
  357. package/src/app-shell/panel-layout.ts +49 -256
  358. package/src/app-shell/panel-motion.ts +34 -52
  359. package/src/app-shell/panel-transitions.ts +39 -0
  360. package/src/app-shell/shell-layout-css.ts +6 -2
  361. package/src/app-shell/types.ts +4 -0
  362. package/src/app-shell/use-panel-exit-completion.ts +95 -0
  363. package/src/app-shell/use-panel-reorder.ts +2 -2
  364. package/src/app-shell/use-panel-resize.ts +37 -10
  365. package/src/app-shell/use-panel-reveal.ts +4 -9
  366. package/src/bottom-sheet/BottomSheetBase.tsx +6 -2
  367. package/src/bottom-sheet/types.ts +2 -0
  368. package/src/chip/Chip.tsx +3 -1
  369. package/src/chip/shared.ts +2 -2
  370. package/src/chip/types.ts +1 -1
  371. package/src/dialog/DialogBottomSheet.tsx +13 -2
  372. package/src/dialog/types.ts +2 -0
  373. package/src/engagement-bar/EngagementAction.tsx +5 -4
  374. package/src/engagement-bar/EngagementBar.tsx +30 -5
  375. package/src/engagement-bar/EngagementPop.tsx +11 -3
  376. package/src/engagement-bar/context.ts +1 -0
  377. package/src/engagement-bar/paint.ts +60 -13
  378. package/src/engagement-bar/types.ts +10 -1
  379. package/src/hooks/use-border-box-size.ts +38 -0
  380. package/src/layout/ScrollBar.web.tsx +74 -40
  381. package/src/layout/scroll-metrics.tsx +2 -0
  382. package/src/layout/types.ts +2 -2
  383. package/src/list/VirtualList.tsx +18 -0
  384. package/src/list/VirtualList.web.tsx +69 -22
  385. package/src/list/flash-list-module.ts +2 -0
  386. package/src/page-header/EdgeScrim.tsx +29 -9
  387. package/src/page-header/PageHeader.tsx +10 -6
  388. package/src/page-header/types.ts +2 -0
  389. package/src/screen/ScreenBase.tsx +13 -6
  390. package/src/screen/ScreenScrollViewBase.tsx +24 -2
  391. package/src/screen/context.ts +3 -0
  392. package/src/screen/use-intrinsic-content-height.ts +56 -0
  393. package/src/screen/use-screen-viewport.ts +60 -11
  394. package/src/scroll/constants.ts +3 -0
  395. package/src/scroll/owner-handoff.ts +45 -11
  396. package/src/scroll/use-scroll-restoration.web.ts +4 -10
  397. package/src/sidebar/Sidebar.tsx +146 -121
  398. package/src/sidebar/arrangement.ts +47 -0
  399. package/src/sidebar/index.ts +6 -0
  400. package/src/sidebar/types.ts +13 -1
  401. package/src/stay-filters/CountFilter.tsx +1 -1
  402. package/src/stay-filters/FilterChip.tsx +1 -1
  403. package/src/stay-filters/ToggleChipGroup.tsx +1 -1
@@ -1,4 +1,11 @@
1
- import { useEffect, useLayoutEffect, useMemo, useRef, type MutableRefObject } from 'react';
1
+ import {
2
+ useCallback,
3
+ useEffect,
4
+ useLayoutEffect,
5
+ useMemo,
6
+ useRef,
7
+ type MutableRefObject,
8
+ } from 'react';
2
9
  import { Platform } from 'react-native';
3
10
  import { useSharedValue } from 'react-native-reanimated';
4
11
  import { animateMotion } from '../motion/recipes';
@@ -6,10 +13,15 @@ import type { useScrollRestoration as UseScrollRestoration } from '../scroll/use
6
13
  import type { ScrollRestorationTarget } from '../scroll/types';
7
14
  import type { ScreenContextValue } from './context';
8
15
  import { useOptionalScrollRestorationContext } from '../scroll/context';
9
- import { recordScrollOwnerHandoff } from '../scroll/owner-handoff';
16
+ import { readScrollOwnerHandoff, recordScrollOwnerHandoff } from '../scroll/owner-handoff';
10
17
  import type { ScreenViewportValue, ScreenHostValue } from './context';
11
18
  import { useRegisterScreenScroller } from './reselect';
12
19
  import { usePrefersReducedMotion } from '../hooks/use-prefers-reduced-motion';
20
+ import type { ScrollMetrics } from '../layout/scroll-metrics';
21
+
22
+ // Retained route Screens can share one panel metric. An outgoing cleanup must
23
+ // not clear the next Screen's measurement.
24
+ const intrinsicOwners = new WeakMap<ScrollMetrics, object>();
13
25
 
14
26
  const useNoContentId = () => null;
15
27
 
@@ -32,7 +44,7 @@ export function useScreenViewportBinding(
32
44
  const contentRef = useRef<unknown>(null);
33
45
  const contentHeight = useSharedValue(-1);
34
46
  const viewportHeight = useSharedValue(0);
35
- const metrics = useMemo(
47
+ const metrics = useMemo<ScrollMetrics>(
36
48
  () =>
37
49
  enabled && host?.metrics
38
50
  ? host.metrics
@@ -43,6 +55,37 @@ export function useScreenViewportBinding(
43
55
  const restoring = useRef(false);
44
56
  const active = useRef(screen.active);
45
57
  active.current = screen.active;
58
+ const intrinsicScope = useMemo(
59
+ () => ({ sources: new Map<object, number>() }),
60
+ [contentId, metrics],
61
+ );
62
+ const currentIntrinsicScope = useRef(intrinsicScope);
63
+ currentIntrinsicScope.current = intrinsicScope;
64
+ const setIntrinsicContentHeight = useCallback(
65
+ (source: object, height: number | null) => {
66
+ const metric = metrics.intrinsicContentHeight;
67
+ if (!metric || currentIntrinsicScope.current !== intrinsicScope) return;
68
+ if (height === null) intrinsicScope.sources.delete(source);
69
+ else if (enabled && active.current) intrinsicScope.sources.set(source, height);
70
+ else return;
71
+ if (height !== null) intrinsicOwners.set(metrics, intrinsicScope);
72
+ if (intrinsicOwners.get(metrics) !== intrinsicScope) return;
73
+ const values = [...intrinsicScope.sources.values()];
74
+ metric.value =
75
+ values.length && values.every((value) => value >= 0) ? Math.max(...values) : -1;
76
+ },
77
+ [enabled, intrinsicScope, metrics],
78
+ );
79
+ useLayoutEffect(() => {
80
+ if (!enabled || !screen.active) return;
81
+ return () => {
82
+ intrinsicScope.sources.clear();
83
+ if (intrinsicOwners.get(metrics) === intrinsicScope) {
84
+ intrinsicOwners.delete(metrics);
85
+ if (metrics.intrinsicContentHeight) metrics.intrinsicContentHeight.value = -1;
86
+ }
87
+ };
88
+ }, [enabled, screen.active, intrinsicScope, metrics]);
46
89
  const reducedMotion = usePrefersReducedMotion();
47
90
  const owner = useRef<{
48
91
  documentFlow: boolean;
@@ -56,6 +99,8 @@ export function useScreenViewportBinding(
56
99
  useLayoutEffect(() => {
57
100
  if (!enabled || !web || typeof window === 'undefined') return;
58
101
  const previous = owner.current;
102
+ const element = scrollRef.current as HTMLElement | null;
103
+ const target = documentFlow ? window : element;
59
104
  let releaseHandoff: (() => void) | undefined;
60
105
  if (
61
106
  previous &&
@@ -64,9 +109,10 @@ export function useScreenViewportBinding(
64
109
  previous.active &&
65
110
  screen.active
66
111
  ) {
67
- const element = scrollRef.current as HTMLElement | null;
68
- const target = documentFlow ? window : element;
69
- if (target) releaseHandoff = recordScrollOwnerHandoff(target, previous.offset);
112
+ if (target)
113
+ releaseHandoff = recordScrollOwnerHandoff(target, previous.offset, (offset) => {
114
+ if (owner.current?.documentFlow === documentFlow) owner.current.offset = offset;
115
+ });
70
116
  if (documentFlow) window.scrollTo({ top: previous.offset, behavior: 'instant' });
71
117
  else if (element) element.scrollTop = previous.offset;
72
118
  }
@@ -74,9 +120,9 @@ export function useScreenViewportBinding(
74
120
  contentId,
75
121
  documentFlow,
76
122
  active: screen.active,
77
- offset: documentFlow
78
- ? window.scrollY
79
- : ((scrollRef.current as HTMLElement | null)?.scrollTop ?? 0),
123
+ offset:
124
+ (target ? readScrollOwnerHandoff(target) : undefined) ??
125
+ (documentFlow ? window.scrollY : (element?.scrollTop ?? 0)),
80
126
  };
81
127
  // A newly mounted router sidecar can focus on a later commit. Retain the
82
128
  // transfer for this active owner lifetime instead of expiring it during
@@ -95,7 +141,8 @@ export function useScreenViewportBinding(
95
141
  ? (document.scrollingElement ?? document.documentElement)
96
142
  : element!;
97
143
  const y = documentFlow ? window.scrollY : node.scrollTop;
98
- if (owner.current?.documentFlow === documentFlow) owner.current.offset = Math.max(0, y);
144
+ if (owner.current?.documentFlow === documentFlow)
145
+ owner.current.offset = readScrollOwnerHandoff(target) ?? Math.max(0, y);
99
146
  metrics.scrollY.value = Math.max(0, y);
100
147
  metrics.contentHeight.value = node.scrollHeight;
101
148
  metrics.viewportHeight.value = Math.max(0, node.clientHeight - (documentFlow ? reserved : 0));
@@ -127,6 +174,8 @@ export function useScreenViewportBinding(
127
174
  scrollRef: documentFlow ? null : scrollRef,
128
175
  metrics,
129
176
  active: screen.active,
177
+ contentRef,
178
+ setIntrinsicContentHeight,
130
179
  scrollTo(options) {
131
180
  if (!active.current) return;
132
181
  if (web) {
@@ -146,7 +195,7 @@ export function useScreenViewportBinding(
146
195
  }
147
196
  },
148
197
  }),
149
- [web, documentFlow, metrics, screen.active, scrollRef],
198
+ [web, documentFlow, metrics, screen.active, scrollRef, setIntrinsicContentHeight],
150
199
  );
151
200
  // The screen's own viewport answers a reselect, as the page: a list scrolling
152
201
  // inside it wins.
@@ -5,3 +5,6 @@ export const SCROLL_USER_TAKEOVER_EVENTS = [
5
5
  'pointerdown',
6
6
  'keydown',
7
7
  ] as const;
8
+
9
+ /** Fractional CSS pixels may round when the browser accepts a restored offset. */
10
+ export const SCROLL_RESTORE_TOLERANCE_PX = 2;
@@ -1,25 +1,46 @@
1
- import { SCROLL_USER_TAKEOVER_EVENTS } from './constants';
1
+ import { SCROLL_RESTORE_TOLERANCE_PX, SCROLL_USER_TAKEOVER_EVENTS } from './constants';
2
2
 
3
- /** An active Screen's owner transfer, consumed once when restoration focuses. */
4
- const offsets = new WeakMap<object, { offset: number; release(): void }>();
3
+ /** One restoration claim; keep its intent until the owner accepts it or the user takes over. */
4
+ const offsets = new WeakMap<
5
+ object,
6
+ {
7
+ offset: number;
8
+ consumed: boolean;
9
+ pending: boolean;
10
+ current(): number | undefined;
11
+ release(): void;
12
+ }
13
+ >();
5
14
 
6
- export function recordScrollOwnerHandoff(owner: object, offset: number) {
15
+ export function recordScrollOwnerHandoff(
16
+ owner: object,
17
+ offset: number,
18
+ onTakeOver?: (offset: number) => void,
19
+ ) {
7
20
  offsets.get(owner)?.release();
8
21
  const target = owner as Partial<EventTarget> & { scrollTop?: number };
9
22
  let userTookOver = false;
23
+ const current = () =>
24
+ typeof window !== 'undefined' && owner === window ? window.scrollY : target.scrollTop;
10
25
  const observe = () => {
11
- if (!userTookOver) return;
12
- const current =
13
- typeof window !== 'undefined' && owner === window ? window.scrollY : target.scrollTop;
14
- if (typeof current === 'number' && Number.isFinite(current))
15
- transfer.offset = Math.max(0, current);
26
+ const value = current();
27
+ if (value !== undefined && Math.abs(value - transfer.offset) <= SCROLL_RESTORE_TOLERANCE_PX)
28
+ transfer.pending = false;
29
+ if (userTookOver && typeof value === 'number' && Number.isFinite(value))
30
+ transfer.offset = Math.max(0, value);
31
+ if (transfer.consumed && !transfer.pending) transfer.release();
16
32
  };
17
33
  const takeOver = () => {
18
34
  userTookOver = true;
35
+ transfer.pending = false;
19
36
  observe();
37
+ onTakeOver?.(transfer.offset);
20
38
  };
21
39
  const transfer = {
22
40
  offset,
41
+ consumed: false,
42
+ pending: true,
43
+ current,
23
44
  release() {
24
45
  // A departed Screen must not delete a newer Screen's transfer on the
25
46
  // shared window owner. Release belongs to this transfer, not its node.
@@ -41,6 +62,19 @@ export function recordScrollOwnerHandoff(owner: object, offset: number) {
41
62
 
42
63
  export function takeScrollOwnerHandoff(owner: object): number | undefined {
43
64
  const transfer = offsets.get(owner);
44
- transfer?.release();
45
- return transfer?.offset;
65
+ if (!transfer || transfer.consumed) return undefined;
66
+ transfer.consumed = true;
67
+ readScrollOwnerHandoff(owner);
68
+ return transfer.offset;
69
+ }
70
+
71
+ /** Geometry can clamp a receiving owner before its virtual content is ready. */
72
+ export function readScrollOwnerHandoff(owner: object): number | undefined {
73
+ const transfer = offsets.get(owner);
74
+ if (!transfer) return undefined;
75
+ const current = transfer.current();
76
+ if (current !== undefined && Math.abs(current - transfer.offset) <= SCROLL_RESTORE_TOLERANCE_PX)
77
+ transfer.pending = false;
78
+ if (transfer.consumed && !transfer.pending) transfer.release();
79
+ return transfer.pending ? transfer.offset : undefined;
46
80
  }
@@ -41,7 +41,10 @@
41
41
  import { useCallback, useMemo, useRef, useState } from 'react';
42
42
 
43
43
  import { useScrollRestorationContext } from './context';
44
- import { SCROLL_USER_TAKEOVER_EVENTS } from './constants';
44
+ import {
45
+ SCROLL_RESTORE_TOLERANCE_PX as RESTORE_STICK_TOLERANCE_PX,
46
+ SCROLL_USER_TAKEOVER_EVENTS,
47
+ } from './constants';
45
48
  import { createScroller, resolveScrollTarget } from './scrollable.web';
46
49
  import { deriveScrollKey } from './store';
47
50
  import { takeScrollOwnerHandoff } from './owner-handoff';
@@ -61,15 +64,6 @@ import type {
61
64
  */
62
65
  const RESTORE_FRAME_CAP = 30;
63
66
 
64
- /**
65
- * Tolerance (in CSS pixels) for considering a restore "stuck". After writing
66
- * `element.scrollTop = target`, the browser may clamp it to the current
67
- * `scrollHeight - clientHeight`; if the resulting offset is within this many
68
- * pixels of the target we treat the restore as complete. Sub-pixel rounding and
69
- * fractional device-pixel ratios make an exact equality check unreliable.
70
- */
71
- const RESTORE_STICK_TOLERANCE_PX = 2;
72
-
73
67
  /**
74
68
  * This platform observes offsets by subscribing to the resolved DOM node's own
75
69
  * `scroll` event, so it needs nothing from the caller. The handler is still
@@ -1,3 +1,4 @@
1
+ import { resolveSidebarArrangement } from './arrangement';
1
2
  import { resolvePaintMode } from '../theme/paint';
2
3
  import {
3
4
  SurfaceLevelProvider,
@@ -200,6 +201,7 @@ const SidebarPanel: React.FC<SidebarProps> = ({
200
201
  primaryAction,
201
202
  primaryActionPlacement = 'bottom',
202
203
  contentAlignment = 'start',
204
+ arrangement,
203
205
  content,
204
206
  onScroll,
205
207
  footer,
@@ -884,6 +886,11 @@ const SidebarPanel: React.FC<SidebarProps> = ({
884
886
 
885
887
  // Keep the same children mounted while the header changes from a row to a
886
888
  // column. Numeric positions share the panel clock, including reversals.
889
+ const placed = resolveSidebarArrangement(contentAlignment, arrangement);
890
+ // The logo and its account menu move into the centred group only where the panel draws its own
891
+ // header row: a consumer's `header` replaces the row, and the mobile drawer keeps its own.
892
+ const identityGrouped =
893
+ !mobile && header == null && Boolean(logo || accountMenu) && placed.logo === 'group';
887
894
  const headerRow = mobile ? (
888
895
  <>
889
896
  <View
@@ -921,7 +928,7 @@ const SidebarPanel: React.FC<SidebarProps> = ({
921
928
  testID="sidebar-header"
922
929
  style={[{ width: '100%', position: 'relative' }, headerGeometry]}
923
930
  >
924
- {logo || accountMenu ? (
931
+ {!identityGrouped && (logo || accountMenu) ? (
925
932
  <Animated.View
926
933
  style={[
927
934
  { position: 'absolute', insetInlineStart: 0, minWidth: 0 },
@@ -947,7 +954,7 @@ const SidebarPanel: React.FC<SidebarProps> = ({
947
954
  {headerControl}
948
955
  </Animated.View>
949
956
  </Animated.View>
950
- {logo ? accountMenu : null}
957
+ {!identityGrouped && logo ? accountMenu : null}
951
958
  </>
952
959
  );
953
960
 
@@ -965,6 +972,134 @@ const SidebarPanel: React.FC<SidebarProps> = ({
965
972
  />
966
973
  ));
967
974
 
975
+ // Anything grouped is centred with the destinations in the room above the persistent footer;
976
+ // what is not stays pinned (the controls at the top, the footer at the bottom).
977
+ const { centred } = placed;
978
+ const actionPlacement =
979
+ arrangement?.primaryAction ?? (primaryActionPlacement === 'top' ? 'top' : placed.primaryAction);
980
+ const primaryActionNode = primaryAction ? (
981
+ <SidebarPrimaryAction
982
+ action={primaryAction}
983
+ collapsed={collapsed}
984
+ placement={actionPlacement === 'top' ? 'top' : undefined}
985
+ testID={testID ? `${testID}-primary-action` : undefined}
986
+ />
987
+ ) : null;
988
+ const identityNode = identityGrouped ? (
989
+ <Animated.View style={[{ width: '100%', gap: 12, paddingBottom: 12 }, scrollInsets]}>
990
+ {logo ? (
991
+ <SidebarLogoView logo={logo} collapsed={collapsed} testID="sidebar-logo" />
992
+ ) : (
993
+ accountMenu
994
+ )}
995
+ {logo ? accountMenu : null}
996
+ </Animated.View>
997
+ ) : null;
998
+ const headerNode = (
999
+ <Animated.View
1000
+ testID={`${testID ?? 'sidebar'}-fixed-header`}
1001
+ style={[
1002
+ {
1003
+ width: '100%',
1004
+ gap: 12,
1005
+ paddingTop: Math.max(expandedPadding, windowControlsRoom),
1006
+ paddingBottom: 12,
1007
+ },
1008
+ scrollInsets,
1009
+ ]}
1010
+ >
1011
+ {header != null ? (typeof header === 'function' ? header({ collapsed }) : header) : headerRow}
1012
+ {typeof toolbar === 'function' ? toolbar({ collapsed }) : toolbar}
1013
+ {actionPlacement === 'top' ? primaryActionNode : null}
1014
+ {inlineModes ? null : modeSwitcher}
1015
+ {showSearch && !flatMobile ? searchButton : null}
1016
+ </Animated.View>
1017
+ );
1018
+ const mainRegion = (
1019
+ <Animated.View
1020
+ testID={`${testID ?? 'sidebar'}-main-region`}
1021
+ style={[
1022
+ {
1023
+ width: '100%',
1024
+ flexGrow: centred ? 0 : 1,
1025
+ paddingBottom: 8,
1026
+ gap: hasSections ? 24 : 0,
1027
+ },
1028
+ scrollInsets,
1029
+ ]}
1030
+ >
1031
+ {shownItems.length > 0 || !hasTree ? (
1032
+ <Animated.View
1033
+ collapsable={false}
1034
+ role="navigation"
1035
+ style={[{ width: '100%', gap: 4 }, !hasTree && navInset]}
1036
+ >
1037
+ {nothingMatches && !hasTree ? (
1038
+ <Text
1039
+ variant="body-regular"
1040
+ style={{
1041
+ paddingLeft: 8,
1042
+ paddingRight: 8,
1043
+ paddingTop: 12,
1044
+ paddingBottom: 12,
1045
+ color: palette.textTertiary,
1046
+ }}
1047
+ >
1048
+ {noResultsLabel}
1049
+ </Text>
1050
+ ) : (
1051
+ shownItems.map(renderRow)
1052
+ )}
1053
+ </Animated.View>
1054
+ ) : null}
1055
+ {onboarding && !collapsed ? (
1056
+ <SidebarOnboardingCard
1057
+ {...onboarding}
1058
+ testID={onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`}
1059
+ />
1060
+ ) : null}
1061
+ {collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? (
1062
+ <TreeDragProvider
1063
+ sections={sections}
1064
+ onDrop={onTreeItemDrop}
1065
+ movedLabel={messages.moved}
1066
+ scroll={treeScroll}
1067
+ >
1068
+ {treeView}
1069
+ </TreeDragProvider>
1070
+ ) : (
1071
+ treeView
1072
+ )}
1073
+ {content != null ? (
1074
+ <Animated.View
1075
+ testID={`${testID ?? 'sidebar'}-content`}
1076
+ pointerEvents={collapsed ? 'none' : 'auto'}
1077
+ aria-hidden={collapsed}
1078
+ accessibilityElementsHidden={collapsed}
1079
+ importantForAccessibility={collapsed ? 'no-hide-descendants' : 'auto'}
1080
+ {...(IS_WEB && collapsed ? { inert: true } : {})}
1081
+ ref={contentFade.ref}
1082
+ style={[{ overflow: 'hidden', flexShrink: 0 }, contentMorph, contentFade.style]}
1083
+ >
1084
+ <Animated.View
1085
+ onLayout={(event) => setContentHeight(event.nativeEvent.layout.height)}
1086
+ style={contentWidth}
1087
+ >
1088
+ {content}
1089
+ </Animated.View>
1090
+ </Animated.View>
1091
+ ) : null}
1092
+ {nothingMatches && hasTree ? (
1093
+ <Text
1094
+ variant="body-regular"
1095
+ style={{ paddingLeft: 8, paddingRight: 8, color: palette.textTertiary }}
1096
+ >
1097
+ {noResultsLabel}
1098
+ </Text>
1099
+ ) : null}
1100
+ </Animated.View>
1101
+ );
1102
+
968
1103
  const sidebar = (
969
1104
  <SidebarSizeProvider value={size}>
970
1105
  <SidebarGeometryProvider value={geometry}>
@@ -1025,37 +1160,7 @@ const SidebarPanel: React.FC<SidebarProps> = ({
1025
1160
  overflow: 'hidden',
1026
1161
  }}
1027
1162
  contentContainerStyle={{ flexGrow: 1 }}
1028
- stickyHeader={
1029
- <Animated.View
1030
- testID={`${testID ?? 'sidebar'}-fixed-header`}
1031
- style={[
1032
- {
1033
- width: '100%',
1034
- gap: 12,
1035
- paddingTop: Math.max(expandedPadding, windowControlsRoom),
1036
- paddingBottom: 12,
1037
- },
1038
- scrollInsets,
1039
- ]}
1040
- >
1041
- {header != null
1042
- ? typeof header === 'function'
1043
- ? header({ collapsed })
1044
- : header
1045
- : headerRow}
1046
- {typeof toolbar === 'function' ? toolbar({ collapsed }) : toolbar}
1047
- {primaryAction && primaryActionPlacement === 'top' ? (
1048
- <SidebarPrimaryAction
1049
- action={primaryAction}
1050
- collapsed={collapsed}
1051
- placement="top"
1052
- testID={testID ? `${testID}-primary-action` : undefined}
1053
- />
1054
- ) : null}
1055
- {inlineModes ? null : modeSwitcher}
1056
- {showSearch && !flatMobile ? searchButton : null}
1057
- </Animated.View>
1058
- }
1163
+ stickyHeader={headerNode}
1059
1164
  stickyFooter={
1060
1165
  <Animated.View
1061
1166
  testID={`${testID ?? 'sidebar'}-sticky-footer`}
@@ -1069,13 +1174,7 @@ const SidebarPanel: React.FC<SidebarProps> = ({
1069
1174
  scrollInsets,
1070
1175
  ]}
1071
1176
  >
1072
- {primaryAction && primaryActionPlacement === 'bottom' ? (
1073
- <SidebarPrimaryAction
1074
- action={primaryAction}
1075
- collapsed={collapsed}
1076
- testID={testID ? `${testID}-primary-action` : undefined}
1077
- />
1078
- ) : null}
1177
+ {actionPlacement === 'bottom' ? primaryActionNode : null}
1079
1178
  {showThemeToggle ? (
1080
1179
  <Animated.View
1081
1180
  testID="sidebar-theme-morph"
@@ -1160,89 +1259,15 @@ const SidebarPanel: React.FC<SidebarProps> = ({
1160
1259
  </Animated.View>
1161
1260
  }
1162
1261
  >
1163
- <Animated.View
1164
- testID={`${testID ?? 'sidebar'}-main-region`}
1165
- style={[
1166
- {
1167
- width: '100%',
1168
- flexGrow: 1,
1169
- paddingBottom: 8,
1170
- gap: hasSections ? 24 : 0,
1171
- justifyContent: contentAlignment === 'center' ? 'center' : undefined,
1172
- },
1173
- scrollInsets,
1174
- ]}
1175
- >
1176
- {shownItems.length > 0 || !hasTree ? (
1177
- <Animated.View
1178
- collapsable={false}
1179
- role="navigation"
1180
- style={[{ width: '100%', gap: 4 }, !hasTree && navInset]}
1181
- >
1182
- {nothingMatches && !hasTree ? (
1183
- <Text
1184
- variant="body-regular"
1185
- style={{
1186
- paddingLeft: 8,
1187
- paddingRight: 8,
1188
- paddingTop: 12,
1189
- paddingBottom: 12,
1190
- color: palette.textTertiary,
1191
- }}
1192
- >
1193
- {noResultsLabel}
1194
- </Text>
1195
- ) : (
1196
- shownItems.map(renderRow)
1197
- )}
1262
+ <View style={{ flexGrow: 1, justifyContent: centred ? 'center' : undefined }}>
1263
+ {identityNode}
1264
+ {mainRegion}
1265
+ {actionPlacement === 'group' ? (
1266
+ <Animated.View style={[{ width: '100%' }, scrollInsets]}>
1267
+ {primaryActionNode}
1198
1268
  </Animated.View>
1199
1269
  ) : null}
1200
- {onboarding && !collapsed ? (
1201
- <SidebarOnboardingCard
1202
- {...onboarding}
1203
- testID={onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`}
1204
- />
1205
- ) : null}
1206
- {collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? (
1207
- <TreeDragProvider
1208
- sections={sections}
1209
- onDrop={onTreeItemDrop}
1210
- movedLabel={messages.moved}
1211
- scroll={treeScroll}
1212
- >
1213
- {treeView}
1214
- </TreeDragProvider>
1215
- ) : (
1216
- treeView
1217
- )}
1218
- {content != null ? (
1219
- <Animated.View
1220
- testID={`${testID ?? 'sidebar'}-content`}
1221
- pointerEvents={collapsed ? 'none' : 'auto'}
1222
- aria-hidden={collapsed}
1223
- accessibilityElementsHidden={collapsed}
1224
- importantForAccessibility={collapsed ? 'no-hide-descendants' : 'auto'}
1225
- {...(IS_WEB && collapsed ? { inert: true } : {})}
1226
- ref={contentFade.ref}
1227
- style={[{ overflow: 'hidden', flexShrink: 0 }, contentMorph, contentFade.style]}
1228
- >
1229
- <Animated.View
1230
- onLayout={(event) => setContentHeight(event.nativeEvent.layout.height)}
1231
- style={contentWidth}
1232
- >
1233
- {content}
1234
- </Animated.View>
1235
- </Animated.View>
1236
- ) : null}
1237
- {nothingMatches && hasTree ? (
1238
- <Text
1239
- variant="body-regular"
1240
- style={{ paddingLeft: 8, paddingRight: 8, color: palette.textTertiary }}
1241
- >
1242
- {noResultsLabel}
1243
- </Text>
1244
- ) : null}
1245
- </Animated.View>
1270
+ </View>
1246
1271
  </SidebarScrollArea>
1247
1272
  </AnimatedStyledView>
1248
1273
  </CollapseProvider>
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Where the parts of a sidebar sit in its column.
3
+ *
4
+ * Every sidebar has three regions: a pinned top (the controls: collapse, mode
5
+ * toggle), a pinned bottom (the `footer`: an account control), and the room
6
+ * between them. The destinations always live in that room. A part that is
7
+ * `group` joins them there, as one block centred in the room; a part that is
8
+ * pinned stays in its region.
9
+ */
10
+
11
+ /** Where the logo (or account) row sits. */
12
+ export type SidebarLogoPlacement = 'top' | 'group';
13
+ /** Where the persistent primary action sits. */
14
+ export type SidebarPrimaryActionPlacement = 'bottom' | 'group';
15
+
16
+ export interface SidebarArrangement {
17
+ /** `top` (default) pins the logo with the controls; `group` centres it with the destinations. */
18
+ logo?: SidebarLogoPlacement;
19
+ /** `bottom` (default) pins the action above the footer; `group` centres it with the destinations. */
20
+ primaryAction?: SidebarPrimaryActionPlacement;
21
+ }
22
+
23
+ export interface ResolvedSidebarArrangement {
24
+ logo: SidebarLogoPlacement;
25
+ primaryAction: SidebarPrimaryActionPlacement;
26
+ /** Anything is grouped, so the destinations are centred in the room too. */
27
+ centred: boolean;
28
+ }
29
+
30
+ /**
31
+ * The arrangement a sidebar draws: each part's own placement, else the one
32
+ * `contentAlignment` implies (`center` is the preset that groups every part),
33
+ * else its default. A part that is given always wins over the preset.
34
+ */
35
+ export function resolveSidebarArrangement(
36
+ contentAlignment: 'start' | 'center' | undefined,
37
+ arrangement: SidebarArrangement | undefined,
38
+ ): ResolvedSidebarArrangement {
39
+ const preset = contentAlignment === 'center';
40
+ const logo = arrangement?.logo ?? (preset ? 'group' : 'top');
41
+ const primaryAction = arrangement?.primaryAction ?? (preset ? 'group' : 'bottom');
42
+ return {
43
+ logo,
44
+ primaryAction,
45
+ centred: preset || logo === 'group' || primaryAction === 'group',
46
+ };
47
+ }
@@ -1,4 +1,10 @@
1
1
  export { Sidebar } from './Sidebar';
2
+ export type {
3
+ ResolvedSidebarArrangement,
4
+ SidebarArrangement,
5
+ SidebarLogoPlacement,
6
+ SidebarPrimaryActionPlacement,
7
+ } from './arrangement';
2
8
  export { SidebarFolder } from './SidebarFolder';
3
9
  export { SidebarItem } from './SidebarItem';
4
10
  export { SidebarToolbar } from './SidebarToolbar';
@@ -1,3 +1,4 @@
1
+ import type { SidebarArrangement } from './arrangement';
1
2
  import type { ComponentRef, ReactNode, Ref } from 'react';
2
3
  import type { ScrollAreaScrollbarSide } from '../layout/types';
3
4
  import type { DropZoneProps } from '../drop-zone/types';
@@ -378,8 +379,19 @@ export interface SidebarProps {
378
379
  toolbar?: ReactNode | ((state: { collapsed: boolean }) => ReactNode);
379
380
  /** Expanded panel inset, also used to measure app-owned scroll content. Defaults to the size's inset. */
380
381
  contentPadding?: number;
381
- /** Center the main navigation group in space above the persistent footer. */
382
+ /**
383
+ * `center` is the preset that centres the logo, the destinations and the primary action as one
384
+ * group in the room above the persistent footer; `start` (default) pins the logo at the top and
385
+ * the primary action above the footer. Say `arrangement` for a part-by-part choice.
386
+ */
382
387
  contentAlignment?: 'start' | 'center';
388
+ /**
389
+ * Where each part sits, overriding what `contentAlignment` implies: the logo pinned at the top
390
+ * or grouped with the destinations, the primary action pinned above the footer or grouped with
391
+ * them. The controls (collapse, mode toggle) are always pinned at the top and the `footer` at
392
+ * the bottom. Panel variant; a rail keeps its own column.
393
+ */
394
+ arrangement?: SidebarArrangement;
383
395
  /** App-owned destination content after the built-in rows/tree, inside the same
384
396
  * scroll viewport. Hidden and noninteractive while collapsed; remains mounted
385
397
  * so pagination and disclosure state survive. Not rendered in variant="rail".
@@ -14,7 +14,7 @@ import type { CountFilterProps } from './types';
14
14
  * `min`..`max`, the last reading `8+`.
15
15
  *
16
16
  * title body-regular, text-primary, 16 above the pills
17
- * pills the filter pill (40 tall, full pill), 8 apart; the selected one is
17
+ * pills the filter pill (44 tall, full pill), 8 apart; the selected one is
18
18
  * inverted. One row that scrolls sideways when it does not fit, so the
19
19
  * counts stay in reading order on a narrow screen instead of wrapping.
20
20
  *