geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
78 lines (77 loc) • 2.44 kB
JavaScript
import * as e from "react";
import { cn as s } from "./index.es79.js";
import { AlertVariants as v, AlertContentVariants as h, AlertButtonVariants as u } from "./index.es108.js";
import { Button as _ } from "./index.es7.js";
import { Typography as N } from "./index.es17.js";
const n = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e.createElement(
"h5",
{
ref: a,
className: s("mb-1 font-medium leading-none tracking-tight", t),
...r
}
));
n.displayName = "AlertTitle";
const c = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e.createElement(
N,
{
variant: "body4",
ref: a,
className: s("text-sm [&_p]:leading-relaxed", t)
},
r.children
));
c.displayName = "AlertDescription";
const A = (t) => {
switch (t) {
case "success":
return "https://frontend-static-files.geoiq.io/strapi/icons_v5_cbb854431a.svg";
case "warning":
return "https://frontend-static-files.geoiq.io/strapi/icons_v5_1_ba9b25fd5c.svg";
case "error":
return "https://frontend-static-files.geoiq.io/strapi/Frame_427320353_64f8f337a6.svg";
case "info":
return "https://frontend-static-files.geoiq.io/strapi/icons_v5_139132dbe2.svg";
default:
return "https://frontend-static-files.geoiq.io/strapi/icons_v5_139132dbe2.svg";
}
}, x = e.forwardRef(
({
className: t,
variant: r,
description: a,
shortContent: i,
title: l,
id: o,
showButton: m,
buttonLabel: f,
onButtonClick: p,
...d
}, g) => /* @__PURE__ */ e.createElement(
"div",
{
id: o,
ref: g,
role: "alert",
...d,
className: s(v({ variant: r, shortContent: i }), t)
},
/* @__PURE__ */ e.createElement("div", { className: "flex h-full w-[20px] flex-shrink-0 flex-col items-start py-0" }, /* @__PURE__ */ e.createElement("img", { src: A(r), className: "w-5 h-5", alt: "Alert Icon" })),
/* @__PURE__ */ e.createElement("div", { className: s(h({ shortContent: i })) }, l && /* @__PURE__ */ e.createElement(n, null, l), /* @__PURE__ */ e.createElement(c, { className: "flex items-center text-light-3" }, a), m && /* @__PURE__ */ e.createElement(
_,
{
variant: "secondary",
size: "sm",
onClick: p,
className: s(u({ shortContent: i }))
},
f
))
)
);
x.displayName = "Alert";
export {
x as Alert,
v as AlertVariants
};
//# sourceMappingURL=index.es18.js.map