@nice-digital/nds-prev-next 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/PrevNext.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import React from "react";
2
- import "./../scss/prev-next.scss";
3
- export interface PrevNextLink {
4
- text: string;
5
- destination: string;
6
- elementType?: React.ElementType;
7
- intro?: string;
8
- method?: string;
9
- }
10
- export interface PrevNextProps {
11
- [prop: string]: unknown;
12
- previousPageLink?: PrevNextLink;
13
- nextPageLink?: PrevNextLink;
14
- className?: string;
15
- }
16
- export declare const PrevNext: React.FC<PrevNextProps>;
1
+ import React from "react";
2
+ import "./../scss/prev-next.scss";
3
+ export interface PrevNextLink {
4
+ text: string;
5
+ destination: string;
6
+ elementType?: React.ElementType;
7
+ intro?: string;
8
+ method?: string;
9
+ }
10
+ export interface PrevNextProps {
11
+ [prop: string]: unknown;
12
+ previousPageLink?: PrevNextLink;
13
+ nextPageLink?: PrevNextLink;
14
+ className?: string;
15
+ }
16
+ export declare const PrevNext: React.FC<PrevNextProps>;
package/es/PrevNext.js CHANGED
@@ -1,51 +1,51 @@
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.PrevNext = void 0;
18
- const jsx_runtime_1 = require("react/jsx-runtime");
19
- const classnames_1 = __importDefault(require("classnames"));
20
- require("./../scss/prev-next.scss");
21
- const Link = ({ text, destination, elementType: ElementType = "a", intro, method }) => {
22
- let linkProps = {
23
- className: "prev-next__link",
24
- [method || (ElementType === "a" && "href") || "to"]: destination
25
- };
26
- return ((0, jsx_runtime_1.jsxs)(ElementType, Object.assign({}, linkProps, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "prev-next__link-intro" }, { children: intro })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "prev-next__link-text" }, { children: text }))] })));
27
- };
28
- const PrevNext = (props) => {
29
- const { nextPageLink, previousPageLink, className } = props, rest = __rest(props, ["nextPageLink", "previousPageLink", "className"]);
30
- let nextLinkProps, previousLinkProps;
31
- nextLinkProps = nextPageLink
32
- ? {
33
- intro: (nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.intro) || "Next page",
34
- text: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.text,
35
- destination: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.destination,
36
- elementType: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.elementType,
37
- method: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.method
38
- }
39
- : null;
40
- previousLinkProps = previousPageLink
41
- ? {
42
- intro: (previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.intro) || "Previous page",
43
- text: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.text,
44
- destination: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.destination,
45
- elementType: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.elementType,
46
- method: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.method
47
- }
48
- : null;
49
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)("prev-next", className), "data-component": "prev-next" }, rest, { children: (nextPageLink || previousPageLink) && ((0, jsx_runtime_1.jsxs)("nav", Object.assign({ "aria-label": "Previous and next pages" }, { children: [nextPageLink && nextLinkProps && (0, jsx_runtime_1.jsx)(Link, Object.assign({}, nextLinkProps)), previousPageLink && previousLinkProps && ((0, jsx_runtime_1.jsx)(Link, Object.assign({}, previousLinkProps)))] }))) })));
50
- };
51
- exports.PrevNext = PrevNext;
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.PrevNext = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ require("./../scss/prev-next.scss");
21
+ const Link = ({ text, destination, elementType: ElementType = "a", intro, method }) => {
22
+ let linkProps = {
23
+ className: "prev-next__link",
24
+ [method || (ElementType === "a" && "href") || "to"]: destination
25
+ };
26
+ return ((0, jsx_runtime_1.jsxs)(ElementType, Object.assign({}, linkProps, { children: [(0, jsx_runtime_1.jsx)("span", { className: "prev-next__link-intro", children: intro }), (0, jsx_runtime_1.jsx)("span", { className: "prev-next__link-text", children: text })] })));
27
+ };
28
+ const PrevNext = (props) => {
29
+ const { nextPageLink, previousPageLink, className } = props, rest = __rest(props, ["nextPageLink", "previousPageLink", "className"]);
30
+ let nextLinkProps, previousLinkProps;
31
+ nextLinkProps = nextPageLink
32
+ ? {
33
+ intro: (nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.intro) || "Next page",
34
+ text: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.text,
35
+ destination: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.destination,
36
+ elementType: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.elementType,
37
+ method: nextPageLink === null || nextPageLink === void 0 ? void 0 : nextPageLink.method
38
+ }
39
+ : null;
40
+ previousLinkProps = previousPageLink
41
+ ? {
42
+ intro: (previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.intro) || "Previous page",
43
+ text: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.text,
44
+ destination: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.destination,
45
+ elementType: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.elementType,
46
+ method: previousPageLink === null || previousPageLink === void 0 ? void 0 : previousPageLink.method
47
+ }
48
+ : null;
49
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)("prev-next", className), "data-component": "prev-next" }, rest, { children: (nextPageLink || previousPageLink) && ((0, jsx_runtime_1.jsxs)("nav", { "aria-label": "Previous and next pages", children: [nextPageLink && nextLinkProps && (0, jsx_runtime_1.jsx)(Link, Object.assign({}, nextLinkProps)), previousPageLink && previousLinkProps && ((0, jsx_runtime_1.jsx)(Link, Object.assign({}, previousLinkProps)))] })) })));
50
+ };
51
+ exports.PrevNext = PrevNext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-prev-next",
3
- "version": "4.0.16",
3
+ "version": "4.0.17-alpha-node-update.0",
4
4
  "description": "Previous and next navigation component for the NICE Design System",
5
5
  "author": "Warren Keith <w@rren.dev>",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "url": "https://github.com/nice-digital/nice-design-system/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@nice-digital/nds-core": "^4.0.16",
38
+ "@nice-digital/nds-core": "^4.0.17-alpha-node-update.0",
39
39
  "classnames": "^2.2.6"
40
40
  },
41
41
  "peerDependencies": {
@@ -47,8 +47,8 @@
47
47
  "@testing-library/react": "^13.4.0",
48
48
  "@testing-library/user-event": "^14.4.3",
49
49
  "@types/jest": "^29.2.2",
50
- "@types/node": "^18.11.9",
51
- "typescript": "^4.8.4"
50
+ "@types/node": "22.19.0",
51
+ "typescript": "^5.9.3"
52
52
  },
53
- "gitHead": "7f069b2855600345c7366e8dc965a5d839a20c17"
53
+ "gitHead": "1b7a4a13183120071b022adecd2fcf4eebefbb6c"
54
54
  }