@purpurds/breadcrumbs 5.4.2 → 5.5.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/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Name: @purpurds/icon
2
- Version: 5.4.1
2
+ Version: 5.4.3
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
@@ -6,5 +6,5 @@
6
6
  Copyright (c) 2018 Jed Watson.
7
7
  Licensed under the MIT License (MIT), see
8
8
  http://jedwatson.github.io/classnames
9
- */(function(e){(function(){var u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=i(r,a(n)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var n in r)u.call(r,n)&&r[n]&&(t=i(t,n));return t}function i(r,t){return t?r?r+" "+t:r+t:r}e.exports?(s.default=s,e.exports=s):window.classNames=s})()})($);var F=$.exports;const N=D(F),p={"purpur-breadcrumbs":"_purpur-breadcrumbs_11sb5_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_11sb5_18","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_11sb5_32","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_11sb5_46","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_11sb5_54","purpur-breadcrumb-item":"_purpur-breadcrumb-item_11sb5_64","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_11sb5_67","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_11sb5_87","purpur-breadcrumb-item__separator":"_purpur-breadcrumb-item__separator_11sb5_90"},R=(e,u,s)=>({"@type":"ListItem",position:s,name:e,item:u}),V=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),v="purpur-breadcrumbs",g="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:i=!0,negative:r=!1})=>{const t=N([a,p[v],p[`${v}--${r?"negative":"default"}`]]),n=m.Children.count(s),l=[],d=m.Children.map(s,(_,I)=>{const x=I+1,q=n===x,b=_.props.children,o=typeof b=="string"?null:b.props;let f=null,h=null;return typeof b=="string"?(f=b,h=_.props.href):o!=null&&o.children&&typeof(o==null?void 0:o.children)=="string"&&(f=o.children,h=o.href),f&&h&&l.push(R(f,h,x)),m.cloneElement(_,{current:q,negative:r,...x===1&&{children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:p[`${v}__home`],"aria-hidden":"true",children:c.jsx(S,{size:"xs"})}),_.props.children]})}})}),y=l.length===n?V(l):null;return c.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[c.jsx("ol",{className:p[`${v}__list`],children:d}),i&&y?c.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:y}}):null]})},k=({href:e,["data-testid"]:u,children:s,current:a=!1,negative:i=!1,onClick:r,...t})=>{const n=N([p[g],p[`${g}--${i?"negative":"default"}`]],{[p[`${g}--current`]]:a}),l=()=>{const d={href:e,"data-testid":u,"aria-current":a?"page":void 0,onClick:r};return e||typeof s=="string"?m.createElement("a",d,s):m.cloneElement(s,{...d,...s.props})};return c.jsxs("li",{...t,className:n,children:[l(),a?null:c.jsx("span",{"aria-hidden":!0,className:p[`${g}__separator`],children:"/"})]})};O.Item=k;exports.Breadcrumbs=O;
9
+ */(function(e){(function(){var u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=i(r,a(n)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var n in r)u.call(r,n)&&r[n]&&(t=i(t,n));return t}function i(r,t){return t?r?r+" "+t:r+t:r}e.exports?(s.default=s,e.exports=s):window.classNames=s})()})($);var F=$.exports;const N=D(F),p={"purpur-breadcrumbs":"_purpur-breadcrumbs_3f81v_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_3f81v_21","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_3f81v_35","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_3f81v_49","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_3f81v_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_3f81v_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_3f81v_70","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_3f81v_92","purpur-breadcrumb-item__separator":"_purpur-breadcrumb-item__separator_3f81v_95"},R=(e,u,s)=>({"@type":"ListItem",position:s,name:e,item:u}),V=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),h="purpur-breadcrumbs",g="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:i=!0,negative:r=!1})=>{const t=N([a,p[h],p[`${h}--${r?"negative":"default"}`]]),n=m.Children.count(s),l=[],d=m.Children.map(s,(_,I)=>{const x=I+1,q=n===x,f=_.props.children,o=typeof f=="string"?null:f.props;let b=null,v=null;return typeof f=="string"?(b=f,v=_.props.href):o!=null&&o.children&&typeof(o==null?void 0:o.children)=="string"&&(b=o.children,v=o.href),b&&v&&l.push(R(b,v,x)),m.cloneElement(_,{current:q,negative:r,...x===1&&{children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:p[`${h}__home`],"aria-hidden":"true",children:c.jsx(S,{size:"xs"})}),_.props.children]})}})}),y=l.length===n?V(l):null;return c.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[c.jsx("ol",{className:p[`${h}__list`],children:d}),i&&y?c.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:y}}):null]})},k=({href:e,["data-testid"]:u,children:s,current:a=!1,negative:i=!1,onClick:r,...t})=>{const n=N([p[g],p[`${g}--${i?"negative":"default"}`]],{[p[`${g}--current`]]:a}),l=()=>{const d={href:e,"data-testid":u,"aria-current":a?"page":void 0,onClick:r};return e||typeof s=="string"?m.createElement("a",d,s):m.cloneElement(s,{...d,...s.props})};return c.jsxs("li",{...t,className:n,children:[l(),a?null:c.jsx("span",{"aria-hidden":!0,className:p[`${g}__separator`],children:"/"})]})};O.Item=k;exports.Breadcrumbs=O;
10
10
  //# sourceMappingURL=breadcrumbs.cjs.js.map
@@ -12,10 +12,10 @@ var S = { exports: {} };
12
12
  (function(e) {
13
13
  (function() {
14
14
  var u = {}.hasOwnProperty;
15
- function s() {
15
+ function n() {
16
16
  for (var r = "", t = 0; t < arguments.length; t++) {
17
- var n = arguments[t];
18
- n && (r = i(r, a.call(this, n)));
17
+ var s = arguments[t];
18
+ s && (r = i(r, a.call(this, s)));
19
19
  }
20
20
  return r;
21
21
  }
@@ -25,18 +25,18 @@ var S = { exports: {} };
25
25
  if (typeof r != "object")
26
26
  return "";
27
27
  if (Array.isArray(r))
28
- return s.apply(this, r);
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
31
  var t = "";
32
- for (var n in r)
33
- u.call(r, n) && r[n] && (t = i(t, this && this[n] || n));
32
+ for (var s in r)
33
+ u.call(r, s) && r[s] && (t = i(t, this && this[s] || s));
34
34
  return t;
35
35
  }
36
36
  function i(r, t) {
37
37
  return t ? r ? r + " " + t : r + t : r;
38
38
  }
39
- e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
39
+ e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
40
40
  })();
41
41
  })(S);
42
42
  var B = S.exports;
@@ -62,30 +62,30 @@ const P = /* @__PURE__ */ H(B), A = {
62
62
  );
63
63
  j.displayName = "IconHome";
64
64
  const z = P.bind(A), $ = "purpur-icon", C = "md", T = (e) => e.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), k = ({ content: e = "", title: u } = {}) => {
65
- const s = [
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 ${T(s)}>${a}${e}</svg>`;
71
+ return `<svg ${T(n)}>${a}${e}</svg>`;
72
72
  }, D = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), F = ({
73
73
  ["data-testid"]: e,
74
74
  svg: u,
75
- allyTitle: s,
75
+ allyTitle: n,
76
76
  className: a = "",
77
77
  size: i = C,
78
78
  ...r
79
79
  }) => {
80
80
  const t = k({
81
81
  content: D(u.svg),
82
- title: s
83
- }), n = z(a, $, `${$}--${i}`);
82
+ title: n
83
+ }), s = z(a, $, `${$}--${i}`);
84
84
  return /* @__PURE__ */ o(
85
85
  "span",
86
86
  {
87
- "aria-label": s,
88
- className: n,
87
+ "aria-label": n,
88
+ className: s,
89
89
  "data-testid": e,
90
90
  dangerouslySetInnerHTML: { __html: t },
91
91
  ...r
@@ -104,10 +104,10 @@ var I = { exports: {} };
104
104
  (function(e) {
105
105
  (function() {
106
106
  var u = {}.hasOwnProperty;
107
- function s() {
107
+ function n() {
108
108
  for (var r = "", t = 0; t < arguments.length; t++) {
109
- var n = arguments[t];
110
- n && (r = i(r, a(n)));
109
+ var s = arguments[t];
110
+ s && (r = i(r, a(s)));
111
111
  }
112
112
  return r;
113
113
  }
@@ -117,68 +117,68 @@ var I = { exports: {} };
117
117
  if (typeof r != "object")
118
118
  return "";
119
119
  if (Array.isArray(r))
120
- return s.apply(null, r);
120
+ return n.apply(null, r);
121
121
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
122
122
  return r.toString();
123
123
  var t = "";
124
- for (var n in r)
125
- u.call(r, n) && r[n] && (t = i(t, n));
124
+ for (var s in r)
125
+ u.call(r, s) && r[s] && (t = i(t, s));
126
126
  return t;
127
127
  }
128
128
  function i(r, t) {
129
129
  return t ? r ? r + " " + t : r + t : r;
130
130
  }
131
- e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
131
+ e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
132
132
  })();
133
133
  })(I);
134
134
  var J = I.exports;
135
135
  const O = /* @__PURE__ */ V(J), c = {
136
- "purpur-breadcrumbs": "_purpur-breadcrumbs_11sb5_1",
137
- "purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_11sb5_18",
138
- "purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_11sb5_32",
139
- "purpur-breadcrumbs__list": "_purpur-breadcrumbs__list_11sb5_46",
140
- "purpur-breadcrumbs__home": "_purpur-breadcrumbs__home_11sb5_54",
141
- "purpur-breadcrumb-item": "_purpur-breadcrumb-item_11sb5_64",
142
- "purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_11sb5_67",
143
- "purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_11sb5_87",
144
- "purpur-breadcrumb-item__separator": "_purpur-breadcrumb-item__separator_11sb5_90"
145
- }, R = (e, u, s) => ({
136
+ "purpur-breadcrumbs": "_purpur-breadcrumbs_3f81v_1",
137
+ "purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_3f81v_21",
138
+ "purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_3f81v_35",
139
+ "purpur-breadcrumbs__list": "_purpur-breadcrumbs__list_3f81v_49",
140
+ "purpur-breadcrumbs__home": "_purpur-breadcrumbs__home_3f81v_57",
141
+ "purpur-breadcrumb-item": "_purpur-breadcrumb-item_3f81v_67",
142
+ "purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_3f81v_70",
143
+ "purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_3f81v_92",
144
+ "purpur-breadcrumb-item__separator": "_purpur-breadcrumb-item__separator_3f81v_95"
145
+ }, R = (e, u, n) => ({
146
146
  "@type": "ListItem",
147
- position: s,
147
+ position: n,
148
148
  name: e,
149
149
  item: u
150
150
  }), K = (e) => JSON.stringify({
151
151
  "@context": "https://schema.org",
152
152
  "@type": "BreadcrumbList",
153
153
  itemListElement: e
154
- }), h = "purpur-breadcrumbs", v = "purpur-breadcrumb-item", Q = ({
154
+ }), b = "purpur-breadcrumbs", h = "purpur-breadcrumb-item", Q = ({
155
155
  ["data-testid"]: e,
156
156
  ariaLabel: u,
157
- children: s,
157
+ children: n,
158
158
  className: a,
159
159
  meta: i = !0,
160
160
  negative: r = !1
161
161
  }) => {
162
162
  const t = O([
163
163
  a,
164
- c[h],
165
- c[`${h}--${r ? "negative" : "default"}`]
166
- ]), n = w.count(s), l = [], m = w.map(s, (d, M) => {
167
- const y = M + 1, q = n === y, _ = d.props.children, p = typeof _ == "string" ? null : _.props;
168
- let b = null, f = null;
169
- return typeof _ == "string" ? (b = _, f = d.props.href) : p != null && p.children && typeof (p == null ? void 0 : p.children) == "string" && (b = p.children, f = p.href), b && f && l.push(R(b, f, y)), N(d, {
164
+ c[b],
165
+ c[`${b}--${r ? "negative" : "default"}`]
166
+ ]), s = w.count(n), l = [], m = w.map(n, (d, M) => {
167
+ const y = M + 1, q = s === y, _ = d.props.children, p = typeof _ == "string" ? null : _.props;
168
+ let f = null, v = null;
169
+ return typeof _ == "string" ? (f = _, v = d.props.href) : p != null && p.children && typeof (p == null ? void 0 : p.children) == "string" && (f = p.children, v = p.href), f && v && l.push(R(f, v, y)), N(d, {
170
170
  current: q,
171
171
  negative: r,
172
172
  ...y === 1 && {
173
173
  children: /* @__PURE__ */ x(L, { children: [
174
- /* @__PURE__ */ o("span", { className: c[`${h}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(j, { size: "xs" }) }),
174
+ /* @__PURE__ */ o("span", { className: c[`${b}__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 === n ? K(l) : null;
179
+ }), g = l.length === s ? K(l) : null;
180
180
  return /* @__PURE__ */ x("nav", { "data-testid": e, "aria-label": u || "Breadcrumb", className: t, children: [
181
- /* @__PURE__ */ o("ol", { className: c[`${h}__list`], children: m }),
181
+ /* @__PURE__ */ o("ol", { className: c[`${b}__list`], children: m }),
182
182
  i && g ? /* @__PURE__ */ o(
183
183
  "script",
184
184
  {
@@ -191,19 +191,19 @@ const O = /* @__PURE__ */ V(J), c = {
191
191
  }, U = ({
192
192
  href: e,
193
193
  ["data-testid"]: u,
194
- children: s,
194
+ children: n,
195
195
  current: a = !1,
196
196
  negative: i = !1,
197
197
  onClick: r,
198
198
  ...t
199
199
  }) => {
200
- const n = O(
201
- [c[v], c[`${v}--${i ? "negative" : "default"}`]],
200
+ const s = O(
201
+ [c[h], c[`${h}--${i ? "negative" : "default"}`]],
202
202
  {
203
- [c[`${v}--current`]]: a
203
+ [c[`${h}--current`]]: a
204
204
  }
205
205
  );
206
- return /* @__PURE__ */ x("li", { ...t, className: n, children: [
206
+ return /* @__PURE__ */ x("li", { ...t, className: s, children: [
207
207
  (() => {
208
208
  const m = {
209
209
  href: e,
@@ -211,12 +211,12 @@ const O = /* @__PURE__ */ V(J), c = {
211
211
  "aria-current": a ? "page" : void 0,
212
212
  onClick: r
213
213
  };
214
- return e || typeof s == "string" ? E("a", m, s) : N(s, {
214
+ return e || typeof n == "string" ? E("a", m, n) : N(n, {
215
215
  ...m,
216
- ...s.props
216
+ ...n.props
217
217
  });
218
218
  })(),
219
- a ? null : /* @__PURE__ */ o("span", { "aria-hidden": !0, className: c[`${v}__separator`], children: "/" })
219
+ a ? null : /* @__PURE__ */ o("span", { "aria-hidden": !0, className: c[`${h}__separator`], children: "/" })
220
220
  ] });
221
221
  };
222
222
  Q.Item = U;