@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.
@@ -1,7 +1,7 @@
1
- import { jsx as o, jsxs as $, Fragment as P } from "react/jsx-runtime";
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(t) {
4
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
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(t) {
12
+ (function(e) {
13
13
  (function() {
14
14
  var s = {}.hasOwnProperty;
15
15
  function n() {
16
- for (var r = "", e = 0; e < arguments.length; e++) {
17
- var u = arguments[e];
18
- u && (r = i(r, a.call(this, u)));
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 e = "";
31
+ var t = "";
32
32
  for (var u in r)
33
- s.call(r, u) && r[u] && (e = i(e, this && this[u] || u));
34
- return e;
33
+ s.call(r, u) && r[u] && (t = o(t, this && this[u] || u));
34
+ return t;
35
35
  }
36
- function i(r, e) {
37
- return e ? r ? r + " " + e : r + e : r;
36
+ function o(r, t) {
37
+ return t ? r ? r + " " + t : r + t : r;
38
38
  }
39
- t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
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}${t}</svg>`;
72
- }, V = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), L = ({
73
- ["data-testid"]: t,
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: i = J,
64
+ size: o = F,
78
65
  ...r
79
66
  }) => {
80
- const e = U({
67
+ const t = J({
81
68
  content: V(s.svg),
82
69
  title: n
83
- }), u = F(a, S, `${S}--${i}`);
84
- return /* @__PURE__ */ o(
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": t,
90
- dangerouslySetInnerHTML: { __html: e },
76
+ "data-testid": e,
77
+ dangerouslySetInnerHTML: { __html: t },
91
78
  ...r
92
79
  }
93
80
  );
94
81
  };
95
- L.displayName = "Icon";
96
- function X(t) {
97
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
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 q = { exports: {} };
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(t) {
99
+ (function(e) {
106
100
  (function() {
107
101
  var s = {}.hasOwnProperty;
108
102
  function n() {
109
- for (var r = "", e = 0; e < arguments.length; e++) {
110
- var u = arguments[e];
111
- u && (r = i(r, a(u)));
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 e = "";
118
+ var t = "";
125
119
  for (var u in r)
126
- s.call(r, u) && r[u] && (e = i(e, u));
127
- return e;
120
+ s.call(r, u) && r[u] && (t = o(t, u));
121
+ return t;
128
122
  }
129
- function i(r, e) {
130
- return e ? r ? r + " " + e : r + e : r;
123
+ function o(r, t) {
124
+ return t ? r ? r + " " + t : r + t : r;
131
125
  }
132
- t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
126
+ e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
133
127
  })();
134
- })(q);
135
- var Y = q.exports;
136
- const M = /* @__PURE__ */ X(Y), l = {
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
- }, K = (t, s, n) => ({
139
+ }, U = (e, s, n) => ({
146
140
  "@type": "ListItem",
147
141
  position: n,
148
- name: t,
142
+ name: e,
149
143
  item: s
150
- }), Q = (t) => JSON.stringify({
144
+ }), W = (e) => JSON.stringify({
151
145
  "@context": "https://schema.org",
152
146
  "@type": "BreadcrumbList",
153
- itemListElement: t
154
- }), h = "purpur-breadcrumbs", y = "purpur-breadcrumb-item", R = ({
155
- ["data-testid"]: t,
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: i = !0,
153
+ meta: o = !0,
160
154
  negative: r = !1,
161
- highlightLast: e = !0,
155
+ highlightLast: t = !0,
162
156
  hideHomeIcon: u,
163
157
  ...x
164
158
  }) => {
165
- const p = M([
159
+ const l = M([
166
160
  a,
167
- l[h],
168
- l[`${h}--${r ? "negative" : "default"}`]
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, A = e && b === g, d = m.props.children, c = typeof d == "string" ? null : d.props;
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(K(f, _, g)), j(m, {
173
- current: A,
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__ */ $(P, { children: [
177
- u ? null : /* @__PURE__ */ o("span", { className: l[`${h}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(O, { size: "xs" }) }),
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 ? Q(v) : null;
176
+ }), w = v.length === b ? W(v) : null;
183
177
  return /* @__PURE__ */ $(
184
178
  "nav",
185
179
  {
186
- "data-testid": t,
180
+ "data-testid": e,
187
181
  "aria-label": s || "Breadcrumb",
188
- className: p,
182
+ className: l,
189
183
  ...x,
190
184
  children: [
191
- /* @__PURE__ */ o("ol", { className: l[`${h}__list`], children: B }),
192
- i && w ? /* @__PURE__ */ o(
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
- }, W = ({
204
- href: t,
197
+ }, Y = ({
198
+ href: e,
205
199
  ["data-testid"]: s,
206
200
  children: n,
207
201
  current: a = !1,
208
- negative: i = !1,
202
+ negative: o = !1,
209
203
  onClick: r,
210
- ...e
204
+ ...t
211
205
  }) => {
212
206
  const u = M(
213
- [l[y], l[`${y}--${i ? "negative" : "default"}`]],
207
+ [p[y], p[`${y}--${o ? "negative" : "default"}`]],
214
208
  {
215
- [l[`${y}--current`]]: a
209
+ [p[`${y}--current`]]: a
216
210
  }
217
211
  );
218
- return /* @__PURE__ */ o("li", { ...e, className: u, children: (() => {
219
- const p = {
220
- href: t,
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 t || typeof n == "string" ? E("a", p, n) : j(n, {
226
- ...p,
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
- R.Item = W;
225
+ X.Item = Y;
232
226
  export {
233
- R as Breadcrumbs,
234
- W as BreadcrumbsItem
227
+ X as Breadcrumbs,
228
+ Y as BreadcrumbsItem
235
229
  };
236
230
  //# sourceMappingURL=breadcrumbs.es.js.map