import { styled, css, DefaultTheme } from "styled-components"; import { Box } from "../../Box"; import { ClipFill } from "../types"; interface CurveProps { clipFill?: ClipFill; } interface ContainerProps extends CurveProps { clipPath: string; } const sharedStyles = (theme: DefaultTheme, clipPath: string, clipFill?: ClipFill) => css` width: 100%; height: 20px; clip-path: url(${clipPath}); background: ${() => { if (theme.isDark) { return clipFill?.dark || clipFill?.light || theme.colors.background; } return clipFill?.light || theme.colors.background; }}; & svg { display: block; } `; const ConcaveContainer = styled(Box)` ${({ theme, clipPath, clipFill }) => sharedStyles(theme, clipPath, clipFill)} transform: ${({ clipPath }) => (clipPath === "#bottomConcaveCurve" ? "translate(0, -13px)" : "translate(0, 1px)")}; `; const ConvexContainer = styled(Box)` ${({ theme, clipPath, clipFill }) => sharedStyles(theme, clipPath, clipFill)} transform: ${({ clipPath }) => (clipPath === "#bottomConvexCurve" ? "translate(0, -13px)" : "translate(0, -1px)")}; `; export const ConvexTop: React.FC> = ({ clipFill }) => ( ); export const ConvexBottom: React.FC> = ({ clipFill }) => ( ); export const ConcaveTop: React.FC> = ({ clipFill }) => ( ); export const ConcaveBottom: React.FC> = ({ clipFill }) => ( );