// Copyright (c) Meta Platforms, Inc. and affiliates. 'use client'; import * as stylex from '@stylexjs/stylex'; import {ScrollableArea} from '@astryxdesign/core/ScrollableArea'; import {Card} from '@astryxdesign/core/Card'; import {Grid} from '@astryxdesign/core/Grid'; import {VStack} from '@astryxdesign/core/Layout'; import {Heading, Text} from '@astryxdesign/core/Text'; import { borderVars, colorVars, radiusVars, } from '@astryxdesign/core/theme/tokens.stylex'; const styles = stylex.create({ // A hairline frame so the nested viewport's edge — the edge the gesture // meets — is visible. sectionFrame: { borderWidth: borderVars['--border-width'], borderStyle: 'solid', borderColor: colorVars['--color-border'], borderRadius: radiusVars['--radius-element'], }, }); const SHARED = [ {id: 'brand', title: 'Brand refresh', meta: 'Priya Raman'}, {id: 'checkout', title: 'Checkout audit', meta: 'Tomas Lindqvist'}, {id: 'partner', title: 'Partner deck', meta: 'Ines Okafor'}, {id: 'research', title: 'Research synthesis', meta: 'Mei Watanabe'}, {id: 'tax', title: 'Tax region notes', meta: 'Hugo Bernard'}, {id: 'sso', title: 'SSO rollout plan', meta: 'Sofia Marchetti'}, ]; const ARCHIVED = [ {id: 'roadmap', title: '2025 roadmap', meta: 'Archived in March'}, {id: 'legacy', title: 'Legacy pricing', meta: 'Archived in March'}, {id: 'kit', title: 'Old brand kit', meta: 'Archived in January'}, {id: 'beta', title: 'Beta feedback', meta: 'Archived in January'}, {id: 'survey', title: 'Q4 survey results', meta: 'Archived in January'}, {id: 'offsite', title: 'Offsite agenda', meta: 'Archived last year'}, ]; function FileGrid({ files, }: { files: Array<{id: string; title: string; meta: string}>; }) { return ( {files.map(file => ( {file.title} {file.meta} ))} ); } export default function ScrollableAreaOverscrollChaining() { return ( Workspace files Two sections, two edge policies Shared with you {/* Default overscroll="allow": a gesture that reaches this section's end carries on scrolling the panel behind it. */} Scroll past the end and the panel keeps going. Archived {/* overscroll="contain" stops the gesture at this section's edge, so the panel behind it stays put. */} Scroll past the end and the panel stays where it is. ); }