Skip to content

Commit 4d6559c

Browse files
Make change non-breaking
1 parent 8529e3b commit 4d6559c

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

packages/bento-design-system/src/IconButton/Config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type IconButtonConfig = {
55
radius: BentoSprinkles["borderRadius"];
66
padding: Record<
77
IconProps["size"],
8-
{ paddingX: BentoSprinkles["paddingX"]; paddingY: BentoSprinkles["paddingY"] }
8+
| BentoSprinkles["padding"]
9+
| { paddingX: BentoSprinkles["paddingX"]; paddingY: BentoSprinkles["paddingY"] }
910
>;
1011
};

packages/bento-design-system/src/IconButton/IconButton.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export function IconButton(props: Props) {
3737
},
3838
ref
3939
);
40+
41+
const paddingConfig = config.padding[props.size];
42+
4043
return (
4144
<Box
4245
as="button"
@@ -57,7 +60,11 @@ export function IconButton(props: Props) {
5760
justifyContent="center"
5861
borderRadius={config.radius}
5962
{...match(props.kind)
60-
.with("solid", "outline", () => config.padding[props.size])
63+
.with("solid", "outline", () =>
64+
paddingConfig && typeof paddingConfig === "object" && "paddingX" in paddingConfig
65+
? paddingConfig
66+
: { padding: paddingConfig }
67+
)
6168
.with("transparent", () => {})
6269
.exhaustive()}
6370
>

packages/bento-design-system/src/util/defaultConfigs.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ export const formLayout: FormLayoutConfig = {
314314
export const iconButton: IconButtonConfig = {
315315
radius: 4,
316316
padding: {
317-
8: { paddingX: 8, paddingY: 8 },
318-
12: { paddingX: 8, paddingY: 8 },
319-
16: { paddingX: 16, paddingY: 16 },
320-
24: { paddingX: 16, paddingY: 16 },
317+
8: 8,
318+
12: 8,
319+
16: 16,
320+
24: 16,
321321
},
322322
};
323323

0 commit comments

Comments
 (0)