@thinkbuff/figma-react
Version:
A Figma React UI components for creating plugins and widgets
98 lines (95 loc) • 3.54 kB
JavaScript
import { jsx, jsxs } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import { cn } from '../../utils/cn.mjs';
const AlertDialogRoot = AlertDialogPrimitive.Root;
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
const AlertDialogPortal = AlertDialogPrimitive.Portal;
const AlertDialogAction = AlertDialogPrimitive.Action;
const AlertDialogCancel = AlertDialogPrimitive.Cancel;
const AlertDialogOverlay = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
AlertDialogPrimitive.Overlay,
{
ref,
className: cn(
"fixed",
"inset-0",
"z-50",
"bg-black/50",
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
className
),
...props
}
));
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
const AlertDialogContent = forwardRef(({ className, container, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { container, children: [
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
/* @__PURE__ */ jsx(
AlertDialogPrimitive.Content,
{
ref,
className: cn(
"fixed",
"grid",
"w-full",
"max-w-80",
"left-1/2",
"top-1/2",
"-translate-x-1/2",
"-translate-y-1/2",
"z-50",
"rounded-0.5",
"bg-figma",
"p-6",
"shadow-lg",
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-12/25",
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-12/25",
"animate-duration-200",
className
),
...props
}
)
] }));
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
const AlertDialogHeader = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
"div",
{
ref,
className: cn("flex", "items-center", "pb-6", className),
...props,
children
}
));
AlertDialogHeader.displayName = "AlertDialogHeader";
const AlertDialogFooter = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
"div",
{
ref,
className: cn("flex", "items-center", "pt-6", className),
...props,
children
}
));
AlertDialogFooter.displayName = "AlertDialogFooter";
const AlertDialogTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
AlertDialogPrimitive.Title,
{
ref,
className: cn("text-figma", "font-size-14", "font-medium", className),
...props
}
));
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
const AlertDialogDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
AlertDialogPrimitive.Description,
{
ref,
className: cn("text-figma", "font-size-11", className),
...props
}
));
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
export { AlertDialogAction as Action, AlertDialogCancel as Cancel, AlertDialogContent as Content, AlertDialogDescription as Description, AlertDialogFooter as Footer, AlertDialogHeader as Header, AlertDialogOverlay as Overlay, AlertDialogPortal as Portal, AlertDialogRoot as Root, AlertDialogTitle as Title, AlertDialogTrigger as Trigger };