diff --git a/packages/core/src/hooks/useButtonChecks.ts b/packages/core/src/hooks/useButtonChecks.ts index 5db58b04..b8fd87cd 100644 --- a/packages/core/src/hooks/useButtonChecks.ts +++ b/packages/core/src/hooks/useButtonChecks.ts @@ -49,7 +49,7 @@ export const useButtonChecks = __DEV__ }); checkCompatibleAccessibilityState({ accessibilityStates: props?.accessibilityState, - accessibilityRole: props?.accessiblityRole, + accessibilityRole: props?.accessibilityRole, }); checkAccessibilityRole(props.accessibilityRole); diff --git a/packages/forms/src/components/FormSubmit.test.tsx b/packages/forms/src/components/FormSubmit.test.tsx index 4324141b..1522d8ae 100644 --- a/packages/forms/src/components/FormSubmit.test.tsx +++ b/packages/forms/src/components/FormSubmit.test.tsx @@ -32,7 +32,7 @@ describe('FormSubmit', () => { ); }); - it('hides the children from the accessiblity tree', () => { + it('hides the children from the accessibility tree', () => { const { getByTestId } = render( - I'm pressable + + I'm pressable ; ``` @@ -73,28 +75,28 @@ Indicates whether an element is currently busy or not. ```tsx import { ActivityIndicator } from 'react-native'; -import { TouchableOpacity, Text } from 'react-native-ama'; +import { Text, TouchableOpacity } from 'react-native-ama'; const Test = () => { - const [isLoading, setIsLoading] = React.useState(false); + const [isLoading, setIsLoading] = React.useState(false); - const doSometing = async () => { - setIsLoading(true); + const doSomething = async () => { + setIsLoading(true); - await slowCall(); + await slowCall(); - setIsLoading(true); - }; + setIsLoading(true); + }; - return ( - - {isLoading ? : Do it} - - ); + return ( + + {isLoading ? : Do it} + + ); }; ``` @@ -126,23 +128,23 @@ Indicates whether an expandable element is currently expanded or collapsed. ```tsx import { ActivityIndicator } from 'react-native'; -import { TouchableOpacity, Text } from 'react-native-ama'; +import { Text, TouchableOpacity } from 'react-native-ama'; const Test = () => { - const [isExpanded, setIsExpanded] = React.useState(false); - - return ( - <> - setIsExpanded(expanded => !expanded)}> - {isExpanded ? : } - - {isExpanded ? <>{/* content goes here */} : null} - - ); + const [isExpanded, setIsExpanded] = React.useState(false); + + return ( + <> + setIsExpanded(expanded => !expanded)}> + {isExpanded ? : } + + {isExpanded ? <>{/* content goes here */} : null} + + ); }; ``` diff --git a/packages/react-native/docs/TouchableWithoutFeedback.md b/packages/react-native/docs/TouchableWithoutFeedback.md index 39b4a81a..b9d7ac4d 100644 --- a/packages/react-native/docs/TouchableWithoutFeedback.md +++ b/packages/react-native/docs/TouchableWithoutFeedback.md @@ -10,8 +10,7 @@ import { TouchableWithoutFeedback } from 'react-native-ama'; + accessibilityLabel="I'm pressable!"> I'm pressable @@ -84,7 +83,7 @@ import { Text, TouchableWithoutFeedback } from 'react-native-ama'; const Test = () => { const [isLoading, setIsLoading] = React.useState(false); - const doSometing = async () => { + const doSomething = async () => { setIsLoading(true); await slowCall(); @@ -94,11 +93,10 @@ const Test = () => { return ( + onPress={doSomething}> {isLoading ? : Do it} ); @@ -141,11 +139,10 @@ const Test = () => { return ( <> setIsExpanded(expanded => !expanded)} - > + onPress={() => setIsExpanded(expanded => !expanded)}> {isExpanded ? : } {isExpanded ? <>{/* content goes here */} : null} diff --git a/website/versioned_docs/version-0.7.x/components/Pressable.mdx b/website/versioned_docs/version-0.7.x/components/Pressable.mdx index 3d834515..37cc7e53 100644 --- a/website/versioned_docs/version-0.7.x/components/Pressable.mdx +++ b/website/versioned_docs/version-0.7.x/components/Pressable.mdx @@ -8,7 +8,7 @@ Pressable is an extension of the React Native [Pressable](https://reactnative.de import { Pressable } from 'react-native-ama'; - I'm pressable + I'm pressable ; ``` @@ -16,10 +16,10 @@ import { Pressable } from 'react-native-ama'; Compared to the default React Native component, this custom component: -- Forces the use of `accessibilityRole` and `accessibilityLabel` +- Forces the use of `accessibilityRole` and `accessibilityLabel` - `accessibilityState` has been removed as its states `busy`, `checked`, `selected`, `expanded` are exposed as a property - Performs a [Minimum Size](../guidelines/minimum-size.md) check -- Performs a [contrast checker](../guidelines/contrast.md) between its background color and its children color +- Performs a [contrast checker](../guidelines/contrast.md) between its background color and its children color ### accessibilityRole @@ -77,25 +77,25 @@ import { ActivityIndicator } from 'react-native'; import { Pressable, Text } from 'react-native-ama'; const Test = () => { - const [isLoading, setIsLoading] = React.useState(false); + const [isLoading, setIsLoading] = React.useState(false); - const doSometing = async () => { - setIsLoading(true); + const doSomething = async () => { + setIsLoading(true); - await slowCall(); + await slowCall(); - setIsLoading(true); - }; + setIsLoading(true); + }; - return ( - - {isLoading ? : Do it} - - ); + return ( + + {isLoading ? : Do it} + + ); }; ``` @@ -130,20 +130,20 @@ import { ActivityIndicator } from 'react-native'; import { Pressable, Text } from 'react-native-ama'; const Test = () => { - const [isExpanded, setIsExpanded] = React.useState(false); - - return ( - <> - setIsExpanded(expanded => !expanded)}> - {isExpanded ? : } - - {isExpanded ? <>{/* content goes here */} : null} - - ); + const [isExpanded, setIsExpanded] = React.useState(false); + + return ( + <> + setIsExpanded(expanded => !expanded)}> + {isExpanded ? : } + + {isExpanded ? <>{/* content goes here */} : null} + + ); }; ``` diff --git a/website/versioned_docs/version-0.7.x/components/TouchableOpacity.md b/website/versioned_docs/version-0.7.x/components/TouchableOpacity.md index 9a88da71..a88f5cb9 100644 --- a/website/versioned_docs/version-0.7.x/components/TouchableOpacity.md +++ b/website/versioned_docs/version-0.7.x/components/TouchableOpacity.md @@ -7,8 +7,10 @@ TouchableOpacity is an extension of the React Native [TouchableOpacity](https:// ```tsx import { TouchableOpacity } from 'react-native-ama'; - - I'm pressable + + I'm pressable ; ``` @@ -73,28 +75,28 @@ Indicates whether an element is currently busy or not. ```tsx import { ActivityIndicator } from 'react-native'; -import { TouchableOpacity, Text } from 'react-native-ama'; +import { Text, TouchableOpacity } from 'react-native-ama'; const Test = () => { - const [isLoading, setIsLoading] = React.useState(false); + const [isLoading, setIsLoading] = React.useState(false); - const doSometing = async () => { - setIsLoading(true); + const doSomething = async () => { + setIsLoading(true); - await slowCall(); + await slowCall(); - setIsLoading(true); - }; + setIsLoading(true); + }; - return ( - - {isLoading ? : Do it} - - ); + return ( + + {isLoading ? : Do it} + + ); }; ``` @@ -126,23 +128,23 @@ Indicates whether an expandable element is currently expanded or collapsed. ```tsx import { ActivityIndicator } from 'react-native'; -import { TouchableOpacity, Text } from 'react-native-ama'; +import { Text, TouchableOpacity } from 'react-native-ama'; const Test = () => { - const [isExpanded, setIsExpanded] = React.useState(false); - - return ( - <> - setIsExpanded(expanded => !expanded)}> - {isExpanded ? : } - - {isExpanded ? <>{/* content goes here */} : null} - - ); + const [isExpanded, setIsExpanded] = React.useState(false); + + return ( + <> + setIsExpanded(expanded => !expanded)}> + {isExpanded ? : } + + {isExpanded ? <>{/* content goes here */} : null} + + ); }; ``` diff --git a/website/versioned_docs/version-0.7.x/components/TouchableWithoutFeedback.md b/website/versioned_docs/version-0.7.x/components/TouchableWithoutFeedback.md index 2dd23f1d..5cb35d6e 100644 --- a/website/versioned_docs/version-0.7.x/components/TouchableWithoutFeedback.md +++ b/website/versioned_docs/version-0.7.x/components/TouchableWithoutFeedback.md @@ -5,8 +5,8 @@ import { DevOnly } from '@site/src/components'; TouchableWithoutFeedback is an extension of the React Native [TouchableWithoutFeedback](https://reactnative.dev/docs/touchablewithoutfeedback) component, [focused on accessibility](#accessibility-improvements). ```tsx -import { TouchableWithoutFeedback } from 'react-native-ama'; import { View } from 'react-native'; +import { TouchableWithoutFeedback } from 'react-native-ama'; { const [isLoading, setIsLoading] = React.useState(false); - const doSometing = async () => { + const doSomething = async () => { setIsLoading(true); await slowCall(); @@ -93,10 +93,10 @@ const Test = () => { return ( + onPress={doSomething}> {isLoading ? : Do it} ); @@ -131,7 +131,7 @@ Indicates whether an expandable element is currently expanded or collapsed. ```tsx import { ActivityIndicator } from 'react-native'; -import { TouchableWithoutFeedback, Text } from 'react-native-ama'; +import { Text, TouchableWithoutFeedback } from 'react-native-ama'; const Test = () => { const [isExpanded, setIsExpanded] = React.useState(false); @@ -139,7 +139,7 @@ const Test = () => { return ( <> setIsExpanded(expanded => !expanded)}>