@payfit/unity-components
Version:
37 lines (36 loc) • 1.14 kB
JavaScript
import { useTimelineContext as e } from "../Timeline.context.js";
import { timelineMarker as t } from "../Timeline.variants.js";
import n from "./check.js";
import { forwardRef as r } from "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
//#region src/components/timeline/parts/TimelineMarker.tsx
var o = r(({ state: r = "pending", stepNumber: o, className: s }, c) => {
let { type: l, orientation: u } = e(), { container: d, icon: f, ball: p, number: m, line: h } = t({
state: r,
type: l,
orientation: u,
className: s
}), g = r === "completed", _ = l === "numbered" && !g && o !== void 0;
return /* @__PURE__ */ a("div", {
ref: c,
className: d(),
"aria-hidden": "true",
children: [/* @__PURE__ */ a("div", {
className: p(),
children: [g && /* @__PURE__ */ i(n, {
className: f(),
"aria-hidden": "true"
}), _ && /* @__PURE__ */ i("span", {
className: m(),
"aria-hidden": "true",
children: o
})]
}), /* @__PURE__ */ i("div", {
className: h(),
"data-timeline-line": !0
})]
});
});
o.displayName = "TimelineMarker";
//#endregion
export { o as TimelineMarker };