@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 CHANGED
@@ -1,5 +1,5 @@
1
1
  Name: @purpurds/icon
2
- Version: 5.31.0
2
+ Version: 5.33.0
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
@@ -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-breadcrumbs_465gy_1","purpur-breadcrumbs--default":"_purpur-breadcrumbs--default_465gy_21","purpur-breadcrumbs--negative":"_purpur-breadcrumbs--negative_465gy_35","purpur-breadcrumbs__list":"_purpur-breadcrumbs__list_465gy_49","purpur-breadcrumbs__home":"_purpur-breadcrumbs__home_465gy_57","purpur-breadcrumb-item":"_purpur-breadcrumb-item_465gy_67","purpur-breadcrumb-item--current":"_purpur-breadcrumb-item--current_465gy_72","purpur-breadcrumb-item--negative":"_purpur-breadcrumb-item--negative_465gy_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}),g="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[g],o[`${g}--${r?"negative":"default"}`]]),h=p.Children.count(n),y=[],B=p.Children.map(n,(d,H)=>{const x=H+1,P=t&&h===x,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&&y.push(V(_,b,x)),p.cloneElement(d,{current:P,negative:r,...x===1&&{children:i.jsxs(i.Fragment,{children:[u?null:i.jsx("span",{className:o[`${g}__home`],"aria-hidden":"true",children:i.jsx(N,{size:"xs"})}),d.props.children]})}})}),w=y.length===h?X(y):null;return i.jsxs("nav",{"data-testid":e,"aria-label":s||"Breadcrumb",className:m,...v,children:[i.jsx("ol",{className:o[`${g}__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;
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
@@ -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-breadcrumbs_465gy_1",
138
- "purpur-breadcrumbs--default": "_purpur-breadcrumbs--default_465gy_21",
139
- "purpur-breadcrumbs--negative": "_purpur-breadcrumbs--negative_465gy_35",
140
- "purpur-breadcrumbs__list": "_purpur-breadcrumbs__list_465gy_49",
141
- "purpur-breadcrumbs__home": "_purpur-breadcrumbs__home_465gy_57",
142
- "purpur-breadcrumb-item": "_purpur-breadcrumb-item_465gy_67",
143
- "purpur-breadcrumb-item--current": "_purpur-breadcrumb-item--current_465gy_72",
144
- "purpur-breadcrumb-item--negative": "_purpur-breadcrumb-item--negative_465gy_94"
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
- }), b = "purpur-breadcrumbs", y = "purpur-breadcrumb-item", R = ({
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[b],
168
- l[`${b}--${r ? "negative" : "default"}`]
169
- ]), v = N.count(n), g = [], B = N.map(n, (m, H) => {
170
- const h = H + 1, A = e && v === h, d = m.props.children, c = typeof d == "string" ? null : d.props;
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 && _ && g.push(K(f, _, h)), j(m, {
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
- ...h === 1 && {
175
+ ...g === 1 && {
176
176
  children: /* @__PURE__ */ $(P, { children: [
177
- u ? null : /* @__PURE__ */ o("span", { className: l[`${b}__home`], "aria-hidden": "true", children: /* @__PURE__ */ o(O, { size: "xs" }) }),
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 = g.length === v ? Q(g) : null;
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[`${b}__list`], children: B }),
191
+ /* @__PURE__ */ o("ol", { className: l[`${h}__list`], children: B }),
192
192
  i && w ? /* @__PURE__ */ o(
193
193
  "script",
194
194
  {
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ "moduleName": "breadcrumbs",
3
+ "exports": [
4
+ "BreadcrumbsProps",
5
+ "BreadcrumbsItemProps",
6
+ "Breadcrumbs",
7
+ "BreadcrumbsItem"
8
+ ]
9
+ };
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- ._purpur-breadcrumbs_465gy_1{font-family:var(--purpur-typography-family-default);padding:var(--purpur-spacing-150) 0}._purpur-breadcrumbs_465gy_1 a,._purpur-breadcrumbs_465gy_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_465gy_1 a:hover,._purpur-breadcrumbs_465gy_1 a:active,._purpur-breadcrumbs_465gy_1 li:only-child:not(:has(a)):hover,._purpur-breadcrumbs_465gy_1 li:only-child:not(:has(a)):active{text-decoration-thickness:2px;text-underline-offset:2px}._purpur-breadcrumbs--default_465gy_21,._purpur-breadcrumbs--default_465gy_21 a{color:var(--purpur-color-text-interactive-primary)}._purpur-breadcrumbs--default_465gy_21 a:hover{color:var(--purpur-color-text-interactive-primary-hover);background:var(--purpur-color-background-interactive-transparent-hover)}._purpur-breadcrumbs--default_465gy_21 a:active{color:var(--purpur-color-text-interactive-primary-active);background:var(--purpur-color-background-interactive-transparent-active)}._purpur-breadcrumbs--negative_465gy_35,._purpur-breadcrumbs--negative_465gy_35 a{color:var(--purpur-color-text-interactive-primary-negative)}._purpur-breadcrumbs--negative_465gy_35 a:hover{color:var(--purpur-color-text-interactive-primary-negative-hover);background:var(--purpur-color-background-interactive-transparent-negative-hover)}._purpur-breadcrumbs--negative_465gy_35 a:active{color:var(--purpur-color-text-interactive-primary-negative-active);background:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-breadcrumbs__list_465gy_49{display:flex;flex-direction:row;align-items:center;gap:var(--purpur-spacing-50);padding:0;list-style:none}._purpur-breadcrumbs__home_465gy_57{display:none}@media screen and (min-width: 600px){._purpur-breadcrumbs__home_465gy_57{display:inline-flex;align-items:center}}._purpur-breadcrumb-item_465gy_67{white-space:nowrap;display:flex;align-items:center}._purpur-breadcrumb-item--current_465gy_72{overflow:hidden}._purpur-breadcrumb-item--current_465gy_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_465gy_72 a:hover{background:none}._purpur-breadcrumb-item_465gy_67:not(:nth-last-child(2)):not(:last-child){display:none}@media screen and (min-width: 600px){._purpur-breadcrumb-item_465gy_67:not(:nth-last-child(2)):not(:last-child){display:flex}}._purpur-breadcrumb-item--negative_465gy_94._purpur-breadcrumb-item--current_465gy_72 a{color:var(--purpur-color-text-default-negative)}._purpur-breadcrumb-item_465gy_67:not(:last-child):after{font-size:var(--purpur-typography-scale-75);margin-left:var(--purpur-spacing-50);content:"/"/""}
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.32.0",
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.32.0",
19
- "@purpurds/tokens": "5.32.0"
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
- padding: var(--purpur-spacing-150) 0;
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;