geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
46 lines (45 loc) • 1.75 kB
JavaScript
import e, { forwardRef as l, createContext as o, useContext as s } from "react";
import { StepItemStatus as n } from "./index.es28.js";
import { Typography as i } from "./index.es17.js";
import { cn as p } from "./index.es79.js";
import { StepItemVariants as u } from "./index.es140.js";
const m = o(null), h = l(
({ children: a, steps: t, id: r }, c) => /* @__PURE__ */ e.createElement(m.Provider, { value: t }, /* @__PURE__ */ e.createElement("div", { className: "w-[100%]", ref: c, id: r }, a))
), w = () => {
const a = s(m);
return /* @__PURE__ */ e.createElement("div", { className: "flex justify-between items-center w-[100%]" }, a?.map((t, r) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
E,
{
key: r,
value: t,
variant: t?.status ?? n.PENDING
}
), r !== a.length - 1 && /* @__PURE__ */ e.createElement(
"div",
{
className: ` w-5 grow border-b-2 ${t?.status == n.COMPLETED ? "border-primary-2" : "border-neutral-2"}`
}
))));
}, E = ({ value: a, ...t }) => {
const { variant: r } = t;
return /* @__PURE__ */ e.createElement("div", { className: p(u({ variant: r })) }, r !== n.COMPLETED ? /* @__PURE__ */ e.createElement(
i,
{
variant: "body4",
style: { textAlign: "center", height: "max-content" }
},
a?.label
) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
"img",
{
src: "https://frontend-static-files.geoiq.io/strapi/check_white_e0c342eeb9.svg",
alt: "check-mark-icon"
}
))));
};
export {
w as StepGroup,
m as StepperContext,
h as StepperProvider
};
//# sourceMappingURL=index.es116.js.map