@nice-digital/nds-breadcrumbs 4.0.2 → 4.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-breadcrumbs",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Breadcrumbs component for the NICE Design System",
5
5
  "keywords": [
6
6
  "breadcrumbs"
@@ -30,7 +30,7 @@
30
30
  "url": "https://github.com/nice-digital/nice-design-system/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@nice-digital/nds-core": "^4.0.2",
33
+ "@nice-digital/nds-core": "^4.0.3",
34
34
  "classnames": "^2.3.1"
35
35
  },
36
36
  "peerDependencies": {
@@ -45,5 +45,5 @@
45
45
  "@types/node": "^18.11.9",
46
46
  "typescript": "^4.8.4"
47
47
  },
48
- "gitHead": "d8feb7beba5fffa49da42d6a550cb8f67a50727d"
48
+ "gitHead": "ae51389ba2e51dbe9ee3849e71d44fd567fb2822"
49
49
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Breadcrumb.js","names":["React","PropTypes","classnames","Breadcrumb","props","elementType","method","to","children","className","attributes","ElementType","innerTagProps","propTypes","string","isRequired"],"sources":["../src/Breadcrumb.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classnames from \"classnames\";\n\nexport const Breadcrumb = (props) => {\n\tconst { elementType, method, to, children, className, ...attributes } = props;\n\n\tlet ElementType = elementType || \"span\";\n\n\tconst innerTagProps = {\n\t\t...attributes\n\t};\n\n\tif (to) {\n\t\tElementType = elementType || \"a\";\n\t\tinnerTagProps[method || (ElementType === \"a\" && \"href\") || \"to\"] = to;\n\t}\n\n\treturn (\n\t\t<li className={classnames([\"breadcrumbs__crumb\", className])}>\n\t\t\t<ElementType {...innerTagProps}>{children}</ElementType>\n\t\t</li>\n\t);\n};\n\nBreadcrumb.propTypes = {\n\telementType: PropTypes.elementType, // Allow tag to be customised for custom routing integration\n\tchildren: PropTypes.string.isRequired,\n\tto: PropTypes.string,\n\tmethod: PropTypes.string,\n\tclassName: PropTypes.string\n};\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAW;EACpC,IAAQC,WAAR,GAAwED,KAAxE,CAAQC,WAAR;EAAA,IAAqBC,MAArB,GAAwEF,KAAxE,CAAqBE,MAArB;EAAA,IAA6BC,EAA7B,GAAwEH,KAAxE,CAA6BG,EAA7B;EAAA,IAAiCC,QAAjC,GAAwEJ,KAAxE,CAAiCI,QAAjC;EAAA,IAA2CC,SAA3C,GAAwEL,KAAxE,CAA2CK,SAA3C;EAAA,IAAyDC,UAAzD,iCAAwEN,KAAxE;;EAEA,IAAIO,WAAW,GAAGN,WAAW,IAAI,MAAjC;;EAEA,IAAMO,aAAa,gBACfF,UADe,CAAnB;;EAIA,IAAIH,EAAJ,EAAQ;IACPI,WAAW,GAAGN,WAAW,IAAI,GAA7B;IACAO,aAAa,CAACN,MAAM,IAAKK,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAA9C,CAAb,GAAmEJ,EAAnE;EACA;;EAED,oBACC;IAAI,SAAS,EAAEL,UAAU,CAAC,CAAC,oBAAD,EAAuBO,SAAvB,CAAD;EAAzB,gBACC,oBAAC,WAAD,EAAiBG,aAAjB,EAAiCJ,QAAjC,CADD,CADD;AAKA,CAnBM;AAqBPL,UAAU,CAACU,SAAX,GAAuB;EACtBR,WAAW,EAAEJ,SAAS,CAACI,WADD;EACc;EACpCG,QAAQ,EAAEP,SAAS,CAACa,MAAV,CAAiBC,UAFL;EAGtBR,EAAE,EAAEN,SAAS,CAACa,MAHQ;EAItBR,MAAM,EAAEL,SAAS,CAACa,MAJI;EAKtBL,SAAS,EAAER,SAAS,CAACa;AALC,CAAvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Breadcrumbs.js","names":["React","PropTypes","Breadcrumb","stringify","data","process","env","NODE_ENV","JSON","getBreadcrumbJsonLdItem","breadcrumb","index","position","item","props","to","name","children","Breadcrumbs","rest","jsonLdData","itemListElement","length","filter","Boolean","map","__html","propTypes","oneOfType","arrayOf","objectOf","isRequired"],"sources":["../src/Breadcrumbs.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { Breadcrumb } from \"./Breadcrumb\";\nimport \"../scss/breadcrumbs.scss\";\n\nexport { Breadcrumb };\n\nconst stringify = (data) => {\n\tif (process.env.NODE_ENV === \"production\") return JSON.stringify(data);\n\treturn JSON.stringify(data, null, 2);\n};\n\nconst getBreadcrumbJsonLdItem = (breadcrumb, index = 0) => ({\n\t\"@type\": \"ListItem\",\n\tposition: index + 1,\n\titem: {\n\t\t\"@id\": breadcrumb.props.to,\n\t\tname: breadcrumb.props.children\n\t}\n});\n\nexport const Breadcrumbs = ({ children, ...rest }) => {\n\tconst jsonLdData = {\n\t\t\"@context\": \"http://schema.org\",\n\t\t\"@type\": \"BreadcrumbList\",\n\t\titemListElement: children.length\n\t\t\t? children.filter(Boolean).map(getBreadcrumbJsonLdItem)\n\t\t\t: getBreadcrumbJsonLdItem(children)\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<nav aria-label=\"Breadcrumbs\" role=\"navigation\" {...rest}>\n\t\t\t\t<ol className=\"breadcrumbs\">{children}</ol>\n\t\t\t</nav>\n\t\t\t<script\n\t\t\t\ttype=\"application/ld+json\"\n\t\t\t\tdangerouslySetInnerHTML={{ __html: stringify(jsonLdData) }}\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nBreadcrumbs.propTypes = {\n\tchildren: PropTypes.oneOfType([\n\t\tPropTypes.arrayOf(Breadcrumb),\n\t\tPropTypes.objectOf(Breadcrumb)\n\t]).isRequired\n};\n"],"mappings":";;;AAA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