laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
122 lines (121 loc) • 3.63 kB
JavaScript
"use client";
import { jsx as o, jsxs as s } from "react/jsx-runtime";
import { Root as d, Trigger as i, Content as l, Close as c, Title as f, Description as u, Portal as m, Overlay as h } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
import { cn as a } from "../../lib/utils.js";
import p from "../../node_modules/lucide-react/dist/esm/icons/x.js";
function v({ ...t }) {
return /* @__PURE__ */ o(d, { "data-slot": "sheet", ...t });
}
function w({
...t
}) {
return /* @__PURE__ */ o(i, { "data-slot": "sheet-trigger", ...t });
}
function g({
...t
}) {
return /* @__PURE__ */ o(m, { "data-slot": "sheet-portal", ...t });
}
function b({
className: t,
...e
}) {
return /* @__PURE__ */ o(
h,
{
"data-slot": "sheet-overlay",
className: a(
"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/50",
t
),
...e
}
);
}
function C({
className: t,
children: e,
side: r = "right",
...n
}) {
return /* @__PURE__ */ s(g, { children: [
/* @__PURE__ */ o(b, {}),
/* @__PURE__ */ s(
l,
{
"data-slot": "sheet-content",
className: a(
"bg-d-background 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",
r === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right border-d-border inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
r === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left border-d-border inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
r === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top border-d-border inset-x-0 top-0 h-auto border-b",
r === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom border-d-border inset-x-0 bottom-0 h-auto border-t",
t
),
...n,
children: [
e,
/* @__PURE__ */ s(c, { className: "ring-offset-d-background focus:ring-d-ring data-[state=open]:bg-d-secondary 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", children: [
/* @__PURE__ */ o(p, { className: "size-4" }),
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
] })
]
}
)
] });
}
function T({ className: t, ...e }) {
return /* @__PURE__ */ o(
"div",
{
"data-slot": "sheet-header",
className: a("flex flex-col gap-1.5 p-4", t),
...e
}
);
}
function k({ className: t, ...e }) {
return /* @__PURE__ */ o(
"div",
{
"data-slot": "sheet-footer",
className: a("mt-auto flex flex-col gap-2 p-4", t),
...e
}
);
}
function z({
className: t,
...e
}) {
return /* @__PURE__ */ o(
f,
{
"data-slot": "sheet-title",
className: a("text-d-foreground font-semibold", t),
...e
}
);
}
function j({
className: t,
...e
}) {
return /* @__PURE__ */ o(
u,
{
"data-slot": "sheet-description",
className: a("text-d-secondary-foreground text-sm", t),
...e
}
);
}
export {
v as Sheet,
C as SheetContent,
j as SheetDescription,
k as SheetFooter,
T as SheetHeader,
z as SheetTitle,
w as SheetTrigger
};