import cx from "classnames"; import React from "react"; import { Icon } from "../Icon"; import type { ButtonSize } from "./Button"; import { Button } from "./Button"; export type IconPosition = "left" | "right"; export interface IconButtonProps extends Omit, "type" | "ref"> { /** Name of the icon */ iconName: string; /** Position of the icon */ iconPosition?: IconPosition; /** Class of the icon */ iconClassName?: string; /** Button size. Also affects icon size */ size?: ButtonSize; /** Use square button. Children are rendered as visually hidden */ isSquare?: boolean; children?: React.ReactNode; } const IconButton = React.forwardRef( ( { iconName, iconPosition = "left", iconClassName, children, size, isSquare, ...other }, ref, ) => { const iconSize = size === "large" ? "medium" : (size ?? "medium"); const IconComponent = ({ className, ...props }: { className?: string }) => ( ); if (isSquare) { return ( ); } return ( ); }, ); IconButton.displayName = "IconButton"; export { IconButton };