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:
2026-03-04 18:03:35 +03:00
parent 33359f589a
commit 94545dc8c3
2 changed files with 8 additions and 1 deletions

View File

@@ -207,6 +207,7 @@ export const DayDetail = React.forwardRef<DayDetailHandle, DayDetailProps>(
"rounded-t-2xl pt-3 pb-[calc(24px+env(safe-area-inset-bottom,0px))] max-h-[70vh] bg-[var(--surface)]",
className
)}
overlayClassName="backdrop-blur-md"
showCloseButton={false}
onCloseAnimationEnd={handleClose}
>

View File

@@ -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}