UNPKG

geoiq-frontend-ui-kit

Version:

This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.

53 lines (52 loc) 2.57 kB
import e from "react"; import { DropdownMenu as g, DropdownMenuTrigger as p, DropdownMenuContent as h, DropdownMenuLabel as E, DropdownMenuSeparator as s, DropdownMenuGroup as w, DropdownMenuSub as x, DropdownMenuSubTrigger as N, DropdownMenuPortal as D, DropdownMenuSubContent as M, DropdownMenuItem as c } from "./index.es110.js"; function v({ trigger: o, optionGroups: r, header: t = "My Account", dropdownContentProps: m = {}, container: u }) { return /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(p, { asChild: !0 }, o), /* @__PURE__ */ e.createElement( h, { className: "bg-light-1 w-56 shadow-lg rounded-[8px]", container: u, ...m }, t && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(E, null, t), /* @__PURE__ */ e.createElement(s, { className: "border-t border-neutral-1" })), r.map((b, n) => /* @__PURE__ */ e.createElement(e.Fragment, { key: n }, /* @__PURE__ */ e.createElement(w, null, b.map((a, d) => a.subItems ? /* @__PURE__ */ e.createElement(x, { key: d }, /* @__PURE__ */ e.createElement( N, { disabled: a.disabled, className: `data-[disabled]:hover:bg-light-1 hover:bg-light-2 rounded-md py-[11px] px-4 cursor-pointer data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed ${a.className}` }, a.icon, /* @__PURE__ */ e.createElement("span", { className: "text-xs" }, a.label) ), /* @__PURE__ */ e.createElement(D, null, /* @__PURE__ */ e.createElement(M, { className: "bg-light-1" }, a.subItems?.map((l, i) => /* @__PURE__ */ e.createElement( c, { disabled: l?.disabled, className: ` data-[disabled]:hover:bg-light-1 hover:bg-light-2 data-[disabled]:cursor-not-allowed py-[11px] px-4 rounded-md ${l.className}`, onClick: l.onClick, key: i }, l.icon, /* @__PURE__ */ e.createElement("span", { className: "text-xs" }, l.label) ))))) : /* @__PURE__ */ e.createElement( c, { className: `data-[disabled]:hover:bg-light-1 hover:bg-light-2 data-[disabled]:cursor-not-allowed hover:rounded-md py-[11px] px-4 h-[42px] ${a.className}`, onClick: a.onClick, disabled: a.disabled, key: d }, a.icon, /* @__PURE__ */ e.createElement("span", { className: "text-xs" }, a.label) ))), n + 1 !== r.length && /* @__PURE__ */ e.createElement(s, { className: "border-t border-neutral-1" }))) )); } export { v as Dropdown }; //# sourceMappingURL=index.es20.js.map