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.27 kB
JavaScript
import * as e from "react";
import * as n from "@radix-ui/react-tabs";
import { cn as l } from "./index.es79.js";
import { TabsVariants as d, TabTriggerVariants as T } from "./index.es114.js";
const f = e.forwardRef(({ className: s, variant: t, size: a, ...o }, i) => /* @__PURE__ */ e.createElement(
n.List,
{
ref: i,
className: l(d({ variant: t, size: a, className: s })),
...o
}
));
f.displayName = n.List.displayName;
const g = e.forwardRef(({ className: s, variant: t, size: a, ...o }, i) => /* @__PURE__ */ e.createElement(
n.Trigger,
{
ref: i,
className: l(T({ variant: t, size: a, className: s })),
...o
}
));
g.displayName = n.Trigger.displayName;
const E = e.forwardRef(({ className: s, ...t }, a) => /* @__PURE__ */ e.createElement(
n.Content,
{
ref: a,
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
),
...t
}
));
E.displayName = n.Content.displayName;
const R = e.forwardRef(
({
className: s,
defaultValue: t,
tabList: a,
onTabChange: o,
variant: i,
size: c,
value: p,
id: u,
disabled: m,
...y
}) => /* @__PURE__ */ e.createElement(
n.Root,
{
defaultValue: t,
onValueChange: o,
className: l(s, m ? "cursor-not-allowed" : ""),
value: p,
id: u
},
/* @__PURE__ */ e.createElement(f, { style: y.style, variant: i, size: c }, a.map((r, N) => /* @__PURE__ */ e.createElement(
g,
{
key: N,
value: r.value,
variant: i,
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)
)))
)
);
export {
R as Tabs,
E as TabsContent
};
//# sourceMappingURL=index.es30.js.map