dgz-ui
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript
101 lines (100 loc) • 2.99 kB
JavaScript
import { j as t } from "./jsx-runtime-DS1N_tNq.js";
import * as i from "react";
import { R as g, P as x, C as l, T as u, O as n, a as d, b as r, D as c } from "./index-C4qYhCZt.js";
import { X as y } from "./x-DOq_pA7G.js";
import { c as o } from "./utils-B6fNqzRf.js";
const T = g, k = u, N = x, O = l, m = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ t.jsx(
n,
{
ref: s,
className: o(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",
a
),
...e
}
));
m.displayName = n.displayName;
const D = i.forwardRef(({ className: a, children: e, hasCloseButton: s, ...f }, p) => /* @__PURE__ */ t.jsxs(N, { children: [
/* @__PURE__ */ t.jsx(m, {}),
/* @__PURE__ */ t.jsxs(
d,
{
ref: p,
className: o(
"bg-background 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
a
),
...f,
children: [
e,
s && /* @__PURE__ */ t.jsxs(l, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
/* @__PURE__ */ t.jsx(y, { className: "size-4" }),
/* @__PURE__ */ t.jsx("span", { className: "sr-only", children: "Close" })
] })
]
}
)
] }));
D.displayName = d.displayName;
const j = ({
className: a,
...e
}) => /* @__PURE__ */ t.jsx(
"div",
{
className: o(
"flex flex-col space-y-1.5 text-center sm:text-left",
a
),
...e
}
);
j.displayName = "DialogHeader";
const b = ({
className: a,
...e
}) => /* @__PURE__ */ t.jsx(
"div",
{
className: o(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
a
),
...e
}
);
b.displayName = "DialogFooter";
const h = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ t.jsx(
r,
{
ref: s,
className: o(
"text-lg leading-none font-semibold tracking-tight",
a
),
...e
}
));
h.displayName = r.displayName;
const w = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ t.jsx(
c,
{
ref: s,
className: o("text-muted-foreground text-sm", a),
...e
}
));
w.displayName = c.displayName;
export {
T as D,
N as a,
m as b,
O as c,
k as d,
D as e,
j as f,
b as g,
h,
w as i
};