geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
83 lines (82 loc) • 2.32 kB
JavaScript
import * as e from "react";
import * as i from "@radix-ui/react-tabs";
import { cn as l } from "./index.es85.js";
import { TabsVariants as N, TabTriggerVariants as T } from "./index.es93.js";
const f = e.forwardRef(({ className: s, variant: a, size: n, ...t }, o) => /* @__PURE__ */ e.createElement(
i.List,
{
ref: o,
className: l(N({ variant: a, size: n, className: s })),
...t
}
));
f.displayName = i.List.displayName;
const g = e.forwardRef(({ className: s, variant: a, size: n, ...t }, o) => /* @__PURE__ */ e.createElement(
i.Trigger,
{
ref: o,
className: l(T({ variant: a, size: n, className: s })),
...t
}
));
g.displayName = i.Trigger.displayName;
const E = e.forwardRef(({ className: s, ...a }, n) => /* @__PURE__ */ e.createElement(
i.Content,
{
ref: n,
className: l(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
s
),
...a
}
));
E.displayName = i.Content.displayName;
const R = e.forwardRef(
({
className: s,
defaultValue: a,
tabList: n,
onTabChange: t,
variant: o,
size: c,
value: p,
id: d,
disabled: m,
...u
}) => /* @__PURE__ */ e.createElement(
i.Root,
{
defaultValue: a,
onValueChange: t,
className: l(s, m ? "cursor-not-allowed" : ""),
value: p,
id: d
},
/* @__PURE__ */ e.createElement(f, { style: u.style, variant: o, size: c }, n.map((r, y) => /* @__PURE__ */ e.createElement(
g,
{
key: y,
value: r.value,
variant: o,
size: c,
className: "flex gap-1.5 items-center justify-center",
disabled: m
},
/* @__PURE__ */ e.createElement(e.Fragment, null, r?.icon && typeof r?.icon == "string" && /* @__PURE__ */ e.createElement(
"img",
{
src: r.icon,
alt: "icon",
className: "w-4 h-4 filter hue-rotate-45",
style: { display: r.icon ? "block" : "none" }
}
), r.icon && typeof r.icon != "string" && r.icon && /* @__PURE__ */ e.createElement(r.icon, { size: 16 }), r.label, r.badge !== void 0 && r.badge !== null && r.badge)
)))
)
);
export {
R as Tabs,
E as TabsContent
};
//# sourceMappingURL=index.es33.js.map