Skip to content

Commit d42eb46

Browse files
committed
feat(corner-ornament): updated ornament positions
1 parent 18eb1f7 commit d42eb46

File tree

1 file changed

+45
-34
lines changed
  • packages/paste-core/components/corner-ornament/src

1 file changed

+45
-34
lines changed

packages/paste-core/components/corner-ornament/src/mappings.tsx

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,44 @@ const BadgeTopEndPath = "M.543-.05A.375.375 0 0 0 .875.5h.1c.026 0 .05-.003.075-
88
const IconOrAvatarTopEndPath = "M1.05.437A.35.35 0 0 1 .563-.05H-.05v1.1h1.1V.437Z";
99
const IconOrAvatarBottomEndPath = "M1.05-.05h-1.1v1.1h.613A.35.35 0 0 1 1.05.563V-.05Z";
1010

11+
const iconAvatarSharedPaths: Record<CornerOrnamentPosition, string> = {
12+
bottom_end: IconOrAvatarBottomEndPath,
13+
top_end: IconOrAvatarTopEndPath,
14+
};
15+
1116
export const ClipPathMappings: Record<CornerOrnamentType, Record<CornerOrnamentPosition, string>> = {
1217
badge: {
1318
bottom_end: BadgeBottomEndPath,
1419
top_end: BadgeTopEndPath,
1520
},
21+
icon: iconAvatarSharedPaths,
22+
avatar: iconAvatarSharedPaths,
23+
};
1624

17-
icon: {
18-
bottom_end: IconOrAvatarBottomEndPath,
19-
top_end: IconOrAvatarTopEndPath,
25+
const iconAvatarSharedPositions: Record<CornerOrnamentPosition, Partial<Record<IconSizeOptions, BoxStyleProps>>> = {
26+
bottom_end: {
27+
sizeIcon20: { left: "11px", top: "11px" },
28+
sizeIcon30: { left: "11px", top: "11px" },
29+
sizeIcon40: { left: "13px", top: "13px" },
30+
sizeIcon50: { left: "16px", top: "16px" },
31+
sizeIcon60: { left: "16px", top: "16px" },
32+
sizeIcon70: { left: "17px", top: "17px" },
33+
sizeIcon80: { left: "22px", top: "22px" },
34+
sizeIcon90: { left: "22px", top: "22px" },
35+
sizeIcon100: { left: "30px", top: "30px" },
36+
sizeIcon110: { left: "38px", top: "38px" },
2037
},
21-
avatar: {
22-
bottom_end: IconOrAvatarBottomEndPath,
23-
top_end: IconOrAvatarTopEndPath,
38+
top_end: {
39+
sizeIcon20: { left: "11px", bottom: "11px", top: "-3px" },
40+
sizeIcon30: { left: "11px", bottom: "11px", top: "-3px" },
41+
sizeIcon40: { left: "13px", bottom: "13px", top: "-5px" },
42+
sizeIcon50: { left: "16px", bottom: "16px", top: "-4px" },
43+
sizeIcon60: { left: "16px", bottom: "16px", top: "-4px" },
44+
sizeIcon70: { left: "17px", bottom: "17px", top: "-5px" },
45+
sizeIcon80: { left: "22px", bottom: "22px", top: "-6px" },
46+
sizeIcon90: { left: "22px", bottom: "22px", top: "-6px" },
47+
sizeIcon100: { left: "30px", bottom: "30px", top: "-6px" },
48+
sizeIcon110: { left: "38px", bottom: "38px", top: "-6px" },
2449
},
2550
};
2651

@@ -30,36 +55,22 @@ export const OrnamentPositionStyleMappings: Record<
3055
> = {
3156
badge: {
3257
bottom_end: {
33-
sizeIcon80: { left: "28px", top: "28px" },
34-
},
35-
top_end: {
36-
sizeIcon80: { left: "28px", top: "spaceNegative30" },
37-
},
38-
},
39-
avatar: {
40-
bottom_end: {
41-
sizeIcon70: { left: "space60", top: "space60" },
42-
sizeIcon80: { left: "space70", top: "space70" },
43-
},
44-
top_end: {
45-
sizeIcon70: { left: "space60", top: "spaceNegative20" },
46-
sizeIcon80: { left: "space70", top: "spaceNegative20" },
47-
},
48-
},
49-
icon: {
50-
bottom_end: {
51-
sizeIcon30: { left: "13px", top: "13px" },
52-
sizeIcon40: { left: "17px", top: "17px" },
53-
sizeIcon50: { left: "18px", top: "18px" },
54-
sizeIcon70: { left: "21px", top: "21px" },
55-
sizeIcon80: { left: "26px", top: "26px" },
58+
sizeIcon50: { left: "16px", top: "16px" },
59+
sizeIcon60: { left: "16px", top: "16px" },
60+
sizeIcon70: { left: "19px", top: "19px" },
61+
sizeIcon80: { left: "25px", top: "25px" },
62+
sizeIcon90: { left: "25px", top: "25px" },
63+
sizeIcon110: { left: "42px", top: "42px" },
5664
},
5765
top_end: {
58-
sizeIcon30: { left: "13px", top: "-5px" },
59-
sizeIcon40: { left: "17px", top: "-5px" },
60-
sizeIcon50: { left: "18px", top: "-6px" },
61-
sizeIcon70: { left: "21px", top: "-9px" },
62-
sizeIcon80: { left: "26px", top: "-10px" },
66+
sizeIcon50: { left: "16px", bottom: "16px", top: "-8px" },
67+
sizeIcon60: { left: "16px", bottom: "16px", top: "-8px" },
68+
sizeIcon70: { left: "19px", bottom: "19px", top: "-7px" },
69+
sizeIcon80: { left: "25px", bottom: "25px", top: "-5px" },
70+
sizeIcon90: { left: "25px", bottom: "25px", top: "-5px" },
71+
sizeIcon110: { left: "42px", bottom: "42px", top: "-2px" },
6372
},
6473
},
74+
avatar: iconAvatarSharedPositions,
75+
icon: iconAvatarSharedPositions,
6576
};

0 commit comments

Comments
 (0)