@purpurds/breadcrumbs 5.34.4 → 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/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Name: @purpurds/icon
2
- Version: 5.34.3
2
+ Version: 5.35.0
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 i=require("react/jsx-runtime"),p=require("react");function A(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 c=require("react/jsx-runtime"),p=require("react");function E(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 s={}.hasOwnProperty;function n(){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 n.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)s.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?(n.default=n,e.exports=n):window.classNames=n})()})($);var E=$.exports;const C=A(E),T={"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"},Z={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=>i.jsx(I,{...e,svg:Z});N.displayName="IconHome";const z=C.bind(T),S="purpur-icon",F="md",J=e=>e.filter(s=>Object.keys(s).length>=1).map(s=>`${s.name}="${s.value}"`).join(" "),k=({content:e="",title:s}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},s?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=s?`<title>${s}</title>`:"";return`<svg ${J(n)}>${a}${e}</svg>`},D=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),I=({["data-testid"]:e,svg:s,allyTitle:n,className:a,size:c=F,...r})=>{const t=k({content:D(s.svg),title:n}),u=z(a,S,`${S}--${c}`);return i.jsx("span",{"aria-label":n,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};I.displayName="Icon";function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O={exports:{}};/*!
5
+ */(function(e){(function(){var s={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=o(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 n.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)s.call(r,u)&&r[u]&&(t=o(t,this&&this[u]||u));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(S);var A=S.exports;const C=E(A),T={"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"},Z=C.bind(T),$="purpur-icon",z="md",F=e=>e.filter(s=>Object.keys(s).length>=1).map(s=>`${s.name}="${s.value}"`).join(" "),k=({content:e="",title:s}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},s?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=s?`<title>${s}</title>`:"";return`<svg ${F(n)}>${a}${e}</svg>`},D=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),N=({["data-testid"]:e,svg:s,allyTitle:n,className:a,size:o=z,...r})=>{const t=k({content:D(s.svg),title:n}),u=Z(a,$,`${$}--${o}`);return c.jsx("span",{"aria-label":n,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};N.displayName="Icon";const J={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"},O=e=>c.jsx(N,{...e,svg:J});O.displayName="IconHome";function R(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 s={}.hasOwnProperty;function n(){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 n.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)s.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?(n.default=n,e.exports=n):window.classNames=n})()})(O);var U=O.exports;const q=R(U),o={"purpur-breadcrumbs":"_purpur-breadcrumbs_1xh80_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_1xh80_20","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_1xh80_34","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_1xh80_48","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_1xh80_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_1xh80_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_1xh80_72","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_1xh80_94"},V=(e,s,n)=>({"@type":"ListItem",position:n,name:e,item:s}),X=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),h="purpur-breadcrumbs",j="purpur-breadcrumb-item",L=({["data-testid"]:e,ariaLabel:s,children:n,className:a,meta:c=!0,negative:r=!1,highlightLast:t=!0,hideHomeIcon:u,...v})=>{const m=q([a,o[h],o[`${h}--${r?"negative":"default"}`]]),g=p.Children.count(n),x=[],B=p.Children.map(n,(d,H)=>{const y=H+1,P=t&&g===y,f=d.props.children,l=typeof f=="string"?null:f.props;let _=null,b=null;return typeof f=="string"?(_=f,b=d.props.href):l!=null&&l.children&&typeof(l==null?void 0:l.children)=="string"&&(_=l.children,b=l.href),_&&b&&x.push(V(_,b,y)),p.cloneElement(d,{current:P,negative:r,...y===1&&{children:i.jsxs(i.Fragment,{children:[u?null:i.jsx("span",{className:o[`${h}__home`],"aria-hidden":"true",children:i.jsx(N,{size:"xs"})}),d.props.children]})}})}),w=x.length===g?X(x):null;return i.jsxs("nav",{"data-testid":e,"aria-label":s||"Breadcrumb",className:m,...v,children:[i.jsx("ol",{className:o[`${h}__list`],children:B}),c&&w?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:w}}):null]})},M=({href:e,["data-testid"]:s,children:n,current:a=!1,negative:c=!1,onClick:r,...t})=>{const u=q([o[j],o[`${j}--${c?"negative":"default"}`]],{[o[`${j}--current`]]:a}),v=()=>{const m={href:e,"data-testid":s,"aria-current":a?"page":void 0,onClick:r};return e||typeof n=="string"?p.createElement("a",m,n):p.cloneElement(n,{...m,...n.props})};return i.jsx("li",{...t,className:u,children:v()})};L.Item=M;exports.Breadcrumbs=L;exports.BreadcrumbsItem=M;
9
+ */(function(e){(function(){var s={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=o(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 n.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)s.call(r,u)&&r[u]&&(t=o(t,u));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(I);var V=I.exports;const q=R(V),l={"purpur-breadcrumbs":"_purpur-breadcrumbs_1xh80_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_1xh80_20","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_1xh80_34","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_1xh80_48","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_1xh80_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_1xh80_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_1xh80_72","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_1xh80_94"},K=(e,s,n)=>({"@type":"ListItem",position:n,name:e,item:s}),Q=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),h="purpur-breadcrumbs",j="purpur-breadcrumb-item",M=({["data-testid"]:e,ariaLabel:s,children:n,className:a,meta:o=!0,negative:r=!1,highlightLast:t=!0,hideHomeIcon:u,...v})=>{const m=q([a,l[h],l[`${h}--${r?"negative":"default"}`]]),g=p.Children.count(n),x=[],L=p.Children.map(n,(d,H)=>{const y=H+1,P=t&&g===y,f=d.props.children,i=typeof f=="string"?null:f.props;let _=null,b=null;return typeof f=="string"?(_=f,b=d.props.href):i!=null&&i.children&&typeof(i==null?void 0:i.children)=="string"&&(_=i.children,b=i.href),_&&b&&x.push(K(_,b,y)),p.cloneElement(d,{current:P,negative:r,...y===1&&{children:c.jsxs(c.Fragment,{children:[u?null:c.jsx("span",{className:l[`${h}__home`],"aria-hidden":"true",children:c.jsx(O,{size:"xs"})}),d.props.children]})}})}),w=x.length===g?Q(x):null;return c.jsxs("nav",{"data-testid":e,"aria-label":s||"Breadcrumb",className:m,...v,children:[c.jsx("ol",{className:l[`${h}__list`],children:L}),o&&w?c.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:w}}):null]})},B=({href:e,["data-testid"]:s,children:n,current:a=!1,negative:o=!1,onClick:r,...t})=>{const u=q([l[j],l[`${j}--${o?"negative":"default"}`]],{[l[`${j}--current`]]:a}),v=()=>{const m={href:e,"data-testid":s,"aria-current":a?"page":void 0,onClick:r};return e||typeof n=="string"?p.createElement("a",m,n):p.cloneElement(n,{...m,...n.props})};return c.jsx("li",{...t,className:u,children:v()})};M.Item=B;exports.Breadcrumbs=M;exports.BreadcrumbsItem=B;
10
10
  //# sourceMappingURL=breadcrumbs.cjs.js.map