-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export individual types for sheet component props
- Loading branch information
Showing
8 changed files
with
37 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import { type MotionValue } from 'motion/react'; | ||
import type { MotionValue } from 'motion/react'; | ||
|
||
import _Sheet from './sheet'; | ||
import SheetContainer from './SheetContainer'; | ||
import SheetContent from './SheetContent'; | ||
import SheetHeader from './SheetHeader'; | ||
import SheetBackdrop from './SheetBackdrop'; | ||
import SheetScroller from './SheetScroller'; | ||
import { type SheetCompound } from './types'; | ||
import type { SheetCompound, SheetDraggableProps } from './types'; | ||
import { Sheet as SheetBase } from './sheet'; | ||
import { SheetContainer } from './SheetContainer'; | ||
import { SheetContent } from './SheetContent'; | ||
import { SheetHeader } from './SheetHeader'; | ||
import { SheetBackdrop } from './SheetBackdrop'; | ||
import { SheetScroller } from './SheetScroller'; | ||
|
||
export interface SheetRef { | ||
y: MotionValue<number>; | ||
snapTo: (index: number) => void; | ||
} | ||
|
||
// HACK: this is needed to get the typing to work properly... | ||
const _SheetCompound: any = _Sheet; | ||
_SheetCompound.Container = SheetContainer; | ||
_SheetCompound.Header = SheetHeader; | ||
_SheetCompound.Content = SheetContent; | ||
_SheetCompound.Backdrop = SheetBackdrop; | ||
_SheetCompound.Scroller = SheetScroller; | ||
export const Sheet: SheetCompound = Object.assign(SheetBase, { | ||
Container: SheetContainer, | ||
Header: SheetHeader, | ||
Content: SheetContent, | ||
Backdrop: SheetBackdrop, | ||
Scroller: SheetScroller, | ||
}); | ||
|
||
export const Sheet = _SheetCompound as SheetCompound; | ||
// Export types | ||
export type SheetHeaderProps = SheetDraggableProps; | ||
export type SheetContentProps = SheetDraggableProps; | ||
export type { | ||
SheetProps, | ||
SheetBackdropProps, | ||
SheetScrollerProps, | ||
SheetContainerProps, | ||
} from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters