@purpurds/breadcrumbs 3.1.0 → 3.3.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: 3.0.1
2
+ Version: 3.2.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"),m=require("react");function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),m=require("react");function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w={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 u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=c(r,a.call(this,n)))}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 n in r)u.call(r,n)&&r[n]&&(t=c(t,this&&this[n]||n));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})()})(w);var E=w.exports;const M=B(E),q={"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"},L={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(V,{...e,svg:L});N.displayName="IconHome";const T=M.bind(q),j="purpur-icon",C="md",R=e=>e.filter(u=>Object.keys(u).length>=1).map(u=>`${u.name}="${u.value}"`).join(" "),H=({content:e="",title:u}={})=>{const s=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},u?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=u?`<title>${u}</title>`:"";return`<svg ${R(s)}>${a}${e}</svg>`},P=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),V=({["data-testid"]:e,svg:u,allyTitle:s,className:a="",size:c=C,...r})=>{const t=H({content:P(u.svg),title:s}),n=T(a,j,`${j}--${c}`);return i.jsx("span",{"aria-label":s,className:n,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S={exports:{}};/*!
5
+ */(function(e){(function(){var u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=c(r,a.call(this,n)))}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 n in r)u.call(r,n)&&r[n]&&(t=c(t,this&&this[n]||n));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})()})(w);var B=w.exports;const E=k(B),q={"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"},L={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(C,{...e,svg:L});N.displayName="IconHome";const R=E.bind(q),j="purpur-icon",T="md",H=e=>e.filter(u=>Object.keys(u).length>=1).map(u=>`${u.name}="${u.value}"`).join(" "),P=({content:e="",title:u}={})=>{const s=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},u?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=u?`<title>${u}</title>`:"";return`<svg ${H(s)}>${a}${e}</svg>`},V=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),C=({["data-testid"]:e,svg:u,allyTitle:s,className:a="",size:c=T,...r})=>{const t=P({content:V(u.svg),title:s}),n=R(a,j,`${j}--${c}`);return i.jsx("span",{"aria-label":s,className:n,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S={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 u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=c(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=c(t,n));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 D=S.exports;const $=Z(D),p={"purpur-breadcrumbs":"_purpur-breadcrumbs_hceki_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_hceki_15","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_hceki_29","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_hceki_43","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_hceki_51","purpur-breadcrumb-item":"_purpur-breadcrumb-item_hceki_61","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_hceki_64","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_hceki_84","purpur-breadcrumb-item__separator":"_purpur-breadcrumb-item__separator_hceki_87"},U=(e,u,s)=>({"@type":"ListItem",position:s,name:e,item:u}),z=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),I={DEFAULT:"default",NEGATIVE:"negative"},F=Object.values(I),f="purpur-breadcrumbs",h="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:c=!0,variant:r="default"})=>{const t=$([a,p[f],p[`${f}--${r}`]]),n=m.Children.count(s),l=[],g=m.Children.map(s,(v,A)=>{const x=A+1,k=n===x,d=v.props.children,o=typeof d=="string"?null:d.props;let _=null,b=null;return typeof d=="string"?(_=d,b=v.props.href):o!=null&&o.children&&typeof(o==null?void 0:o.children)=="string"&&(_=o.children,b=o.href),_&&b&&l.push(U(_,b,x)),m.cloneElement(v,{current:k,variant:r})}),y=l.length===n?z(l):null;return i.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[i.jsxs("ol",{className:p[`${f}__list`],children:[i.jsx("li",{"aria-hidden":"true",className:p[`${f}__home`],children:i.jsx(N,{size:"xs"})}),g]}),c&&y?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:y}}):null]})},J=({href:e,["data-testid"]:u,children:s,current:a=!1,variant:c="default",...r})=>{const t=$([p[h],p[`${h}--${c}`]],{[p[`${h}--current`]]:a}),n=()=>{const l={href:e,"data-testid":u,"aria-current":a?"page":void 0};return e||typeof s=="string"?m.createElement("a",l,s):m.cloneElement(s,{...l,...s.props})};return i.jsxs("li",{...r,className:t,children:[n(),a?null:i.jsx("span",{"aria-hidden":!0,className:p[`${h}__separator`],children:"/"})]})};O.Item=J;exports.BREADCRUMB_VARIANT=I;exports.Breadcrumbs=O;exports.breadcrumbVariants=F;
9
+ */(function(e){(function(){var u={}.hasOwnProperty;function s(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=c(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=c(t,n));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 Z=S.exports;const $=D(Z),l={"purpur-breadcrumbs":"_purpur-breadcrumbs_hceki_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_hceki_15","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_hceki_29","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_hceki_43","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_hceki_51","purpur-breadcrumb-item":"_purpur-breadcrumb-item_hceki_61","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_hceki_64","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_hceki_84","purpur-breadcrumb-item__separator":"_purpur-breadcrumb-item__separator_hceki_87"},F=(e,u,s)=>({"@type":"ListItem",position:s,name:e,item:u}),U=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),I={DEFAULT:"default",NEGATIVE:"negative"},z=Object.values(I),f="purpur-breadcrumbs",h="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:c=!0,variant:r="default"})=>{const t=$([a,l[f],l[`${f}--${r}`]]),n=m.Children.count(s),p=[],g=m.Children.map(s,(v,A)=>{const x=A+1,M=n===x,d=v.props.children,o=typeof d=="string"?null:d.props;let _=null,b=null;return typeof d=="string"?(_=d,b=v.props.href):o!=null&&o.children&&typeof(o==null?void 0:o.children)=="string"&&(_=o.children,b=o.href),_&&b&&p.push(F(_,b,x)),m.cloneElement(v,{current:M,variant:r})}),y=p.length===n?U(p):null;return i.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[i.jsxs("ol",{className:l[`${f}__list`],children:[i.jsx("li",{"aria-hidden":"true",className:l[`${f}__home`],children:i.jsx(N,{size:"xs"})}),g]}),c&&y?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:y}}):null]})},J=({href:e,["data-testid"]:u,children:s,current:a=!1,variant:c="default",...r})=>{const t=$([l[h],l[`${h}--${c}`]],{[l[`${h}--current`]]:a}),n=()=>{const p={href:e,"data-testid":u,"aria-current":a?"page":void 0};return e||typeof s=="string"?m.createElement("a",p,s):m.cloneElement(s,{...p,...s.props})};return i.jsxs("li",{...r,className:t,children:[n(),a?null:i.jsx("span",{"aria-hidden":!0,className:l[`${h}__separator`],children:"/"})]})};O.Item=J;exports.BREADCRUMB_VARIANT=I;exports.Breadcrumbs=O;exports.breadcrumbVariants=z;
10
10
  //# sourceMappingURL=breadcrumbs.cjs.js.map