[DS-37] Implement Overlay component #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/DS-37"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket
DS-37 Implement Overlay component
Base branch note
This branch is based on
feature/DS-17(in Review, unmerged), notmain— DS-37 needs thekebab-case/
native/-only component convention that only exists on that branch. The PR base is setto
feature/DS-17accordingly, so this diff shows only DS-37's own commits. Once DS-17 merges tomain, this PR's diff (and its future rebase target) will reflect that.Summary
Overlayprimitive (src/overlay/) — backdrop, portal (via RN's ownModal, aliasedto
react-native-web'sModalfor Storybook/browser), DOM focus trap, Escape/back-button dismissvia
onRequestClose, and web scroll-locking — that focus-stealing UI (Selecttoday;Modal,ContextMenu,Confirm, a futureDrawerlater) composes on top of instead of reimplementing.animationType='fade'), with ananimationTypeoverride for othermotion (
Selectuses it to keep its prior slide-up sheet).backdropClassName/contentClassNamefor NativeWind-based placement,backdropStyle/contentStyleas an inline-style escape hatch for dynamically-computed anchoring(e.g. a future
ContextMenu), anddismissibleto gate backdrop/Escape/back-button close forconfirm-style flows.
Selectopened from inside a
Modal) don't unlock scroll early when they close out of order.Select(src/select/native/index.tsx) to renderOverlayinstead of its ownhand-rolled
Modal+ backdrop/sheetPressables — same observable behavior, verified by itsexisting 9-test suite (only a
-sheet→-contenttestID rename).src/overlay/native/stories.tsx) demonstrate the API generalizing to acentered dialog, a bottom sheet, and a non-dismissible confirm-style overlay.
src/overlay/native/test.tsx— 12 tests covering visibility, backdrop/content dismiss, thebubble guard,
dismissible={false}, theonRequestClose(Escape/back-button) path, andnon-LIFO scroll-lock behavior across multiple open overlays.
Verification:
bun run typecheck,bun run lint,bun run test(49 pass, 0 fail), andbun run buildall pass.