@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.
- package/docs/activity-heatmap.mdx +7 -0
- package/docs/adoption-matrix.mdx +26 -26
- package/docs/announcement.mdx +7 -0
- package/docs/app-shell.mdx +18 -11
- package/docs/avatar.mdx +2 -0
- package/docs/badge.mdx +2 -0
- package/docs/chip.mdx +6 -2
- package/docs/compose-layouts.mdx +114 -2
- package/docs/composition-bar.mdx +4 -0
- package/docs/contact-card.mdx +5 -0
- package/docs/dialog.mdx +7 -0
- package/docs/divider.mdx +8 -0
- package/docs/empty-state.mdx +8 -0
- package/docs/engagement-bar.mdx +9 -0
- package/docs/icon-circle.mdx +2 -0
- package/docs/layout.mdx +1 -1
- package/docs/list.mdx +4 -3
- package/docs/page-header.mdx +7 -0
- package/docs/public-parts.mdx +39 -28
- package/docs/screen.mdx +4 -0
- package/docs/scroll.mdx +6 -3
- package/docs/sidebar.mdx +26 -5
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/docs/typography.mdx +9 -0
- package/lib/commonjs/app-shell/AppShell.js +3 -3
- package/lib/commonjs/app-shell/AppShell.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellEngine.js +2 -1
- package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellPanelLayout.js +345 -172
- package/lib/commonjs/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/commonjs/app-shell/RetainedPanelLayout.js +6 -0
- package/lib/commonjs/app-shell/RetainedPanelLayout.js.map +1 -1
- package/lib/commonjs/app-shell/panel-layout-css.js +20 -13
- package/lib/commonjs/app-shell/panel-layout-css.js.map +1 -1
- package/lib/commonjs/app-shell/panel-layout.js +33 -185
- package/lib/commonjs/app-shell/panel-layout.js.map +1 -1
- package/lib/commonjs/app-shell/panel-motion.js +13 -36
- package/lib/commonjs/app-shell/panel-motion.js.map +1 -1
- package/lib/commonjs/app-shell/panel-transitions.js +26 -0
- package/lib/commonjs/app-shell/panel-transitions.js.map +1 -0
- package/lib/commonjs/app-shell/shell-layout-css.js +2 -2
- package/lib/commonjs/app-shell/shell-layout-css.js.map +1 -1
- package/lib/commonjs/app-shell/use-panel-exit-completion.js +100 -0
- package/lib/commonjs/app-shell/use-panel-exit-completion.js.map +1 -0
- package/lib/commonjs/app-shell/use-panel-resize.js +21 -7
- package/lib/commonjs/app-shell/use-panel-resize.js.map +1 -1
- package/lib/commonjs/app-shell/use-panel-reveal.js +2 -1
- package/lib/commonjs/app-shell/use-panel-reveal.js.map +1 -1
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +3 -2
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +10 -1
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/chip/shared.js +2 -2
- package/lib/commonjs/dialog/DialogBottomSheet.js +6 -3
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementAction.js +6 -5
- package/lib/commonjs/engagement-bar/EngagementAction.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementBar.js +31 -7
- package/lib/commonjs/engagement-bar/EngagementBar.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementPop.js +10 -3
- package/lib/commonjs/engagement-bar/EngagementPop.js.map +1 -1
- package/lib/commonjs/engagement-bar/context.js.map +1 -1
- package/lib/commonjs/engagement-bar/paint.js +59 -12
- package/lib/commonjs/engagement-bar/paint.js.map +1 -1
- package/lib/commonjs/hooks/use-border-box-size.js +46 -0
- package/lib/commonjs/hooks/use-border-box-size.js.map +1 -0
- package/lib/commonjs/layout/ScrollBar.web.js +62 -29
- package/lib/commonjs/layout/ScrollBar.web.js.map +1 -1
- package/lib/commonjs/layout/scroll-metrics.js.map +1 -1
- package/lib/commonjs/list/VirtualList.js +12 -0
- package/lib/commonjs/list/VirtualList.js.map +1 -1
- package/lib/commonjs/list/VirtualList.web.js +40 -19
- package/lib/commonjs/list/VirtualList.web.js.map +1 -1
- package/lib/commonjs/list/flash-list-module.js.map +1 -1
- package/lib/commonjs/page-header/EdgeScrim.js +14 -4
- package/lib/commonjs/page-header/EdgeScrim.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +19 -6
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/screen/ScreenBase.js +15 -6
- package/lib/commonjs/screen/ScreenBase.js.map +1 -1
- package/lib/commonjs/screen/ScreenScrollViewBase.js +12 -2
- package/lib/commonjs/screen/ScreenScrollViewBase.js.map +1 -1
- package/lib/commonjs/screen/context.js.map +1 -1
- package/lib/commonjs/screen/use-intrinsic-content-height.js +53 -0
- package/lib/commonjs/screen/use-intrinsic-content-height.js.map +1 -0
- package/lib/commonjs/screen/use-screen-viewport.js +37 -6
- package/lib/commonjs/screen/use-screen-viewport.js.map +1 -1
- package/lib/commonjs/scroll/constants.js +4 -1
- package/lib/commonjs/scroll/constants.js.map +1 -1
- package/lib/commonjs/scroll/owner-handoff.js +27 -7
- package/lib/commonjs/scroll/owner-handoff.js.map +1 -1
- package/lib/commonjs/scroll/use-scroll-restoration.web.js +2 -11
- package/lib/commonjs/scroll/use-scroll-restoration.web.js.map +1 -1
- package/lib/commonjs/sidebar/Sidebar.js +121 -87
- package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
- package/lib/commonjs/sidebar/arrangement.js +36 -0
- package/lib/commonjs/sidebar/arrangement.js.map +1 -0
- package/lib/commonjs/sidebar/index.js.map +1 -1
- package/lib/commonjs/stay-filters/CountFilter.js +1 -1
- package/lib/commonjs/stay-filters/FilterChip.js +1 -1
- package/lib/commonjs/stay-filters/ToggleChipGroup.js +1 -1
- package/lib/module/app-shell/AppShell.js +3 -3
- package/lib/module/app-shell/AppShell.js.map +1 -1
- package/lib/module/app-shell/AppShellEngine.js +2 -1
- package/lib/module/app-shell/AppShellEngine.js.map +1 -1
- package/lib/module/app-shell/AppShellPanelLayout.js +319 -147
- package/lib/module/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/module/app-shell/RetainedPanelLayout.js +7 -1
- package/lib/module/app-shell/RetainedPanelLayout.js.map +1 -1
- package/lib/module/app-shell/panel-layout-css.js +19 -12
- package/lib/module/app-shell/panel-layout-css.js.map +1 -1
- package/lib/module/app-shell/panel-layout.js +32 -183
- package/lib/module/app-shell/panel-layout.js.map +1 -1
- package/lib/module/app-shell/panel-motion.js +14 -36
- package/lib/module/app-shell/panel-motion.js.map +1 -1
- package/lib/module/app-shell/panel-transitions.js +21 -0
- package/lib/module/app-shell/panel-transitions.js.map +1 -0
- package/lib/module/app-shell/shell-layout-css.js +2 -2
- package/lib/module/app-shell/shell-layout-css.js.map +1 -1
- package/lib/module/app-shell/use-panel-exit-completion.js +97 -0
- package/lib/module/app-shell/use-panel-exit-completion.js.map +1 -0
- package/lib/module/app-shell/use-panel-resize.js +22 -8
- package/lib/module/app-shell/use-panel-resize.js.map +1 -1
- package/lib/module/app-shell/use-panel-reveal.js +2 -1
- package/lib/module/app-shell/use-panel-reveal.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +3 -2
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/chip/Chip.js +10 -1
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/chip/shared.js +2 -2
- package/lib/module/dialog/DialogBottomSheet.js +6 -3
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/engagement-bar/EngagementAction.js +7 -6
- package/lib/module/engagement-bar/EngagementAction.js.map +1 -1
- package/lib/module/engagement-bar/EngagementBar.js +29 -5
- package/lib/module/engagement-bar/EngagementBar.js.map +1 -1
- package/lib/module/engagement-bar/EngagementPop.js +10 -3
- package/lib/module/engagement-bar/EngagementPop.js.map +1 -1
- package/lib/module/engagement-bar/context.js.map +1 -1
- package/lib/module/engagement-bar/paint.js +60 -13
- package/lib/module/engagement-bar/paint.js.map +1 -1
- package/lib/module/hooks/use-border-box-size.js +42 -0
- package/lib/module/hooks/use-border-box-size.js.map +1 -0
- package/lib/module/layout/ScrollBar.web.js +64 -31
- package/lib/module/layout/ScrollBar.web.js.map +1 -1
- package/lib/module/layout/scroll-metrics.js.map +1 -1
- package/lib/module/list/VirtualList.js +12 -0
- package/lib/module/list/VirtualList.js.map +1 -1
- package/lib/module/list/VirtualList.web.js +41 -20
- package/lib/module/list/VirtualList.web.js.map +1 -1
- package/lib/module/list/flash-list-module.js.map +1 -1
- package/lib/module/page-header/EdgeScrim.js +14 -4
- package/lib/module/page-header/EdgeScrim.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +19 -6
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/screen/ScreenBase.js +15 -6
- package/lib/module/screen/ScreenBase.js.map +1 -1
- package/lib/module/screen/ScreenScrollViewBase.js +12 -2
- package/lib/module/screen/ScreenScrollViewBase.js.map +1 -1
- package/lib/module/screen/context.js.map +1 -1
- package/lib/module/screen/use-intrinsic-content-height.js +50 -0
- package/lib/module/screen/use-intrinsic-content-height.js.map +1 -0
- package/lib/module/screen/use-screen-viewport.js +39 -8
- package/lib/module/screen/use-screen-viewport.js.map +1 -1
- package/lib/module/scroll/constants.js +3 -0
- package/lib/module/scroll/constants.js.map +1 -1
- package/lib/module/scroll/owner-handoff.js +27 -8
- package/lib/module/scroll/owner-handoff.js.map +1 -1
- package/lib/module/scroll/use-scroll-restoration.web.js +1 -10
- package/lib/module/scroll/use-scroll-restoration.web.js.map +1 -1
- package/lib/module/sidebar/Sidebar.js +121 -87
- package/lib/module/sidebar/Sidebar.js.map +1 -1
- package/lib/module/sidebar/arrangement.js +32 -0
- package/lib/module/sidebar/arrangement.js.map +1 -0
- package/lib/module/sidebar/index.js.map +1 -1
- package/lib/module/stay-filters/CountFilter.js +1 -1
- package/lib/module/stay-filters/FilterChip.js +1 -1
- package/lib/module/stay-filters/ToggleChipGroup.js +1 -1
- package/lib/typescript/commonjs/app-shell/AppShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellPanelLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/RetainedPanelLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts +2 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts +11 -2
- package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout.d.ts +13 -27
- package/lib/typescript/commonjs/app-shell/panel-layout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-motion.d.ts +1 -12
- package/lib/typescript/commonjs/app-shell/panel-motion.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts +4 -0
- package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts.map +1 -0
- package/lib/typescript/commonjs/app-shell/shell-layout-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/types.d.ts +4 -0
- package/lib/typescript/commonjs/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts +14 -0
- package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts.map +1 -0
- package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts +2 -2
- package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts +4 -2
- package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts +2 -2
- package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts +2 -0
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/shared.d.ts +1 -1
- package/lib/typescript/commonjs/chip/types.d.ts +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +2 -0
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts +3 -3
- package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts +2 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/context.d.ts +1 -0
- package/lib/typescript/commonjs/engagement-bar/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/paint.d.ts +4 -2
- package/lib/typescript/commonjs/engagement-bar/paint.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/types.d.ts +10 -1
- package/lib/typescript/commonjs/engagement-bar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts +13 -0
- package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts.map +1 -0
- package/lib/typescript/commonjs/layout/ScrollBar.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/scroll-metrics.d.ts +2 -0
- package/lib/typescript/commonjs/layout/scroll-metrics.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/types.d.ts +2 -2
- package/lib/typescript/commonjs/layout/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/VirtualList.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/flash-list-module.d.ts +1 -1
- package/lib/typescript/commonjs/list/flash-list-module.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +3 -1
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/types.d.ts +2 -0
- package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/ScreenBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/ScreenScrollViewBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/context.d.ts +3 -0
- package/lib/typescript/commonjs/screen/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts +3 -0
- package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts.map +1 -0
- package/lib/typescript/commonjs/screen/use-screen-viewport.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/constants.d.ts +2 -0
- package/lib/typescript/commonjs/scroll/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/owner-handoff.d.ts +3 -1
- package/lib/typescript/commonjs/scroll/owner-handoff.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/use-scroll-restoration.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/arrangement.d.ts +32 -0
- package/lib/typescript/commonjs/sidebar/arrangement.d.ts.map +1 -0
- package/lib/typescript/commonjs/sidebar/index.d.ts +1 -0
- package/lib/typescript/commonjs/sidebar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts +13 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/stay-filters/CountFilter.d.ts +1 -1
- package/lib/typescript/commonjs/stay-filters/ToggleChipGroup.d.ts +1 -1
- package/lib/typescript/module/app-shell/AppShell.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellPanelLayout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/RetainedPanelLayout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout-css.d.ts +2 -1
- package/lib/typescript/module/app-shell/panel-layout-css.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout-types.d.ts +11 -2
- package/lib/typescript/module/app-shell/panel-layout-types.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout.d.ts +13 -27
- package/lib/typescript/module/app-shell/panel-layout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-motion.d.ts +1 -12
- package/lib/typescript/module/app-shell/panel-motion.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-transitions.d.ts +4 -0
- package/lib/typescript/module/app-shell/panel-transitions.d.ts.map +1 -0
- package/lib/typescript/module/app-shell/shell-layout-css.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/types.d.ts +4 -0
- package/lib/typescript/module/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts +14 -0
- package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts.map +1 -0
- package/lib/typescript/module/app-shell/use-panel-reorder.d.ts +2 -2
- package/lib/typescript/module/app-shell/use-panel-reorder.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-resize.d.ts +4 -2
- package/lib/typescript/module/app-shell/use-panel-resize.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-reveal.d.ts +2 -2
- package/lib/typescript/module/app-shell/use-panel-reveal.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/types.d.ts +2 -0
- package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/chip/shared.d.ts +1 -1
- package/lib/typescript/module/chip/types.d.ts +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +2 -0
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementAction.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementBar.d.ts +3 -3
- package/lib/typescript/module/engagement-bar/EngagementBar.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementPop.d.ts +2 -1
- package/lib/typescript/module/engagement-bar/EngagementPop.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/context.d.ts +1 -0
- package/lib/typescript/module/engagement-bar/context.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/paint.d.ts +4 -2
- package/lib/typescript/module/engagement-bar/paint.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/types.d.ts +10 -1
- package/lib/typescript/module/engagement-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-border-box-size.d.ts +13 -0
- package/lib/typescript/module/hooks/use-border-box-size.d.ts.map +1 -0
- package/lib/typescript/module/layout/ScrollBar.web.d.ts.map +1 -1
- package/lib/typescript/module/layout/scroll-metrics.d.ts +2 -0
- package/lib/typescript/module/layout/scroll-metrics.d.ts.map +1 -1
- package/lib/typescript/module/layout/types.d.ts +2 -2
- package/lib/typescript/module/layout/types.d.ts.map +1 -1
- package/lib/typescript/module/list/VirtualList.d.ts.map +1 -1
- package/lib/typescript/module/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/module/list/flash-list-module.d.ts +1 -1
- package/lib/typescript/module/list/flash-list-module.d.ts.map +1 -1
- package/lib/typescript/module/page-header/EdgeScrim.d.ts +3 -1
- package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/page-header/types.d.ts +2 -0
- package/lib/typescript/module/page-header/types.d.ts.map +1 -1
- package/lib/typescript/module/screen/ScreenBase.d.ts.map +1 -1
- package/lib/typescript/module/screen/ScreenScrollViewBase.d.ts.map +1 -1
- package/lib/typescript/module/screen/context.d.ts +3 -0
- package/lib/typescript/module/screen/context.d.ts.map +1 -1
- package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts +3 -0
- package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts.map +1 -0
- package/lib/typescript/module/screen/use-screen-viewport.d.ts.map +1 -1
- package/lib/typescript/module/scroll/constants.d.ts +2 -0
- package/lib/typescript/module/scroll/constants.d.ts.map +1 -1
- package/lib/typescript/module/scroll/owner-handoff.d.ts +3 -1
- package/lib/typescript/module/scroll/owner-handoff.d.ts.map +1 -1
- package/lib/typescript/module/scroll/use-scroll-restoration.web.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/arrangement.d.ts +32 -0
- package/lib/typescript/module/sidebar/arrangement.d.ts.map +1 -0
- package/lib/typescript/module/sidebar/index.d.ts +1 -0
- package/lib/typescript/module/sidebar/index.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/types.d.ts +13 -1
- package/lib/typescript/module/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/module/stay-filters/CountFilter.d.ts +1 -1
- package/lib/typescript/module/stay-filters/ToggleChipGroup.d.ts +1 -1
- package/package.json +1 -1
- package/src/__tests__/support/public-part-classifications.json +169 -26
- package/src/__tests__/support/yoga-host-tree.ts +55 -2
- package/src/app-shell/AppShell.tsx +7 -3
- package/src/app-shell/AppShellEngine.tsx +6 -2
- package/src/app-shell/AppShellPanelLayout.tsx +466 -189
- package/src/app-shell/RetainedPanelLayout.tsx +7 -1
- package/src/app-shell/panel-layout-css.ts +41 -27
- package/src/app-shell/panel-layout-types.ts +11 -2
- package/src/app-shell/panel-layout.ts +49 -256
- package/src/app-shell/panel-motion.ts +34 -52
- package/src/app-shell/panel-transitions.ts +39 -0
- package/src/app-shell/shell-layout-css.ts +6 -2
- package/src/app-shell/types.ts +4 -0
- package/src/app-shell/use-panel-exit-completion.ts +95 -0
- package/src/app-shell/use-panel-reorder.ts +2 -2
- package/src/app-shell/use-panel-resize.ts +37 -10
- package/src/app-shell/use-panel-reveal.ts +4 -9
- package/src/bottom-sheet/BottomSheetBase.tsx +6 -2
- package/src/bottom-sheet/types.ts +2 -0
- package/src/chip/Chip.tsx +3 -1
- package/src/chip/shared.ts +2 -2
- package/src/chip/types.ts +1 -1
- package/src/dialog/DialogBottomSheet.tsx +13 -2
- package/src/dialog/types.ts +2 -0
- package/src/engagement-bar/EngagementAction.tsx +5 -4
- package/src/engagement-bar/EngagementBar.tsx +30 -5
- package/src/engagement-bar/EngagementPop.tsx +11 -3
- package/src/engagement-bar/context.ts +1 -0
- package/src/engagement-bar/paint.ts +60 -13
- package/src/engagement-bar/types.ts +10 -1
- package/src/hooks/use-border-box-size.ts +38 -0
- package/src/layout/ScrollBar.web.tsx +74 -40
- package/src/layout/scroll-metrics.tsx +2 -0
- package/src/layout/types.ts +2 -2
- package/src/list/VirtualList.tsx +18 -0
- package/src/list/VirtualList.web.tsx +69 -22
- package/src/list/flash-list-module.ts +2 -0
- package/src/page-header/EdgeScrim.tsx +29 -9
- package/src/page-header/PageHeader.tsx +10 -6
- package/src/page-header/types.ts +2 -0
- package/src/screen/ScreenBase.tsx +13 -6
- package/src/screen/ScreenScrollViewBase.tsx +24 -2
- package/src/screen/context.ts +3 -0
- package/src/screen/use-intrinsic-content-height.ts +56 -0
- package/src/screen/use-screen-viewport.ts +60 -11
- package/src/scroll/constants.ts +3 -0
- package/src/scroll/owner-handoff.ts +45 -11
- package/src/scroll/use-scroll-restoration.web.ts +4 -10
- package/src/sidebar/Sidebar.tsx +146 -121
- package/src/sidebar/arrangement.ts +47 -0
- package/src/sidebar/index.ts +6 -0
- package/src/sidebar/types.ts +13 -1
- package/src/stay-filters/CountFilter.tsx +1 -1
- package/src/stay-filters/FilterChip.tsx +1 -1
- package/src/stay-filters/ToggleChipGroup.tsx +1 -1
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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:
|
|
78
|
-
?
|
|
79
|
-
|
|
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)
|
|
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.
|
package/src/scroll/constants.ts
CHANGED
|
@@ -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
|
-
/**
|
|
4
|
-
const offsets = new WeakMap<
|
|
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(
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (typeof
|
|
15
|
-
transfer.offset = Math.max(0,
|
|
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
|
|
45
|
-
|
|
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 {
|
|
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
|
package/src/sidebar/Sidebar.tsx
CHANGED
|
@@ -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
|
-
{
|
|
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
|
-
<
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
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
|
-
|
|
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
|
+
}
|
package/src/sidebar/index.ts
CHANGED
|
@@ -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';
|
package/src/sidebar/types.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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 (
|
|
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
|
*
|