import * as React from "react"; import styled from "styled-components"; import Flex from "./Flex"; type Props = { /** The width and height of the squircle */ size?: number; /** The color of the squircle */ color?: string; children?: React.ReactNode; className?: string; }; const Squircle: React.FC = ({ color, size = 28, children, className, }: Props) => ( {children} ); const Wrapper = styled(Flex)<{ size: number }>` position: relative; width: ${(props) => props.size}px; height: ${(props) => props.size}px; svg { transition: fill 150ms ease-in-out; transition-delay: var(--delay); } `; const Content = styled.div` display: flex; transform: translate(-50%, -50%); position: absolute; top: 50%; left: 50%; `; export default Squircle;