@purpurds/breadcrumbs 3.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.
@@ -0,0 +1,10 @@
1
+ System.register(["react","react/jsx-runtime"],function(v,X){"use strict";var g,y,i,E,x;return{setters:[l=>{g=l.Children,y=l.cloneElement,i=l.default,E=l.createElement},l=>{x=l.jsx}],execute:function(){function l(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var N={exports:{}};/*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */(function(r){(function(){var u={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var s=arguments[t];s&&(e=c(e,a.call(this,s)))}return e}function a(e){if(typeof e=="string"||typeof e=="number")return this&&this[e]||e;if(typeof e!="object")return"";if(Array.isArray(e))return n.apply(this,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var s in e)u.call(e,s)&&e[s]&&(t=c(t,this&&this[s]||s));return t}function c(e,t){return t?e?e+" "+t:e+t:e}r.exports?(n.default=n,r.exports=n):window.classNames=n})()})(N);var B=N.exports;const M=l(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"},q={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"},$=r=>x(P,{...r,svg:q});$.displayName="IconHome";const C=M.bind(L),S="purpur-icon",R="md",T=r=>r.filter(u=>Object.keys(u).length>=1).map(u=>`${u.name}="${u.value}"`).join(" "),H=({content:r="",title:u}={})=>{const n=[{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 ${T(n)}>${a}${r}</svg>`},V=r=>r.replace(/<(\/?)svg([^>]*)>/g,"").trim(),P=({["data-testid"]:r,svg:u,allyTitle:n,className:a="",size:c=R,...e})=>{const t=H({content:V(u.svg),title:n}),s=C(a,S,`${S}--${c}`);return x("span",{"aria-label":n,className:s,"data-testid":r,dangerouslySetInnerHTML:{__html:t},...e})};function Z(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j={exports:{}};/*!
6
+ Copyright (c) 2018 Jed Watson.
7
+ Licensed under the MIT License (MIT), see
8
+ http://jedwatson.github.io/classnames
9
+ */(function(r){(function(){var u={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var s=arguments[t];s&&(e=c(e,a(s)))}return e}function a(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var s in e)u.call(e,s)&&e[s]&&(t=c(t,s));return t}function c(e,t){return t?e?e+" "+t:e+t:e}r.exports?(n.default=n,r.exports=n):window.classNames=n})()})(j);var D=j.exports;const I=Z(D),o={"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=(r,u,n)=>({"@type":"ListItem",position:n,name:r,item:u}),z=r=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r}),F=v("BREADCRUMB_VARIANT",{DEFAULT:"default",NEGATIVE:"negative"}),Y=v("breadcrumbVariants",Object.values(F)),d="purpur-breadcrumbs",_="purpur-breadcrumb-item",J=v("Breadcrumbs",({["data-testid"]:r,ariaLabel:u,children:n,className:a,meta:c=!0,variant:e="default"})=>{const t=I([a,o[d],o[`${d}--${e}`]]),s=g.count(n),m=[],A=g.map(n,(w,Q)=>{const k=Q+1,W=s===k,b=w.props.children,p=typeof b=="string"?null:b.props;let f=null,h=null;return typeof b=="string"?(f=b,h=w.props.href):p!=null&&p.children&&typeof(p==null?void 0:p.children)=="string"&&(f=p.children,h=p.href),f&&h&&m.push(U(f,h,k)),y(w,{current:W,variant:e})}),O=m.length===s?z(m):null;return i.createElement("nav",{"data-testid":r,"aria-label":u||"Breadcrumb",className:t},i.createElement("ol",{className:o[`${d}__list`]},i.createElement("li",{"aria-hidden":"true",className:o[`${d}__home`]},i.createElement($,{size:"xs"})),A),c&&O?i.createElement("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:O}}):null)}),K=({href:r,["data-testid"]:u,children:n,current:a=!1,variant:c="default",...e})=>{const t=I([o[_],o[`${_}--${c}`]],{[o[`${_}--current`]]:a}),s=()=>{const m={href:r,"data-testid":u,"aria-current":a?"page":void 0};return r||typeof n=="string"?E("a",m,n):y(n,{...m,...n.props})};return i.createElement("li",{...e,className:t},s(),a?null:i.createElement("span",{"aria-hidden":!0,className:o[`${_}__separator`]},"/"))};J.Item=K}}});
10
+ //# sourceMappingURL=breadcrumbs.system.js.map