Skip to content

Commit e4d7e75

Browse files
authored
Merge pull request #97 from adaptui/updating-dependencies
2 parents fa9bceb + 6f6cc13 commit e4d7e75

25 files changed

+4996
-5772
lines changed

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = function (api) {
1717
},
1818
},
1919
],
20+
"@babel/plugin-proposal-export-namespace-from",
2021
"react-native-reanimated/plugin",
2122
],
2223
};

example/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registerRootComponent } from "expo";
22

33
import App from "./src/App";
44

5+
import "react-native-gesture-handler";
56
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
67
// It also ensures that whether you load the app in the Expo client or in a native build,
78
// the environment is set up appropriately

example/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@
1111
"start": "expo start"
1212
},
1313
"dependencies": {
14-
"@react-navigation/drawer": "6.5.0",
15-
"@react-navigation/native": "6.0.13",
16-
"expo": "44.0.6",
17-
"react": "17.0.1",
18-
"react-dom": "17.0.1",
19-
"react-native": "0.64.3",
20-
"react-native-gesture-handler": "~2.1.0",
14+
"@react-navigation/drawer": "^6.5.3",
15+
"@react-navigation/native": "^6.0.16",
16+
"expo": "^47.0.0",
17+
"react": "18.1.0",
18+
"react-dom": "18.1.0",
19+
"react-native": "0.70.5",
20+
"react-native-gesture-handler": "~2.8.0",
2121
"react-native-popper": "0.3.2",
22-
"react-native-reanimated": "2.3.1",
23-
"react-native-safe-area-context": "3.3.2",
24-
"react-native-screens": "3.10.1",
25-
"react-native-web": "0.18.9",
22+
"react-native-reanimated": "2.12.0",
23+
"react-native-safe-area-context": "4.4.1",
24+
"react-native-screens": "~3.18.0",
25+
"react-native-web": "~0.18.10",
2626
"twrnc": "3.4.1"
2727
},
2828
"devDependencies": {
29-
"@babel/core": "7.18.9",
29+
"@babel/core": "^7.19.3",
3030
"@babel/runtime": "7.18.9",
31-
"@types/react": "17.0.30",
32-
"@types/react-native": "0.64.24",
31+
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
32+
"@types/react": "~18.0.24",
33+
"@types/react-native": "~0.70.6",
3334
"babel-loader": "8.2.5",
3435
"babel-plugin-module-resolver": "4.1.0",
35-
"babel-preset-expo": "9.1.0",
36+
"babel-preset-expo": "~9.2.1",
3637
"expo-cli": "6.0.0"
3738
},
3839
"resolutions": {
39-
"**/@types/react": "17.0.30",
40-
"react-error-overlay": "6.0.11",
41-
"react-native-reanimated": "2.3.1"
40+
"react-error-overlay": "6.0.9",
41+
"react-native-reanimated": "2.12.0"
4242
}
4343
}

example/yarn.lock

Lines changed: 2322 additions & 2396 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,32 @@
7575
"preset": "react-native"
7676
},
7777
"dependencies": {
78-
"@chakra-ui/hooks": "^2.0.0",
79-
"@gorhom/bottom-sheet": "^4.3.1",
80-
"@react-aria/focus": "^3.6.1",
81-
"@react-aria/visually-hidden": "^3.3.0",
78+
"@chakra-ui/hooks": "^2.1.2",
79+
"@gorhom/bottom-sheet": "^4.4.5",
80+
"@react-aria/focus": "^3.10.0",
81+
"@react-aria/visually-hidden": "^3.6.0",
8282
"@react-native-aria/checkbox": "^0.2.3",
83-
"@react-native-aria/focus": "^0.2.5",
84-
"@react-native-aria/interactions": "^0.2.8",
85-
"@react-native-aria/radio": "^0.2.5",
8683
"@react-stately/toggle": "^3.3.0",
8784
"lodash": "^4.17.21",
88-
"react-native-gesture-handler": "2.1.0",
85+
"react-native-gesture-handler": "2.8.0",
8986
"react-native-popper": "^0.3.2",
90-
"react-native-reanimated": "2.3.1",
91-
"react-native-svg": "^12.1.1",
87+
"react-native-reanimated": "2.13.0",
88+
"react-native-svg": "^13.6.0",
9289
"tailwind-merge": "^1.8.0",
9390
"tailwindcss": "^3.2.4",
9491
"twrnc": "^3.4.1"
9592
},
9693
"devDependencies": {
97-
"@babel/core": "7.18.9",
94+
"@babel/core": "^7.19.1",
9895
"@babel/eslint-parser": "7.18.9",
9996
"@babel/helper-string-parser": "^7.19.4",
10097
"@commitlint/cli": "17.0.3",
101-
"@commitlint/config-conventional": "17.0.3",
98+
"@commitlint/config-conventional": "17.3.0",
10299
"@react-native-community/eslint-config": "3.0.3",
103100
"@release-it/conventional-changelog": "5.0.0",
104101
"@types/jest": "29.1.2",
105-
"@types/react": "17.0.30",
106-
"@types/react-native": "0.64.24",
102+
"@types/react": "18.0.0",
103+
"@types/react-native": "0.70.0",
107104
"all-contributors-cli": "6.20.0",
108105
"commitlint": "17.0.3",
109106
"eslint": "8.20.0",
@@ -115,20 +112,17 @@
115112
"lint-staged": "13.0.3",
116113
"pinst": "3.0.0",
117114
"prettier": "2.7.1",
118-
"react": "17.0.1",
119-
"react-dom": "17.0.1",
120-
"react-native": "0.64.3",
115+
"react": "18.1.0",
116+
"react-dom": "18.1.0",
117+
"react-native": "0.70.0",
121118
"react-native-builder-bob": "0.18.3",
122119
"release-it": "15.1.4",
123120
"sort-package-json": "2.0.0",
124-
"typescript": "4.7.4"
121+
"typescript": "4.8.3"
125122
},
126123
"peerDependencies": {
127-
"react": "16.x || 17.x",
128-
"react-native": ">=0.62"
129-
},
130-
"resolutions": {
131-
"**/@types/react": "17.0.30"
124+
"react": "*",
125+
"react-native": "*"
132126
},
133127
"publishConfig": {
134128
"access": "public",

src/components/button/Button.tsx

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import React, { forwardRef } from "react";
2-
import { Platform, PressableProps, TextStyle } from "react-native";
2+
import {
3+
Platform,
4+
PressableProps,
5+
PressableStateCallbackType,
6+
TextStyle,
7+
} from "react-native";
38

49
import { RenderPropType } from "../../index";
510
import { Box, Text, Touchable } from "../../primitives";
@@ -134,7 +139,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
134139
iconStyle: tailwind.style(cx(buttonTheme.size[size]?.prefix)),
135140
})
136141
) : (
137-
<ButtonPrefix size={size}>{prefix}</ButtonPrefix>
142+
<ButtonPrefix size={size}>{prefix as React.ReactNode}</ButtonPrefix>
138143
);
139144

140145
const prefixEl =
@@ -168,7 +173,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
168173
iconStyle: tailwind.style(cx(buttonTheme.size[size]?.suffix)),
169174
})
170175
) : (
171-
<ButtonSuffix size={size}>{suffix}</ButtonSuffix>
176+
<ButtonSuffix size={size}>{suffix as React.ReactNode}</ButtonSuffix>
172177
);
173178

174179
const suffixEl = loading ? (
@@ -185,50 +190,52 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
185190
<>{_suffix}</>
186191
);
187192

188-
const defaultChildren = iconOnly ? (
189-
<Box
190-
style={[
191-
tailwind.style(
192-
cx(
193-
buttonTheme.size[size]?.icon,
194-
loading ? buttonTheme.loading.children : "",
193+
const defaultChildren = (
194+
iconOnly ? (
195+
<Box
196+
style={[
197+
tailwind.style(
198+
cx(
199+
buttonTheme.size[size]?.icon,
200+
loading ? buttonTheme.loading.children : "",
201+
),
195202
),
196-
),
197-
{ aspectRatio: iconAspectRatio },
198-
]}
199-
>
200-
{/* @ts-ignore */}
201-
{React.cloneElement(iconOnly, {
202-
color: tailwind.getColor(
203-
isButtonDisabled
204-
? buttonTheme.themeColor[themeColor]?.[variant]?.icon.disabled
205-
: buttonTheme.themeColor[themeColor]?.[variant]?.icon.default,
206-
),
207-
})}
208-
</Box>
209-
) : typeof props.children === "string" ? (
210-
<Text
211-
adjustsFontSizeToFit
212-
allowFontScaling={false}
213-
selectable={false}
214-
style={[
215-
tailwind.style(
216-
cx(
217-
buttonTheme.size[size]?.text,
218-
buttonTheme.themeColor[themeColor]?.[variant]?.text.default,
203+
{ aspectRatio: iconAspectRatio },
204+
]}
205+
>
206+
{/* @ts-ignore */}
207+
{React.cloneElement(iconOnly, {
208+
color: tailwind.getColor(
219209
isButtonDisabled
220-
? buttonTheme.themeColor[themeColor]?.[variant]?.text.disabled
221-
: "",
210+
? buttonTheme.themeColor[themeColor]?.[variant]?.icon.disabled
211+
: buttonTheme.themeColor[themeColor]?.[variant]?.icon.default,
222212
),
223-
),
224-
styleAdapter(textStyle),
225-
]}
226-
>
227-
{props.children}
228-
</Text>
229-
) : (
230-
props.children
231-
);
213+
})}
214+
</Box>
215+
) : typeof props.children === "string" ? (
216+
<Text
217+
adjustsFontSizeToFit
218+
allowFontScaling={false}
219+
selectable={false}
220+
style={[
221+
tailwind.style(
222+
cx(
223+
buttonTheme.size[size]?.text,
224+
buttonTheme.themeColor[themeColor]?.[variant]?.text.default,
225+
isButtonDisabled
226+
? buttonTheme.themeColor[themeColor]?.[variant]?.text.disabled
227+
: "",
228+
),
229+
),
230+
styleAdapter(textStyle),
231+
]}
232+
>
233+
{props.children}
234+
</Text>
235+
) : (
236+
props.children
237+
)
238+
) as React.ReactNode;
232239

233240
const iconOnlyEl = loading ? (
234241
<ButtonFullWidthSpinner
@@ -259,7 +266,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
259266

260267
return (
261268
<Touchable
262-
style={touchState => {
269+
style={(touchState: PressableStateCallbackType) => {
263270
return [
264271
tailwind.style(
265272
cx(

src/components/button/ButtonPrefix.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import { ButtonSizes } from "./Button";
88

99
export interface ButtonPrefixProps {
1010
size: ButtonSizes;
11+
children: React.ReactNode;
1112
}
1213

1314
export const ButtonPrefix: React.FC<ButtonPrefixProps> = ({
1415
size,
15-
...props
16+
children,
1617
}) => {
1718
const tailwind = useTheme();
1819
const buttonTheme = useTheme("button");
1920

2021
return (
2122
<Box style={[tailwind.style(cx(buttonTheme.size[size]?.prefix))]}>
22-
{props.children}
23+
{children}
2324
</Box>
2425
);
2526
};

src/components/button/ButtonSpinner.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { isValidElement } from "react";
33
import { Box } from "../../primitives";
44
import { useTheme } from "../../theme";
55
import { cx } from "../../utils";
6-
import { Spinner, SpinnerSizes } from "../spinner";
6+
import { Spinner } from "../spinner";
77

88
import { ButtonProps } from "./Button";
99

@@ -16,7 +16,9 @@ interface ButtonSpinnerProps
1616
interface ButtonFullWidthSpinnerProps
1717
extends Required<
1818
Pick<ButtonProps, "size" | "themeColor" | "variant" | "spinner">
19-
> {}
19+
> {
20+
children: React.ReactNode;
21+
}
2022

2123
const spinnerSizes = {
2224
sm: {
@@ -48,19 +50,19 @@ export const ButtonSpinner: React.FC<ButtonSpinnerProps> = ({
4850
const tailwind = useTheme();
4951
const buttonTheme = useTheme("button");
5052

53+
const spinnerSize =
54+
prefix || suffix
55+
? spinnerSizes[size]?.spinner
56+
: spinnerSizes[size]?.iconOnly;
57+
5158
return isValidElement(spinner) ? (
5259
React.cloneElement(spinner, {
53-
size: (prefix || suffix
54-
? spinnerSizes[size]?.spinner
55-
: spinnerSizes[size]?.iconOnly) as SpinnerSizes,
60+
// @ts-ignore
61+
size: spinnerSize,
5662
})
5763
) : (
5864
<Spinner
59-
size={
60-
(prefix || suffix
61-
? spinnerSizes[size]?.spinner
62-
: spinnerSizes[size]?.iconOnly) as SpinnerSizes
63-
}
65+
size={spinnerSize}
6466
style={tailwind.style(
6567
cx(buttonTheme.themeColor[themeColor]?.[variant]?.spinner?.disabled),
6668
)}

src/components/button/ButtonSuffix.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import { ButtonSizes } from "./Button";
88

99
export interface ButtonSuffixProps {
1010
size: ButtonSizes;
11+
children: React.ReactNode;
1112
}
1213

1314
export const ButtonSuffix: React.FC<ButtonSuffixProps> = ({
1415
size,
15-
...props
16+
children,
1617
}) => {
1718
const tailwind = useTheme();
1819
const buttonTheme = useTheme("button");
1920

2021
return (
2122
<Box style={[tailwind.style(cx(buttonTheme.size[size]?.suffix))]}>
22-
{props.children}
23+
{children}
2324
</Box>
2425
);
2526
};

src/components/checkbox/Checkbox.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, {
55
useMemo,
66
useRef,
77
} from "react";
8-
import { Platform } from "react-native";
8+
import { Platform, PressableStateCallbackType } from "react-native";
99
import { useToggleState } from "@react-stately/toggle";
1010

1111
import { Check, Dash } from "../../icons";
@@ -347,7 +347,7 @@ const RNCheckbox: React.FC<Partial<CheckboxProps>> = forwardRef<
347347
accessibilityValue={{ text: props?.value }}
348348
onAccessibilityTap={handleChange}
349349
// A11y Props
350-
style={touchState => [
350+
style={(touchState: PressableStateCallbackType) => [
351351
tailwind.style(
352352
cx(
353353
checkboxTheme?.label?.common,
@@ -405,9 +405,9 @@ const RNCheckbox: React.FC<Partial<CheckboxProps>> = forwardRef<
405405
})}
406406
disabled={isDisabled}
407407
>
408-
{({ pressed }) =>
408+
{(touchState: PressableStateCallbackType) =>
409409
children({
410-
pressed,
410+
pressed: touchState.pressed,
411411
isHovered: !!hovered.value,
412412
isFocussed: !!focused.value,
413413
})

0 commit comments

Comments
 (0)