Skip to content
3 changes: 2 additions & 1 deletion packages/lib/src/action-icon/ActionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const ActionIconContainer = styled.div<
display: flex;
justify-content: center;
align-items: center;
width: ${({ size }) => getSize(size)};
height: ${({ size }) => getSize(size)};
aspect-ratio: 1 / 1;
flex-shrink: 0;
text-decoration: none;
border-radius: ${({ shape, size }) => getBorderRadius(shape, size)};
background-color: ${({ color }) => getBackgroundColor(color)};
Expand Down
11 changes: 5 additions & 6 deletions packages/lib/src/action-icon/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const borderRadiusMap = {
};

const sizeMap = {
xsmall: "var(--height-s)",
small: "var(--height-m)",
medium: "var(--height-xl)",
large: "var(--height-xxxl)",
xsmall: "24px",
small: "32px",
medium: "40px",
large: "56px",
xlarge: "72px",
xxlarge: "80px",
};
Expand Down Expand Up @@ -91,8 +91,7 @@ export const getBorderRadius = (shape: ActionIconPropTypes["shape"], size: Actio
return "100%";
};

export const getSize = (size: ActionIconPropTypes["size"]) =>
size && sizeMap[size] ? sizeMap[size] : "var(--height-xl)";
export const getSize = (size: ActionIconPropTypes["size"]) => (size && sizeMap[size] ? sizeMap[size] : "40px");

export const getIconSize = (size: ActionIconPropTypes["size"]) =>
size && iconSizeMap[size] ? iconSizeMap[size] : "var(--height-s)";
Expand Down
Loading