Skip to content

Commit b436c37

Browse files
Merge pull request #106 from buildo/expand_illustration_size
Allow any number as size for illustrations
2 parents 72902ec + 61aba27 commit b436c37

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

Diff for: packages/bento-design-system/src/Illustrations/IllustrationProps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type IllustrationProps = {
2-
size: 24 | 32 | 40 | 80 | 160;
2+
size: 24 | 32 | 40 | 80 | 160 | number;
33
} & (
44
| {
55
style: "color";

Diff for: packages/bento-design-system/src/Illustrations/svgIllustrationProps.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,5 @@ function outlineColor(color: (IllustrationProps & { style: "outline" })["color"]
2222
}
2323

2424
function sizeToDimensions(size: IllustrationProps["size"]): { width: number; height: number } {
25-
switch (size) {
26-
case 24:
27-
return { width: 24, height: 24 };
28-
case 32:
29-
return { width: 32, height: 32 };
30-
case 40:
31-
return { width: 40, height: 40 };
32-
case 80:
33-
return { width: 80, height: 80 };
34-
case 160:
35-
return { width: 160, height: 160 };
36-
}
25+
return { width: size, height: size };
3726
}

0 commit comments

Comments
 (0)