@nice-digital/nds-horizontal-nav 4.0.16 → 4.0.17-alpha-node-update.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/es/HorizontalNav.d.ts +19 -19
- package/es/HorizontalNav.js +36 -36
- package/package.json +5 -5
package/es/HorizontalNav.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "../scss/horizontal-nav.scss";
|
|
3
|
-
export interface HorizontalNavProps {
|
|
4
|
-
[prop: string]: unknown;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface HorizontalNavLinkProps {
|
|
9
|
-
[prop: string]: unknown;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
destination: string;
|
|
13
|
-
elementType?: React.ElementType;
|
|
14
|
-
isCurrent?: boolean;
|
|
15
|
-
method?: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const HorizontalNav: React.FC<HorizontalNavProps>;
|
|
19
|
-
export declare const HorizontalNavLink: React.FC<HorizontalNavLinkProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../scss/horizontal-nav.scss";
|
|
3
|
+
export interface HorizontalNavProps {
|
|
4
|
+
[prop: string]: unknown;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HorizontalNavLinkProps {
|
|
9
|
+
[prop: string]: unknown;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
destination: string;
|
|
13
|
+
elementType?: React.ElementType;
|
|
14
|
+
isCurrent?: boolean;
|
|
15
|
+
method?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const HorizontalNav: React.FC<HorizontalNavProps>;
|
|
19
|
+
export declare const HorizontalNavLink: React.FC<HorizontalNavLinkProps>;
|
package/es/HorizontalNav.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.HorizontalNavLink = exports.HorizontalNav = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
require("../scss/horizontal-nav.scss");
|
|
21
|
-
const HorizontalNav = (_a) => {
|
|
22
|
-
var { className, children } = _a, rest = __rest(_a, ["className", "children"]);
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("nav", Object.assign({ className: (0, classnames_1.default)("horizontal-nav", className) }, rest, { children: (0, jsx_runtime_1.jsx)("ul",
|
|
24
|
-
};
|
|
25
|
-
exports.HorizontalNav = HorizontalNav;
|
|
26
|
-
const HorizontalNavLink = (_a) => {
|
|
27
|
-
var { title, isCurrent = false, destination, elementType: ElementType = "a", children, className, method } = _a, rest = __rest(_a, ["title", "isCurrent", "destination", "elementType", "children", "className", "method"]);
|
|
28
|
-
// Would like to make method a required prop in the future but not possible without a breaking change
|
|
29
|
-
const props = {
|
|
30
|
-
"aria-current": isCurrent,
|
|
31
|
-
className: (0, classnames_1.default)("horizontal-nav__link", className),
|
|
32
|
-
[method || (ElementType === "a" && "href") || "to"]: destination
|
|
33
|
-
};
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)("li",
|
|
35
|
-
};
|
|
36
|
-
exports.HorizontalNavLink = HorizontalNavLink;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.HorizontalNavLink = exports.HorizontalNav = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
require("../scss/horizontal-nav.scss");
|
|
21
|
+
const HorizontalNav = (_a) => {
|
|
22
|
+
var { className, children } = _a, rest = __rest(_a, ["className", "children"]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("nav", Object.assign({ className: (0, classnames_1.default)("horizontal-nav", className) }, rest, { children: (0, jsx_runtime_1.jsx)("ul", { className: "horizontal-nav__list", children: children }) })));
|
|
24
|
+
};
|
|
25
|
+
exports.HorizontalNav = HorizontalNav;
|
|
26
|
+
const HorizontalNavLink = (_a) => {
|
|
27
|
+
var { title, isCurrent = false, destination, elementType: ElementType = "a", children, className, method } = _a, rest = __rest(_a, ["title", "isCurrent", "destination", "elementType", "children", "className", "method"]);
|
|
28
|
+
// Would like to make method a required prop in the future but not possible without a breaking change
|
|
29
|
+
const props = {
|
|
30
|
+
"aria-current": isCurrent,
|
|
31
|
+
className: (0, classnames_1.default)("horizontal-nav__link", className),
|
|
32
|
+
[method || (ElementType === "a" && "href") || "to"]: destination
|
|
33
|
+
};
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("li", { className: "horizontal-nav__item", "data-component": "horizontal-nav", children: (0, jsx_runtime_1.jsx)(ElementType, Object.assign({}, props, rest, { children: title || children || destination || "No Link" })) }));
|
|
35
|
+
};
|
|
36
|
+
exports.HorizontalNavLink = HorizontalNavLink;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-horizontal-nav",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.17-alpha-node-update.0",
|
|
4
4
|
"description": "Horizontal navigation component for the NICE Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"navigation"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nice-digital/nds-core": "^4.0.
|
|
35
|
+
"@nice-digital/nds-core": "^4.0.17-alpha-node-update.0",
|
|
36
36
|
"classnames": "^2.2.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@testing-library/react": "^13.4.0",
|
|
45
45
|
"@testing-library/user-event": "^14.4.3",
|
|
46
46
|
"@types/jest": "^29.2.2",
|
|
47
|
-
"@types/node": "
|
|
48
|
-
"typescript": "^
|
|
47
|
+
"@types/node": "22.19.0",
|
|
48
|
+
"typescript": "^5.9.3"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1b7a4a13183120071b022adecd2fcf4eebefbb6c"
|
|
51
51
|
}
|