Skip to content

Commit

Permalink
fix: overlayclassname
Browse files Browse the repository at this point in the history
  • Loading branch information
nahoc committed Aug 28, 2024
1 parent 8d349a5 commit ac3b612
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@risc0/ui",
"version": "0.0.160",
"version": "0.0.161",
"private": false,
"sideEffects": false,
"type": "module",
Expand Down Expand Up @@ -36,7 +36,7 @@
"clsx": "2.1.1",
"cmdk": "1.0.0",
"lucide-react": "0.436.0",
"next": "15.0.0-canary.130",
"next": "15.0.0-canary.132",
"next-themes": "0.3.0",
"radash": "12.1.0",
"react-hook-form": "7.52.2",
Expand All @@ -47,12 +47,12 @@
"tailwind-merge": "2.5.2",
"tailwindcss": "3.4.10",
"tailwindcss-animate": "1.0.7",
"typescript": "5.7.0-dev.20240826",
"typescript": "5.7.0-dev.20240828",
"vaul": "0.9.1"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@ladle/react": "4.1.0",
"@ladle/react": "4.1.1",
"@testing-library/jest-dom": "6.5.0",
"@testing-library/react": "16.0.0",
"@testing-library/react-hooks": "8.0.1",
Expand Down
35 changes: 19 additions & 16 deletions sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,25 @@ interface SheetContentProps
extends ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
VariantProps<typeof sheetVariants> {}

const SheetContent = forwardRef<ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
({ side = "right", className, children, ...props }, ref) => {
return (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
<XIcon className="size-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
{children}
</SheetPrimitive.Content>
</SheetPortal>
);
},
);
const SheetContent = forwardRef<
ElementRef<typeof SheetPrimitive.Content>,
SheetContentProps & {
sheetOverlayClassName?: string;
}
>(({ side = "right", className, sheetOverlayClassName, children, ...props }, ref) => {
return (
<SheetPortal>
<SheetOverlay className={sheetOverlayClassName} />
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
<XIcon className="size-4" />
<span className="sr-only">Close</span>
</SheetPrimitive.Close>
{children}
</SheetPrimitive.Content>
</SheetPortal>
);
});

const SheetHeader = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => {
return <div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />;
Expand Down

0 comments on commit ac3b612

Please sign in to comment.