@payfit/unity-components
Version:
34 lines (33 loc) • 1.01 kB
JavaScript
import { TimelineProvider as e } from "./Timeline.context.js";
import { timeline as t } from "./Timeline.variants.js";
import { forwardRef as n } from "react";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { useId as a } from "react-aria/useId";
//#region src/components/timeline/Timeline.tsx
var o = n(({ "aria-label": n, customProgressLabel: o, orientation: s = "vertical", type: c = "default", className: l, children: u }, d) => {
let f = a();
return /* @__PURE__ */ i(e, {
orientation: s,
type: c,
children: [o && /* @__PURE__ */ r("div", {
id: f,
className: "uy:sr-only",
children: o
}), /* @__PURE__ */ r(c === "numbered" ? "ol" : "ul", {
ref: (e) => {
typeof d == "function" ? d(e) : d && (d.current = e);
},
className: t({
orientation: s,
className: l
}),
"aria-label": n,
"aria-describedby": o ? f : void 0,
"aria-orientation": s,
children: u
})]
});
});
o.displayName = "Timeline";
//#endregion
export { o as Timeline };