From d7782d774ae56fac3ffc8d0cf870daea82114791 Mon Sep 17 00:00:00 2001 From: Sjaak Schilperoort Date: Tue, 8 Sep 2026 11:49:51 +0200 Subject: [PATCH 1/2] Add hitSlop property to IconButton --- package.json | 2 +- src/components/IconButton.tsx | 3 +++ src/components/__tests__/IconButton.test.tsx | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e9b9537..e55bfea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@observation.org/react-native-components", - "version": "1.95.0", + "version": "1.96.0", "main": "src/index.ts", "exports": { ".": "./src/index.ts", diff --git a/src/components/IconButton.tsx b/src/components/IconButton.tsx index 8b96084..3d4b26d 100644 --- a/src/components/IconButton.tsx +++ b/src/components/IconButton.tsx @@ -10,6 +10,7 @@ type Props = { onPress?: () => void icon: IconProps accessibilityLabel?: string + hitSlop?: TouchableOpacityProps['hitSlop'] testID?: string Touchable?: ComponentType } @@ -20,6 +21,7 @@ const IconButton = ({ onPress, icon, accessibilityLabel, + hitSlop, testID = 'pressable', Touchable = TouchableOpacity, }: Props) => { @@ -32,6 +34,7 @@ const IconButton = ({ disabled={disabled} onPress={disabled ? undefined : onPress} activeOpacity={0.5} + hitSlop={hitSlop} > diff --git a/src/components/__tests__/IconButton.test.tsx b/src/components/__tests__/IconButton.test.tsx index a08a88e..dae880b 100644 --- a/src/components/__tests__/IconButton.test.tsx +++ b/src/components/__tests__/IconButton.test.tsx @@ -40,4 +40,16 @@ describe('IconButton', () => { // THEN expect(mockOnPress).toHaveBeenCalledTimes(0) }) + + test('Applies hitSlop', () => { + // GIVEN + const hitSlop = { top: 10, bottom: 10, left: 10, right: 10 } + const { getByTestId } = render() + + // WHEN + const pressable = getByTestId('pressable') + + // THEN + expect(pressable.props.hitSlop).toEqual(hitSlop) + }) }) From 2473f61531180f83eee58bcc41b42867df1c01c6 Mon Sep 17 00:00:00 2001 From: Sjaak Schilperoort Date: Tue, 8 Sep 2026 18:16:24 +0200 Subject: [PATCH 2/2] Add text styles for species local and scientific name --- src/theme/tokens/text.ts | 16 ++++++++++++++++ src/theme/types.ts | 27 ++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/theme/tokens/text.ts b/src/theme/tokens/text.ts index e7179c3..70bd06e 100644 --- a/src/theme/tokens/text.ts +++ b/src/theme/tokens/text.ts @@ -19,6 +19,22 @@ export const createTextStyles = (theme: Theme) => fontStyle: 'italic', color: theme.color.text.system.subtler, }, + speciesLocalName: { + fontFamily: 'Ubuntu', + fontStyle: 'normal', + fontSize: 16, + lineHeight: 24, + fontWeight: 'bold', + color: theme.color.text.system.strong, + }, + speciesScientificName: { + fontFamily: 'Ubuntu', + fontStyle: 'italic', + fontSize: 12, + lineHeight: 16, + fontWeight: 'normal', + color: theme.color.text.system.subtler, + }, body: { ...theme.font.medium, color: theme.color.text.system.subtle, diff --git a/src/theme/types.ts b/src/theme/types.ts index e1ad25f..6e6eb53 100644 --- a/src/theme/types.ts +++ b/src/theme/types.ts @@ -289,6 +289,7 @@ export type TextName = | 'inputLabel' | 'scientificName' | 'body' + | 'bodyBlack' | 'light' | 'lead' | 'link' @@ -298,6 +299,30 @@ export type TextName = | 'title' | 'percentage' | 'thumbnail' + | 'subLabel' + | 'speciesLocalName' + | 'speciesScientificName' | keyof TextNameOverrides -export type Text = Record +export interface Text { + iconLabel: TextStyle + tabIconLabel: TextStyle + inputLabel: TextStyle + /** @deprecated Use theme.text.speciesScientificName */ + scientificName: TextStyle + body: TextStyle + bodyBlack: TextStyle + light: TextStyle + lead: TextStyle + link: TextStyle + linkBold: TextStyle + input: TextStyle + subtitle: TextStyle + title: TextStyle + percentage: TextStyle + thumbnail: TextStyle + subLabel: TextStyle + speciesLocalName: TextStyle + speciesScientificName: TextStyle + [name: string]: TextStyle +}