@purpurds/breadcrumbs 5.32.0 → 5.34.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.es.js +18 -18
- package/dist/metadata.js +9 -0
- package/dist/styles.css +1 -1
- package/package.json +5 -4
- package/src/breadcrumbs.module.scss +2 -2
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 s={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=c(r,a(u)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)s.call(r,u)&&r[u]&&(t=c(t,u));return t}function c(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(O);var U=O.exports;const q=R(U),o={"purpur-breadcrumbs":"_purpur-
|
|
9
|
+
*/(function(e){(function(){var s={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=c(r,a(u)))}return r}function a(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)s.call(r,u)&&r[u]&&(t=c(t,u));return t}function c(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(O);var U=O.exports;const q=R(U),o={"purpur-breadcrumbs":"_purpur-breadcrumbs_1xh80_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_1xh80_20","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_1xh80_34","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_1xh80_48","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_1xh80_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_1xh80_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_1xh80_72","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_1xh80_94"},V=(e,s,n)=>({"@type":"ListItem",position:n,name:e,item:s}),X=e=>JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e}),h="purpur-breadcrumbs",j="purpur-breadcrumb-item",L=({["data-testid"]:e,ariaLabel:s,children:n,className:a,meta:c=!0,negative:r=!1,highlightLast:t=!0,hideHomeIcon:u,...v})=>{const m=q([a,o[h],o[`${h}--${r?"negative":"default"}`]]),g=p.Children.count(n),x=[],B=p.Children.map(n,(d,H)=>{const y=H+1,P=t&&g===y,f=d.props.children,l=typeof f=="string"?null:f.props;let _=null,b=null;return typeof f=="string"?(_=f,b=d.props.href):l!=null&&l.children&&typeof(l==null?void 0:l.children)=="string"&&(_=l.children,b=l.href),_&&b&&x.push(V(_,b,y)),p.cloneElement(d,{current:P,negative:r,...y===1&&{children:i.jsxs(i.Fragment,{children:[u?null:i.jsx("span",{className:o[`${h}__home`],"aria-hidden":"true",children:i.jsx(N,{size:"xs"})}),d.props.children]})}})}),w=x.length===g?X(x):null;return i.jsxs("nav",{"data-testid":e,"aria-label":s||"Breadcrumb",className:m,...v,children:[i.jsx("ol",{className:o[`${h}__list`],children:B}),c&&w?i.jsx("script",{type:"application/ld+json","data-testid":"breadcrumbs-meta",dangerouslySetInnerHTML:{__html:w}}):null]})},M=({href:e,["data-testid"]:s,children:n,current:a=!1,negative:c=!1,onClick:r,...t})=>{const u=q([o[j],o[`${j}--${c?"negative":"default"}`]],{[o[`${j}--current`]]:a}),v=()=>{const m={href:e,"data-testid":s,"aria-current":a?"page":void 0,onClick:r};return e||typeof n=="string"?p.createElement("a",m,n):p.cloneElement(n,{...m,...n.props})};return i.jsx("li",{...t,className:u,children:v()})};L.Item=M;exports.Breadcrumbs=L;exports.BreadcrumbsItem=M;
|
|
10
10
|
//# sourceMappingURL=breadcrumbs.cjs.js.map
|
package/dist/breadcrumbs.es.js
CHANGED
|
@@ -134,14 +134,14 @@ var q = { exports: {} };
|
|
|
134
134
|
})(q);
|
|
135
135
|
var Y = q.exports;
|
|
136
136
|
const M = /* @__PURE__ */ X(Y), l = {
|
|
137
|
-
"purpur-breadcrumbs": "_purpur-
|
|
138
|
-
"purpur-breadcrumbs--default": "_purpur-breadcrumbs--
|
|
139
|
-
"purpur-breadcrumbs--negative": "_purpur-breadcrumbs--
|
|
140
|
-
"purpur-breadcrumbs__list": "_purpur-
|
|
141
|
-
"purpur-breadcrumbs__home": "_purpur-
|
|
142
|
-
"purpur-breadcrumb-item": "_purpur-breadcrumb-
|
|
143
|
-
"purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--
|
|
144
|
-
"purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--
|
|
137
|
+
"purpur-breadcrumbs": "_purpur-breadcrumbs_1xh80_1",
|
|
138
|
+
"purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_1xh80_20",
|
|
139
|
+
"purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_1xh80_34",
|
|
140
|
+
"purpur-breadcrumbs__list": "_purpur-breadcrumbs__list_1xh80_48",
|
|
141
|
+
"purpur-breadcrumbs__home": "_purpur-breadcrumbs__home_1xh80_57",
|
|
142
|
+
"purpur-breadcrumb-item": "_purpur-breadcrumb-item_1xh80_67",
|
|
143
|
+
"purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_1xh80_72",
|
|
144
|
+
"purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_1xh80_94"
|
|
145
145
|
}, K = (t, s, n) => ({
|
|
146
146
|
"@type": "ListItem",
|
|
147
147
|
position: n,
|
|
@@ -151,7 +151,7 @@ const M = /* @__PURE__ */ X(Y), l = {
|
|
|
151
151
|
"@context": "https://schema.org",
|
|
152
152
|
"@type": "BreadcrumbList",
|
|
153
153
|
itemListElement: t
|
|
154
|
-
}),
|
|
154
|
+
}), h = "purpur-breadcrumbs", y = "purpur-breadcrumb-item", R = ({
|
|
155
155
|
["data-testid"]: t,
|
|
156
156
|
ariaLabel: s,
|
|
157
157
|
children: n,
|
|
@@ -164,22 +164,22 @@ const M = /* @__PURE__ */ X(Y), l = {
|
|
|
164
164
|
}) => {
|
|
165
165
|
const p = M([
|
|
166
166
|
a,
|
|
167
|
-
l[
|
|
168
|
-
l[`${
|
|
169
|
-
]),
|
|
170
|
-
const
|
|
167
|
+
l[h],
|
|
168
|
+
l[`${h}--${r ? "negative" : "default"}`]
|
|
169
|
+
]), b = N.count(n), v = [], B = N.map(n, (m, H) => {
|
|
170
|
+
const g = H + 1, A = e && b === g, d = m.props.children, c = typeof d == "string" ? null : d.props;
|
|
171
171
|
let f = null, _ = null;
|
|
172
|
-
return typeof d == "string" ? (f = d, _ = m.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (f = c.children, _ = c.href), f && _ &&
|
|
172
|
+
return typeof d == "string" ? (f = d, _ = m.props.href) : c != null && c.children && typeof (c == null ? void 0 : c.children) == "string" && (f = c.children, _ = c.href), f && _ && v.push(K(f, _, g)), j(m, {
|
|
173
173
|
current: A,
|
|
174
174
|
negative: r,
|
|
175
|
-
...
|
|
175
|
+
...g === 1 && {
|
|
176
176
|
children: /* @__PURE__ */ $(P, { children: [
|
|
177
|
-
u ? null : /* @__PURE__ */ o("span", { className: l[`${
|
|
177
|
+
u ? null : /* @__PURE__ */ o("span", { className: l[`${h}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(O, { size: "xs" }) }),
|
|
178
178
|
m.props.children
|
|
179
179
|
] })
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
|
-
}), w =
|
|
182
|
+
}), w = v.length === b ? Q(v) : null;
|
|
183
183
|
return /* @__PURE__ */ $(
|
|
184
184
|
"nav",
|
|
185
185
|
{
|
|
@@ -188,7 +188,7 @@ const M = /* @__PURE__ */ X(Y), l = {
|
|
|
188
188
|
className: p,
|
|
189
189
|
...x,
|
|
190
190
|
children: [
|
|
191
|
-
/* @__PURE__ */ o("ol", { className: l[`${
|
|
191
|
+
/* @__PURE__ */ o("ol", { className: l[`${h}__list`], children: B }),
|
|
192
192
|
i && w ? /* @__PURE__ */ o(
|
|
193
193
|
"script",
|
|
194
194
|
{
|
package/dist/metadata.js
ADDED
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._purpur-
|
|
1
|
+
._purpur-breadcrumbs_1xh80_1{font-family:var(--purpur-typography-family-default)}._purpur-breadcrumbs_1xh80_1 a,._purpur-breadcrumbs_1xh80_1 li:only-child:not(:has(a)){display:inline-flex;gap:var(--purpur-spacing-50);font-size:var(--purpur-typography-scale-75);text-underline-offset:3px;text-decoration-skip-ink:none;padding:14px 2px;letter-spacing:.3px}._purpur-breadcrumbs_1xh80_1 a:hover,._purpur-breadcrumbs_1xh80_1 a:active,._purpur-breadcrumbs_1xh80_1 li:only-child:not(:has(a)):hover,._purpur-breadcrumbs_1xh80_1 li:only-child:not(:has(a)):active{text-decoration-thickness:2px;text-underline-offset:2px}._purpur-breadcrumbs--default_1xh80_20,._purpur-breadcrumbs--default_1xh80_20 a{color:var(--purpur-color-text-interactive-primary)}._purpur-breadcrumbs--default_1xh80_20 a:hover{color:var(--purpur-color-text-interactive-primary-hover);background:var(--purpur-color-background-interactive-transparent-hover)}._purpur-breadcrumbs--default_1xh80_20 a:active{color:var(--purpur-color-text-interactive-primary-active);background:var(--purpur-color-background-interactive-transparent-active)}._purpur-breadcrumbs--negative_1xh80_34,._purpur-breadcrumbs--negative_1xh80_34 a{color:var(--purpur-color-text-interactive-primary-negative)}._purpur-breadcrumbs--negative_1xh80_34 a:hover{color:var(--purpur-color-text-interactive-primary-negative-hover);background:var(--purpur-color-background-interactive-transparent-negative-hover)}._purpur-breadcrumbs--negative_1xh80_34 a:active{color:var(--purpur-color-text-interactive-primary-negative-active);background:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-breadcrumbs__list_1xh80_48{display:flex;flex-direction:row;align-items:center;gap:var(--purpur-spacing-50);margin:0;padding:0;list-style:none}._purpur-breadcrumbs__home_1xh80_57{display:none}@media screen and (min-width: 600px){._purpur-breadcrumbs__home_1xh80_57{display:inline-flex;align-items:center}}._purpur-breadcrumb-item_1xh80_67{white-space:nowrap;display:flex;align-items:center}._purpur-breadcrumb-item--current_1xh80_72{overflow:hidden}._purpur-breadcrumb-item--current_1xh80_72 a{display:block;text-overflow:ellipsis;overflow:hidden;color:var(--purpur-color-text-default);text-decoration:none;font-weight:var(--purpur-typography-weight-medium)}._purpur-breadcrumb-item--current_1xh80_72 a:hover{background:none}._purpur-breadcrumb-item_1xh80_67:not(:nth-last-child(2)):not(:last-child){display:none}@media screen and (min-width: 600px){._purpur-breadcrumb-item_1xh80_67:not(:nth-last-child(2)):not(:last-child){display:flex}}._purpur-breadcrumb-item--negative_1xh80_94._purpur-breadcrumb-item--current_1xh80_72 a{color:var(--purpur-color-text-default-negative)}._purpur-breadcrumb-item_1xh80_67:not(:last-child):after{font-size:var(--purpur-typography-scale-75);margin-left:var(--purpur-spacing-50);content:"/"/""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/breadcrumbs",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/breadcrumbs.cjs.js",
|
|
6
6
|
"types": "./dist/breadcrumbs.d.ts",
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"types": "./dist/breadcrumbs.d.ts",
|
|
11
11
|
"default": "./dist/breadcrumbs.es.js"
|
|
12
12
|
},
|
|
13
|
-
"./styles": "./dist/styles.css"
|
|
13
|
+
"./styles": "./dist/styles.css",
|
|
14
|
+
"./metadata": "./dist/metadata.js"
|
|
14
15
|
},
|
|
15
16
|
"source": "src/breadcrumbs.tsx",
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"classnames": "~2.5.0",
|
|
18
|
-
"@purpurds/icon": "5.
|
|
19
|
-
"@purpurds/tokens": "5.
|
|
19
|
+
"@purpurds/icon": "5.34.0",
|
|
20
|
+
"@purpurds/tokens": "5.34.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@rushstack/eslint-patch": "~1.10.0",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.purpur-breadcrumbs {
|
|
4
4
|
font-family: var(--purpur-typography-family-default);
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
|
|
8
8
|
a,
|
|
9
9
|
li:only-child:not(:has(a)) {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
flex-direction: row;
|
|
64
64
|
align-items: center;
|
|
65
65
|
gap: var(--purpur-spacing-50);
|
|
66
|
-
|
|
66
|
+
margin: 0;
|
|
67
67
|
padding: 0;
|
|
68
68
|
|
|
69
69
|
list-style: none;
|