@not-govuk/back-link 0.17.4 → 0.18.1

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/dist/BackLink.js CHANGED
@@ -1,19 +1,15 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BackLink = void 0;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const component_helpers_1 = require("@react-foundry/component-helpers");
7
- const link_1 = require("@not-govuk/link");
8
- const router_1 = require("@react-foundry/router");
9
- require("../assets/BackLink.scss");
10
- const BackLink = ({ children, classBlock, classModifiers, className, href, text: _text, ...attrs }) => {
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { classBuilder } from '@react-foundry/component-helpers';
4
+ import { A } from '@not-govuk/link';
5
+ import { useNavigate } from '@react-foundry/router';
6
+ import '../assets/BackLink.scss';
7
+ export const BackLink = ({ children, classBlock, classModifiers, className, href, text: _text, ...attrs }) => {
11
8
  const defaultClassBlock = 'govuk-back-link';
12
- const classes = (0, component_helpers_1.classBuilder)(defaultClassBlock, classBlock, classModifiers, className);
13
- const navigate = (0, router_1.useNavigate)();
9
+ const classes = classBuilder(defaultClassBlock, classBlock, classModifiers, className);
10
+ const navigate = useNavigate();
14
11
  const text = _text || children || 'Back';
15
12
  const goBack = () => navigate && navigate(-1);
16
- return href ? ((0, jsx_runtime_1.jsx)(link_1.A, { ...attrs, classBlock: classBlock || defaultClassBlock, classModifiers: classModifiers, className: className, href: href, children: text })) : ((0, jsx_runtime_1.jsx)("a", { ...attrs, className: classes(), href: "#", onClick: goBack, children: text }));
13
+ return href ? (_jsx(A, { ...attrs, classBlock: classBlock || defaultClassBlock, classModifiers: classModifiers, className: className, href: href, children: text })) : (_jsx("a", { ...attrs, className: classes(), href: "#", onClick: goBack, children: text }));
17
14
  };
18
- exports.BackLink = BackLink;
19
- exports.default = exports.BackLink;
15
+ export default BackLink;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@not-govuk/back-link",
3
- "version": "0.17.4",
3
+ "version": "0.18.1",
4
4
  "description": "A component to help users navigate back one page.",
5
+ "type": "module",
5
6
  "main": "dist/BackLink.js",
6
7
  "sass": "assets/BackLink.scss",
7
8
  "exports": {
8
9
  ".": {
9
10
  "sass": "./assets/BackLink.scss",
10
11
  "types": "./dist/BackLink.d.ts",
11
- "import": "./dist/BackLink.mjs",
12
- "require": "./dist/BackLink.js",
13
- "default": "./dist/BackLink.mjs"
12
+ "import": "./dist/BackLink.js",
13
+ "default": "./dist/BackLink.js"
14
14
  }
15
15
  },
16
16
  "files": [
@@ -23,16 +23,16 @@
23
23
  "react-components"
24
24
  ],
25
25
  "dependencies": {
26
- "@react-foundry/component-helpers": "^0.1.9",
27
- "@react-foundry/router": "^0.1.9",
26
+ "@react-foundry/component-helpers": "^0.3.0",
27
+ "@react-foundry/router": "^0.3.0",
28
28
  "govuk-frontend": "^5.14.0",
29
- "@not-govuk/link": "^0.17.4",
30
- "@not-govuk/sass-base": "^0.17.4"
29
+ "@not-govuk/link": "^0.18.1",
30
+ "@not-govuk/sass-base": "^0.18.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@react-foundry/docs-components": "^0.1.9",
34
- "@storybook/addon-docs": "^9.1.20",
35
- "react": "^19.2.4"
33
+ "@react-foundry/docs-components": "^0.3.0",
34
+ "@storybook/addon-docs": "^10.3.5",
35
+ "react": "^19.2.5"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@react-foundry/docs-components": {
@@ -43,21 +43,19 @@
43
43
  }
44
44
  },
45
45
  "devDependencies": {
46
- "@react-foundry/component-test-helpers": "0.1.9",
46
+ "@react-foundry/component-test-helpers": "0.3.0",
47
47
  "@types/react": "19.2.14",
48
48
  "jest": "30.3.0",
49
49
  "jest-environment-jsdom": "30.3.0",
50
50
  "ts-jest": "29.4.9",
51
51
  "typescript": "5.9.3",
52
- "@not-govuk/panel": "0.17.4"
52
+ "@not-govuk/panel": "0.18.1"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
56
- "build": "npm run build:esm && npm run build:cjs",
57
- "build:esm": "tsc -m es2022 && find dist -name '*.js' -exec sh -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\;",
58
- "build:cjs": "tsc",
56
+ "build": "tsc",
59
57
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
60
58
  },
61
- "module": "dist/BackLink.mjs",
59
+ "module": "dist/BackLink.js",
62
60
  "typings": "dist/BackLink.d.ts"
63
61
  }
package/dist/BackLink.mjs DELETED
@@ -1,15 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { classBuilder } from '@react-foundry/component-helpers';
4
- import { A } from '@not-govuk/link';
5
- import { useNavigate } from '@react-foundry/router';
6
- import '../assets/BackLink.scss';
7
- export const BackLink = ({ children, classBlock, classModifiers, className, href, text: _text, ...attrs }) => {
8
- const defaultClassBlock = 'govuk-back-link';
9
- const classes = classBuilder(defaultClassBlock, classBlock, classModifiers, className);
10
- const navigate = useNavigate();
11
- const text = _text || children || 'Back';
12
- const goBack = () => navigate && navigate(-1);
13
- return href ? (_jsx(A, { ...attrs, classBlock: classBlock || defaultClassBlock, classModifiers: classModifiers, className: className, href: href, children: text })) : (_jsx("a", { ...attrs, className: classes(), href: "#", onClick: goBack, children: text }));
14
- };
15
- export default BackLink;