dgz-ui
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript
134 lines (133 loc) • 3.71 kB
JavaScript
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
import "react";
import { R as i, T as l, C as n, a as d, b as u, D as c, P as f, O as m } from "./index-BTN0oPfn.js";
import { c as s } from "./utils-D0f6bOsw.js";
import { X as h } from "./x-DOq_pA7G.js";
function N({ ...t }) {
return /* @__PURE__ */ e.jsx(i, { "data-slot": "sheet", ...t });
}
function v({
...t
}) {
return /* @__PURE__ */ e.jsx(l, { "data-slot": "sheet-trigger", ...t });
}
function k({
...t
}) {
return /* @__PURE__ */ e.jsx(n, { "data-slot": "sheet-close", ...t });
}
function p({
...t
}) {
return /* @__PURE__ */ e.jsx(f, { "data-slot": "sheet-portal", ...t });
}
function x({
className: t,
...a
}) {
return /* @__PURE__ */ e.jsx(
m,
{
"data-slot": "sheet-overlay",
className: s(
"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",
t
),
...a
}
);
}
function w({
className: t,
children: a,
side: o = "right",
...r
}) {
return /* @__PURE__ */ e.jsxs(p, { children: [
/* @__PURE__ */ e.jsx(x, {}),
/* @__PURE__ */ e.jsxs(
d,
{
"data-slot": "sheet-content",
className: s(
"data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
o === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
o === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
o === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
o === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
t
),
...r,
children: [
a,
/* @__PURE__ */ e.jsxs(n, { className: "ring-offset-white focus:ring-neutral-950 data-[state=open]:bg-neutral-100 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 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800", children: [
/* @__PURE__ */ e.jsx(h, { className: "size-4" }),
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
] })
]
}
)
] });
}
function C({ className: t, ...a }) {
return /* @__PURE__ */ e.jsx(
"div",
{
"data-slot": "sheet-header",
className: s("flex flex-col gap-1.5 p-4", t),
...a
}
);
}
function T({ className: t, ...a }) {
return /* @__PURE__ */ e.jsx(
"div",
{
"data-slot": "sheet-footer",
className: s("mt-auto flex flex-col gap-2 p-4", t),
...a
}
);
}
function z({
className: t,
...a
}) {
return /* @__PURE__ */ e.jsx(
u,
{
"data-slot": "sheet-title",
className: s(
"text-neutral-950 font-semibold dark:text-neutral-50",
t
),
...a
}
);
}
function D({
className: t,
...a
}) {
return /* @__PURE__ */ e.jsx(
c,
{
"data-slot": "sheet-description",
className: s(
"text-neutral-500 text-sm dark:text-neutral-400",
t
),
...a
}
);
}
export {
N as S,
v as a,
k as b,
w as c,
C as d,
T as e,
z as f,
D as g
};