@nice-digital/nds-horizontal-nav 2.0.1-alpha.0 → 2.0.4-alpha.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/README.md +1 -1
- package/es/HorizontalNav.js.map +1 -1
- package/lib/HorizontalNav.js.map +1 -1
- package/package.json +3 -3
- package/scss/horizontal-nav.scss +4 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ Any additional props are spread on to the `li` element, useful for accessibility
|
|
|
132
132
|
If you're not using [React](#react), then import the SCSS directly into your application by:
|
|
133
133
|
|
|
134
134
|
```scss
|
|
135
|
-
@
|
|
135
|
+
@forward '@nice-digital/nds-horizontal-nav/scss/horizontal-nav';
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### HTML
|
package/es/HorizontalNav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"HorizontalNav.js","names":["React","PropTypes","classnames","HorizontalNav","className","children","rest","HorizontalNavLink","title","isCurrent","destination","elementType","ElementType","method","props","propTypes","node","string","bool","isRequired"],"sources":["../src/HorizontalNav.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classnames from \"classnames\";\n\nimport \"./../scss/horizontal-nav.scss\";\n\nexport const HorizontalNav = ({ className, children, ...rest }) => {\n\treturn (\n\t\t<nav className={classnames(\"horizontal-nav\", className)} {...rest}>\n\t\t\t<ul className=\"horizontal-nav__list\">{children}</ul>\n\t\t</nav>\n\t);\n};\n\nexport const HorizontalNavLink = ({\n\ttitle,\n\tisCurrent = false,\n\tdestination,\n\telementType: ElementType = \"a\",\n\tchildren,\n\tclassName,\n\tmethod,\n\t...rest\n}) => {\n\t// Would like to make method a required prop in the future but not possible without a breaking change\n\tconst props = {\n\t\t\"aria-current\": isCurrent,\n\t\tclassName: classnames(\"horizontal-nav__link\", className),\n\t\t[method || (ElementType === \"a\" && \"href\") || \"to\"]: destination\n\t};\n\treturn (\n\t\t<li className=\"horizontal-nav__item\">\n\t\t\t<ElementType {...props} {...rest}>\n\t\t\t\t{title || children || destination || \"No Link\"}\n\t\t\t</ElementType>\n\t\t</li>\n\t);\n};\n\nHorizontalNav.propTypes = {\n\tchildren: PropTypes.node,\n\tclassName: PropTypes.string\n};\n\nHorizontalNavLink.propTypes = {\n\tchildren: PropTypes.node,\n\ttitle: PropTypes.string,\n\tisCurrent: PropTypes.bool,\n\tdestination: PropTypes.string.isRequired,\n\telementType: PropTypes.elementType,\n\tclassName: PropTypes.string,\n\tmethod: PropTypes.string\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAO,+BAAP;AAEA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,OAAsC;EAAA,IAAnCC,SAAmC,QAAnCA,SAAmC;EAAA,IAAxBC,QAAwB,QAAxBA,QAAwB;EAAA,IAAXC,IAAW;;EAClE,oBACC;IAAK,SAAS,EAAEJ,UAAU,CAAC,gBAAD,EAAmBE,SAAnB;EAA1B,GAA6DE,IAA7D,gBACC;IAAI,SAAS,EAAC;EAAd,GAAsCD,QAAtC,CADD,CADD;AAKA,CANM;AAQP,OAAO,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB,QAS3B;EAAA;;EAAA,IARLC,KAQK,SARLA,KAQK;EAAA,4BAPLC,SAOK;EAAA,IAPLA,SAOK,gCAPO,KAOP;EAAA,IANLC,WAMK,SANLA,WAMK;EAAA,8BALLC,WAKK;EAAA,IALQC,WAKR,kCALsB,GAKtB;EAAA,IAJLP,QAIK,SAJLA,QAIK;EAAA,IAHLD,SAGK,SAHLA,SAGK;EAAA,IAFLS,MAEK,SAFLA,MAEK;EAAA,IADFP,IACE;;EACL;EACA,IAAMQ,KAAK;IACV,gBAAgBL,SADN;IAEVL,SAAS,EAAEF,UAAU,CAAC,sBAAD,EAAyBE,SAAzB;EAFX,UAGTS,MAAM,IAAKD,WAAW,KAAK,GAAhB,IAAuB,MAAlC,IAA6C,IAHpC,IAG2CF,WAH3C,SAAX;EAKA,oBACC;IAAI,SAAS,EAAC;EAAd,gBACC,oBAAC,WAAD,eAAiBI,KAAjB,EAA4BR,IAA5B,GACEE,KAAK,IAAIH,QAAT,IAAqBK,WAArB,IAAoC,SADtC,CADD,CADD;AAOA,CAvBM;AAyBPP,aAAa,CAACY,SAAd,GAA0B;EACzBV,QAAQ,EAAEJ,SAAS,CAACe,IADK;EAEzBZ,SAAS,EAAEH,SAAS,CAACgB;AAFI,CAA1B;AAKAV,iBAAiB,CAACQ,SAAlB,GAA8B;EAC7BV,QAAQ,EAAEJ,SAAS,CAACe,IADS;EAE7BR,KAAK,EAAEP,SAAS,CAACgB,MAFY;EAG7BR,SAAS,EAAER,SAAS,CAACiB,IAHQ;EAI7BR,WAAW,EAAET,SAAS,CAACgB,MAAV,CAAiBE,UAJD;EAK7BR,WAAW,EAAEV,SAAS,CAACU,WALM;EAM7BP,SAAS,EAAEH,SAAS,CAACgB,MANQ;EAO7BJ,MAAM,EAAEZ,SAAS,CAACgB;AAPW,CAA9B"}
|
package/lib/HorizontalNav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"HorizontalNav.js","names":["HorizontalNav","className","children","rest","classnames","HorizontalNavLink","title","isCurrent","destination","elementType","ElementType","method","props","propTypes","PropTypes","node","string","bool","isRequired"],"sources":["../src/HorizontalNav.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classnames from \"classnames\";\n\nimport \"./../scss/horizontal-nav.scss\";\n\nexport const HorizontalNav = ({ className, children, ...rest }) => {\n\treturn (\n\t\t<nav className={classnames(\"horizontal-nav\", className)} {...rest}>\n\t\t\t<ul className=\"horizontal-nav__list\">{children}</ul>\n\t\t</nav>\n\t);\n};\n\nexport const HorizontalNavLink = ({\n\ttitle,\n\tisCurrent = false,\n\tdestination,\n\telementType: ElementType = \"a\",\n\tchildren,\n\tclassName,\n\tmethod,\n\t...rest\n}) => {\n\t// Would like to make method a required prop in the future but not possible without a breaking change\n\tconst props = {\n\t\t\"aria-current\": isCurrent,\n\t\tclassName: classnames(\"horizontal-nav__link\", className),\n\t\t[method || (ElementType === \"a\" && \"href\") || \"to\"]: destination\n\t};\n\treturn (\n\t\t<li className=\"horizontal-nav__item\">\n\t\t\t<ElementType {...props} {...rest}>\n\t\t\t\t{title || children || destination || \"No Link\"}\n\t\t\t</ElementType>\n\t\t</li>\n\t);\n};\n\nHorizontalNav.propTypes = {\n\tchildren: PropTypes.node,\n\tclassName: PropTypes.string\n};\n\nHorizontalNavLink.propTypes = {\n\tchildren: PropTypes.node,\n\ttitle: PropTypes.string,\n\tisCurrent: PropTypes.bool,\n\tdestination: PropTypes.string.isRequired,\n\telementType: PropTypes.elementType,\n\tclassName: PropTypes.string,\n\tmethod: PropTypes.string\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,OAAsC;EAAA,IAAnCC,SAAmC,QAAnCA,SAAmC;EAAA,IAAxBC,QAAwB,QAAxBA,QAAwB;EAAA,IAAXC,IAAW;EAClE,oBACC;IAAK,SAAS,EAAE,IAAAC,sBAAA,EAAW,gBAAX,EAA6BH,SAA7B;EAAhB,GAA6DE,IAA7D;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,iBACC;IAAI,SAAS,EAAC,sBAAd;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GAAsCD,QAAtC,CADD,CADD;AAKA,CANM;;;;AAQA,IAAMG,iBAAiB,GAAG,SAApBA,iBAAoB,QAS3B;EAAA;;EAAA,IARLC,KAQK,SARLA,KAQK;EAAA,4BAPLC,SAOK;EAAA,IAPLA,SAOK,gCAPO,KAOP;EAAA,IANLC,WAMK,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
|
3
|
+
"version": "2.0.4-alpha.0",
|
|
4
4
|
"description": "Horizontal navigation component for the NICE Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"navigation"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nice-digital/nds-core": "^2.0.
|
|
37
|
+
"@nice-digital/nds-core": "^2.0.4-alpha.0",
|
|
38
38
|
"classnames": "^2.2.6",
|
|
39
39
|
"prop-types": "^15.7.2"
|
|
40
40
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/cli": "^7.5.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "5bbe911b595b15d7d039aec0972d5aeabcd8de6f"
|
|
49
49
|
}
|
package/scss/horizontal-nav.scss
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
.horizontal-nav {
|
|
14
14
|
@include visibility.hide-print;
|
|
15
15
|
margin-bottom: utils.rem(spacing.$large);
|
|
16
|
+
|
|
16
17
|
&__list {
|
|
17
18
|
align-items: stretch;
|
|
18
19
|
display: flex;
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
|
|
44
45
|
@include media-queries.mq($until: sm) {
|
|
45
46
|
border-top: 1px solid colours.$border;
|
|
47
|
+
|
|
46
48
|
&:first-of-type {
|
|
47
49
|
border-top: none;
|
|
48
50
|
}
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
|
|
52
54
|
&__link {
|
|
53
55
|
display: block;
|
|
54
|
-
line-height:
|
|
56
|
+
line-height: 1;
|
|
55
57
|
margin-bottom: -1px; // to ensure there's no rendered gap between the bottom border and the border across the page
|
|
56
58
|
padding: utils.rem(spacing.$medium);
|
|
57
59
|
text-decoration: none;
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
border-bottom: 4px solid colours.$horizontal-nav-current-link-border;
|
|
66
68
|
color: colours.$horizontal-nav-current-link;
|
|
67
69
|
font-weight: bold;
|
|
70
|
+
|
|
68
71
|
@include media-queries.mq($from: md) {
|
|
69
72
|
background-color: unset;
|
|
70
73
|
}
|