@etsoo/toolpad 1.0.44 → 1.0.47

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.
@@ -11,6 +11,10 @@ on:
11
11
  # release:
12
12
  # types: [created]
13
13
 
14
+ permissions:
15
+ id-token: write # Required for OIDC
16
+ contents: read
17
+
14
18
  jobs:
15
19
  # Publish to NPM
16
20
  publish-npm:
@@ -44,6 +48,4 @@ jobs:
44
48
 
45
49
  # Publish to npm
46
50
  # For scoped package, make it public for free service
47
- - run: npm publish --access public
48
- env:
49
- NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
51
+ - run: npm publish
@@ -33,14 +33,13 @@ const AppProviderComponent_1 = require("../AppProvider/AppProviderComponent");
33
33
  (0, vitest_1.test)("can switch theme", async () => {
34
34
  const user = user_event_1.default.setup();
35
35
  (0, react_1.render)((0, jsx_runtime_1.jsx)(AppProviderComponent_1.AppProvider, { children: (0, jsx_runtime_1.jsx)(DashboardLayout_1.DashboardLayout, { showThemeSwitcher: true, children: "Hello world" }) }));
36
- const getBackgroundColorCSSVariable = () => getComputedStyle(document.documentElement).getPropertyValue("--mui-palette-common-background");
37
36
  const header = react_1.screen.getByRole("banner");
38
37
  const themeSwitcherButton = (0, react_1.within)(header).getByLabelText("Switch to dark mode");
39
- (0, vitest_1.expect)(getBackgroundColorCSSVariable()).toBe("#fff");
38
+ (0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
40
39
  await user.click(themeSwitcherButton);
41
- (0, vitest_1.expect)(getBackgroundColorCSSVariable()).toBe("#000");
40
+ (0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("dark");
42
41
  await user.click(themeSwitcherButton);
43
- (0, vitest_1.expect)(getBackgroundColorCSSVariable()).toBe("#fff");
42
+ (0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
44
43
  });
45
44
  (0, vitest_1.test)("navigation works correctly", async () => {
46
45
  const NAVIGATION = [
@@ -5,9 +5,7 @@ exports.Emitter = void 0;
5
5
  * Lightweight event emitter
6
6
  */
7
7
  class Emitter {
8
- constructor() {
9
- this.handlers = new Map();
10
- }
8
+ handlers = new Map();
11
9
  on(name, handler) {
12
10
  let eventHandlers = this.handlers.get(name);
13
11
  if (!eventHandlers) {
@@ -28,14 +28,13 @@ describe("DashboardLayout", () => {
28
28
  test("can switch theme", async () => {
29
29
  const user = userEvent.setup();
30
30
  render(_jsx(AppProvider, { children: _jsx(DashboardLayout, { showThemeSwitcher: true, children: "Hello world" }) }));
31
- const getBackgroundColorCSSVariable = () => getComputedStyle(document.documentElement).getPropertyValue("--mui-palette-common-background");
32
31
  const header = screen.getByRole("banner");
33
32
  const themeSwitcherButton = within(header).getByLabelText("Switch to dark mode");
34
- expect(getBackgroundColorCSSVariable()).toBe("#fff");
33
+ expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
35
34
  await user.click(themeSwitcherButton);
36
- expect(getBackgroundColorCSSVariable()).toBe("#000");
35
+ expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("dark");
37
36
  await user.click(themeSwitcherButton);
38
- expect(getBackgroundColorCSSVariable()).toBe("#fff");
37
+ expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
39
38
  });
40
39
  test("navigation works correctly", async () => {
41
40
  const NAVIGATION = [
@@ -2,9 +2,7 @@
2
2
  * Lightweight event emitter
3
3
  */
4
4
  export class Emitter {
5
- constructor() {
6
- this.handlers = new Map();
7
- }
5
+ handlers = new Map();
8
6
  on(name, handler) {
9
7
  let eventHandlers = this.handlers.get(name);
10
8
  if (!eventHandlers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/toolpad",
3
- "version": "1.0.44",
3
+ "version": "1.0.47",
4
4
  "author": "ETSOO",
5
5
  "description": "Dashboard framework extention based on Toolpad Core",
6
6
  "main": "build/cjs/index.js",
@@ -47,36 +47,35 @@
47
47
  "dependencies": {
48
48
  "@emotion/react": "^11.14.0",
49
49
  "@emotion/styled": "^11.14.1",
50
- "@mui/icons-material": "7.3.6",
51
- "@mui/material": "7.3.6",
52
- "@mui/utils": "7.3.6",
50
+ "@mui/icons-material": "7.3.9",
51
+ "@mui/material": "7.3.9",
52
+ "@mui/utils": "7.3.9",
53
53
  "invariant": "2.2.4",
54
54
  "path-to-regexp": "^6.3.0",
55
- "react": "^19.2.3",
56
- "react-dom": "^19.2.3"
55
+ "react": "^19.2.4",
56
+ "react-dom": "^19.2.4"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/cli": "^7.28.3",
60
- "@babel/core": "^7.28.5",
61
- "@babel/plugin-transform-runtime": "^7.28.5",
62
- "@babel/preset-env": "^7.28.5",
63
- "@babel/runtime-corejs3": "^7.28.4",
59
+ "@babel/core": "^7.29.0",
60
+ "@babel/plugin-transform-runtime": "^7.29.0",
61
+ "@babel/preset-env": "^7.29.2",
62
+ "@babel/runtime-corejs3": "^7.29.2",
64
63
  "@testing-library/jest-dom": "^6.9.1",
65
- "@testing-library/react": "^16.3.1",
64
+ "@testing-library/react": "^16.3.2",
66
65
  "@testing-library/user-event": "^14.6.1",
67
66
  "@types/invariant": "2.2.37",
68
- "@types/node": "^25.0.3",
69
- "@types/react": "19.2.7",
67
+ "@types/node": "^25.5.2",
68
+ "@types/react": "19.2.14",
70
69
  "@types/react-dom": "19.2.3",
71
- "@vitejs/plugin-react": "5.1.2",
72
- "@vitest/browser": "4.0.16",
73
- "@vitest/browser-playwright": "^4.0.16",
74
- "jsdom": "^27.3.0",
75
- "next": "^16.1.1",
76
- "next-router-mock": "^1.0.4",
77
- "playwright": "^1.57.0",
78
- "react-router-dom": "^7.11.0",
79
- "vitest": "4.0.16"
70
+ "@vitejs/plugin-react": "6.0.1",
71
+ "@vitest/browser": "4.1.2",
72
+ "@vitest/browser-playwright": "^4.1.2",
73
+ "jsdom": "^29.0.1",
74
+ "next": "^16.2.2",
75
+ "next-router-mock": "^1.0.5",
76
+ "playwright": "^1.59.1",
77
+ "react-router-dom": "^7.14.0",
78
+ "vitest": "4.1.2"
80
79
  },
81
80
  "peerDependenciesMeta": {
82
81
  "next": {
@@ -45,26 +45,27 @@ describe("DashboardLayout", () => {
45
45
  </AppProvider>
46
46
  );
47
47
 
48
- const getBackgroundColorCSSVariable = () =>
49
- getComputedStyle(document.documentElement).getPropertyValue(
50
- "--mui-palette-common-background"
51
- );
52
-
53
48
  const header = screen.getByRole("banner");
54
49
 
55
50
  const themeSwitcherButton = within(header).getByLabelText(
56
51
  "Switch to dark mode"
57
52
  );
58
53
 
59
- expect(getBackgroundColorCSSVariable()).toBe("#fff");
54
+ expect(
55
+ document.documentElement.getAttribute("data-toolpad-color-scheme")
56
+ ).toBe("light");
60
57
 
61
58
  await user.click(themeSwitcherButton);
62
59
 
63
- expect(getBackgroundColorCSSVariable()).toBe("#000");
60
+ expect(
61
+ document.documentElement.getAttribute("data-toolpad-color-scheme")
62
+ ).toBe("dark");
64
63
 
65
64
  await user.click(themeSwitcherButton);
66
65
 
67
- expect(getBackgroundColorCSSVariable()).toBe("#fff");
66
+ expect(
67
+ document.documentElement.getAttribute("data-toolpad-color-scheme")
68
+ ).toBe("light");
68
69
  });
69
70
 
70
71
  test("navigation works correctly", async () => {
package/tsconfig.cjs.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
- "target": "ES2020",
4
+ "target": "ES2022",
5
5
  "allowJs": false,
6
6
  "module": "NodeNext",
7
7
  "moduleResolution": "NodeNext",
8
8
  "resolveJsonModule": true,
9
9
  "isolatedModules": true,
10
+ "rootDir": "./src",
10
11
  "outDir": "./build/cjs",
11
12
  "noEmit": false,
12
13
  "declaration": true,
package/tsconfig.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
- "target": "ES2020",
5
- "module": "ES2020",
4
+ "target": "ES2022",
5
+ "module": "ESNext",
6
6
  "moduleResolution": "bundler",
7
7
  "isolatedModules": true,
8
+ "rootDir": "./src",
8
9
  "outDir": "./build/mjs",
9
10
  "noEmit": false,
10
11
  "declaration": true,