@momo-kits/foundation 0.77.8-beta.3 → 0.77.8-beta.4
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/Application/BottomTab.tsx +13 -3
- package/Application/ModalScreen.tsx +42 -13
- package/Application/types.ts +3 -0
- package/CheckBox/index.tsx +1 -1
- package/CheckBox/styles.ts +1 -1
- package/Input/Input.tsx +5 -4
- package/Input/InputMoney.tsx +4 -3
- package/Input/InputSearch.tsx +3 -13
- package/Input/InputTextArea.tsx +3 -2
- package/Input/common.tsx +10 -4
- package/Input/index.tsx +7 -0
- package/Layout/GridSystem.tsx +1 -1
- package/Layout/Screen.tsx +14 -4
- package/Layout/index.ts +1 -1
- package/Layout/utils.ts +6 -9
- package/Loader/DotLoader.tsx +4 -4
- package/Loader/Spinner.tsx +3 -3
- package/Pagination/PaginationWhiteDot.tsx +1 -3
- package/Popup/types.ts +9 -1
- package/Radio/index.tsx +1 -1
- package/Text/index.tsx +1 -16
- package/package.json +1 -1
- package/tsconfig.json +25 -0
- /package/{code-scanner.ts → code-scanner.js} +0 -0
|
@@ -8,17 +8,27 @@ import {ApplicationContext} from './index';
|
|
|
8
8
|
|
|
9
9
|
const Tab = createBottomTabNavigator();
|
|
10
10
|
|
|
11
|
-
const BottomTab: React.FC<BottomTabProps> = ({tabs, listeners}) => {
|
|
11
|
+
const BottomTab: React.FC<BottomTabProps> = ({tabs, listeners, navigation}) => {
|
|
12
12
|
const {theme} = useContext(ApplicationContext);
|
|
13
|
+
|
|
14
|
+
const defaultListener = {
|
|
15
|
+
focus: (item: any) => {
|
|
16
|
+
const focusItem = tabs.find(i => item.target.includes(i.name));
|
|
17
|
+
if (focusItem?.options) {
|
|
18
|
+
navigation?.setOptions?.(focusItem.options);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
13
23
|
return (
|
|
14
|
-
<Tab.Navigator>
|
|
24
|
+
<Tab.Navigator backBehavior={'firstRoute'}>
|
|
15
25
|
{tabs.map(item => {
|
|
16
26
|
return (
|
|
17
27
|
<Tab.Screen
|
|
18
28
|
key={item.name}
|
|
19
29
|
name={item.name}
|
|
20
30
|
component={item.screen}
|
|
21
|
-
listeners={listeners}
|
|
31
|
+
listeners={listeners ?? defaultListener}
|
|
22
32
|
options={{
|
|
23
33
|
tabBarLabel: ({color, focused}) => {
|
|
24
34
|
return (
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useContext,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
2
9
|
import {
|
|
3
10
|
KeyboardAvoidingView,
|
|
4
11
|
Platform,
|
|
@@ -6,7 +13,7 @@ import {
|
|
|
6
13
|
StyleSheet,
|
|
7
14
|
View,
|
|
8
15
|
} from 'react-native';
|
|
9
|
-
import {SafeAreaView
|
|
16
|
+
import {SafeAreaView} from 'react-native-safe-area-context';
|
|
10
17
|
import {BottomSheetBackdrop, BottomSheetModal} from '@gorhom/bottom-sheet';
|
|
11
18
|
import Navigation from './Navigation';
|
|
12
19
|
import {BottomSheetParams, ModalParams} from './types';
|
|
@@ -84,7 +91,11 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
84
91
|
|
|
85
92
|
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
86
93
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
87
|
-
const {
|
|
94
|
+
const {
|
|
95
|
+
screen,
|
|
96
|
+
options,
|
|
97
|
+
useSnap = true,
|
|
98
|
+
}: BottomSheetParams = props.route.params;
|
|
88
99
|
const Component = useRef(screen).current;
|
|
89
100
|
const navigation = new Navigation(props.navigation, theme);
|
|
90
101
|
const params = {
|
|
@@ -94,11 +105,36 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
94
105
|
|
|
95
106
|
delete params.screen;
|
|
96
107
|
|
|
97
|
-
const
|
|
98
|
-
const
|
|
108
|
+
const [contentHeight, setContentHeight] = useState(undefined);
|
|
109
|
+
const snapPoints = useMemo(() => {
|
|
110
|
+
if (useSnap) {
|
|
111
|
+
return ['50%', '90%'];
|
|
112
|
+
}
|
|
113
|
+
return [contentHeight ?? '50%'];
|
|
114
|
+
}, [contentHeight]);
|
|
115
|
+
|
|
99
116
|
const bottomSheetRef = useRef<any>(null);
|
|
100
117
|
const mountedRef = useRef(true);
|
|
101
118
|
|
|
119
|
+
let handleOnLayout;
|
|
120
|
+
if (useSnap) {
|
|
121
|
+
handleOnLayout = useCallback(
|
|
122
|
+
({
|
|
123
|
+
nativeEvent: {
|
|
124
|
+
layout: {height},
|
|
125
|
+
},
|
|
126
|
+
}) => {
|
|
127
|
+
setContentHeight(height);
|
|
128
|
+
},
|
|
129
|
+
[],
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let backgroundColor = theme.colors.background.default;
|
|
134
|
+
if (options?.surface) {
|
|
135
|
+
backgroundColor = theme.colors.background.surface;
|
|
136
|
+
}
|
|
137
|
+
|
|
102
138
|
useEffect(() => {
|
|
103
139
|
bottomSheetRef.current?.present();
|
|
104
140
|
return () => {
|
|
@@ -114,11 +150,6 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
114
150
|
/>
|
|
115
151
|
);
|
|
116
152
|
|
|
117
|
-
let backgroundColor = theme.colors.background.default;
|
|
118
|
-
if (options?.surface) {
|
|
119
|
-
backgroundColor = theme.colors.background.surface;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
153
|
return (
|
|
123
154
|
<SafeAreaView style={Styles.flex}>
|
|
124
155
|
<BottomSheetModal
|
|
@@ -131,9 +162,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
131
162
|
}}
|
|
132
163
|
handleComponent={null}
|
|
133
164
|
backdropComponent={backdropComponent}>
|
|
134
|
-
<View
|
|
135
|
-
style={{paddingBottom: bottom}}
|
|
136
|
-
accessibilityLabel={'BottomSheet'}>
|
|
165
|
+
<View onLayout={handleOnLayout} accessibilityLabel={'BottomSheet'}>
|
|
137
166
|
<View style={[styles.sheetContainer, {backgroundColor}]}>
|
|
138
167
|
<View style={styles.indicatorContainer}>
|
|
139
168
|
<View
|
package/Application/types.ts
CHANGED
|
@@ -108,6 +108,7 @@ export interface ModalParams extends ScreenParams {
|
|
|
108
108
|
export interface BottomSheetParams extends ScreenParams {
|
|
109
109
|
[key: string]: any;
|
|
110
110
|
onDismiss?: () => void;
|
|
111
|
+
useSnap?: boolean;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export type NavigationButtonProps = {
|
|
@@ -171,10 +172,12 @@ export type BottomTabItemProps = {
|
|
|
171
172
|
showDot?: boolean;
|
|
172
173
|
badgeLabel?: string;
|
|
173
174
|
screen: Screen;
|
|
175
|
+
options: NavigationOptions;
|
|
174
176
|
};
|
|
175
177
|
|
|
176
178
|
export type BottomTabProps = {
|
|
177
179
|
tabs: BottomTabItemProps[];
|
|
180
|
+
navigation: Navigation;
|
|
178
181
|
listeners?: {
|
|
179
182
|
tabPress?: any;
|
|
180
183
|
focus?: any;
|
package/CheckBox/index.tsx
CHANGED
package/CheckBox/styles.ts
CHANGED
package/Input/Input.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {FC, useContext,
|
|
1
|
+
import React, {FC, useContext, useRef, useState} from 'react';
|
|
2
2
|
import {
|
|
3
3
|
NativeSyntheticEvent,
|
|
4
4
|
TextInput,
|
|
@@ -28,6 +28,7 @@ const Input: FC<InputProps> = ({
|
|
|
28
28
|
floatingIconColor,
|
|
29
29
|
iconColor,
|
|
30
30
|
required,
|
|
31
|
+
errorSpacing,
|
|
31
32
|
...props
|
|
32
33
|
}) => {
|
|
33
34
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -71,10 +72,10 @@ const Input: FC<InputProps> = ({
|
|
|
71
72
|
return (
|
|
72
73
|
<View
|
|
73
74
|
style={[
|
|
74
|
-
getSizeStyle(size),
|
|
75
|
-
getBorderColor(focused, errorMessage, disabled),
|
|
76
75
|
styles.inputWrapper,
|
|
77
76
|
{backgroundColor: theme.colors.background.surface},
|
|
77
|
+
getSizeStyle(size),
|
|
78
|
+
getBorderColor(theme, focused, errorMessage, disabled),
|
|
78
79
|
]}>
|
|
79
80
|
<FloatingView
|
|
80
81
|
floatingValue={floatingValue}
|
|
@@ -126,7 +127,7 @@ const Input: FC<InputProps> = ({
|
|
|
126
127
|
return (
|
|
127
128
|
<View style={styles.wrapper} accessibilityLabel={`Input/${floatingValue}`}>
|
|
128
129
|
{renderInputView()}
|
|
129
|
-
<ErrorView errorMessage={errorMessage} />
|
|
130
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
130
131
|
</View>
|
|
131
132
|
);
|
|
132
133
|
};
|
package/Input/InputMoney.tsx
CHANGED
|
@@ -26,6 +26,7 @@ const InputMoney: FC<InputMoneyProps> = ({
|
|
|
26
26
|
floatingIconColor,
|
|
27
27
|
iconColor,
|
|
28
28
|
required,
|
|
29
|
+
errorSpacing,
|
|
29
30
|
...props
|
|
30
31
|
}) => {
|
|
31
32
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -71,10 +72,10 @@ const InputMoney: FC<InputMoneyProps> = ({
|
|
|
71
72
|
return (
|
|
72
73
|
<View
|
|
73
74
|
style={[
|
|
74
|
-
getSizeStyle(size),
|
|
75
|
-
getBorderColor(focused, errorMessage, disabled),
|
|
76
75
|
styles.inputWrapper,
|
|
77
76
|
{backgroundColor: theme.colors.background.surface},
|
|
77
|
+
getSizeStyle(size),
|
|
78
|
+
getBorderColor(theme, focused, errorMessage, disabled),
|
|
78
79
|
]}>
|
|
79
80
|
<FloatingView
|
|
80
81
|
floatingValue={floatingValue}
|
|
@@ -127,7 +128,7 @@ const InputMoney: FC<InputMoneyProps> = ({
|
|
|
127
128
|
style={styles.wrapper}
|
|
128
129
|
accessibilityLabel={`InputMoney/${floatingValue}`}>
|
|
129
130
|
{renderInputView()}
|
|
130
|
-
<ErrorView errorMessage={errorMessage} />
|
|
131
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
131
132
|
</View>
|
|
132
133
|
);
|
|
133
134
|
};
|
package/Input/InputSearch.tsx
CHANGED
|
@@ -55,18 +55,6 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
55
55
|
onChangeText?.(text);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const getBorderColor = () => {
|
|
59
|
-
let borderColor = showBorder
|
|
60
|
-
? theme.colors.border.default
|
|
61
|
-
: theme.colors.background.surface;
|
|
62
|
-
|
|
63
|
-
if (focused) {
|
|
64
|
-
borderColor = theme.colors.primary;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return {borderColor};
|
|
68
|
-
};
|
|
69
|
-
|
|
70
58
|
const renderInputView = () => {
|
|
71
59
|
let textColor = theme.colors.text.default;
|
|
72
60
|
let placeholderColor = theme.colors.text.hint;
|
|
@@ -135,11 +123,13 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
135
123
|
accessibilityLabel={`InputSearch/${placeholder}`}>
|
|
136
124
|
<View
|
|
137
125
|
style={[
|
|
138
|
-
getBorderColor(),
|
|
139
126
|
styles.searchInputWrapper,
|
|
140
127
|
{
|
|
141
128
|
backgroundColor: theme.colors.background.surface,
|
|
129
|
+
borderColor: theme.colors.background.surface,
|
|
142
130
|
},
|
|
131
|
+
showBorder && {borderColor: theme.colors.border.default},
|
|
132
|
+
focused && {borderColor: theme.colors.primary},
|
|
143
133
|
]}>
|
|
144
134
|
<Icon
|
|
145
135
|
source={'navigation_search'}
|
package/Input/InputTextArea.tsx
CHANGED
|
@@ -34,6 +34,7 @@ const InputTextArea: FC<InputTextAreaProps> = ({
|
|
|
34
34
|
placeholder,
|
|
35
35
|
maxLength,
|
|
36
36
|
required,
|
|
37
|
+
errorSpacing,
|
|
37
38
|
...props
|
|
38
39
|
}) => {
|
|
39
40
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -83,12 +84,12 @@ const InputTextArea: FC<InputTextAreaProps> = ({
|
|
|
83
84
|
return (
|
|
84
85
|
<View
|
|
85
86
|
style={[
|
|
86
|
-
getBorderColor(focused, errorMessage, disabled),
|
|
87
87
|
styles.textAreaWrapper,
|
|
88
88
|
{
|
|
89
89
|
height: height || DEFAULT_HEIGHT,
|
|
90
90
|
backgroundColor: theme.colors.background.surface,
|
|
91
91
|
},
|
|
92
|
+
getBorderColor(theme, focused, errorMessage, disabled),
|
|
92
93
|
]}>
|
|
93
94
|
<FloatingView
|
|
94
95
|
floatingValue={floatingValue}
|
|
@@ -143,7 +144,7 @@ const InputTextArea: FC<InputTextAreaProps> = ({
|
|
|
143
144
|
style={styles.wrapper}
|
|
144
145
|
accessibilityLabel={`InputTextArea/${floatingValue}`}>
|
|
145
146
|
{renderInputView()}
|
|
146
|
-
<ErrorView errorMessage={errorMessage} />
|
|
147
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
147
148
|
</View>
|
|
148
149
|
);
|
|
149
150
|
};
|
package/Input/common.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import React, {FC, useContext} from 'react';
|
|
|
5
5
|
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {Icon} from '../Icon';
|
|
7
7
|
import {Styles} from '../Consts';
|
|
8
|
+
import {Theme} from '../Application/types';
|
|
8
9
|
|
|
9
10
|
type FloatingViewProps = {
|
|
10
11
|
floatingValue?: string;
|
|
@@ -18,12 +19,11 @@ export const DEFAULT_HEIGHT = 112;
|
|
|
18
19
|
export const MAX_LENGTH = 300;
|
|
19
20
|
|
|
20
21
|
export const getBorderColor = (
|
|
22
|
+
theme: Theme,
|
|
21
23
|
focused: boolean,
|
|
22
24
|
errorMessage?: string,
|
|
23
25
|
disabled?: boolean,
|
|
24
26
|
) => {
|
|
25
|
-
const {theme} = useContext(ApplicationContext);
|
|
26
|
-
|
|
27
27
|
let borderColor = theme.colors.border.default;
|
|
28
28
|
|
|
29
29
|
if (focused) {
|
|
@@ -47,7 +47,10 @@ export const getSizeStyle = (size?: 'small' | 'large') => {
|
|
|
47
47
|
}
|
|
48
48
|
return styles.container;
|
|
49
49
|
};
|
|
50
|
-
export const ErrorView: FC<{errorMessage?: string}> = ({
|
|
50
|
+
export const ErrorView: FC<{errorMessage?: string; errorSpacing?: boolean}> = ({
|
|
51
|
+
errorMessage,
|
|
52
|
+
errorSpacing,
|
|
53
|
+
}) => {
|
|
51
54
|
const {theme} = useContext(ApplicationContext);
|
|
52
55
|
const errorColor = theme.colors.error.primary;
|
|
53
56
|
if (errorMessage) {
|
|
@@ -66,7 +69,10 @@ export const ErrorView: FC<{errorMessage?: string}> = ({errorMessage}) => {
|
|
|
66
69
|
</View>
|
|
67
70
|
);
|
|
68
71
|
}
|
|
69
|
-
|
|
72
|
+
if (errorSpacing) {
|
|
73
|
+
return <View style={[styles.errorView, {height: 18}]} />;
|
|
74
|
+
}
|
|
75
|
+
return <View />;
|
|
70
76
|
};
|
|
71
77
|
|
|
72
78
|
export const FloatingView: FC<FloatingViewProps> = ({
|
package/Input/index.tsx
CHANGED
|
@@ -52,6 +52,13 @@ export interface InputProps extends TextInputProps {
|
|
|
52
52
|
* Defaults to `false` if not provided.
|
|
53
53
|
*/
|
|
54
54
|
required?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Optional. If `true`,
|
|
58
|
+
* include spacing when Input not have error message.
|
|
59
|
+
* Defaults to `false` if not provided.
|
|
60
|
+
*/
|
|
61
|
+
errorSpacing?: boolean;
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
type InputPropsWithoutSizeAndIcon = Omit<
|
package/Layout/GridSystem.tsx
CHANGED
|
@@ -51,7 +51,7 @@ const GridSystem: React.FC<any> = ({
|
|
|
51
51
|
bottom: Spacing.M,
|
|
52
52
|
},
|
|
53
53
|
]}>
|
|
54
|
-
{list.map((
|
|
54
|
+
{list.map((_, index) => {
|
|
55
55
|
return (
|
|
56
56
|
<View style={{flexDirection: 'row'}} key={index.toString()}>
|
|
57
57
|
{index != -0 && <View style={{width: grid.gutterSize}} />}
|
package/Layout/Screen.tsx
CHANGED
|
@@ -5,9 +5,8 @@ import React, {useContext, useEffect, useRef} from 'react';
|
|
|
5
5
|
import {ScreenProps} from '../Application/types';
|
|
6
6
|
import {Spacing, Styles} from '../Consts';
|
|
7
7
|
import {Card, Section, validateChildren} from './index';
|
|
8
|
-
import {ApplicationContext} from '../Application';
|
|
8
|
+
import {ApplicationContext, HeaderTitle} from '../Application';
|
|
9
9
|
import Navigation from '../Application/Navigation';
|
|
10
|
-
import {HeaderTitle} from '../Application/Components';
|
|
11
10
|
|
|
12
11
|
const Screen: React.FC<ScreenProps> = ({
|
|
13
12
|
children,
|
|
@@ -70,7 +69,6 @@ const Screen: React.FC<ScreenProps> = ({
|
|
|
70
69
|
const stackNavigation = new Navigation(current?.getParent(), theme);
|
|
71
70
|
stackNavigation?.setOptions({
|
|
72
71
|
animatedValue: animatedValue.current,
|
|
73
|
-
headerTransparent: true,
|
|
74
72
|
});
|
|
75
73
|
});
|
|
76
74
|
}
|
|
@@ -130,8 +128,20 @@ const Screen: React.FC<ScreenProps> = ({
|
|
|
130
128
|
</View>
|
|
131
129
|
);
|
|
132
130
|
});
|
|
131
|
+
} else {
|
|
132
|
+
const item: any = children;
|
|
133
|
+
const space = item?.props?.useMargin === false ? 0 : Spacing.M;
|
|
134
|
+
return (
|
|
135
|
+
<View
|
|
136
|
+
key={`ScreenItem`}
|
|
137
|
+
style={{
|
|
138
|
+
marginTop: space,
|
|
139
|
+
flex: item?.props?.expanded ? 1 : undefined,
|
|
140
|
+
}}>
|
|
141
|
+
{children}
|
|
142
|
+
</View>
|
|
143
|
+
);
|
|
133
144
|
}
|
|
134
|
-
return results;
|
|
135
145
|
};
|
|
136
146
|
|
|
137
147
|
return (
|
package/Layout/index.ts
CHANGED
package/Layout/utils.ts
CHANGED
|
@@ -62,15 +62,12 @@ const useGridSystem = () => {
|
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
useEffect(() => {
|
|
65
|
-
const subscription: any = Dimensions.addEventListener(
|
|
66
|
-
'
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
);
|
|
65
|
+
const subscription: any = Dimensions.addEventListener('change', () => {
|
|
66
|
+
const newColumns = Dimensions.get('window').width > 600 ? 24 : 12;
|
|
67
|
+
if (newColumns != numberOfColumns) {
|
|
68
|
+
setNumberOfColumns(newColumns);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
74
71
|
return () => subscription?.remove();
|
|
75
72
|
}, []);
|
|
76
73
|
|
package/Loader/DotLoader.tsx
CHANGED
|
@@ -14,12 +14,12 @@ const DotLoader: FC<ViewProps> = ({style}) => {
|
|
|
14
14
|
theme.colors.primary,
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
-
let source = animation;
|
|
18
|
-
source.assets[0].layers[0].shapes[0].it.forEach(item => {
|
|
17
|
+
let source: any = animation;
|
|
18
|
+
source.assets[0].layers[0].shapes[0].it.forEach((item: any) => {
|
|
19
19
|
if (item.ty === 'fl' && item.c) {
|
|
20
|
-
item.c.k.forEach((fillItem, index) => {
|
|
20
|
+
item.c.k.forEach((fillItem: any, index: number) => {
|
|
21
21
|
if (typeof fillItem !== 'number') {
|
|
22
|
-
fillItem.s = hexToRGBA(arrayColor[index]);
|
|
22
|
+
fillItem.s = hexToRGBA(arrayColor[index] as string);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
package/Loader/Spinner.tsx
CHANGED
|
@@ -8,9 +8,9 @@ import {ApplicationContext} from '../Application';
|
|
|
8
8
|
const Spinner: FC<ViewProps> = ({style}) => {
|
|
9
9
|
const {theme} = useContext(ApplicationContext);
|
|
10
10
|
|
|
11
|
-
let source = animation;
|
|
12
|
-
source.assets[0].layers.forEach(layer => {
|
|
13
|
-
layer.shapes[0].it.forEach(item => {
|
|
11
|
+
let source: any = animation;
|
|
12
|
+
source.assets[0].layers.forEach((layer: any) => {
|
|
13
|
+
layer.shapes[0].it.forEach((item: any) => {
|
|
14
14
|
if (item.ty === 'fl' && item.c) {
|
|
15
15
|
item.c.k = hexToRGBA(theme.colors.primary);
|
|
16
16
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import React, {FC
|
|
1
|
+
import React, {FC} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
3
|
import {ChildPaginationProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import Dot from './Dot';
|
|
6
6
|
import {Colors, Spacing} from '../Consts';
|
|
7
|
-
import {ApplicationContext} from '../Application';
|
|
8
7
|
|
|
9
8
|
const PaginationWhiteDot: FC<ChildPaginationProps> = ({
|
|
10
9
|
dataLength = 2,
|
|
11
10
|
activeIndex = 0,
|
|
12
11
|
}) => {
|
|
13
|
-
const {theme} = useContext(ApplicationContext);
|
|
14
12
|
const renderDots = () => {
|
|
15
13
|
const dots = [];
|
|
16
14
|
for (let i = 0; i < dataLength; i++) {
|
package/Popup/types.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {TextStyle} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
1
4
|
export type PopupNotifyProps = {
|
|
2
5
|
/**
|
|
3
6
|
* `image`: Optional. Represents the URL or path of the image to be displayed in the PopupNotify component.
|
|
@@ -12,7 +15,7 @@ export type PopupNotifyProps = {
|
|
|
12
15
|
/**
|
|
13
16
|
* `description`: Represents the description text to be displayed in the PopupNotify component.
|
|
14
17
|
*/
|
|
15
|
-
description: string;
|
|
18
|
+
description: string | React.ReactNode;
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* `information`: Optional. Represents additional information text to be displayed in the PopupNotify component.
|
|
@@ -67,4 +70,9 @@ type PopupAction = {
|
|
|
67
70
|
onPress: () => void;
|
|
68
71
|
};
|
|
69
72
|
|
|
73
|
+
export type HighlightText = {
|
|
74
|
+
text: string;
|
|
75
|
+
style: TextStyle;
|
|
76
|
+
};
|
|
77
|
+
|
|
70
78
|
type PopupActionDirection = 'row' | 'column' | 'auto';
|
package/Radio/index.tsx
CHANGED
package/Text/index.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import {Text as RNText, TextProps as RNTextProps} from 'react-native';
|
|
|
3
3
|
import styles from './styles';
|
|
4
4
|
import {Typography, TypographyWeight} from './types';
|
|
5
5
|
import {ApplicationContext} from '../Application';
|
|
6
|
-
import {GridContext} from '../Layout';
|
|
7
6
|
import {scaleSize} from './utils';
|
|
8
7
|
|
|
9
8
|
const SFProText: TypographyWeight = {
|
|
@@ -51,22 +50,14 @@ export interface TextProps extends RNTextProps {
|
|
|
51
50
|
* It can be any valid color string (e.g., hex, rgb, rgba, etc.).
|
|
52
51
|
*/
|
|
53
52
|
color?: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Optional. Represents the width of the Text component in terms of span numbers.
|
|
57
|
-
* It can be used to set a specific width for the text based on a predefined grid system.
|
|
58
|
-
*/
|
|
59
|
-
widthSpan?: number;
|
|
60
53
|
}
|
|
61
54
|
const Text: React.FC<TextProps> = ({
|
|
62
55
|
typography,
|
|
63
56
|
color,
|
|
64
57
|
children,
|
|
65
58
|
style,
|
|
66
|
-
widthSpan,
|
|
67
59
|
...rest
|
|
68
60
|
}) => {
|
|
69
|
-
const grid = useContext(GridContext);
|
|
70
61
|
const {theme} = useContext(ApplicationContext);
|
|
71
62
|
|
|
72
63
|
const getTypoStyle = (typo: Typography) => {
|
|
@@ -101,17 +92,11 @@ const Text: React.FC<TextProps> = ({
|
|
|
101
92
|
};
|
|
102
93
|
|
|
103
94
|
const textStyle = getTypoStyle(typography);
|
|
104
|
-
const spanStyle = widthSpan ? {width: grid.getSizeSpan(widthSpan)} : {};
|
|
105
95
|
return (
|
|
106
96
|
<RNText
|
|
107
97
|
{...rest}
|
|
108
98
|
accessibilityLabel={`Text/${children}`}
|
|
109
|
-
style={[
|
|
110
|
-
style,
|
|
111
|
-
textStyle,
|
|
112
|
-
spanStyle,
|
|
113
|
-
{color: color ?? theme.colors.text.default},
|
|
114
|
-
]}>
|
|
99
|
+
style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
|
|
115
100
|
{children ?? ''}
|
|
116
101
|
</RNText>
|
|
117
102
|
);
|
package/package.json
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": ".",
|
|
4
|
+
"allowUnreachableCode": false,
|
|
5
|
+
"allowUnusedLabels": false,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
"lib": ["esnext"],
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"noImplicitReturns": false,
|
|
14
|
+
"noImplicitUseStrict": false,
|
|
15
|
+
"noStrictGenericChecks": false,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"target": "esnext",
|
|
23
|
+
"verbatimModuleSyntax": false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
File without changes
|