@oneplatformdev/react-native-uikit 1.2.4 → 1.2.6
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 +1 -1
- package/src/components/Avatar/ui/Avatar.tsx +1 -1
- package/src/components/Avatar/ui/styles.ts +5 -1
- package/src/components/BottomModal/ui/styles.ts +5 -1
- package/src/components/Button/ui/Button.tsx +3 -2
- package/src/components/Button/ui/styles.ts +6 -2
- package/src/components/CustomAlert/ui/styles.ts +10 -2
- package/src/components/PhotoPreview/ui/styles.ts +15 -3
- package/src/components/ScreenContainer/types/types.ts +4 -3
- package/src/components/ScreenContainer/ui/styles.ts +5 -1
- package/src/components/Typography/ui/Typography.tsx +2 -2
package/package.json
CHANGED
|
@@ -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'
|
|
@@ -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 {
|
|
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<
|
|
11
|
+
const ButtonComponent = forwardRef<ComponentRef<typeof Pressable>, ButtonProps>(
|
|
11
12
|
(
|
|
12
13
|
{
|
|
13
14
|
accessibilityLabel,
|
|
@@ -31,7 +31,7 @@ export const getStyles = (
|
|
|
31
31
|
const styles = StyleSheet.create({
|
|
32
32
|
container,
|
|
33
33
|
content: {
|
|
34
|
-
|
|
34
|
+
maxWidth: '100%',
|
|
35
35
|
flexDirection: 'row',
|
|
36
36
|
alignItems: 'center',
|
|
37
37
|
justifyContent: 'center',
|
|
@@ -53,7 +53,11 @@ export const getStyles = (
|
|
|
53
53
|
justifyContent: 'center',
|
|
54
54
|
},
|
|
55
55
|
loader: {
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
top: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
bottom: 0,
|
|
54
|
+
left: 0,
|
|
51
55
|
},
|
|
52
56
|
overlay: {
|
|
53
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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<
|
|
9
|
+
const TypographyComponent = forwardRef<ComponentRef<typeof Text>, TypographyProps>(
|
|
10
10
|
(
|
|
11
11
|
{
|
|
12
12
|
text,
|