@purpurds/breadcrumbs 5.35.0 → 6.0.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,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as $, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { Children as N, cloneElement as j, createElement as E } from "react";
|
|
3
|
-
function Z(
|
|
4
|
-
return
|
|
3
|
+
function Z(e) {
|
|
4
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5
5
|
}
|
|
6
6
|
var I = { exports: {} };
|
|
7
7
|
/*!
|
|
@@ -9,13 +9,13 @@ var I = { exports: {} };
|
|
|
9
9
|
Licensed under the MIT License (MIT), see
|
|
10
10
|
http://jedwatson.github.io/classnames
|
|
11
11
|
*/
|
|
12
|
-
(function(
|
|
12
|
+
(function(e) {
|
|
13
13
|
(function() {
|
|
14
14
|
var s = {}.hasOwnProperty;
|
|
15
15
|
function n() {
|
|
16
|
-
for (var r = "",
|
|
17
|
-
var u = arguments[
|
|
18
|
-
u && (r =
|
|
16
|
+
for (var r = "", t = 0; t < arguments.length; t++) {
|
|
17
|
+
var u = arguments[t];
|
|
18
|
+
u && (r = o(r, a.call(this, u)));
|
|
19
19
|
}
|
|
20
20
|
return r;
|
|
21
21
|
}
|
|
@@ -28,15 +28,15 @@ var I = { exports: {} };
|
|
|
28
28
|
return n.apply(this, r);
|
|
29
29
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
30
30
|
return r.toString();
|
|
31
|
-
var
|
|
31
|
+
var t = "";
|
|
32
32
|
for (var u in r)
|
|
33
|
-
s.call(r, u) && r[u] && (
|
|
34
|
-
return
|
|
33
|
+
s.call(r, u) && r[u] && (t = o(t, this && this[u] || u));
|
|
34
|
+
return t;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function o(r, t) {
|
|
37
|
+
return t ? r ? r + " " + t : r + t : r;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
40
40
|
})();
|
|
41
41
|
})(I);
|
|
42
42
|
var C = I.exports;
|
|
@@ -48,67 +48,61 @@ const T = /* @__PURE__ */ Z(C), k = {
|
|
|
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
|
-
}, z = {
|
|
52
|
-
name: "home",
|
|
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
|
-
keywords: ["home"],
|
|
55
|
-
category: "buildings"
|
|
56
|
-
}, O = (t) => /* @__PURE__ */ o(
|
|
57
|
-
L,
|
|
58
|
-
{
|
|
59
|
-
...t,
|
|
60
|
-
svg: z
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
O.displayName = "IconHome";
|
|
64
|
-
const F = T.bind(k), S = "purpur-icon", J = "md", D = (t) => t.filter((s) => Object.keys(s).length >= 1).map((s) => `${s.name}="${s.value}"`).join(" "), U = ({ content: t = "", title: s } = {}) => {
|
|
51
|
+
}, z = T.bind(k), S = "purpur-icon", F = "md", D = (e) => e.filter((s) => Object.keys(s).length >= 1).map((s) => `${s.name}="${s.value}"`).join(" "), J = ({ content: e = "", title: s } = {}) => {
|
|
65
52
|
const n = [
|
|
66
53
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
67
54
|
{ name: "fill", value: "currentColor" },
|
|
68
55
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
69
56
|
s ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
70
57
|
], a = s ? `<title>${s}</title>` : "";
|
|
71
|
-
return `<svg ${D(n)}>${a}${
|
|
72
|
-
}, V = (
|
|
73
|
-
["data-testid"]:
|
|
58
|
+
return `<svg ${D(n)}>${a}${e}</svg>`;
|
|
59
|
+
}, V = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), O = ({
|
|
60
|
+
["data-testid"]: e,
|
|
74
61
|
svg: s,
|
|
75
62
|
allyTitle: n,
|
|
76
63
|
className: a,
|
|
77
|
-
size:
|
|
64
|
+
size: o = F,
|
|
78
65
|
...r
|
|
79
66
|
}) => {
|
|
80
|
-
const
|
|
67
|
+
const t = J({
|
|
81
68
|
content: V(s.svg),
|
|
82
69
|
title: n
|
|
83
|
-
}), u =
|
|
84
|
-
return /* @__PURE__ */
|
|
70
|
+
}), u = z(a, S, `${S}--${o}`);
|
|
71
|
+
return /* @__PURE__ */ i(
|
|
85
72
|
"span",
|
|
86
73
|
{
|
|
87
74
|
"aria-label": n,
|
|
88
75
|
className: u,
|
|
89
|
-
"data-testid":
|
|
90
|
-
dangerouslySetInnerHTML: { __html:
|
|
76
|
+
"data-testid": e,
|
|
77
|
+
dangerouslySetInnerHTML: { __html: t },
|
|
91
78
|
...r
|
|
92
79
|
}
|
|
93
80
|
);
|
|
94
81
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
O.displayName = "Icon";
|
|
83
|
+
const K = {
|
|
84
|
+
name: "home",
|
|
85
|
+
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>',
|
|
86
|
+
keywords: ["home"],
|
|
87
|
+
category: "buildings"
|
|
88
|
+
}, q = (e) => /* @__PURE__ */ i(O, { ...e, svg: K });
|
|
89
|
+
q.displayName = "IconHome";
|
|
90
|
+
function Q(e) {
|
|
91
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
98
92
|
}
|
|
99
|
-
var
|
|
93
|
+
var L = { exports: {} };
|
|
100
94
|
/*!
|
|
101
95
|
Copyright (c) 2018 Jed Watson.
|
|
102
96
|
Licensed under the MIT License (MIT), see
|
|
103
97
|
http://jedwatson.github.io/classnames
|
|
104
98
|
*/
|
|
105
|
-
(function(
|
|
99
|
+
(function(e) {
|
|
106
100
|
(function() {
|
|
107
101
|
var s = {}.hasOwnProperty;
|
|
108
102
|
function n() {
|
|
109
|
-
for (var r = "",
|
|
110
|
-
var u = arguments[
|
|
111
|
-
u && (r =
|
|
103
|
+
for (var r = "", t = 0; t < arguments.length; t++) {
|
|
104
|
+
var u = arguments[t];
|
|
105
|
+
u && (r = o(r, a(u)));
|
|
112
106
|
}
|
|
113
107
|
return r;
|
|
114
108
|
}
|
|
@@ -121,19 +115,19 @@ var q = { exports: {} };
|
|
|
121
115
|
return n.apply(null, r);
|
|
122
116
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
123
117
|
return r.toString();
|
|
124
|
-
var
|
|
118
|
+
var t = "";
|
|
125
119
|
for (var u in r)
|
|
126
|
-
s.call(r, u) && r[u] && (
|
|
127
|
-
return
|
|
120
|
+
s.call(r, u) && r[u] && (t = o(t, u));
|
|
121
|
+
return t;
|
|
128
122
|
}
|
|
129
|
-
function
|
|
130
|
-
return
|
|
123
|
+
function o(r, t) {
|
|
124
|
+
return t ? r ? r + " " + t : r + t : r;
|
|
131
125
|
}
|
|
132
|
-
|
|
126
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
133
127
|
})();
|
|
134
|
-
})(
|
|
135
|
-
var
|
|
136
|
-
const M = /* @__PURE__ */
|
|
128
|
+
})(L);
|
|
129
|
+
var R = L.exports;
|
|
130
|
+
const M = /* @__PURE__ */ Q(R), p = {
|
|
137
131
|
"purpur-breadcrumbs": "_purpur-breadcrumbs_1xh80_1",
|
|
138
132
|
"purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_1xh80_20",
|
|
139
133
|
"purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_1xh80_34",
|
|
@@ -142,54 +136,54 @@ const M = /* @__PURE__ */ X(Y), l = {
|
|
|
142
136
|
"purpur-breadcrumb-item": "_purpur-breadcrumb-item_1xh80_67",
|
|
143
137
|
"purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_1xh80_72",
|
|
144
138
|
"purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_1xh80_94"
|
|
145
|
-
},
|
|
139
|
+
}, U = (e, s, n) => ({
|
|
146
140
|
"@type": "ListItem",
|
|
147
141
|
position: n,
|
|
148
|
-
name:
|
|
142
|
+
name: e,
|
|
149
143
|
item: s
|
|
150
|
-
}),
|
|
144
|
+
}), W = (e) => JSON.stringify({
|
|
151
145
|
"@context": "https://schema.org",
|
|
152
146
|
"@type": "BreadcrumbList",
|
|
153
|
-
itemListElement:
|
|
154
|
-
}), h = "purpur-breadcrumbs", y = "purpur-breadcrumb-item",
|
|
155
|
-
["data-testid"]:
|
|
147
|
+
itemListElement: e
|
|
148
|
+
}), h = "purpur-breadcrumbs", y = "purpur-breadcrumb-item", X = ({
|
|
149
|
+
["data-testid"]: e,
|
|
156
150
|
ariaLabel: s,
|
|
157
151
|
children: n,
|
|
158
152
|
className: a,
|
|
159
|
-
meta:
|
|
153
|
+
meta: o = !0,
|
|
160
154
|
negative: r = !1,
|
|
161
|
-
highlightLast:
|
|
155
|
+
highlightLast: t = !0,
|
|
162
156
|
hideHomeIcon: u,
|
|
163
157
|
...x
|
|
164
158
|
}) => {
|
|
165
|
-
const
|
|
159
|
+
const l = M([
|
|
166
160
|
a,
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
p[h],
|
|
162
|
+
p[`${h}--${r ? "negative" : "default"}`]
|
|
169
163
|
]), b = N.count(n), v = [], B = N.map(n, (m, H) => {
|
|
170
|
-
const g = H + 1,
|
|
164
|
+
const g = H + 1, P = t && b === g, d = m.props.children, c = typeof d == "string" ? null : d.props;
|
|
171
165
|
let f = null, _ = null;
|
|
172
|
-
return typeof d == "string" ? (f = d, _ = m.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (f = c.children, _ = c.href), f && _ && v.push(
|
|
173
|
-
current:
|
|
166
|
+
return typeof d == "string" ? (f = d, _ = m.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (f = c.children, _ = c.href), f && _ && v.push(U(f, _, g)), j(m, {
|
|
167
|
+
current: P,
|
|
174
168
|
negative: r,
|
|
175
169
|
...g === 1 && {
|
|
176
|
-
children: /* @__PURE__ */ $(
|
|
177
|
-
u ? null : /* @__PURE__ */
|
|
170
|
+
children: /* @__PURE__ */ $(A, { children: [
|
|
171
|
+
u ? null : /* @__PURE__ */ i("span", { className: p[`${h}__home`], "aria-hidden": "true", children: /* @__PURE__ */ i(q, { size: "xs" }) }),
|
|
178
172
|
m.props.children
|
|
179
173
|
] })
|
|
180
174
|
}
|
|
181
175
|
});
|
|
182
|
-
}), w = v.length === b ?
|
|
176
|
+
}), w = v.length === b ? W(v) : null;
|
|
183
177
|
return /* @__PURE__ */ $(
|
|
184
178
|
"nav",
|
|
185
179
|
{
|
|
186
|
-
"data-testid":
|
|
180
|
+
"data-testid": e,
|
|
187
181
|
"aria-label": s || "Breadcrumb",
|
|
188
|
-
className:
|
|
182
|
+
className: l,
|
|
189
183
|
...x,
|
|
190
184
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
185
|
+
/* @__PURE__ */ i("ol", { className: p[`${h}__list`], children: B }),
|
|
186
|
+
o && w ? /* @__PURE__ */ i(
|
|
193
187
|
"script",
|
|
194
188
|
{
|
|
195
189
|
type: "application/ld+json",
|
|
@@ -200,37 +194,37 @@ const M = /* @__PURE__ */ X(Y), l = {
|
|
|
200
194
|
]
|
|
201
195
|
}
|
|
202
196
|
);
|
|
203
|
-
},
|
|
204
|
-
href:
|
|
197
|
+
}, Y = ({
|
|
198
|
+
href: e,
|
|
205
199
|
["data-testid"]: s,
|
|
206
200
|
children: n,
|
|
207
201
|
current: a = !1,
|
|
208
|
-
negative:
|
|
202
|
+
negative: o = !1,
|
|
209
203
|
onClick: r,
|
|
210
|
-
...
|
|
204
|
+
...t
|
|
211
205
|
}) => {
|
|
212
206
|
const u = M(
|
|
213
|
-
[
|
|
207
|
+
[p[y], p[`${y}--${o ? "negative" : "default"}`]],
|
|
214
208
|
{
|
|
215
|
-
[
|
|
209
|
+
[p[`${y}--current`]]: a
|
|
216
210
|
}
|
|
217
211
|
);
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
const
|
|
220
|
-
href:
|
|
212
|
+
return /* @__PURE__ */ i("li", { ...t, className: u, children: (() => {
|
|
213
|
+
const l = {
|
|
214
|
+
href: e,
|
|
221
215
|
"data-testid": s,
|
|
222
216
|
"aria-current": a ? "page" : void 0,
|
|
223
217
|
onClick: r
|
|
224
218
|
};
|
|
225
|
-
return
|
|
226
|
-
...
|
|
219
|
+
return e || typeof n == "string" ? E("a", l, n) : j(n, {
|
|
220
|
+
...l,
|
|
227
221
|
...n.props
|
|
228
222
|
});
|
|
229
223
|
})() });
|
|
230
224
|
};
|
|
231
|
-
|
|
225
|
+
X.Item = Y;
|
|
232
226
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
X as Breadcrumbs,
|
|
228
|
+
Y as BreadcrumbsItem
|
|
235
229
|
};
|
|
236
230
|
//# sourceMappingURL=breadcrumbs.es.js.map
|