@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.
@@ -1,5 +1,5 @@
1
- import { jsx as o, jsxs as x, Fragment as L } from "react/jsx-runtime";
2
- import { Children as w, cloneElement as N, createElement as M } from "react";
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 P = S.exports;
43
- const A = /* @__PURE__ */ H(P), E = {
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
- }, T = {
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
- W,
57
+ J,
58
58
  {
59
59
  ...e,
60
- svg: T
60
+ svg: Z
61
61
  }
62
62
  );
63
63
  j.displayName = "IconHome";
64
- const Z = A.bind(E), $ = "purpur-icon", k = "md", C = (e) => e.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), z = ({ content: e = "", title: u } = {}) => {
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 ${C(n)}>${a}${e}</svg>`;
72
- }, F = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), W = ({
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 = k,
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 = Z(a, $, `${$}--${i}`);
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 J = I.exports;
135
- const O = /* @__PURE__ */ D(J), p = {
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
- }, K = (e, u, n) => ({
145
+ }, V = (e, u, n) => ({
146
146
  "@type": "ListItem",
147
147
  position: n,
148
148
  name: e,
149
149
  item: u
150
- }), V = (e) => JSON.stringify({
150
+ }), X = (e) => JSON.stringify({
151
151
  "@context": "https://schema.org",
152
152
  "@type": "BreadcrumbList",
153
153
  itemListElement: e
154
- }), b = "purpur-breadcrumbs", h = "purpur-breadcrumb-item", Q = ({
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[b],
165
- p[`${b}--${r ? "negative" : "default"}`]
166
- ]), s = w.count(n), l = [], m = w.map(n, (d, q) => {
167
- const y = q + 1, B = s === y, f = d.props.children, c = typeof f == "string" ? null : f.props;
168
- let _ = null, v = null;
169
- return typeof f == "string" ? (_ = f, v = d.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (_ = c.children, v = c.href), _ && v && l.push(K(_, v, y)), N(d, {
170
- current: B,
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(L, { children: [
174
- /* @__PURE__ */ o("span", { className: p[`${b}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(j, { size: "xs" }) }),
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 ? V(l) : null;
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[`${b}__list`], children: m }),
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
- }, R = ({
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" ? M("a", m, n) : N(n, {
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
- Q.Item = R;
222
+ Y.Item = K;
223
223
  export {
224
- Q as Breadcrumbs,
225
- R as BreadcrumbsItem
224
+ Y as Breadcrumbs,
225
+ K as BreadcrumbsItem
226
226
  };
227
227
  //# sourceMappingURL=breadcrumbs.es.js.map