import * as React from "react"; import { Dialog as DialogPrimitive } from "radix-ui"; import { styled, theme } from "../theme"; import { Button } from "../button"; import { Icon } from "../icon"; import { Close } from "@washingtonpost/wpds-assets"; import type * as WPDS from "../theme"; const NAME = "DialogClose"; const StyledClose = styled(DialogPrimitive.Close, { variants: { main: { true: { position: "absolute", insetBlockStart: theme.space["100"], insetInlineEnd: theme.space["100"], }, }, }, }); export type DialogCloseProps = { /** Any React node may be used as a child */ children?: React.ReactNode; /** Override CSS */ css?: WPDS.CSS; } & React.ComponentPropsWithRef; export const DialogClose = React.forwardRef< HTMLButtonElement, DialogCloseProps >(({ ...props }, ref) => { if (props.asChild) { return ; } else { return ( ); } }); DialogClose.displayName = NAME;