geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
102 lines (101 loc) • 3.49 kB
JavaScript
import * as e from "react";
import * as t from "@radix-ui/react-dialog";
import { cva as m } from "class-variance-authority";
import { X as c } from "lucide-react";
import { cn as r } from "./index.es85.js";
const v = t.Root, w = t.Trigger, E = t.Close, f = t.Portal, n = e.forwardRef(({ className: a, ...o }, s) => /* @__PURE__ */ e.createElement(
t.Overlay,
{
className: r(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
a
),
...o,
ref: s
}
));
n.displayName = t.Overlay.displayName;
const p = m(
"fixed z-50 gap-4 bg-background shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
{
variants: {
side: {
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
custom: ""
// custom is to place the sheet anywhere on the screen
}
},
defaultVariants: {
side: "right"
}
}
), u = e.forwardRef(({ side: a = "right", className: o, children: s, container: i, ...l }, d) => /* @__PURE__ */ e.createElement(f, { container: i }, /* @__PURE__ */ e.createElement(n, null), /* @__PURE__ */ e.createElement(
t.Content,
{
ref: d,
className: r(p({ side: a }), o),
...l
},
s,
/* @__PURE__ */ e.createElement(t.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none" }, /* @__PURE__ */ e.createElement(c, { className: "w-4 h-4" }), /* @__PURE__ */ e.createElement("span", { className: "sr-only" }, "Close"))
)));
u.displayName = t.Content.displayName;
const g = ({
className: a,
...o
}) => /* @__PURE__ */ e.createElement(
"div",
{
className: r("flex flex-col p-3 text-center sm:text-left", a),
...o
}
);
g.displayName = "SheetHeader";
const h = ({
className: a,
...o
}) => /* @__PURE__ */ e.createElement(
"div",
{
className: r(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
a
),
...o
}
);
h.displayName = "SheetFooter";
const y = e.forwardRef(({ className: a, ...o }, s) => /* @__PURE__ */ e.createElement(
t.Title,
{
ref: s,
className: r("text-foreground text-lg font-semibold", a),
...o
}
));
y.displayName = t.Title.displayName;
const x = e.forwardRef(({ className: a, ...o }, s) => /* @__PURE__ */ e.createElement(
t.Description,
{
ref: s,
className: r("text-muted-foreground text-sm", a),
...o
}
));
x.displayName = t.Description.displayName;
export {
v as Sheet,
E as SheetClose,
u as SheetContent,
x as SheetDescription,
h as SheetFooter,
g as SheetHeader,
n as SheetOverlay,
f as SheetPortal,
y as SheetTitle,
w as SheetTrigger
};
//# sourceMappingURL=index.es42.js.map