@konstructio/ui
Version:
A set of reusable and customizable React components built for konstruct.io
78 lines (77 loc) • 2.68 kB
JavaScript
import { o as g } from "./chunk-cI0lbGMq.js";
import { t as v } from "./prop-types-CE0Kfmwk.js";
import { t as u } from "./utils-COaoD3PI.js";
import { breadcrumbVariants as b, breadcrumbWrapperVariants as y } from "./components/Breadcrumb/Breadcrumb.variants.js";
import { Item as O } from "./components/Breadcrumb/components/Item/Item.js";
import d, { Fragment as j, forwardRef as w, useId as _ } from "react";
import { jsx as i, jsxs as x } from "react/jsx-runtime";
var l = /* @__PURE__ */ g(v());
function m() {
return m = Object.assign || function(r) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n];
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && (r[e] = t[e]);
}
return r;
}, m.apply(this, arguments);
}
function k(r, n) {
if (r == null) return {};
var t = z(r, n), e, o;
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(r);
for (o = 0; o < a.length; o++)
e = a[o], !(n.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(r, e) && (t[e] = r[e]);
}
return t;
}
function z(r, n) {
if (r == null) return {};
var t = {}, e = Object.keys(r), o, a;
for (a = 0; a < e.length; a++)
o = e[a], !(n.indexOf(o) >= 0) && (t[o] = r[o]);
return t;
}
var p = w(function(r, n) {
var t = r.color, e = t === void 0 ? "currentColor" : t, o = r.size, a = o === void 0 ? 24 : o, s = k(r, ["color", "size"]);
return /* @__PURE__ */ d.createElement("svg", m({
ref: n,
xmlns: "http://www.w3.org/2000/svg",
width: a,
height: a,
viewBox: "0 0 24 24",
fill: "none",
stroke: e,
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, s), /* @__PURE__ */ d.createElement("polyline", { points: "9 18 15 12 9 6" }));
});
p.propTypes = {
color: l.default.string,
size: l.default.oneOfType([l.default.string, l.default.number])
};
p.displayName = "ChevronRight";
var C = ({ "aria-label": r = "breadcrumb", className: n, steps: t, theme: e, wrapperClassName: o, ...a }) => {
const s = _();
return /* @__PURE__ */ i("nav", {
"aria-label": r,
"data-theme": e,
className: u(y({ className: o })),
children: /* @__PURE__ */ i("ol", {
className: u(b({ className: n })),
...a,
children: t.map(({ label: c, ...h }, f) => /* @__PURE__ */ x(j, { children: [/* @__PURE__ */ i(O, {
...h,
label: c,
isLast: f === t.length - 1
}), f !== t.length - 1 && /* @__PURE__ */ i("li", {
"aria-hidden": "true",
children: /* @__PURE__ */ i(p, { className: "text-gray-400 w-5 h-5 mt-0.5" })
})] }, `${s}-${c}`))
})
});
};
export {
C as t
};