@wise/components-theming 1.2.2 → 1.3.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/package.json +6 -7
- package/src/useTheme.spec.tsx +6 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/components-theming",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Provides theming support for the Wise Design system components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
"@rollup/plugin-babel": "^6.0.4",
|
|
25
25
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
26
26
|
"@testing-library/jest-dom": "^5.17.0",
|
|
27
|
-
"@testing-library/react": "^
|
|
28
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
27
|
+
"@testing-library/react": "^13.4.0",
|
|
29
28
|
"@tsconfig/recommended": "^1.0.6",
|
|
30
29
|
"@types/babel__core": "^7.20.5",
|
|
31
30
|
"@types/jest": "^29.5.12",
|
|
32
|
-
"@types/react": "^
|
|
33
|
-
"@types/react-dom": "^
|
|
31
|
+
"@types/react": "^18.3.3",
|
|
32
|
+
"@types/react-dom": "^18.3.0",
|
|
34
33
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
35
34
|
"classnames": "^2.5.1",
|
|
36
35
|
"jest": "^29.7.0",
|
|
@@ -39,8 +38,8 @@
|
|
|
39
38
|
"typescript": "4.9.5"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|
|
42
|
-
"react": ">=
|
|
43
|
-
"react-dom": ">=
|
|
41
|
+
"react": ">=18",
|
|
42
|
+
"react-dom": ">=18"
|
|
44
43
|
},
|
|
45
44
|
"sideEffects": [
|
|
46
45
|
"*.css"
|
package/src/useTheme.spec.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react
|
|
1
|
+
import { renderHook } from '@testing-library/react';
|
|
2
2
|
|
|
3
3
|
import { ThemeProvider } from './ThemeProvider';
|
|
4
4
|
import { DEFAULT_BASE_THEME, DEFAULT_SCREEN_MODE } from './const';
|
|
@@ -28,10 +28,7 @@ describe('useTheme', () => {
|
|
|
28
28
|
const {
|
|
29
29
|
result: { current },
|
|
30
30
|
} = renderHook(() => useTheme(), {
|
|
31
|
-
wrapper: ThemeProvider
|
|
32
|
-
initialProps: {
|
|
33
|
-
theme: 'personal' as const,
|
|
34
|
-
},
|
|
31
|
+
wrapper: (props) => <ThemeProvider theme="personal" {...props} />,
|
|
35
32
|
});
|
|
36
33
|
|
|
37
34
|
expect(current).toStrictEqual({
|
|
@@ -48,10 +45,7 @@ describe('useTheme', () => {
|
|
|
48
45
|
const {
|
|
49
46
|
result: { current },
|
|
50
47
|
} = renderHook(() => useTheme(), {
|
|
51
|
-
wrapper: ThemeProvider
|
|
52
|
-
initialProps: {
|
|
53
|
-
theme: 'forest-green' as const,
|
|
54
|
-
},
|
|
48
|
+
wrapper: (props) => <ThemeProvider theme="forest-green" {...props} />,
|
|
55
49
|
});
|
|
56
50
|
|
|
57
51
|
expect(current).toStrictEqual({
|
|
@@ -68,10 +62,7 @@ describe('useTheme', () => {
|
|
|
68
62
|
const {
|
|
69
63
|
result: { current },
|
|
70
64
|
} = renderHook(() => useTheme(), {
|
|
71
|
-
wrapper: ThemeProvider
|
|
72
|
-
initialProps: {
|
|
73
|
-
theme: 'bright-green' as const,
|
|
74
|
-
},
|
|
65
|
+
wrapper: (props) => <ThemeProvider theme="bright-green" {...props} />,
|
|
75
66
|
});
|
|
76
67
|
|
|
77
68
|
expect(current).toStrictEqual({
|
|
@@ -88,11 +79,7 @@ describe('useTheme', () => {
|
|
|
88
79
|
const {
|
|
89
80
|
result: { current },
|
|
90
81
|
} = renderHook(() => useTheme(), {
|
|
91
|
-
wrapper: ThemeProvider
|
|
92
|
-
initialProps: {
|
|
93
|
-
theme: DEFAULT_BASE_THEME,
|
|
94
|
-
screenMode: 'dark' as const,
|
|
95
|
-
},
|
|
82
|
+
wrapper: (props) => <ThemeProvider theme={DEFAULT_BASE_THEME} screenMode="dark" {...props} />,
|
|
96
83
|
});
|
|
97
84
|
|
|
98
85
|
expect(current).toStrictEqual({
|
|
@@ -109,11 +96,7 @@ describe('useTheme', () => {
|
|
|
109
96
|
const {
|
|
110
97
|
result: { current },
|
|
111
98
|
} = renderHook(() => useTheme(), {
|
|
112
|
-
wrapper: ThemeProvider
|
|
113
|
-
initialProps: {
|
|
114
|
-
theme: 'personal' as const,
|
|
115
|
-
screenMode: 'dark' as const,
|
|
116
|
-
},
|
|
99
|
+
wrapper: (props) => <ThemeProvider theme="personal" screenMode="dark" {...props} />,
|
|
117
100
|
});
|
|
118
101
|
|
|
119
102
|
expect(current).toStrictEqual({
|