geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
89 lines (88 loc) • 3.35 kB
JavaScript
import * as e from "react";
import * as a from "@radix-ui/react-toast";
import { cva as i } from "class-variance-authority";
import { X as l } from "lucide-react";
import { cn as s } from "./index.es79.js";
import m from "./index.es83.js";
import c from "./index.es84.js";
import d from "./index.es85.js";
import p from "./index.es86.js";
const D = a.Provider, f = e.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e.createElement(
a.Viewport,
{
ref: r,
className: s(
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
t
),
...o
}
));
f.displayName = a.Viewport.displayName;
const u = i(
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-4 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
{
variants: {
variant: {
default: "bg-light-1 border text-foreground"
}
},
defaultVariants: {
variant: "default"
}
}
), w = e.forwardRef(({ className: t, variant: o, ...r }, n) => /* @__PURE__ */ e.createElement(
a.Root,
{
ref: n,
className: s(u({ variant: o }), t),
...r
}
));
w.displayName = a.Root.displayName;
const v = e.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e.createElement(a.Action, { ref: r, className: s(t), ...o }));
v.displayName = a.Action.displayName;
const x = e.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e.createElement(
a.Close,
{
ref: r,
className: s(
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 ",
t
),
"toast-close": "",
...o
},
/* @__PURE__ */ e.createElement(l, { className: "w-4 h-4" })
));
x.displayName = a.Close.displayName;
const y = e.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e.createElement(a.Title, { ref: r, className: t, ...o }));
y.displayName = a.Title.displayName;
const N = e.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e.createElement(a.Description, { ref: r, className: t, ...o }));
N.displayName = a.Description.displayName;
const g = ({ icon: t }) => {
switch (t) {
case "success":
return /* @__PURE__ */ e.createElement(c, null);
case "info":
return /* @__PURE__ */ e.createElement(m, null);
case "danger":
return /* @__PURE__ */ e.createElement(d, null);
case "warning":
return /* @__PURE__ */ e.createElement(p, null);
default:
return /* @__PURE__ */ e.createElement("div", null);
}
};
g.displayName = "ToastIcon";
export {
v as ToastAction,
x as ToastClose,
N as ToastDescription,
g as ToastIcon,
w as ToastPrimitive,
D as ToastProvider,
y as ToastTitle,
f as ToastViewport
};
//# sourceMappingURL=index.es32.js.map