@nice-digital/nds-breadcrumbs 1.2.12 → 1.2.15

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/README.md CHANGED
@@ -59,6 +59,10 @@ import { Breadcrumbs, Breadcrumb } from "@nice-digital/nds-breadcrumbs";
59
59
 
60
60
  The indvidual breadcrumb items
61
61
 
62
+ ###### rest
63
+
64
+ Any additional props will be spread across the containing `nav`, including any additional classNames
65
+
62
66
  ##### Breadcrumb
63
67
 
64
68
  ###### to
@@ -87,6 +91,12 @@ The method of activating the link. By default a link is an anchor with `href` at
87
91
 
88
92
  The text of the breadcrumb. Can accept any valid React node, but should be limited to a string to conform with the design system.
89
93
 
94
+ ###### className
95
+
96
+ - Type: `string`
97
+
98
+ Any additional className will be merged on to the container
99
+
90
100
  ### SCSS
91
101
 
92
102
  If you're not using [React](#react), then import the SCSS directly into your application by:
package/es/Breadcrumb.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- var _excluded = ["elementType", "method", "to", "children"];
3
+ var _excluded = ["elementType", "method", "to", "children", "className"];
4
4
  import React from "react";
5
5
  import PropTypes from "prop-types";
6
+ import classnames from "classnames";
6
7
  export var Breadcrumb = function Breadcrumb(props) {
7
8
  var elementType = props.elementType,
8
9
  method = props.method,
9
10
  to = props.to,
10
11
  children = props.children,
12
+ className = props.className,
11
13
  attributes = _objectWithoutPropertiesLoose(props, _excluded);
12
14
 
13
15
  var ElementType = elementType || "span";
@@ -20,7 +22,7 @@ export var Breadcrumb = function Breadcrumb(props) {
20
22
  }
21
23
 
22
24
  return /*#__PURE__*/React.createElement("li", {
23
- className: "breadcrumbs__crumb"
25
+ className: classnames(["breadcrumbs__crumb", className])
24
26
  }, /*#__PURE__*/React.createElement(ElementType, innerTagProps, children));
25
27
  };
26
28
  Breadcrumb.propTypes = {
@@ -28,6 +30,7 @@ Breadcrumb.propTypes = {
28
30
  // Allow tag to be customised for custom routing integration
29
31
  children: PropTypes.string.isRequired,
30
32
  to: PropTypes.string,
31
- method: PropTypes.string
33
+ method: PropTypes.string,
34
+ className: PropTypes.string
32
35
  };
33
36
  //# sourceMappingURL=Breadcrumb.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Breadcrumb.js"],"names":["React","PropTypes","Breadcrumb","props","elementType","method","to","children","attributes","ElementType","innerTagProps","propTypes","string","isRequired"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAAAC,KAAK,EAAI;AAClC,MAAQC,WAAR,GAA6DD,KAA7D,CAAQC,WAAR;AAAA,MAAqBC,MAArB,GAA6DF,KAA7D,CAAqBE,MAArB;AAAA,MAA6BC,EAA7B,GAA6DH,KAA7D,CAA6BG,EAA7B;AAAA,MAAiCC,QAAjC,GAA6DJ,KAA7D,CAAiCI,QAAjC;AAAA,MAA8CC,UAA9C,iCAA6DL,KAA7D;;AAEA,MAAIM,WAAW,GAAGL,WAAW,IAAI,MAAjC;;AAEA,MAAMM,aAAa,gBACfF,UADe,CAAnB;;AAIA,MAAIF,EAAJ,EAAQ;AACPG,IAAAA,WAAW,GAAGL,WAAW,IAAI,GAA7B;AACAM,IAAAA,aAAa,CAACL,MAAM,IAAKI,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAA9C,CAAb,GAAmEH,EAAnE;AACA;;AAED,sBACC;AAAI,IAAA,SAAS,EAAC;AAAd,kBACC,oBAAC,WAAD,EAAiBI,aAAjB,EAAiCH,QAAjC,CADD,CADD;AAKA,CAnBM;AAqBPL,UAAU,CAACS,SAAX,GAAuB;AACtBP,EAAAA,WAAW,EAAEH,SAAS,CAACG,WADD;AACc;AACpCG,EAAAA,QAAQ,EAAEN,SAAS,CAACW,MAAV,CAAiBC,UAFL;AAGtBP,EAAAA,EAAE,EAAEL,SAAS,CAACW,MAHQ;AAItBP,EAAAA,MAAM,EAAEJ,SAAS,CAACW;AAJI,CAAvB","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport const Breadcrumb = props => {\n\tconst { elementType, method, to, children, ...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=\"breadcrumbs__crumb\">\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};\n"],"file":"Breadcrumb.js"}
1
+ {"version":3,"sources":["../src/Breadcrumb.js"],"names":["React","PropTypes","classnames","Breadcrumb","props","elementType","method","to","children","className","attributes","ElementType","innerTagProps","propTypes","string","isRequired"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAAAC,KAAK,EAAI;AAClC,MAAQC,WAAR,GAAwED,KAAxE,CAAQC,WAAR;AAAA,MAAqBC,MAArB,GAAwEF,KAAxE,CAAqBE,MAArB;AAAA,MAA6BC,EAA7B,GAAwEH,KAAxE,CAA6BG,EAA7B;AAAA,MAAiCC,QAAjC,GAAwEJ,KAAxE,CAAiCI,QAAjC;AAAA,MAA2CC,SAA3C,GAAwEL,KAAxE,CAA2CK,SAA3C;AAAA,MAAyDC,UAAzD,iCAAwEN,KAAxE;;AAEA,MAAIO,WAAW,GAAGN,WAAW,IAAI,MAAjC;;AAEA,MAAMO,aAAa,gBACfF,UADe,CAAnB;;AAIA,MAAIH,EAAJ,EAAQ;AACPI,IAAAA,WAAW,GAAGN,WAAW,IAAI,GAA7B;AACAO,IAAAA,aAAa,CAACN,MAAM,IAAKK,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAA9C,CAAb,GAAmEJ,EAAnE;AACA;;AAED,sBACC;AAAI,IAAA,SAAS,EAAEL,UAAU,CAAC,CAAC,oBAAD,EAAuBO,SAAvB,CAAD;AAAzB,kBACC,oBAAC,WAAD,EAAiBG,aAAjB,EAAiCJ,QAAjC,CADD,CADD;AAKA,CAnBM;AAqBPL,UAAU,CAACU,SAAX,GAAuB;AACtBR,EAAAA,WAAW,EAAEJ,SAAS,CAACI,WADD;AACc;AACpCG,EAAAA,QAAQ,EAAEP,SAAS,CAACa,MAAV,CAAiBC,UAFL;AAGtBR,EAAAA,EAAE,EAAEN,SAAS,CAACa,MAHQ;AAItBR,EAAAA,MAAM,EAAEL,SAAS,CAACa,MAJI;AAKtBL,EAAAA,SAAS,EAAER,SAAS,CAACa;AALC,CAAvB","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"],"file":"Breadcrumb.js"}
package/lib/Breadcrumb.js CHANGED
@@ -13,9 +13,11 @@ var _react = _interopRequireDefault(require("react"));
13
13
 
14
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
- var _excluded = ["elementType", "method", "to", "children"];
16
+ var _classnames = _interopRequireDefault(require("classnames"));
17
17
 
18
- var _jsxFileName = "/Users/warren/Web/nice-design-system/components/nds-breadcrumbs/src/Breadcrumb.js",
18
+ var _excluded = ["elementType", "method", "to", "children", "className"];
19
+
20
+ var _jsxFileName = "C:\\dev\\nice-design-system\\components\\nds-breadcrumbs\\src\\Breadcrumb.js",
19
21
  _this = void 0;
20
22
 
21
23
  var Breadcrumb = function Breadcrumb(props) {
@@ -23,6 +25,7 @@ var Breadcrumb = function Breadcrumb(props) {
23
25
  method = props.method,
24
26
  to = props.to,
25
27
  children = props.children,
28
+ className = props.className,
26
29
  attributes = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
27
30
  var ElementType = elementType || "span";
28
31
  var innerTagProps = (0, _extends2["default"])({}, attributes);
@@ -33,18 +36,18 @@ var Breadcrumb = function Breadcrumb(props) {
33
36
  }
34
37
 
35
38
  return /*#__PURE__*/_react["default"].createElement("li", {
36
- className: "breadcrumbs__crumb",
39
+ className: (0, _classnames["default"])(["breadcrumbs__crumb", className]),
37
40
  __self: _this,
38
41
  __source: {
39
42
  fileName: _jsxFileName,
40
- lineNumber: 19,
43
+ lineNumber: 20,
41
44
  columnNumber: 3
42
45
  }
43
46
  }, /*#__PURE__*/_react["default"].createElement(ElementType, (0, _extends2["default"])({}, innerTagProps, {
44
47
  __self: _this,
45
48
  __source: {
46
49
  fileName: _jsxFileName,
47
- lineNumber: 20,
50
+ lineNumber: 21,
48
51
  columnNumber: 4
49
52
  }
50
53
  }), children));
@@ -56,6 +59,7 @@ Breadcrumb.propTypes = {
56
59
  // Allow tag to be customised for custom routing integration
57
60
  children: _propTypes["default"].string.isRequired,
58
61
  to: _propTypes["default"].string,
59
- method: _propTypes["default"].string
62
+ method: _propTypes["default"].string,
63
+ className: _propTypes["default"].string
60
64
  };
61
65
  //# sourceMappingURL=Breadcrumb.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Breadcrumb.js"],"names":["Breadcrumb","props","elementType","method","to","children","attributes","ElementType","innerTagProps","propTypes","PropTypes","string","isRequired"],"mappings":";;;;;;;;;;;AAAA;;AACA;;;;;;;AAEO,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,KAAK,EAAI;AAClC,MAAQC,WAAR,GAA6DD,KAA7D,CAAQC,WAAR;AAAA,MAAqBC,MAArB,GAA6DF,KAA7D,CAAqBE,MAArB;AAAA,MAA6BC,EAA7B,GAA6DH,KAA7D,CAA6BG,EAA7B;AAAA,MAAiCC,QAAjC,GAA6DJ,KAA7D,CAAiCI,QAAjC;AAAA,MAA8CC,UAA9C,kDAA6DL,KAA7D;AAEA,MAAIM,WAAW,GAAGL,WAAW,IAAI,MAAjC;AAEA,MAAMM,aAAa,iCACfF,UADe,CAAnB;;AAIA,MAAIF,EAAJ,EAAQ;AACPG,IAAAA,WAAW,GAAGL,WAAW,IAAI,GAA7B;AACAM,IAAAA,aAAa,CAACL,MAAM,IAAKI,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAA9C,CAAb,GAAmEH,EAAnE;AACA;;AAED,sBACC;AAAI,IAAA,SAAS,EAAC,oBAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBACC,gCAAC,WAAD,gCAAiBI,aAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAiCH,QAAjC,CADD,CADD;AAKA,CAnBM;;;AAqBPL,UAAU,CAACS,SAAX,GAAuB;AACtBP,EAAAA,WAAW,EAAEQ,sBAAUR,WADD;AACc;AACpCG,EAAAA,QAAQ,EAAEK,sBAAUC,MAAV,CAAiBC,UAFL;AAGtBR,EAAAA,EAAE,EAAEM,sBAAUC,MAHQ;AAItBR,EAAAA,MAAM,EAAEO,sBAAUC;AAJI,CAAvB","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport const Breadcrumb = props => {\n\tconst { elementType, method, to, children, ...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=\"breadcrumbs__crumb\">\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};\n"],"file":"Breadcrumb.js"}
1
+ {"version":3,"sources":["../src/Breadcrumb.js"],"names":["Breadcrumb","props","elementType","method","to","children","className","attributes","ElementType","innerTagProps","propTypes","PropTypes","string","isRequired"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;AAEO,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,KAAK,EAAI;AAClC,MAAQC,WAAR,GAAwED,KAAxE,CAAQC,WAAR;AAAA,MAAqBC,MAArB,GAAwEF,KAAxE,CAAqBE,MAArB;AAAA,MAA6BC,EAA7B,GAAwEH,KAAxE,CAA6BG,EAA7B;AAAA,MAAiCC,QAAjC,GAAwEJ,KAAxE,CAAiCI,QAAjC;AAAA,MAA2CC,SAA3C,GAAwEL,KAAxE,CAA2CK,SAA3C;AAAA,MAAyDC,UAAzD,kDAAwEN,KAAxE;AAEA,MAAIO,WAAW,GAAGN,WAAW,IAAI,MAAjC;AAEA,MAAMO,aAAa,iCACfF,UADe,CAAnB;;AAIA,MAAIH,EAAJ,EAAQ;AACPI,IAAAA,WAAW,GAAGN,WAAW,IAAI,GAA7B;AACAO,IAAAA,aAAa,CAACN,MAAM,IAAKK,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAA9C,CAAb,GAAmEJ,EAAnE;AACA;;AAED,sBACC;AAAI,IAAA,SAAS,EAAE,4BAAW,CAAC,oBAAD,EAAuBE,SAAvB,CAAX,CAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBACC,gCAAC,WAAD,gCAAiBG,aAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAiCJ,QAAjC,CADD,CADD;AAKA,CAnBM;;;AAqBPL,UAAU,CAACU,SAAX,GAAuB;AACtBR,EAAAA,WAAW,EAAES,sBAAUT,WADD;AACc;AACpCG,EAAAA,QAAQ,EAAEM,sBAAUC,MAAV,CAAiBC,UAFL;AAGtBT,EAAAA,EAAE,EAAEO,sBAAUC,MAHQ;AAItBT,EAAAA,MAAM,EAAEQ,sBAAUC,MAJI;AAKtBN,EAAAA,SAAS,EAAEK,sBAAUC;AALC,CAAvB","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"],"file":"Breadcrumb.js"}
@@ -21,7 +21,7 @@ require("../scss/breadcrumbs.scss");
21
21
 
22
22
  var _excluded = ["children"];
23
23
 
24
- var _jsxFileName = "/Users/warren/Web/nice-design-system/components/nds-breadcrumbs/src/Breadcrumbs.js",
24
+ var _jsxFileName = "C:\\dev\\nice-design-system\\components\\nds-breadcrumbs\\src\\Breadcrumbs.js",
25
25
  _this = void 0;
26
26
 
27
27
  var stringify = function stringify(data) {
@@ -18,6 +18,7 @@ declare module "@nice-digital/nds-breadcrumbs" {
18
18
 
19
19
  export interface BreadcrumbsProps {
20
20
  [prop: string]: unknown;
21
+ className?: string;
21
22
  children: ValidBreadcrumbProp[] | ValidBreadcrumbProp;
22
23
  }
23
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-breadcrumbs",
3
- "version": "1.2.12",
3
+ "version": "1.2.15",
4
4
  "description": "Breadcrumbs component for the NICE Design System",
5
5
  "keywords": [
6
6
  "breadcrumbs"
@@ -34,7 +34,8 @@
34
34
  "url": "https://github.com/nice-digital/nice-design-system/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@nice-digital/nds-core": "^1.2.11",
37
+ "@nice-digital/nds-core": "^1.2.13",
38
+ "classnames": "^2.3.1",
38
39
  "prop-types": "^15.7.2"
39
40
  },
40
41
  "peerDependencies": {
@@ -44,5 +45,5 @@
44
45
  "devDependencies": {
45
46
  "@babel/cli": "^7.5.0"
46
47
  },
47
- "gitHead": "6507bf955411adbcfdd4ddabe739125dd18dfd16"
48
+ "gitHead": "2bdf3454416a51f8e6c407a0f03ff14c08b6023a"
48
49
  }