feat: add overlay class support to SheetContent and DayDetail components
- Introduced overlayClassName prop to SheetContent for customizable overlay styling. - Updated DayDetail component to utilize the new overlayClassName for enhanced visual effects. - Improved user experience by allowing dynamic styling of the overlay during component rendering.
This commit is contained in:
@@ -53,12 +53,15 @@ function SheetContent({
|
||||
showCloseButton = true,
|
||||
onCloseAnimationEnd,
|
||||
onAnimationEnd,
|
||||
overlayClassName,
|
||||
...props
|
||||
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
||||
side?: "top" | "right" | "bottom" | "left"
|
||||
showCloseButton?: boolean
|
||||
/** When provided, content and overlay stay mounted until close animation ends (forceMount). */
|
||||
onCloseAnimationEnd?: () => void
|
||||
/** Optional class name applied to the overlay (e.g. backdrop-blur-md). */
|
||||
overlayClassName?: string
|
||||
}) {
|
||||
const useForceMount = Boolean(onCloseAnimationEnd)
|
||||
|
||||
@@ -74,7 +77,10 @@ function SheetContent({
|
||||
|
||||
return (
|
||||
<SheetPortal>
|
||||
<SheetOverlay forceMount={useForceMount ? true : undefined} />
|
||||
<SheetOverlay
|
||||
forceMount={useForceMount ? true : undefined}
|
||||
className={overlayClassName}
|
||||
/>
|
||||
<SheetPrimitive.Content
|
||||
data-slot="sheet-content"
|
||||
forceMount={useForceMount ? true : undefined}
|
||||
|
||||
Reference in New Issue
Block a user