Skip to content

Commit 97f9a4b

Browse files
Add react router links to Breadcrumbs
1 parent cd73eb5 commit 97f9a4b

File tree

9 files changed

+241
-36
lines changed

9 files changed

+241
-36
lines changed

.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const config: StorybookConfig = {
99
"@storybook/addon-interactions",
1010
"@storybook/addon-links",
1111
"storybook-dark-mode",
12+
"storybook-addon-remix-react-router",
1213
],
1314
framework: {
1415
name: "@storybook/react-webpack5",

.storybook/preview.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { CssBaseline } from "@mui/material";
33
import type { Preview } from "@storybook/react";
4+
import { withRouter } from "storybook-addon-remix-react-router";
45

56
import { ThemeProvider } from "../src";
67
import { GenericTheme, DiamondTheme } from "../src";
@@ -11,6 +12,7 @@ const TextThemeBase = "Theme: Generic";
1112
const TextThemeDiamond = "Theme: Diamond";
1213

1314
export const decorators = [
15+
withRouter,
1416
(StoriesWithPadding: React.FC) => {
1517
return (
1618
<div style={{ padding: "2em" }}>

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default [
2020
"babel.config.js",
2121
"eslint.config.js",
2222
"jest.config.js",
23+
"jest.setup.js",
2324
"rollup.config.mjs",
2425
]},
2526
js.configs.recommended,

jest.config.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/** @type {import('jest').Config} */
2-
const config = { testEnvironment: "jsdom",
3-
moduleNameMapper: {
4-
"^.+.(svg)$": "jest-transform-stub",
5-
},
6-
transform: {
7-
"^.+\\.tsx?$": "babel-jest"
8-
}};
2+
const config = {
3+
testEnvironment: "jsdom",
4+
moduleNameMapper: {
5+
"^.+.(svg)$": "jest-transform-stub",
6+
},
7+
transform: {
8+
"^.+\\.tsx?$": "babel-jest",
9+
},
10+
setupFilesAfterEnv: ['./jest.setup.js'],
11+
};
912

10-
export default config;
13+
export default config;

jest.setup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { TextEncoder, TextDecoder } = require('util');
2+
3+
global.TextEncoder = TextEncoder;
4+
global.TextDecoder = TextDecoder;

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
"storybook:publish": "gh-pages -b storybook/publish -d storybook-static"
2525
},
2626
"dependencies": {
27-
"react-icons": "^5.3.0"
27+
"react-icons": "^5.3.0",
28+
"react-router-dom": "^7.5.3",
29+
"storybook-addon-remix-react-router": "3"
2830
},
2931
"peerDependencies": {
3032
"@emotion/react": "^11.13.3",
3133
"@emotion/styled": "^11.13.0",
32-
"@mui/material": "^6.1.7",
3334
"@mui/icons-material": "^6.1.7",
35+
"@mui/material": "^6.1.7",
3436
"react": "^18.3.1",
3537
"react-dom": "^18.3.1"
3638
},
@@ -40,6 +42,7 @@
4042
"@babel/preset-react": "^7.25.9",
4143
"@babel/preset-typescript": "^7.26.0",
4244
"@chromatic-com/storybook": "^3.2.2",
45+
"@eslint/eslintrc": "^3.2.0",
4346
"@rollup/plugin-commonjs": "^28.0.1",
4447
"@rollup/plugin-image": "^3.0.3",
4548
"@rollup/plugin-json": "^6.1.0",
@@ -63,11 +66,19 @@
6366
"@types/node": "^20.17.6",
6467
"@types/react": "^18.3.12",
6568
"@types/react-dom": "^18.3.1",
69+
"@typescript-eslint/eslint-plugin": "^8.18.1",
70+
"@typescript-eslint/parser": "^8.18.1",
6671
"babel-jest": "^29.7.0",
72+
"eslint": "^9.17.0",
73+
"eslint-config-prettier": "^9.1.0",
74+
"eslint-plugin-prettier": "^5.2.1",
75+
"eslint-plugin-react": "^7.37.2",
76+
"eslint-plugin-react-hooks": "^5.1.0",
6777
"file-loader": "^6.2.0",
6878
"gh-pages": "^6.2.0",
6979
"jest": "^29.7.0",
7080
"jest-environment-jsdom": "^29.7.0",
81+
"jest-transform-stub": "^2.0.0",
7182
"rollup": "^4.27.3",
7283
"rollup-plugin-dts": "^6.1.1",
7384
"rollup-plugin-peer-deps-external": "^2.2.4",
@@ -76,16 +87,7 @@
7687
"storybook-dark-mode": "^4.0.2",
7788
"tslib": "^2.8.1",
7889
"typescript": "^5.6.3",
79-
"typescript-eslint": "^8.15.0",
80-
"eslint": "^9.17.0",
81-
"eslint-config-prettier": "^9.1.0",
82-
"eslint-plugin-prettier": "^5.2.1",
83-
"eslint-plugin-react": "^7.37.2",
84-
"eslint-plugin-react-hooks": "^5.1.0",
85-
"jest-transform-stub": "^2.0.0",
86-
"@typescript-eslint/eslint-plugin": "^8.18.1",
87-
"@typescript-eslint/parser": "^8.18.1",
88-
"@eslint/eslintrc": "^3.2.0"
90+
"typescript-eslint": "^8.15.0"
8991
},
9092
"packageManager": "[email protected]+sha256.24235772cc4ac82a62627cd47f834c72667a2ce87799a846ec4e8e555e2d4b8b"
9193
}

pnpm-lock.yaml

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)