UNPKG

@lunalytics/ui

Version:

React based component library created to be used in Lunalytics

46 lines (45 loc) 1.26 kB
import { jsxs as h, jsx as l } from "react/jsx-runtime"; import { c as p } from "../../index-2w0W-O47.js"; import '../../assets/tabs.css';const b = ({ id: s, label: r, description: c, shortDescription: n, options: i = [], activeOption: f, tabIndex: d = 0, handleChange: t, color: x = "primary", variant: y = "solid", theme: e = "dark", error: o, ...u }) => /* @__PURE__ */ h("div", { children: [ r && /* @__PURE__ */ l("label", { className: "luna-title", children: r }), n && /* @__PURE__ */ l("div", { className: "luna-short-desc", children: n }), /* @__PURE__ */ l("div", { className: "luna-tabs", children: i.map((a) => { const v = a.color || "primary", m = a.variant || "solid", N = p("luna-tabs-item", { [v]: a.color, [m]: a.variant, [`theme-${e}`]: e }); return /* @__PURE__ */ l( "div", { id: s, tabIndex: d, className: N, onClick: () => t(a.value), ...u, children: a.value }, a.value ); }) }), o && /* @__PURE__ */ l("label", { className: "luna-error", id: s, children: o }), c && /* @__PURE__ */ l("div", { className: "luna-desc", children: c }) ] }); b.displayName = "Tabs"; export { b as default };