@purpurds/breadcrumbs 3.3.1 → 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
package/dist/LICENSE.txt
CHANGED
package/dist/breadcrumbs.cjs.js
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
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 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),
|
|
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),h="purpur-breadcrumbs",v="purpur-breadcrumb-item",O=({["data-testid"]:e,ariaLabel:u,children:s,className:a,meta:c=!0,variant:r="default"})=>{const t=$([a,l[h],l[`${h}--${r}`]]),n=m.Children.count(s),p=[],d=m.Children.map(s,(y,A)=>{const x=A+1,M=n===x,_=y.props.children,o=typeof _=="string"?null:_.props;let b=null,f=null;return typeof _=="string"?(b=_,f=y.props.href):o!=null&&o.children&&typeof(o==null?void 0:o.children)=="string"&&(b=o.children,f=o.href),b&&f&&p.push(F(b,f,x)),m.cloneElement(y,{current:M,variant:r})}),g=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[`${h}__list`],children:[i.jsx("li",{"aria-hidden":"true",className:l[`${h}__home`],children:i.jsx(N,{size:"xs"})}),d]}),c&&g?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:g}}):null]})},J=({href:e,["data-testid"]:u,children:s,current:a=!1,variant:c="default",onClick:r,...t})=>{const n=$([l[v],l[`${v}--${c}`]],{[l[`${v}--current`]]:a}),p=()=>{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:[p(),a?null:i.jsx("span",{"aria-hidden":!0,className:l[`${v}__separator`],children:"/"})]})};O.Item=J;exports.BREADCRUMB_VARIANT=I;exports.Breadcrumbs=O;exports.breadcrumbVariants=z;
|
|
10
10
|
//# sourceMappingURL=breadcrumbs.cjs.js.map
|