UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

1 lines 2.65 kB
import {a}from'./chunk-JUNHRB4B.js';import {Dialog}from'radix-ui';import {jsx,jsxs}from'react/jsx-runtime';import {XIcon}from'lucide-react';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';function T(o){return jsx(Dialog.Root,{"data-slot":"dialog",...o})}function F(o){return jsx(Dialog.Close,{"data-slot":"dialog-close",...o})}var l=cva(["bg-background border-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded border p-6 shadow-lg duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 "],{variants:{width:{xs:"w-xs",sm:"w-sm",md:"w-md",lg:"w-lg",xl:"w-xl","2xl":"w-2xl","3xl":"w-3xl","4xl":"w-4xl","5xl":"w-5xl","6xl":"w-6xl",full:"w-full"}},defaultVariants:{width:"md"}});function X({className:o,children:t,width:s="md",showCloseButton:n=false,...p}){return jsxs(Dialog.Portal,{"data-slot":"dialog-portal",children:[jsx(Dialog.Overlay,{"data-slot":"dialog-overlay",className:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-background/80 fixed inset-0 z-50 backdrop-blur-xs"}),jsxs(Dialog.Content,{"data-slot":"dialog-content",className:twMerge(l({width:s}),o),...p,children:[t,n?jsxs(Dialog.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]}):null]})]})}function G({...o}){return jsx(Dialog.Trigger,{"data-slot":"dialog-trigger",...o})}function Q({className:o,...t}){return jsx("div",{"data-slot":"dialog-header",className:a("flex flex-col gap-2 text-center sm:text-left",o),...t})}function Z({className:o,...t}){return jsx("div",{"data-slot":"dialog-footer",className:a("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...t})}function eo({className:o,...t}){return jsx(Dialog.Title,{"data-slot":"dialog-title",className:a("text-lg leading-none font-semibold",o),...t})}function so({className:o,...t}){return jsx(Dialog.Description,{"data-slot":"dialog-description",className:a("text-muted-foreground text-sm",o),...t})}export{T as a,F as b,X as c,G as d,Q as e,Z as f,eo as g,so as h};