Skip to content

Commit f4845f4

Browse files
committed
Add support for react native 76
1 parent b66a19a commit f4845f4

21 files changed

+7640
-8098
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
}

docusaurus/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "3.5.2",
19-
"@docusaurus/preset-classic": "3.5.2",
18+
"@docusaurus/core": "^3.7.0",
19+
"@docusaurus/preset-classic": "^3.7.0",
2020
"@mdx-js/react": "^3.0.1",
2121
"clsx": "^2.1.1",
2222
"color": "^4.2.3",
23-
"prism-react-renderer": "^2.4.0",
23+
"prism-react-renderer": "^2.4.1",
2424
"react": "^18.3.1",
2525
"react-dom": "^18.3.1"
2626
},
2727
"devDependencies": {
28-
"@docusaurus/module-type-aliases": "3.5.2",
28+
"@docusaurus/module-type-aliases": "^3.7.0",
2929
"@tsconfig/docusaurus": "^2.0.3",
30-
"typescript": "^5.6.2"
30+
"typescript": "^5.7.3"
3131
},
3232
"browserslist": {
3333
"production": [

docusaurus/yarn.lock

Lines changed: 2584 additions & 1955 deletions
Large diffs are not rendered by default.

example/app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"slug": "react-native-paper-dates-example",
55
"description": "Example app for react-native-paper-dates",
66
"version": "1.0.0",
7-
"privacy": "public",
87
"scheme": "react-native-paper-dates",
98
"ios": {
109
"supportsTablet": true

example/package.json

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,49 @@
1414
},
1515
"dependencies": {
1616
"@expo/webpack-config": "~19.0.1",
17-
"crypto-browserify": "^3.12.0",
18-
"expo": "^51.0.34",
19-
"expo-constants": "~16.0.2",
20-
"expo-crypto": "~13.0.2",
21-
"expo-linking": "~6.3.1",
22-
"expo-router": "~3.5.23",
23-
"expo-splash-screen": "~0.27.6",
24-
"expo-status-bar": "~1.12.1",
25-
"react": "18.2.0",
26-
"react-dom": "18.2.0",
27-
"react-native": "~0.75.0",
28-
"react-native-gesture-handler": "~2.18.1",
29-
"react-native-paper": "^5.12.5",
30-
"react-native-paper-dates": "^0.22.25",
31-
"react-native-reanimated": "~3.15.0",
32-
"react-native-safe-area-context": "4.10.5",
33-
"react-native-screens": "~3.34.0",
34-
"react-native-web": "~0.19.12",
17+
"crypto-browserify": "^3.12.1",
18+
"expo": "^52.0.28",
19+
"expo-constants": "~17.0.5",
20+
"expo-crypto": "~14.0.2",
21+
"expo-linking": "~7.0.5",
22+
"expo-router": "~4.0.17",
23+
"expo-splash-screen": "~0.29.21",
24+
"expo-status-bar": "~2.0.1",
25+
"react": "18.3.1",
26+
"react-dom": "18.3.1",
27+
"react-native": "~0.76.6",
28+
"react-native-gesture-handler": "~2.22.1",
29+
"react-native-paper": "^5.13.1",
30+
"react-native-paper-dates": "^0.22.30",
31+
"react-native-reanimated": "~3.16.7",
32+
"react-native-safe-area-context": "5.1.0",
33+
"react-native-screens": "~4.5.0",
34+
"react-native-web": "~0.19.13",
3535
"stream-browserify": "^3.0.0"
3636
},
3737
"devDependencies": {
38-
"@babel/core": "^7.24.9",
38+
"@babel/core": "^7.26.7",
3939
"babel-loader": "^9.2.1",
4040
"babel-plugin-module-resolver": "^5.0.2"
4141
},
4242
"expo": {
43+
"doctor": {
44+
"reactNativeDirectoryCheck": {
45+
"exclude": [
46+
"@expo/webpack-config",
47+
"crypto-browserify",
48+
"stream-browserify"
49+
],
50+
"listUnknownPackages": false
51+
}
52+
},
4353
"install": {
4454
"exclude": [
45-
"react-native@~0.74.0",
46-
"react-native-reanimated@~3.10.0",
47-
"react-native-gesture-handler@~2.16.1",
48-
"react-native-screens@~3.31.1"
55+
"react-native-reanimated",
56+
"react-native-gesture-handler",
57+
"react-native-screens",
58+
"react-native-safe-area-context",
59+
"react-native-webview"
4960
]
5061
}
5162
}

example/yarn.lock

Lines changed: 2204 additions & 3130 deletions
Large diffs are not rendered by default.

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module.exports = {
1010
'node_modules/(?!(@react-native|react-native(-.*)?)/)',
1111
],
1212
setupFiles: ['<rootDir>/testSetup.js'],
13-
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
1413
collectCoverage: true,
1514
collectCoverageFrom: [
1615
'**/src/**',

package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,36 @@
5050
"registry": "https://registry.npmjs.org/"
5151
},
5252
"devDependencies": {
53-
"@commitlint/config-conventional": "^19.5.0",
53+
"@commitlint/config-conventional": "^19.6.0",
5454
"@react-native-community/eslint-config": "^3.2.0",
55-
"@release-it/conventional-changelog": "^8.0.2",
55+
"@release-it/conventional-changelog": "^10.0.0",
5656
"@testing-library/jest-native": "^5.4.3",
57-
"@testing-library/react-native": "^12.7.2",
58-
"@types/color": "^3.0.6",
59-
"@types/jest": "^29.5.13",
60-
"@types/react": "^18.3.10",
57+
"@testing-library/react-native": "^13.0.1",
58+
"@types/color": "^4.2.0",
59+
"@types/jest": "^29.5.14",
60+
"@types/react": "^18.3.18",
6161
"@types/react-native-vector-icons": "^6.4.18",
62-
"@types/react-test-renderer": "^18.3.0",
62+
"@types/react-test-renderer": "^18.3.1",
6363
"babel-loader": "^9.2.1",
64-
"caniuse-lite": "^1.0.30001664",
65-
"commitlint": "^19.5.0",
64+
"caniuse-lite": "^1.0.30001695",
65+
"commitlint": "^19.6.1",
6666
"eslint": "^8.57.1",
6767
"eslint-config-prettier": "^9.1.0",
68-
"eslint-plugin-prettier": "^5.2.1",
69-
"husky": "^9.1.6",
68+
"eslint-plugin-prettier": "^5.2.3",
69+
"eslint-plugin-testing-library": "^7.1.1",
70+
"husky": "^9.1.7",
7071
"jest": "^29.7.0",
7172
"metro-react-native-babel-preset": "^0.77.0",
72-
"pod-install": "^0.2.2",
73-
"prettier": "^3.3.2",
73+
"pod-install": "^0.3.4",
74+
"prettier": "^3.4.2",
7475
"react": "^18.3.1",
75-
"react-native": "^0.75.3",
76-
"react-native-builder-bob": "^0.30.2",
77-
"react-native-paper": "^5.12.5",
78-
"react-native-safe-area-context": "^4.11.0",
76+
"react-native": "^0.76.6",
77+
"react-native-builder-bob": "^0.36.0",
78+
"react-native-paper": "^5.13.1",
79+
"react-native-safe-area-context": "^5.1.0",
7980
"react-native-vector-icons": "^10.2.0",
8081
"react-test-renderer": "^18.3.1",
81-
"release-it": "^17.6.0",
82+
"release-it": "^18.1.2",
8283
"typescript": "~5.5.3"
8384
},
8485
"peerDependencies": {

src/Time/AmPmSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function AmPmSwitcher({
4444
borderColor: backgroundColor,
4545
borderRadius: theme.roundness * 2,
4646
height: inputType === inputTypes.keyboard ? 72 : 80,
47-
marginBottom: inputType === 'keyboard' ? 24 : 0,
47+
marginBottom: inputType === 'keyboard' ? 16 : 0,
4848
},
4949
]}
5050
>

src/Time/TimeInput.tsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,39 @@ function TimeInput(
7171
}
7272

7373
return (
74-
<View style={styles.root}>
74+
<View
75+
style={[
76+
styles.root,
77+
// eslint-disable-next-line react-native/no-inline-styles
78+
{
79+
backgroundColor,
80+
borderRadius: theme.roundness * 2,
81+
borderColor:
82+
theme.isV3 && highlighted
83+
? theme.colors.onPrimaryContainer
84+
: undefined,
85+
borderWidth: theme.isV3 && highlighted ? 2 : 0,
86+
height: inputType === inputTypes.keyboard ? 72 : 80,
87+
},
88+
]}
89+
>
7590
<TextInput
7691
ref={ref}
92+
textAlign="center"
7793
style={[
78-
styles.input,
7994
// eslint-disable-next-line react-native/no-inline-styles
8095
{
8196
color,
8297
fontFamily: theme?.isV3
8398
? theme.fonts.titleMedium.fontFamily
8499
: (theme as any as MD2Theme).fonts.medium.fontFamily,
85100
fontSize: inputFontSize,
86-
backgroundColor,
87-
borderRadius: theme.roundness * 2,
88-
borderColor:
89-
theme.isV3 && highlighted
90-
? theme.colors.onPrimaryContainer
101+
lineHeight:
102+
Platform.OS === 'android'
103+
? Math.max(inputFontSize, 48)
91104
: undefined,
92-
borderWidth: theme.isV3 && highlighted ? 2 : 0,
93-
height: inputType === inputTypes.keyboard ? 72 : 80,
105+
paddingTop: Platform.OS === 'android' ? 10 : undefined,
106+
paddingBottom: Platform.OS === 'android' ? 0 : undefined,
94107
},
95108
]}
96109
maxFontSizeMultiplier={1.5}
@@ -100,9 +113,7 @@ function TimeInput(
100113
onBlur={() => setInputFocused(false)}
101114
keyboardAppearance={theme.dark ? 'dark' : 'default'}
102115
keyboardType="number-pad"
103-
onChangeText={(e: string) => {
104-
onInnerChange(Number(e))
105-
}}
116+
onChangeText={(e) => onInnerChange(Number(e))}
106117
{...rest}
107118
/>
108119
{onPress && inputType === inputTypes.picker ? (
@@ -130,14 +141,9 @@ function TimeInput(
130141
}
131142

132143
const styles = StyleSheet.create({
133-
input: {
134-
textAlign: 'center',
135-
textAlignVertical: 'center',
136-
width: 96,
137-
},
138144
root: {
139-
height: 80,
140-
position: 'relative',
145+
alignItems: 'center',
146+
justifyContent: 'center',
141147
width: 96,
142148
},
143149
})

0 commit comments

Comments
 (0)