@purpurds/breadcrumbs 4.3.0 → 4.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: 4.2.0
2
+ Version: 4.4.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 o=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 M(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=i(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=i(t,this&&this[n]||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})()})(w);var E=w.exports;const q=B(E),L={"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"},R={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=>o.jsx(D,{...e,svg:R});N.displayName="IconHome";const T=q.bind(L),j="purpur-icon",H="md",P=e=>e.filter(u=>Object.keys(u).length>=1).map(u=>`${u.name}="${u.value}"`).join(" "),V=({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 ${P(s)}>${a}${e}</svg>`},C=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),D=({["data-testid"]:e,svg:u,allyTitle:s,className:a="",size:i=H,...r})=>{const t=V({content:C(u.svg),title:s}),n=T(a,j,`${j}--${i}`);return o.jsx("span",{"aria-label":s,className:n,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};function F(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 q=M(B),L={"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"},R={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(D,{...e,svg:R});N.displayName="IconHome";const T=q.bind(L),j="purpur-icon",V="md",C=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 ${C(s)}>${a}${e}</svg>`},P=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),D=({["data-testid"]:e,svg:u,allyTitle:s,className:a="",size:c=V,...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:{}};/*!
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})()})(S);var Z=S.exports;const $=F(Z),p={"purpur-breadcrumbs":"_purpur-breadcrumbs_1oiut_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_1oiut_18","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_1oiut_32","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_1oiut_46","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_1oiut_54","purpur-breadcrumb-item":"_purpur-breadcrumb-item_1oiut_64","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_1oiut_67","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_1oiut_87","purpur-breadcrumb-item__separator":"_purpur-breadcrumb-item__separator_1oiut_90"},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"},k=Object.values(I),v="purpur-breadcrumbs",g="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:i=!0,variant:r="default"})=>{const t=$([a,p[v],p[`${v}--${r}`]]),n=m.Children.count(s),l=[],d=m.Children.map(s,(_,A)=>{const x=A+1,M=n===x,b=_.props.children,c=typeof b=="string"?null:b.props;let f=null,h=null;return typeof b=="string"?(f=b,h=_.props.href):c!=null&&c.children&&typeof(c==null?void 0:c.children)=="string"&&(f=c.children,h=c.href),f&&h&&l.push(U(f,h,x)),m.cloneElement(_,{current:M,variant:r,...x===1&&{children:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:p[`${v}__home`],"aria-hidden":"true",children:o.jsx(N,{size:"xs"})}),_.props.children]})}})}),y=l.length===n?z(l):null;return o.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[o.jsx("ol",{className:p[`${v}__list`],children:d}),i&&y?o.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:i="default",onClick:r,...t})=>{const n=$([p[g],p[`${g}--${i}`]],{[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 o.jsxs("li",{...t,className:n,children:[l(),a?null:o.jsx("span",{"aria-hidden":!0,className:p[`${g}__separator`],children:"/"})]})};O.Item=J;exports.BREADCRUMB_VARIANT=I;exports.Breadcrumbs=O;exports.breadcrumbVariants=k;
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 $=Z(z),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"},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"},k=Object.values(I),v="purpur-breadcrumbs",g="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:c=!0,variant:r="default"})=>{const t=$([a,p[v],p[`${v}--${r}`]]),n=m.Children.count(s),l=[],d=m.Children.map(s,(_,A)=>{const x=A+1,E=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(F(f,h,x)),m.cloneElement(_,{current:E,variant:r,...x===1&&{children:i.jsxs(i.Fragment,{children:[i.jsx("span",{className:p[`${v}__home`],"aria-hidden":"true",children:i.jsx(N,{size:"xs"})}),_.props.children]})}})}),y=l.length===n?U(l):null;return i.jsxs("nav",{"data-testid":e,"aria-label":u||"Breadcrumb",className:t,children:[i.jsx("ol",{className:p[`${v}__list`],children:d}),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",onClick:r,...t})=>{const n=$([p[g],p[`${g}--${c}`]],{[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 i.jsxs("li",{...t,className:n,children:[l(),a?null:i.jsx("span",{"aria-hidden":!0,className:p[`${g}__separator`],children:"/"})]})};O.Item=J;exports.BREADCRUMB_VARIANT=I;exports.Breadcrumbs=O;exports.breadcrumbVariants=k;
10
10
  //# sourceMappingURL=breadcrumbs.cjs.js.map