UNPKG

geoiq-frontend-ui-kit

Version:

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

54 lines (53 loc) 1.78 kB
import * as e from "react"; import { SplitButtonDropdownVariants as d, SplitButtonVariants as f, TitleVariants as E } from "./index.es74.js"; import { ChevronDown as N, Loader2 as h } from "lucide-react"; import { Typography as w } from "./index.es17.js"; import { cn as r } from "./index.es79.js"; import { Dropdown as y } from "./index.es20.js"; const S = e.forwardRef( ({ variant: n, size: t, title: o, prefixIcon: s, loading: a, id: c, disabled: m, optionGroups: i = [], ...l }, p) => { const u = /* @__PURE__ */ e.createElement( "button", { "aria-haspopup": "true", disabled: m || a, className: r(d({ variant: n, size: t }), "group") }, /* @__PURE__ */ e.createElement(N, { className: "group-data-[state=open]:rotate-180 duration-300" }) ); return /* @__PURE__ */ e.createElement("div", { className: "flex items-center justify-center select-none" }, /* @__PURE__ */ e.createElement( "button", { className: r(f({ variant: n, size: t })), id: c, ref: p, disabled: m || a, ...l }, a ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(h, { className: "w-4 h-4 mr-2 animate-spin" }), "Please wait...") : o ? /* @__PURE__ */ e.createElement("div", { className: "flex items-center" }, s, /* @__PURE__ */ e.createElement( w, { className: r(E({ titleSize: t })), variant: "body1" }, o )) : l.children ), /* @__PURE__ */ e.createElement(y, { header: "", trigger: u, optionGroups: i })); } ); S.displayName = "SplitButton"; export { S as SplitButton, f as SplitButtonVariants }; //# sourceMappingURL=index.es33.js.map