@purpurds/breadcrumbs 3.3.2 → 3.4.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 +1 -1
- package/dist/breadcrumbs.cjs.js +1 -1
- package/dist/breadcrumbs.cjs.js.map +1 -1
- package/dist/breadcrumbs.d.ts +2 -1
- package/dist/breadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs.es.js +48 -46
- package/dist/breadcrumbs.es.js.map +1 -1
- package/dist/breadcrumbs.system.js +3 -3
- package/dist/breadcrumbs.system.js.map +1 -1
- package/package.json +4 -4
- package/readme.mdx +3 -1
- package/src/breadcrumbs.stories.tsx +3 -3
- package/src/breadcrumbs.tsx +4 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
System.register(["react","react/jsx-runtime"],function(
|
|
1
|
+
System.register(["react","react/jsx-runtime"],function(g,X){"use strict";var y,x,i,S,w;return{setters:[l=>{y=l.Children,x=l.cloneElement,i=l.default,S=l.createElement},l=>{w=l.jsx}],execute:function(){function l(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $={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(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})()})(
|
|
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})()})($);var B=$.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"},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"},j=r=>w(P,{...r,svg:R});j.displayName="IconHome";const q=M.bind(L),I="purpur-icon",H="md",T=r=>r.filter(u=>Object.keys(u).length>=1).map(u=>`${u.name}="${u.value}"`).join(" "),V=({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>`},C=r=>r.replace(/<(\/?)svg([^>]*)>/g,"").trim(),P=({["data-testid"]:r,svg:u,allyTitle:n,className:a="",size:c=H,...e})=>{const t=V({content:C(u.svg),title:n}),s=q(a,I,`${I}--${c}`);return w("span",{"aria-label":n,className:s,"data-testid":r,dangerouslySetInnerHTML:{__html:t},...e})};function D(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var A={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(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})()})(
|
|
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})()})(A);var Z=A.exports;const O=D(Z),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"},F=(r,u,n)=>({"@type":"ListItem",position:n,name:r,item:u}),U=r=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r}),z=g("BREADCRUMB_VARIANT",{DEFAULT:"default",NEGATIVE:"negative"}),Y=g("breadcrumbVariants",Object.values(z)),d="purpur-breadcrumbs",_="purpur-breadcrumb-item",J=g("Breadcrumbs",({["data-testid"]:r,ariaLabel:u,children:n,className:a,meta:c=!0,variant:e="default"})=>{const t=O([a,o[d],o[`${d}--${e}`]]),s=y.count(n),m=[],f=y.map(n,(N,Q)=>{const k=Q+1,W=s===k,b=N.props.children,p=typeof b=="string"?null:b.props;let h=null,v=null;return typeof b=="string"?(h=b,v=N.props.href):p!=null&&p.children&&typeof(p==null?void 0:p.children)=="string"&&(h=p.children,v=p.href),h&&v&&m.push(F(h,v,k)),x(N,{current:W,variant:e})}),E=m.length===s?U(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(j,{size:"xs"})),f),c&&E?i.createElement("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:E}}):null)}),K=({href:r,["data-testid"]:u,children:n,current:a=!1,variant:c="default",onClick:e,...t})=>{const s=O([o[_],o[`${_}--${c}`]],{[o[`${_}--current`]]:a}),m=()=>{const f={href:r,"data-testid":u,"aria-current":a?"page":void 0,onClick:e};return r||typeof n=="string"?S("a",f,n):x(n,{...f,...n.props})};return i.createElement("li",{...t,className:s},m(),a?null:i.createElement("span",{"aria-hidden":!0,className:o[`${_}__separator`]},"/"))};J.Item=K}}});
|
|
10
10
|
//# sourceMappingURL=breadcrumbs.system.js.map
|