@oneplatformdev/react-native-uikit 1.2.4 → 1.2.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/react-native-uikit",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "main": "src/index.ts",
5
5
  "types": "src/index.ts",
6
6
  "bin": {
@@ -38,7 +38,7 @@ export const Avatar = ({
38
38
  const label = onPress
39
39
  ? accessibilityLabel ?? fallbackLabel
40
40
  : imageAccessibilityLabel ?? accessibilityLabel ?? fallbackLabel;
41
- const content = showImage ? (
41
+ const content = source !== undefined && showImage ? (
42
42
  <Image source={source} onError={onImageError} accessible={false} style={[imageStyle, styles.image]} />
43
43
  ) : fallback != null && typeof fallback !== 'boolean' ? (
44
44
  typeof fallback === 'string' || typeof fallback === 'number'
@@ -35,7 +35,11 @@ export const getStyles = (
35
35
  justifyContent: 'center',
36
36
  },
37
37
  image: {
38
- ...StyleSheet.absoluteFill,
38
+ position: 'absolute',
39
+ top: 0,
40
+ right: 0,
41
+ bottom: 0,
42
+ left: 0,
39
43
  },
40
44
  text: {
41
45
  color: foreground,
@@ -19,7 +19,11 @@ export const getStyles = (
19
19
  justifyContent: 'flex-end',
20
20
  },
21
21
  backdrop: {
22
- ...StyleSheet.absoluteFill,
22
+ position: 'absolute',
23
+ top: 0,
24
+ right: 0,
25
+ bottom: 0,
26
+ left: 0,
23
27
  backgroundColor: colors.text,
24
28
  },
25
29
  keyboardBackground: {
@@ -1,13 +1,14 @@
1
1
  import { forwardRef, memo, useCallback, useMemo } from "react";
2
+ import type { ComponentRef } from "react";
2
3
  import { ActivityIndicator, Pressable, View } from "react-native";
3
- import type { PressableInstance, PressableStateCallbackType } from "react-native";
4
+ import type { PressableStateCallbackType } from "react-native";
4
5
  import { Typography } from "../../Typography";
5
6
  import { useButton } from "../presenters/useButton";
6
7
  import type { ButtonProps } from "../types/types";
7
8
  import { useScaling } from '../../../utils';
8
9
  import { getStyles, resolveButtonStyle } from './styles';
9
10
 
10
- const ButtonComponent = forwardRef<PressableInstance, ButtonProps>(
11
+ const ButtonComponent = forwardRef<ComponentRef<typeof Pressable>, ButtonProps>(
11
12
  (
12
13
  {
13
14
  accessibilityLabel,
@@ -53,7 +53,11 @@ export const getStyles = (
53
53
  justifyContent: 'center',
54
54
  },
55
55
  loader: {
56
- ...StyleSheet.absoluteFill,
56
+ position: 'absolute',
57
+ top: 0,
58
+ right: 0,
59
+ bottom: 0,
60
+ left: 0,
57
61
  alignItems: 'center',
58
62
  justifyContent: 'center',
59
63
  },
@@ -10,11 +10,19 @@ export const getStyles = (colors: UIColors, spacing: UISpacing, radius: UIRadius
10
10
  alignItems: 'center',
11
11
  },
12
12
  backdrop: {
13
- ...StyleSheet.absoluteFill,
13
+ position: 'absolute',
14
+ top: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ left: 0,
14
18
  backgroundColor: colors.text,
15
19
  },
16
20
  backdropTouch: {
17
- ...StyleSheet.absoluteFill,
21
+ position: 'absolute',
22
+ top: 0,
23
+ right: 0,
24
+ bottom: 0,
25
+ left: 0,
18
26
  },
19
27
  alertContainer: {
20
28
  width: '90%',
@@ -47,10 +47,18 @@ export const getStyles = (
47
47
  overflow: 'hidden',
48
48
  },
49
49
  image: {
50
- ...StyleSheet.absoluteFill,
50
+ position: 'absolute',
51
+ top: 0,
52
+ right: 0,
53
+ bottom: 0,
54
+ left: 0,
51
55
  },
52
56
  overlay: {
53
- ...StyleSheet.absoluteFill,
57
+ position: 'absolute',
58
+ top: 0,
59
+ right: 0,
60
+ bottom: 0,
61
+ left: 0,
54
62
  },
55
63
  remove: {
56
64
  position: 'absolute',
@@ -109,7 +117,11 @@ export const getFullscreenStyles = (
109
117
  width: '100%',
110
118
  },
111
119
  loadingOverlay: {
112
- ...StyleSheet.absoluteFill,
120
+ position: 'absolute',
121
+ top: 0,
122
+ right: 0,
123
+ bottom: 0,
124
+ left: 0,
113
125
  alignItems: 'center',
114
126
  justifyContent: 'center',
115
127
  },
@@ -1,12 +1,12 @@
1
- import type { ReactNode, Ref } from 'react';
2
- import type { ScrollViewProps, StyleProp, ViewStyle } from 'react-native';
1
+ import type { ComponentRef, ReactNode, Ref } from 'react';
2
+ import type { ScrollView, ScrollViewProps, StyleProp, ViewStyle } from 'react-native';
3
3
  import type { KeyboardAwareScrollViewRef } from 'react-native-keyboard-controller';
4
4
  import type { LinearGradientProps } from 'react-native-linear-gradient';
5
5
  import type { Edge } from 'react-native-safe-area-context';
6
6
 
7
7
  export type ScreenContainerGradient = Pick<LinearGradientProps, 'colors' | 'locations' | 'start' | 'end'>;
8
8
 
9
- export interface ScreenContainerProps extends Omit<ScrollViewProps, 'children' | 'style' | 'contentContainerStyle'> {
9
+ export interface ScreenContainerProps extends Omit<ScrollViewProps, 'children' | 'style' | 'contentContainerStyle' | 'scrollViewRef'> {
10
10
  children?: ReactNode;
11
11
  edges?: Edge[];
12
12
  isKeyboardAvoiding?: boolean;
@@ -14,6 +14,7 @@ export interface ScreenContainerProps extends Omit<ScrollViewProps, 'children' |
14
14
  contentContainerStyle?: StyleProp<ViewStyle>;
15
15
  headerComponent?: ReactNode;
16
16
  footerComponent?: ReactNode;
17
+ scrollViewRef?: Ref<ComponentRef<typeof ScrollView>>;
17
18
  keyboardScrollViewRef?: Ref<KeyboardAwareScrollViewRef>;
18
19
  gradient?: ScreenContainerGradient;
19
20
  }
@@ -10,7 +10,11 @@ export const getStyles = (colors: UIColors) => {
10
10
  backgroundColor: colors.background,
11
11
  },
12
12
  gradient: {
13
- ...StyleSheet.absoluteFill,
13
+ position: 'absolute',
14
+ top: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ left: 0,
14
18
  },
15
19
  safeArea: {
16
20
  flex: 1,
@@ -1,12 +1,12 @@
1
1
  import React, { forwardRef, memo, useMemo } from 'react';
2
+ import type { ComponentRef } from 'react';
2
3
  import { Text } from 'react-native';
3
- import type { TextInstance } from 'react-native';
4
4
  import { useUITheme } from '../../../theme';
5
5
  import { useScaling } from '../../../utils';
6
6
  import { getTypographyStyle } from './styles';
7
7
  import type { TypographyProps } from '../types/types';
8
8
 
9
- const TypographyComponent = forwardRef<TextInstance, TypographyProps>(
9
+ const TypographyComponent = forwardRef<ComponentRef<typeof Text>, TypographyProps>(
10
10
  (
11
11
  {
12
12
  text,