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:
@@ -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)]",
|
"rounded-t-2xl pt-3 pb-[calc(24px+env(safe-area-inset-bottom,0px))] max-h-[70vh] bg-[var(--surface)]",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
overlayClassName="backdrop-blur-md"
|
||||||
showCloseButton={false}
|
showCloseButton={false}
|
||||||
onCloseAnimationEnd={handleClose}
|
onCloseAnimationEnd={handleClose}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -53,12 +53,15 @@ function SheetContent({
|
|||||||
showCloseButton = true,
|
showCloseButton = true,
|
||||||
onCloseAnimationEnd,
|
onCloseAnimationEnd,
|
||||||
onAnimationEnd,
|
onAnimationEnd,
|
||||||
|
overlayClassName,
|
||||||
...props
|
...props
|
||||||
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
||||||
side?: "top" | "right" | "bottom" | "left"
|
side?: "top" | "right" | "bottom" | "left"
|
||||||
showCloseButton?: boolean
|
showCloseButton?: boolean
|
||||||
/** When provided, content and overlay stay mounted until close animation ends (forceMount). */
|
/** When provided, content and overlay stay mounted until close animation ends (forceMount). */
|
||||||
onCloseAnimationEnd?: () => void
|
onCloseAnimationEnd?: () => void
|
||||||
|
/** Optional class name applied to the overlay (e.g. backdrop-blur-md). */
|
||||||
|
overlayClassName?: string
|
||||||
}) {
|
}) {
|
||||||
const useForceMount = Boolean(onCloseAnimationEnd)
|
const useForceMount = Boolean(onCloseAnimationEnd)
|
||||||
|
|
||||||
@@ -74,7 +77,10 @@ function SheetContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SheetPortal>
|
<SheetPortal>
|
||||||
<SheetOverlay forceMount={useForceMount ? true : undefined} />
|
<SheetOverlay
|
||||||
|
forceMount={useForceMount ? true : undefined}
|
||||||
|
className={overlayClassName}
|
||||||
|
/>
|
||||||
<SheetPrimitive.Content
|
<SheetPrimitive.Content
|
||||||
data-slot="sheet-content"
|
data-slot="sheet-content"
|
||||||
forceMount={useForceMount ? true : undefined}
|
forceMount={useForceMount ? true : undefined}
|
||||||
|
|||||||
Reference in New Issue
Block a user