@purpurds/breadcrumbs 5.28.2 → 5.28.3

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.28.1
2
+ Version: 5.28.2
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react");function H(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),m=require("react");function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */(function(e){(function(){var n={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=i(r,a.call(this,u)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)n.call(r,u)&&r[u]&&(t=i(t,this&&this[u]||u));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 P=$.exports;const A=H(P),E={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},C={name:"home",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>',keywords:["home"],category:"buildings"},N=e=>c.jsx(S,{...e,svg:C});N.displayName="IconHome";const T=A.bind(E),w="purpur-icon",Z="md",z=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),F=({content:e="",title:n}={})=>{const s=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},n?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=n?`<title>${n}</title>`:"";return`<svg ${z(s)}>${a}${e}</svg>`},J=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),S=({["data-testid"]:e,svg:n,allyTitle:s,className:a,size:i=Z,...r})=>{const t=F({content:J(n.svg),title:s}),u=T(a,w,`${w}--${i}`);return c.jsx("span",{"aria-label":s,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};S.displayName="Icon";function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I={exports:{}};/*!
5
+ */(function(e){(function(){var n={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=c(r,a.call(this,u)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)n.call(r,u)&&r[u]&&(t=c(t,this&&this[u]||u));return t}function c(r,t){return t?r?r+" "+t:r+t:r}e.exports?(s.default=s,e.exports=s):window.classNames=s})()})(S);var A=S.exports;const E=P(A),C={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},T={name:"home",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>',keywords:["home"],category:"buildings"},$=e=>i.jsx(N,{...e,svg:T});$.displayName="IconHome";const Z=E.bind(C),w="purpur-icon",z="md",F=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),J=({content:e="",title:n}={})=>{const s=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},n?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=n?`<title>${n}</title>`:"";return`<svg ${F(s)}>${a}${e}</svg>`},k=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),N=({["data-testid"]:e,svg:n,allyTitle:s,className:a,size:c=z,...r})=>{const t=J({content:k(n.svg),title:s}),u=Z(a,w,`${w}--${c}`);return i.jsx("span",{"aria-label":s,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};N.displayName="Icon";function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I={exports:{}};/*!
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 n={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=i(r,a(u)))}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 u in r)n.call(r,u)&&r[u]&&(t=i(t,u));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})()})(I);var D=I.exports;const O=k(D),l={"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,n,s)=>({"@type":"ListItem",position:s,name:e,item:n}),U=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),h="purpur-breadcrumbs",g="purpur-breadcrumb-item",q=({["data-testid"]:e,ariaLabel:n,children:s,className:a,meta:i=!0,negative:r=!1,highlightLast:t=!0})=>{const u=O([a,l[h],l[`${h}--${r?"negative":"default"}`]]),d=m.Children.count(s),p=[],x=m.Children.map(s,(_,M)=>{const y=M+1,B=t&&d===y,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&&p.push(R(b,v,y)),m.cloneElement(_,{current:B,negative:r,...y===1&&{children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:l[`${h}__home`],"aria-hidden":"true",children:c.jsx(N,{size:"xs"})}),_.props.children]})}})}),j=p.length===d?U(p):null;return c.jsxs("nav",{"data-testid":e,"aria-label":n||"Breadcrumb",className:u,children:[c.jsx("ol",{className:l[`${h}__list`],children:x}),i&&j?c.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:j}}):null]})},L=({href:e,["data-testid"]:n,children:s,current:a=!1,negative:i=!1,onClick:r,...t})=>{const u=O([l[g],l[`${g}--${i?"negative":"default"}`]],{[l[`${g}--current`]]:a}),d=()=>{const p={href:e,"data-testid":n,"aria-current":a?"page":void 0,onClick:r};return e||typeof s=="string"?m.createElement("a",p,s):m.cloneElement(s,{...p,...s.props})};return c.jsxs("li",{...t,className:u,children:[d(),a?null:c.jsx("span",{"aria-hidden":!0,className:l[`${g}__separator`],children:"/"})]})};q.Item=L;exports.Breadcrumbs=q;exports.BreadcrumbsItem=L;
9
+ */(function(e){(function(){var n={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=c(r,a(u)))}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 u in r)n.call(r,u)&&r[u]&&(t=c(t,u));return t}function c(r,t){return t?r?r+" "+t:r+t:r}e.exports?(s.default=s,e.exports=s):window.classNames=s})()})(I);var R=I.exports;const O=D(R),l={"purpur-breadcrumbs":"_purpur-breadcrumbs_465gy_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_465gy_21","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_465gy_35","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_465gy_49","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_465gy_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_465gy_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_465gy_72","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_465gy_94"},U=(e,n,s)=>({"@type":"ListItem",position:s,name:e,item:n}),V=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),g="purpur-breadcrumbs",x="purpur-breadcrumb-item",q=({["data-testid"]:e,ariaLabel:n,children:s,className:a,meta:c=!0,negative:r=!1,highlightLast:t=!0,hideHomeIcon:u})=>{const h=O([a,l[g],l[`${g}--${r?"negative":"default"}`]]),p=m.Children.count(s),d=[],M=m.Children.map(s,(_,B)=>{const y=B+1,H=t&&p===y,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&&d.push(U(b,v,y)),m.cloneElement(_,{current:H,negative:r,...y===1&&{children:i.jsxs(i.Fragment,{children:[u?null:i.jsx("span",{className:l[`${g}__home`],"aria-hidden":"true",children:i.jsx($,{size:"xs"})}),_.props.children]})}})}),j=d.length===p?V(d):null;return i.jsxs("nav",{"data-testid":e,"aria-label":n||"Breadcrumb",className:h,children:[i.jsx("ol",{className:l[`${g}__list`],children:M}),c&&j?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:j}}):null]})},L=({href:e,["data-testid"]:n,children:s,current:a=!1,negative:c=!1,onClick:r,...t})=>{const u=O([l[x],l[`${x}--${c?"negative":"default"}`]],{[l[`${x}--current`]]:a}),h=()=>{const p={href:e,"data-testid":n,"aria-current":a?"page":void 0,onClick:r};return e||typeof s=="string"?m.createElement("a",p,s):m.cloneElement(s,{...p,...s.props})};return i.jsx("li",{...t,className:u,children:h()})};q.Item=L;exports.Breadcrumbs=q;exports.BreadcrumbsItem=L;
10
10
  //# sourceMappingURL=breadcrumbs.cjs.js.map