UNPKG

@uva-glass/component-library

Version:

React components UvA

63 lines (62 loc) 2.46 kB
import { jsx as r, jsxs as o, Fragment as d } from "react/jsx-runtime"; import { c as l } from "../../clsx-OuTLNxxd.js"; import { Icon as t } from "../Icon/Icon.js"; import '../../assets/VarIndicator.css';const a = { "var-indicator__container": "_var-indicator__container_15lwy_27", "var-indicator__label": "_var-indicator__label_15lwy_46", "var-indicator__step-container": "_var-indicator__step-container_15lwy_50", "var-indicator__container--compact": "_var-indicator__container--compact_15lwy_61", "var-indicator__container--compact-flyover-wrapper": "_var-indicator__container--compact-flyover-wrapper_15lwy_71", "var-indicator__container--draft": "_var-indicator__container--draft_15lwy_85", "var-indicator__container--rejected": "_var-indicator__container--rejected_15lwy_86", "var-indicator__container--submitted": "_var-indicator__container--submitted_15lwy_101", "var-indicator__container--active": "_var-indicator__container--active_15lwy_113" }, v = { DRAFT: "CircleLarge", REJECTED: "CircleLarge", SUBMITTED: "CircleLargeDotted", ACTIVE: "SignalActive" }, T = ({ label: s, variant: i = "DRAFT", maxSteps: n, currentStep: m = 1, isCompact: _, onClick: p }) => { const e = () => /* @__PURE__ */ o(d, { children: [ /* @__PURE__ */ r(t, { name: v[i], size: 16 }), /* @__PURE__ */ r("span", { className: a["var-indicator__label"], children: s[`${i}`] }), n && n > 0 && i === "SUBMITTED" && Array.from({ length: n }, (c, y) => y + 1).map((c) => /* @__PURE__ */ r("div", { className: a["var-indicator__step-container"], children: /* @__PURE__ */ r(t, { name: c <= m ? "CircleSmallFilled" : "CircleSmall" }) }, c)) ] }); return /* @__PURE__ */ r( "button", { className: l( a["var-indicator__container"], a[`var-indicator__container--${i.toLowerCase()}`], { [a["var-indicator__container--compact"]]: _ } ), onClick: p, children: _ ? /* @__PURE__ */ o(d, { children: [ /* @__PURE__ */ r(t, { name: v[i], size: 16 }), /* @__PURE__ */ r( "div", { className: l( a["var-indicator__container"], a["var-indicator__container--compact-flyover-wrapper"] ), children: /* @__PURE__ */ r(e, {}) } ) ] }) : /* @__PURE__ */ r(e, {}) } ); }; export { T as VarIndicator }; //# sourceMappingURL=VarIndicator.js.map