@purpurds/breadcrumbs 5.13.0 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/breadcrumbs.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as o, jsxs as x, Fragment as
|
|
2
|
-
import { Children as w, cloneElement as N, createElement as
|
|
1
|
+
import { jsx as o, jsxs as x, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { Children as w, cloneElement as N, createElement as B } from "react";
|
|
3
3
|
function H(e) {
|
|
4
4
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5
5
|
}
|
|
@@ -39,8 +39,8 @@ var S = { exports: {} };
|
|
|
39
39
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
40
40
|
})();
|
|
41
41
|
})(S);
|
|
42
|
-
var
|
|
43
|
-
const
|
|
42
|
+
var A = S.exports;
|
|
43
|
+
const P = /* @__PURE__ */ H(A), E = {
|
|
44
44
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
45
45
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
46
46
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -48,39 +48,39 @@ const A = /* @__PURE__ */ H(P), E = {
|
|
|
48
48
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
49
49
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
50
50
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
51
|
-
},
|
|
51
|
+
}, Z = {
|
|
52
52
|
name: "home",
|
|
53
53
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M11.38 1.848a.9.9 0 0 1 1.24 0l8.69 8.276c1.242 1.183.405 3.276-1.31 3.276h-.6v8.1a.9.9 0 0 1-.9.9h-13a.9.9 0 0 1-.9-.9v-8.1H4c-1.715 0-2.552-2.093-1.31-3.276l8.69-8.276ZM12 3.743l-8.069 7.685c-.026.024-.03.04-.032.049a.11.11 0 0 0 .008.06.11.11 0 0 0 .036.049c.007.005.021.014.057.014h1.5a.9.9 0 0 1 .9.9v8.1h11.2v-8.1a.9.9 0 0 1 .9-.9H20c.036 0 .05-.009.057-.014a.111.111 0 0 0 .036-.049.111.111 0 0 0 .008-.06c-.002-.008-.006-.025-.032-.05L12 3.744ZM10.6 14a.9.9 0 0 1 .9-.9H15a.9.9 0 0 1 .9.9v4a.9.9 0 0 1-.9.9h-3.5a.9.9 0 0 1-.9-.9v-4Zm1.8.9v2.2h1.7v-2.2h-1.7Z" clip-rule="evenodd"/></svg>',
|
|
54
54
|
keywords: ["home"],
|
|
55
55
|
category: "buildings"
|
|
56
56
|
}, j = (e) => /* @__PURE__ */ o(
|
|
57
|
-
|
|
57
|
+
J,
|
|
58
58
|
{
|
|
59
59
|
...e,
|
|
60
|
-
svg:
|
|
60
|
+
svg: Z
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
63
|
j.displayName = "IconHome";
|
|
64
|
-
const
|
|
64
|
+
const C = P.bind(E), $ = "purpur-icon", T = "md", k = (e) => e.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), z = ({ content: e = "", title: u } = {}) => {
|
|
65
65
|
const n = [
|
|
66
66
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
67
67
|
{ name: "fill", value: "currentColor" },
|
|
68
68
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
69
69
|
u ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
70
70
|
], a = u ? `<title>${u}</title>` : "";
|
|
71
|
-
return `<svg ${
|
|
72
|
-
}, F = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
71
|
+
return `<svg ${k(n)}>${a}${e}</svg>`;
|
|
72
|
+
}, F = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), J = ({
|
|
73
73
|
["data-testid"]: e,
|
|
74
74
|
svg: u,
|
|
75
75
|
allyTitle: n,
|
|
76
76
|
className: a,
|
|
77
|
-
size: i =
|
|
77
|
+
size: i = T,
|
|
78
78
|
...r
|
|
79
79
|
}) => {
|
|
80
80
|
const t = z({
|
|
81
81
|
content: F(u.svg),
|
|
82
82
|
title: n
|
|
83
|
-
}), s =
|
|
83
|
+
}), s = C(a, $, `${$}--${i}`);
|
|
84
84
|
return /* @__PURE__ */ o(
|
|
85
85
|
"span",
|
|
86
86
|
{
|
|
@@ -131,8 +131,8 @@ var I = { exports: {} };
|
|
|
131
131
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
132
132
|
})();
|
|
133
133
|
})(I);
|
|
134
|
-
var
|
|
135
|
-
const O = /* @__PURE__ */ D(
|
|
134
|
+
var U = I.exports;
|
|
135
|
+
const O = /* @__PURE__ */ D(U), p = {
|
|
136
136
|
"purpur-breadcrumbs": "_purpur-breadcrumbs_3f81v_1",
|
|
137
137
|
"purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_3f81v_21",
|
|
138
138
|
"purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_3f81v_35",
|
|
@@ -142,16 +142,16 @@ const O = /* @__PURE__ */ D(J), p = {
|
|
|
142
142
|
"purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_3f81v_70",
|
|
143
143
|
"purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_3f81v_92",
|
|
144
144
|
"purpur-breadcrumb-item__separator": "_purpur-breadcrumb-item__separator_3f81v_95"
|
|
145
|
-
},
|
|
145
|
+
}, V = (e, u, n) => ({
|
|
146
146
|
"@type": "ListItem",
|
|
147
147
|
position: n,
|
|
148
148
|
name: e,
|
|
149
149
|
item: u
|
|
150
|
-
}),
|
|
150
|
+
}), X = (e) => JSON.stringify({
|
|
151
151
|
"@context": "https://schema.org",
|
|
152
152
|
"@type": "BreadcrumbList",
|
|
153
153
|
itemListElement: e
|
|
154
|
-
}),
|
|
154
|
+
}), v = "purpur-breadcrumbs", h = "purpur-breadcrumb-item", Y = ({
|
|
155
155
|
["data-testid"]: e,
|
|
156
156
|
ariaLabel: u,
|
|
157
157
|
children: n,
|
|
@@ -161,24 +161,24 @@ const O = /* @__PURE__ */ D(J), p = {
|
|
|
161
161
|
}) => {
|
|
162
162
|
const t = O([
|
|
163
163
|
a,
|
|
164
|
-
p[
|
|
165
|
-
p[`${
|
|
166
|
-
]), s = w.count(n), l = [], m = w.map(n, (d,
|
|
167
|
-
const y =
|
|
168
|
-
let _ = null,
|
|
169
|
-
return typeof f == "string" ? (_ = f,
|
|
170
|
-
current:
|
|
164
|
+
p[v],
|
|
165
|
+
p[`${v}--${r ? "negative" : "default"}`]
|
|
166
|
+
]), s = w.count(n), l = [], m = w.map(n, (d, L) => {
|
|
167
|
+
const y = L + 1, q = s === y, f = d.props.children, c = typeof f == "string" ? null : f.props;
|
|
168
|
+
let _ = null, b = null;
|
|
169
|
+
return typeof f == "string" ? (_ = f, b = d.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (_ = c.children, b = c.href), _ && b && l.push(V(_, b, y)), N(d, {
|
|
170
|
+
current: q,
|
|
171
171
|
negative: r,
|
|
172
172
|
...y === 1 && {
|
|
173
|
-
children: /* @__PURE__ */ x(
|
|
174
|
-
/* @__PURE__ */ o("span", { className: p[`${
|
|
173
|
+
children: /* @__PURE__ */ x(M, { children: [
|
|
174
|
+
/* @__PURE__ */ o("span", { className: p[`${v}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(j, { size: "xs" }) }),
|
|
175
175
|
d.props.children
|
|
176
176
|
] })
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
}), g = l.length === s ?
|
|
179
|
+
}), g = l.length === s ? X(l) : null;
|
|
180
180
|
return /* @__PURE__ */ x("nav", { "data-testid": e, "aria-label": u || "Breadcrumb", className: t, children: [
|
|
181
|
-
/* @__PURE__ */ o("ol", { className: p[`${
|
|
181
|
+
/* @__PURE__ */ o("ol", { className: p[`${v}__list`], children: m }),
|
|
182
182
|
i && g ? /* @__PURE__ */ o(
|
|
183
183
|
"script",
|
|
184
184
|
{
|
|
@@ -188,7 +188,7 @@ const O = /* @__PURE__ */ D(J), p = {
|
|
|
188
188
|
}
|
|
189
189
|
) : null
|
|
190
190
|
] });
|
|
191
|
-
},
|
|
191
|
+
}, K = ({
|
|
192
192
|
href: e,
|
|
193
193
|
["data-testid"]: u,
|
|
194
194
|
children: n,
|
|
@@ -211,7 +211,7 @@ const O = /* @__PURE__ */ D(J), p = {
|
|
|
211
211
|
"aria-current": a ? "page" : void 0,
|
|
212
212
|
onClick: r
|
|
213
213
|
};
|
|
214
|
-
return e || typeof n == "string" ?
|
|
214
|
+
return e || typeof n == "string" ? B("a", m, n) : N(n, {
|
|
215
215
|
...m,
|
|
216
216
|
...n.props
|
|
217
217
|
});
|
|
@@ -219,9 +219,9 @@ const O = /* @__PURE__ */ D(J), p = {
|
|
|
219
219
|
a ? null : /* @__PURE__ */ o("span", { "aria-hidden": !0, className: p[`${h}__separator`], children: "/" })
|
|
220
220
|
] });
|
|
221
221
|
};
|
|
222
|
-
|
|
222
|
+
Y.Item = K;
|
|
223
223
|
export {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
Y as Breadcrumbs,
|
|
225
|
+
K as BreadcrumbsItem
|
|
226
226
|
};
|
|
227
227
|
//# sourceMappingURL=breadcrumbs.es.js.map
|