Skip to content

Commit d9cccdc

Browse files
committed
WEB-111 Add 4:3 ratio to Images, fix object-cover
1 parent d24bfb7 commit d9cccdc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/puck/media.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import { cn } from "@/lib/utils";
44
import { fields, radiusVariants, selectFrom, type Radius } from "@/lib/puck/tokens";
55
import { ImageIcon } from "lucide-react";
66

7-
const aspectRatioOptions = ["auto", "square", "video", "wide"] as const;
7+
const aspectRatioOptions = ["auto", "square", "photo", "video", "wide"] as const;
88
type AspectRatio = (typeof aspectRatioOptions)[number];
99

1010
const objectFitOptions = ["cover", "contain", "fill"] as const;
1111
type ObjectFit = (typeof objectFitOptions)[number];
1212

13-
const mediaWrapperVariants = cva("relative w-full overflow-hidden", {
13+
const mediaWrapperVariants = cva("relative h-full w-full overflow-hidden", {
1414
variants: {
1515
aspectRatio: {
1616
auto: "",
1717
square: "aspect-square",
18+
photo: "aspect-[4/3]",
1819
video: "aspect-video",
1920
wide: "aspect-[21/9]",
2021
},
@@ -59,6 +60,7 @@ export const Media: ComponentConfig<MediaProps> = {
5960
options: [
6061
{ label: "Auto", value: "auto" },
6162
{ label: "Square (1:1)", value: "square" },
63+
{ label: "Photo (4:3)", value: "photo" },
6264
{ label: "Video (16:9)", value: "video" },
6365
{ label: "Wide (21:9)", value: "wide" },
6466
],

0 commit comments

Comments
 (0)