stone-kit
Version:
uikit for redesign
143 lines (142 loc) • 3.88 kB
JavaScript
import { jsxs as e, jsx as n } from "react/jsx-runtime";
import { c as w } from "../../../index-YnD2EP-S.js";
import { NewIcon as p } from "../../NewIcon/ui/NewIcon.js";
const M = "_root_16fjr_1", N = "_iconsWrapper_16fjr_17", W = "_metroColor_16fjr_27", x = "_route_16fjr_37", B = "_auto_16fjr_47", T = "_full_16fjr_51", $ = "_transparent_16fjr_55", C = "_long_16fjr_60", b = "_mini_16fjr_64", v = "_metroColorMini_16fjr_68", y = "_routeMini_16fjr_77", I = "_withBg_16fjr_90", F = "_withWhiteBg_16fjr_94", o = {
root: M,
iconsWrapper: N,
metroColor: W,
route: x,
auto: B,
full: T,
transparent: $,
long: C,
mini: b,
metroColorMini: v,
routeMini: y,
withBg: I,
withWhiteBg: F
}, s = w.bind(o), E = ({
addClassName: l,
addClassNameColor: a,
addClassNameTimeTo: g,
metro: r,
separatorColor: j = "#F4F5F6",
width: _ = "auto",
variant: c = "default",
isBetween: u = !1,
withBg: d = !1,
withWhiteBg: f = !1,
...h
}) => {
const m = ["pedestrian", "auto"];
return Array.isArray(r) ? /* @__PURE__ */ e(
"div",
{
className: s(
o.root,
o[c],
o[u ? "long" : ""],
o[d ? "withBg" : ""],
o[f ? "withWhiteBg" : ""],
l,
o[_]
),
...h,
children: [
/* @__PURE__ */ e("div", { className: s(o.metroColor, a), children: [
/* @__PURE__ */ n("div", { className: o.iconsWrapper, children: r.map((i, t) => i.icon ? /* @__PURE__ */ n(
"div",
{
className: o.icon,
children: /* @__PURE__ */ n(
"img",
{
src: i.icon,
width: 20,
height: 20
}
)
},
`metro + ${i.name} + ${t}`
) : /* @__PURE__ */ n(
"span",
{
style: {
background: i?.color ?? "",
border: t > 0 ? `1px solid ${j}` : ""
}
},
`color + ${i.name} + ${t}`
)) }),
r.map((i) => i.name).join(", ")
] }),
r?.map((i, t) => !i.mode || !i.timeTo ? null : /* @__PURE__ */ e(
"div",
{
className: o.route,
children: [
m.includes(i.mode) && /* @__PURE__ */ n(
p,
{
size: "20",
name: i.mode,
color: "#777E90"
}
),
i.timeTo + " " + (i.selfIconText ?? "мин")
]
},
`route - ${i.name} - ${t}`
))
]
}
) : /* @__PURE__ */ e(
"div",
{
className: s(
o.root,
o[c],
o[u ? "long" : ""],
o[d ? "withBg" : ""],
o[f ? "withWhiteBg" : ""],
l,
o[_]
),
...h,
children: [
/* @__PURE__ */ e(
"div",
{
className: s(o.metroColor, a, { [o.metroColorMini]: c === "mini" }),
children: [
r?.icon && /* @__PURE__ */ n(
"img",
{
src: r.icon,
width: 20,
height: 20
}
),
r?.color && !r?.icon && /* @__PURE__ */ n("span", { style: { background: r?.color ?? "" } }),
r.name
]
}
),
r.timeTo && /* @__PURE__ */ e("div", { className: s(o.route, g, { [o.routeMini]: c === "mini" }), children: [
r.mode && m.includes(r.mode) && /* @__PURE__ */ n(
p,
{
size: "20",
name: r.mode,
color: "#777E90"
}
),
r.timeTo + " " + (r.selfIconText ?? "мин")
] })
]
}
);
};
export {
E as MetroTag
};