Skip to content

Commit 8529e3b

Browse files
Allow separate config of paddingX and paddingY for IconButton
1 parent 0878d8a commit 8529e3b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ import { BentoSprinkles } from "../internal";
33

44
export type IconButtonConfig = {
55
radius: BentoSprinkles["borderRadius"];
6-
padding: Record<IconProps["size"], BentoSprinkles["padding"]>;
6+
padding: Record<
7+
IconProps["size"],
8+
{ paddingX: BentoSprinkles["paddingX"]; paddingY: BentoSprinkles["paddingY"] }
9+
>;
710
};

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export function IconButton(props: Props) {
5656
alignItems="center"
5757
justifyContent="center"
5858
borderRadius={config.radius}
59-
padding={match(props.kind)
59+
{...match(props.kind)
6060
.with("solid", "outline", () => config.padding[props.size])
61-
.with("transparent", () => undefined)
61+
.with("transparent", () => {})
6262
.exhaustive()}
6363
>
6464
{props.icon({ size: props.size, color: "inherit" })}

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: 8,
318-
12: 8,
319-
16: 16,
320-
24: 16,
317+
8: { paddingX: 8, paddingY: 8 },
318+
12: { paddingX: 8, paddingY: 8 },
319+
16: { paddingX: 16, paddingY: 16 },
320+
24: { paddingX: 16, paddingY: 16 },
321321
},
322322
};
323323

0 commit comments

Comments
 (0)