@janiscommerce/ui-native 1.25.2 → 1.27.0-beta.0
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 +14 -11
- package/dist/android/app/_BUCK +0 -55
- package/dist/android/app/build.gradle +0 -230
- package/dist/android/app/build_defs.bzl +0 -19
- package/dist/android/app/debug.keystore +0 -0
- package/dist/android/app/proguard-rules.pro +0 -10
- package/dist/android/app/src/debug/AndroidManifest.xml +0 -13
- package/dist/android/app/src/debug/java/com/myapp/ReactNativeFlipper.java +0 -72
- package/dist/android/app/src/main/AndroidManifest.xml +0 -25
- package/dist/android/app/src/main/assets/fonts/Roboto-Bold.ttf +0 -0
- package/dist/android/app/src/main/assets/fonts/Roboto-Light.ttf +0 -0
- package/dist/android/app/src/main/assets/fonts/Roboto-Medium.ttf +0 -0
- package/dist/android/app/src/main/assets/fonts/Roboto-Regular.ttf +0 -0
- package/dist/android/app/src/main/assets/fonts/janis-font-icon.ttf +0 -0
- package/dist/android/app/src/main/java/com/myapp/MainActivity.java +0 -15
- package/dist/android/app/src/main/java/com/myapp/MainApplication.java +0 -80
- package/dist/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/dist/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/dist/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/dist/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/dist/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/dist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/dist/android/app/src/main/res/values/strings.xml +0 -3
- package/dist/android/app/src/main/res/values/styles.xml +0 -9
- package/dist/android/build.gradle +0 -42
- package/dist/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/dist/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/dist/android/gradle.properties +0 -28
- package/dist/android/gradlew +0 -185
- package/dist/android/gradlew.bat +0 -89
- package/dist/android/settings.gradle +0 -6
- package/dist/components/atoms/BaseButton/index.d.ts +0 -10
- package/dist/components/atoms/BaseButton/index.js +0 -24
- package/dist/components/atoms/BaseCardList/index.d.ts +0 -8
- package/dist/components/atoms/BaseCardList/index.js +0 -33
- package/dist/components/atoms/BaseInput/index.d.ts +0 -10
- package/dist/components/atoms/BaseInput/index.js +0 -7
- package/dist/components/atoms/BaseToast/index.d.ts +0 -17
- package/dist/components/atoms/BaseToast/index.js +0 -31
- package/dist/components/atoms/BaseToast/utils/index.d.ts +0 -7
- package/dist/components/atoms/BaseToast/utils/index.js +0 -7
- package/dist/components/atoms/CheckBox/icon/CheckedIcon.d.ts +0 -13
- package/dist/components/atoms/CheckBox/icon/CheckedIcon.js +0 -14
- package/dist/components/atoms/CheckBox/index.d.ts +0 -15
- package/dist/components/atoms/CheckBox/index.js +0 -43
- package/dist/components/atoms/Collapsible/index.d.ts +0 -24
- package/dist/components/atoms/Collapsible/index.js +0 -59
- package/dist/components/atoms/Icon/assets/fonts/selection.json +0 -1
- package/dist/components/atoms/Icon/index.d.ts +0 -9
- package/dist/components/atoms/Icon/index.js +0 -14
- package/dist/components/atoms/Image/index.d.ts +0 -10
- package/dist/components/atoms/Image/index.js +0 -30
- package/dist/components/atoms/Input/index.d.ts +0 -31
- package/dist/components/atoms/Input/index.js +0 -94
- package/dist/components/atoms/Input/utils/index.d.ts +0 -28
- package/dist/components/atoms/Input/utils/index.js +0 -44
- package/dist/components/atoms/List/index.d.ts +0 -26
- package/dist/components/atoms/List/index.js +0 -21
- package/dist/components/atoms/Loading/LoadingSvg/index.d.ts +0 -8
- package/dist/components/atoms/Loading/LoadingSvg/index.js +0 -13
- package/dist/components/atoms/Loading/index.d.ts +0 -12
- package/dist/components/atoms/Loading/index.js +0 -60
- package/dist/components/atoms/Modal/index.d.ts +0 -15
- package/dist/components/atoms/Modal/index.js +0 -83
- package/dist/components/atoms/RadioButton/index.d.ts +0 -22
- package/dist/components/atoms/RadioButton/index.js +0 -49
- package/dist/components/atoms/StatusChip/index.d.ts +0 -8
- package/dist/components/atoms/StatusChip/index.js +0 -44
- package/dist/components/atoms/Svg/index.d.ts +0 -24
- package/dist/components/atoms/Svg/index.js +0 -31
- package/dist/components/atoms/Svg/svgs/EmptyIllustration.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/EmptyIllustration.js +0 -23
- package/dist/components/atoms/Svg/svgs/EmptyListIllustration.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/EmptyListIllustration.js +0 -73
- package/dist/components/atoms/Svg/svgs/EmptyNotifications.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/EmptyNotifications.js +0 -17
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogo.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogo.js +0 -48
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogoBeta.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogoBeta.js +0 -50
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogoQa.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/JanisCommerceLogoQa.js +0 -50
- package/dist/components/atoms/Svg/svgs/JanisIso.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/JanisIso.js +0 -29
- package/dist/components/atoms/Svg/svgs/LoginIllustration.d.ts +0 -4
- package/dist/components/atoms/Svg/svgs/LoginIllustration.js +0 -31
- package/dist/components/atoms/Svg/svgs/index.d.ts +0 -12
- package/dist/components/atoms/Svg/svgs/index.js +0 -19
- package/dist/components/atoms/SwipeUp/childComponents/index.d.ts +0 -11
- package/dist/components/atoms/SwipeUp/childComponents/index.js +0 -22
- package/dist/components/atoms/SwipeUp/index.d.ts +0 -10
- package/dist/components/atoms/SwipeUp/index.js +0 -11
- package/dist/components/atoms/Text/index.d.ts +0 -8
- package/dist/components/atoms/Text/index.js +0 -19
- package/dist/components/atoms/Typography/index.d.ts +0 -13
- package/dist/components/atoms/Typography/index.js +0 -13
- package/dist/components/atoms/Typography/utils/getStyleByTypography/index.d.ts +0 -8
- package/dist/components/atoms/Typography/utils/getStyleByTypography/index.js +0 -19
- package/dist/components/molecules/Avatar/index.d.ts +0 -22
- package/dist/components/molecules/Avatar/index.js +0 -64
- package/dist/components/molecules/Avatar/utils/formatPlaceholder/index.d.ts +0 -12
- package/dist/components/molecules/Avatar/utils/formatPlaceholder/index.js +0 -20
- package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.d.ts +0 -8
- package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.js +0 -12
- package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.d.ts +0 -7
- package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.js +0 -12
- package/dist/components/molecules/BaseDetail/components/index.d.ts +0 -3
- package/dist/components/molecules/BaseDetail/components/index.js +0 -3
- package/dist/components/molecules/BaseDetail/index.d.ts +0 -8
- package/dist/components/molecules/BaseDetail/index.js +0 -9
- package/dist/components/molecules/BaseDetail/types/index.d.ts +0 -15
- package/dist/components/molecules/BaseDetail/types/index.js +0 -1
- package/dist/components/molecules/Button/index.d.ts +0 -50
- package/dist/components/molecules/Button/index.js +0 -57
- package/dist/components/molecules/Button/types/index.d.ts +0 -45
- package/dist/components/molecules/Button/types/index.js +0 -1
- package/dist/components/molecules/Button/utils/getButtonStyles/index.d.ts +0 -3
- package/dist/components/molecules/Button/utils/getButtonStyles/index.js +0 -84
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/constants/index.d.ts +0 -5
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/constants/index.js +0 -5
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/defaultValues/index.d.ts +0 -5
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/defaultValues/index.js +0 -5
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/styleConfigs/index.d.ts +0 -120
- package/dist/components/molecules/Button/utils/getButtonStyles/utils/styleConfigs/index.js +0 -123
- package/dist/components/molecules/Carousel/index.d.ts +0 -19
- package/dist/components/molecules/Carousel/index.js +0 -35
- package/dist/components/molecules/Carousel/utils/index.d.ts +0 -13
- package/dist/components/molecules/Carousel/utils/index.js +0 -102
- package/dist/components/molecules/ErrorBoundary/components/ErrorFallback/index.d.ts +0 -3
- package/dist/components/molecules/ErrorBoundary/components/ErrorFallback/index.js +0 -24
- package/dist/components/molecules/ErrorBoundary/index.d.ts +0 -20
- package/dist/components/molecules/ErrorBoundary/index.js +0 -37
- package/dist/components/molecules/Input/index.d.ts +0 -26
- package/dist/components/molecules/Input/index.js +0 -94
- package/dist/components/molecules/Input/utils/handleChangeText/index.d.ts +0 -3
- package/dist/components/molecules/Input/utils/handleChangeText/index.js +0 -16
- package/dist/components/molecules/ItemSelectionButton/index.d.ts +0 -11
- package/dist/components/molecules/ItemSelectionButton/index.js +0 -66
- package/dist/components/molecules/LayoutWithBottomButtons/index.d.ts +0 -11
- package/dist/components/molecules/LayoutWithBottomButtons/index.js +0 -72
- package/dist/components/molecules/LayoutWithBottomButtons/utils/index.d.ts +0 -364
- package/dist/components/molecules/LayoutWithBottomButtons/utils/index.js +0 -148
- package/dist/components/molecules/MainCardList/index.d.ts +0 -14
- package/dist/components/molecules/MainCardList/index.js +0 -60
- package/dist/components/molecules/ProgressBar/index.d.ts +0 -11
- package/dist/components/molecules/ProgressBar/index.js +0 -58
- package/dist/components/molecules/ProgressBar/utils/index.d.ts +0 -20
- package/dist/components/molecules/ProgressBar/utils/index.js +0 -52
- package/dist/components/molecules/Select/Components/Dropdown/index.d.ts +0 -10
- package/dist/components/molecules/Select/Components/Dropdown/index.js +0 -23
- package/dist/components/molecules/Select/Components/Modal/index.d.ts +0 -8
- package/dist/components/molecules/Select/Components/Modal/index.js +0 -59
- package/dist/components/molecules/Select/Components/Options/index.d.ts +0 -18
- package/dist/components/molecules/Select/Components/Options/index.js +0 -75
- package/dist/components/molecules/Select/Components/SwitcherComponent/index.d.ts +0 -13
- package/dist/components/molecules/Select/Components/SwitcherComponent/index.js +0 -8
- package/dist/components/molecules/Select/index.d.ts +0 -51
- package/dist/components/molecules/Select/index.js +0 -178
- package/dist/components/molecules/Select/utils/index.d.ts +0 -2
- package/dist/components/molecules/Select/utils/index.js +0 -7
- package/dist/components/molecules/SwipeList/index.d.ts +0 -11
- package/dist/components/molecules/SwipeList/index.js +0 -31
- package/dist/components/molecules/Tabs/index.d.ts +0 -23
- package/dist/components/molecules/Tabs/index.js +0 -112
- package/dist/components/molecules/Toast/index.d.ts +0 -23
- package/dist/components/molecules/Toast/index.js +0 -102
- package/dist/components/molecules/Toast/utils/index.d.ts +0 -7
- package/dist/components/molecules/Toast/utils/index.js +0 -7
- package/dist/components/organisms/FullScreenMessage/index.d.ts +0 -21
- package/dist/components/organisms/FullScreenMessage/index.js +0 -73
- package/dist/components/organisms/LoadingFullScreen/index.d.ts +0 -12
- package/dist/components/organisms/LoadingFullScreen/index.js +0 -41
- package/dist/components/organisms/ProductDetail/components/ProductInfo/index.d.ts +0 -9
- package/dist/components/organisms/ProductDetail/components/ProductInfo/index.js +0 -44
- package/dist/components/organisms/ProductDetail/index.d.ts +0 -9
- package/dist/components/organisms/ProductDetail/index.js +0 -10
- package/dist/components/organisms/SwipeItemSelectionList/index.d.ts +0 -14
- package/dist/components/organisms/SwipeItemSelectionList/index.js +0 -37
- package/dist/index.d.ts +0 -37
- package/dist/index.js +0 -41
- package/dist/ios/MyApp/AppDelegate.h +0 -8
- package/dist/ios/MyApp/AppDelegate.m +0 -58
- package/dist/ios/MyApp/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/dist/ios/MyApp/Images.xcassets/Contents.json +0 -6
- package/dist/ios/MyApp/Info.plist +0 -55
- package/dist/ios/MyApp/LaunchScreen.storyboard +0 -58
- package/dist/ios/MyApp/main.m +0 -9
- package/dist/ios/MyApp.xcodeproj/project.pbxproj +0 -791
- package/dist/ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp-tvOS.xcscheme +0 -88
- package/dist/ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp.xcscheme +0 -88
- package/dist/ios/MyAppTests/Info.plist +0 -24
- package/dist/ios/MyAppTests/MyAppTests.m +0 -65
- package/dist/ios/Podfile +0 -33
- package/dist/scale/index.d.ts +0 -8
- package/dist/scale/index.js +0 -13
- package/dist/theme/palette.d.ts +0 -13
- package/dist/theme/palette.js +0 -63
- package/dist/theme/typography.d.ts +0 -37
- package/dist/theme/typography.js +0 -94
- package/dist/ts/interfaces/colors.d.ts +0 -55
- package/dist/ts/interfaces/colors.js +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -7
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BottomSheetFlatList, BottomSheetScrollView, BottomSheetView, } from '@gorhom/bottom-sheet';
|
|
3
|
-
export const SwipeUpFlatList = React.forwardRef(({ data, renderItem, ...props }, ref) => {
|
|
4
|
-
if (!data || !data.length || !renderItem) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
return <BottomSheetFlatList ref={ref} data={data} renderItem={renderItem} {...props}/>;
|
|
8
|
-
});
|
|
9
|
-
export const SwipeUpScrollView = React.forwardRef(({ children, ...props }, ref) => {
|
|
10
|
-
if (!children) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return (<BottomSheetScrollView ref={ref} {...props}>
|
|
14
|
-
{children}
|
|
15
|
-
</BottomSheetScrollView>);
|
|
16
|
-
});
|
|
17
|
-
export const SwipeUpView = ({ children, ...props }) => {
|
|
18
|
-
if (!children) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return <BottomSheetView {...props}>{children}</BottomSheetView>;
|
|
22
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BottomSheetProps } from '@gorhom/bottom-sheet';
|
|
3
|
-
import { ViewStyle } from 'react-native';
|
|
4
|
-
export interface SwipeUpProps extends BottomSheetProps {
|
|
5
|
-
onChangeSnap?: () => void;
|
|
6
|
-
swipeWrapperStyle?: ViewStyle;
|
|
7
|
-
snapPosition?: number;
|
|
8
|
-
}
|
|
9
|
-
declare const SwipeUp: React.ForwardRefExoticComponent<SwipeUpProps & React.RefAttributes<import("@gorhom/bottom-sheet/lib/typescript/types").BottomSheetMethods>>;
|
|
10
|
-
export default SwipeUp;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BottomSheet from '@gorhom/bottom-sheet';
|
|
3
|
-
const SwipeUp = React.forwardRef(({ children, snapPoints = ['100%'], snapPosition = 0, style, onChangeSnap, backgroundStyle, swipeWrapperStyle, ...props }, ref) => {
|
|
4
|
-
if (!children) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
return (<BottomSheet ref={ref} snapPoints={snapPoints} index={snapPosition} onChange={onChangeSnap} style={style} containerStyle={backgroundStyle} backgroundStyle={swipeWrapperStyle} {...props}>
|
|
8
|
-
{children}
|
|
9
|
-
</BottomSheet>);
|
|
10
|
-
});
|
|
11
|
-
export default SwipeUp;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { StyleProp, TextProps as TextComponentProps, TextStyle } from 'react-native';
|
|
3
|
-
export interface TextProps extends TextComponentProps {
|
|
4
|
-
children?: ReactElement | string;
|
|
5
|
-
style?: StyleProp<TextStyle>;
|
|
6
|
-
}
|
|
7
|
-
declare const Text: ({ children, style, ...props }: TextProps) => React.JSX.Element | null;
|
|
8
|
-
export default Text;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet, Text as TextComponent, } from 'react-native';
|
|
3
|
-
import { moderateScale, scaledForDevice } from '../../../scale';
|
|
4
|
-
const Text = ({ children, style, ...props }) => {
|
|
5
|
-
if (!children) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
const validFontSize = scaledForDevice(13, moderateScale);
|
|
9
|
-
const styles = StyleSheet.create({
|
|
10
|
-
TextStyles: {
|
|
11
|
-
fontSize: validFontSize,
|
|
12
|
-
fontFamily: 'Roboto',
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
return (<TextComponent style={[styles.TextStyles, style]} {...props}>
|
|
16
|
-
{children}
|
|
17
|
-
</TextComponent>);
|
|
18
|
-
};
|
|
19
|
-
export default Text;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { StyleProp, TextStyle, TextProps } from 'react-native';
|
|
3
|
-
export type TypographyType = 'display' | 'heading' | 'title' | 'label' | 'body' | 'overline';
|
|
4
|
-
export type TypographySize = 'large' | 'medium' | 'small';
|
|
5
|
-
interface TypographyProps extends TextProps {
|
|
6
|
-
children?: ReactElement | string;
|
|
7
|
-
style?: StyleProp<TextStyle>;
|
|
8
|
-
type?: TypographyType;
|
|
9
|
-
size?: TypographySize;
|
|
10
|
-
color?: string;
|
|
11
|
-
}
|
|
12
|
-
declare const Typography: ({ children, style, type, size, color, ...props }: TypographyProps) => React.JSX.Element | null;
|
|
13
|
-
export default Typography;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Text } from 'react-native';
|
|
3
|
-
import getStyleByTypography from './utils/getStyleByTypography';
|
|
4
|
-
const Typography = ({ children, style, type, size, color, ...props }) => {
|
|
5
|
-
if (!children) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
const typographyStyles = getStyleByTypography(type, size, color);
|
|
9
|
-
return (<Text style={[style, typographyStyles.typography]} {...props}>
|
|
10
|
-
{children}
|
|
11
|
-
</Text>);
|
|
12
|
-
};
|
|
13
|
-
export default Typography;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TextStyle } from 'react-native';
|
|
2
|
-
import typography, { Typography } from '../../../../../theme/typography';
|
|
3
|
-
type TypographyType = keyof Typography;
|
|
4
|
-
type TypographySize = 'large' | 'medium' | 'small';
|
|
5
|
-
declare const getStyleByTypography: (type?: TypographyType | string, size?: TypographySize | string, color?: string) => {
|
|
6
|
-
typography: TextStyle;
|
|
7
|
-
};
|
|
8
|
-
export default getStyleByTypography;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
import typography from '../../../../../theme/typography';
|
|
3
|
-
const getStyleByTypography = (type = 'body', size = 'medium', color) => {
|
|
4
|
-
const validType = Object.keys(typography).includes(type)
|
|
5
|
-
? type
|
|
6
|
-
: 'body';
|
|
7
|
-
const typographyCategory = typography[validType];
|
|
8
|
-
const validSize = Object.keys(typographyCategory).includes(size)
|
|
9
|
-
? size
|
|
10
|
-
: 'medium';
|
|
11
|
-
const typographyStyle = typographyCategory[validSize];
|
|
12
|
-
return StyleSheet.create({
|
|
13
|
-
typography: {
|
|
14
|
-
...typographyStyle,
|
|
15
|
-
...(color && { color }),
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export default getStyleByTypography;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
export declare const sizeValues: {
|
|
4
|
-
sm: number;
|
|
5
|
-
md: number;
|
|
6
|
-
lg: number;
|
|
7
|
-
};
|
|
8
|
-
export type sizeType = typeof sizeValues;
|
|
9
|
-
export type sizeKeys = keyof sizeType;
|
|
10
|
-
export interface AvatarProps {
|
|
11
|
-
placeholder: string;
|
|
12
|
-
textColor?: string;
|
|
13
|
-
bgColor?: string;
|
|
14
|
-
size?: sizeKeys;
|
|
15
|
-
customSize?: number;
|
|
16
|
-
imageUrl?: string;
|
|
17
|
-
onErrorImg?: () => void;
|
|
18
|
-
style?: ViewStyle;
|
|
19
|
-
}
|
|
20
|
-
export declare const getSize: (size: sizeKeys, customSize?: number) => number;
|
|
21
|
-
declare const Avatar: ({ size, textColor, bgColor, imageUrl, placeholder, customSize, onErrorImg, style, ...props }: AvatarProps) => React.JSX.Element | null;
|
|
22
|
-
export default Avatar;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import Image from '../../atoms/Image';
|
|
4
|
-
import Typography from '../../atoms/Typography';
|
|
5
|
-
import { formatPlaceholder } from './utils/formatPlaceholder/index';
|
|
6
|
-
import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
|
|
7
|
-
export const sizeValues = {
|
|
8
|
-
sm: 24,
|
|
9
|
-
md: 36,
|
|
10
|
-
lg: 60,
|
|
11
|
-
};
|
|
12
|
-
const styles = StyleSheet.create({
|
|
13
|
-
container: {
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
overflow: 'hidden',
|
|
16
|
-
},
|
|
17
|
-
text: {
|
|
18
|
-
textAlign: 'center',
|
|
19
|
-
textTransform: 'uppercase',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
export const getSize = (size, customSize) => customSize || sizeValues[size];
|
|
23
|
-
const Avatar = ({ size = 'sm', textColor = '#FFFFFF', bgColor = '#E8EAF6', imageUrl = '', placeholder, customSize, onErrorImg, style, ...props }) => {
|
|
24
|
-
const [showInitials, setShowInitials] = useState(false);
|
|
25
|
-
if (!placeholder) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
const initials = formatPlaceholder(String(placeholder));
|
|
29
|
-
const calculateBorderRadius = getSize(size, customSize) / 2;
|
|
30
|
-
const calculateSize = getSize(size, customSize);
|
|
31
|
-
const calculateFontSize = getSize(size, customSize) * 0.4;
|
|
32
|
-
const validBorderRadius = scaledForDevice(calculateBorderRadius, moderateScale);
|
|
33
|
-
const validWidth = scaledForDevice(calculateSize, horizontalScale);
|
|
34
|
-
const validHeight = scaledForDevice(calculateSize, moderateScale);
|
|
35
|
-
const validFontSize = scaledForDevice(calculateFontSize, moderateScale);
|
|
36
|
-
const handleOnErrorImage = () => {
|
|
37
|
-
setShowInitials(true);
|
|
38
|
-
if (onErrorImg) {
|
|
39
|
-
onErrorImg();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
return (<View style={[
|
|
43
|
-
styles.container,
|
|
44
|
-
{
|
|
45
|
-
backgroundColor: bgColor,
|
|
46
|
-
borderRadius: validBorderRadius,
|
|
47
|
-
height: validHeight,
|
|
48
|
-
width: validWidth,
|
|
49
|
-
},
|
|
50
|
-
style,
|
|
51
|
-
]} {...props}>
|
|
52
|
-
{!!imageUrl && !showInitials && (<Image accessibilityRole="image" onError={handleOnErrorImage} onLoad={() => setShowInitials(false)} source={{
|
|
53
|
-
uri: imageUrl,
|
|
54
|
-
}} style={{
|
|
55
|
-
height: validHeight,
|
|
56
|
-
width: validWidth,
|
|
57
|
-
}}/>)}
|
|
58
|
-
|
|
59
|
-
{(showInitials || !imageUrl) && !!initials.length && (<Typography style={[styles.text, { color: textColor, fontSize: validFontSize }]}>
|
|
60
|
-
{initials}
|
|
61
|
-
</Typography>)}
|
|
62
|
-
</View>);
|
|
63
|
-
};
|
|
64
|
-
export default Avatar;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the placeholder provided is single or compound and returns either the first two letters,
|
|
3
|
-
* or the initials of the two first words.
|
|
4
|
-
* @param {string} placeholder
|
|
5
|
-
* @return {string} An array with the first two leters of the placeholder, or initials of the
|
|
6
|
-
* first two words in uppercase
|
|
7
|
-
* @example formatPlaceholder('Juan') // returns 'JU'
|
|
8
|
-
* @example formatPlaceholder('Juan Perez') // returns 'JP'
|
|
9
|
-
* @example formatPlaceholder('Juan Perez Rodriguez') // returns 'JP'
|
|
10
|
-
* @example formatPlaceholder('') // returns ''
|
|
11
|
-
*/
|
|
12
|
-
export declare const formatPlaceholder: (placeholder?: string) => string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the placeholder provided is single or compound and returns either the first two letters,
|
|
3
|
-
* or the initials of the two first words.
|
|
4
|
-
* @param {string} placeholder
|
|
5
|
-
* @return {string} An array with the first two leters of the placeholder, or initials of the
|
|
6
|
-
* first two words in uppercase
|
|
7
|
-
* @example formatPlaceholder('Juan') // returns 'JU'
|
|
8
|
-
* @example formatPlaceholder('Juan Perez') // returns 'JP'
|
|
9
|
-
* @example formatPlaceholder('Juan Perez Rodriguez') // returns 'JP'
|
|
10
|
-
* @example formatPlaceholder('') // returns ''
|
|
11
|
-
*/
|
|
12
|
-
export const formatPlaceholder = (placeholder = '') => {
|
|
13
|
-
const names = placeholder.split(' ');
|
|
14
|
-
if (names.length > 1) {
|
|
15
|
-
const firstLetter = names[0].substring(0, 1).toUpperCase();
|
|
16
|
-
const secondLetter = names[1].substring(0, 1).toUpperCase();
|
|
17
|
-
return `${firstLetter}${secondLetter}`;
|
|
18
|
-
}
|
|
19
|
-
return placeholder.substring(0, 2).toUpperCase();
|
|
20
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ModalMethods } from '../../../../atoms/Modal';
|
|
3
|
-
declare const BaseDetailModal: React.ForwardRefExoticComponent<{
|
|
4
|
-
componentType: "modal";
|
|
5
|
-
} & import("../../../../atoms/Modal").UIModalProps & {
|
|
6
|
-
scrollProps?: import("react-native").ScrollViewProps | undefined;
|
|
7
|
-
} & React.RefAttributes<ModalMethods>>;
|
|
8
|
-
export default BaseDetailModal;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import Modal from '../../../../atoms/Modal';
|
|
3
|
-
import { ScrollView } from 'react-native';
|
|
4
|
-
const BaseDetailModal = forwardRef((props, ref) => {
|
|
5
|
-
const { children, scrollProps = {}, ...rest } = props;
|
|
6
|
-
return (<Modal ref={ref} {...rest}>
|
|
7
|
-
<ScrollView showsVerticalScrollIndicator={false} {...scrollProps}>
|
|
8
|
-
{children}
|
|
9
|
-
</ScrollView>
|
|
10
|
-
</Modal>);
|
|
11
|
-
});
|
|
12
|
-
export default BaseDetailModal;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const BaseDetailSwipe: React.ForwardRefExoticComponent<{
|
|
3
|
-
componentType: "swipe";
|
|
4
|
-
} & import("../../../../atoms/SwipeUp").SwipeUpProps & {
|
|
5
|
-
scrollProps?: import("@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types").BottomSheetScrollViewProps | undefined;
|
|
6
|
-
} & React.RefAttributes<import("@gorhom/bottom-sheet/lib/typescript/types").BottomSheetMethods>>;
|
|
7
|
-
export default BaseDetailSwipe;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import SwipeUp from '../../../../atoms/SwipeUp';
|
|
3
|
-
import { SwipeUpScrollView } from '../../../../atoms/SwipeUp/childComponents';
|
|
4
|
-
const BaseDetailSwipe = forwardRef((props, ref) => {
|
|
5
|
-
const { children, scrollProps = {}, ...rest } = props;
|
|
6
|
-
return (<SwipeUp ref={ref} {...rest}>
|
|
7
|
-
<SwipeUpScrollView showsVerticalScrollIndicator={false} {...scrollProps}>
|
|
8
|
-
{children}
|
|
9
|
-
</SwipeUpScrollView>
|
|
10
|
-
</SwipeUp>);
|
|
11
|
-
});
|
|
12
|
-
export default BaseDetailSwipe;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseModalProps, BaseSwipeUpProps } from './types';
|
|
3
|
-
import { ModalMethods } from '../../atoms/Modal';
|
|
4
|
-
import { BottomSheetMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
|
|
5
|
-
type BaseDetailProps = BaseModalProps | BaseSwipeUpProps;
|
|
6
|
-
export type BaseDetailMethods = ModalMethods & BottomSheetMethods;
|
|
7
|
-
declare const BaseDetail: React.ForwardRefExoticComponent<BaseDetailProps & React.RefAttributes<BaseDetailMethods>>;
|
|
8
|
-
export default BaseDetail;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import { BaseDetailModal, BaseDetailSwipe } from './components';
|
|
3
|
-
const BaseDetail = forwardRef((props, ref) => {
|
|
4
|
-
if (props.componentType === 'swipe') {
|
|
5
|
-
return <BaseDetailSwipe {...props} ref={ref} enablePanDownToClose index={-1}/>;
|
|
6
|
-
}
|
|
7
|
-
return <BaseDetailModal {...props} fullScreen componentType="modal" ref={ref}/>;
|
|
8
|
-
});
|
|
9
|
-
export default BaseDetail;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BottomSheetScrollViewProps } from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types';
|
|
2
|
-
import { UIModalProps } from '../../../atoms/Modal';
|
|
3
|
-
import { SwipeUpProps } from '../../../atoms/SwipeUp';
|
|
4
|
-
import { ScrollViewProps } from 'react-native';
|
|
5
|
-
export type ComponentType = 'modal' | 'swipe';
|
|
6
|
-
export type BaseModalProps = {
|
|
7
|
-
componentType: 'modal';
|
|
8
|
-
} & UIModalProps & {
|
|
9
|
-
scrollProps?: ScrollViewProps;
|
|
10
|
-
};
|
|
11
|
-
export type BaseSwipeUpProps = {
|
|
12
|
-
componentType: 'swipe';
|
|
13
|
-
} & SwipeUpProps & {
|
|
14
|
-
scrollProps?: BottomSheetScrollViewProps;
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import { BaseButtonProps } from '../../atoms/BaseButton';
|
|
4
|
-
export declare const types: {
|
|
5
|
-
main: string;
|
|
6
|
-
secondary: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const variant: {
|
|
9
|
-
contained: string;
|
|
10
|
-
outlined: string;
|
|
11
|
-
text: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const color: {
|
|
14
|
-
primary: string;
|
|
15
|
-
black: string;
|
|
16
|
-
success: string;
|
|
17
|
-
error: string;
|
|
18
|
-
warning: string;
|
|
19
|
-
alert: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const iconPosition: {
|
|
22
|
-
top: string;
|
|
23
|
-
bottom: string;
|
|
24
|
-
left: string;
|
|
25
|
-
right: string;
|
|
26
|
-
};
|
|
27
|
-
export type buttonType = typeof types;
|
|
28
|
-
export type keyType = keyof buttonType;
|
|
29
|
-
export type buttonVariant = typeof variant;
|
|
30
|
-
export type keyVariant = keyof buttonVariant;
|
|
31
|
-
export type buttonColor = typeof color;
|
|
32
|
-
export type keyColor = keyof buttonColor;
|
|
33
|
-
export type buttonIconPosition = typeof iconPosition;
|
|
34
|
-
export type keyIconPosition = keyof buttonIconPosition;
|
|
35
|
-
export interface ButtonProps extends BaseButtonProps {
|
|
36
|
-
type?: keyType;
|
|
37
|
-
variant?: keyVariant;
|
|
38
|
-
color?: keyColor;
|
|
39
|
-
isLoading?: boolean;
|
|
40
|
-
value?: string | null;
|
|
41
|
-
icon?: string;
|
|
42
|
-
iconPosition?: keyIconPosition;
|
|
43
|
-
disabled?: boolean;
|
|
44
|
-
style?: ViewStyle;
|
|
45
|
-
pressedStyle?: ViewStyle;
|
|
46
|
-
iconStyle?: TextStyle;
|
|
47
|
-
textStyle?: TextStyle;
|
|
48
|
-
}
|
|
49
|
-
declare const Button: FC<ButtonProps>;
|
|
50
|
-
export default Button;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import BaseButton from '../../atoms/BaseButton';
|
|
4
|
-
import getButtonStyles from './utils/getButtonStyles';
|
|
5
|
-
import Loading from '../../atoms/Loading';
|
|
6
|
-
import Typography from '../../atoms/Typography';
|
|
7
|
-
import Icon from '../../atoms/Icon';
|
|
8
|
-
export const types = {
|
|
9
|
-
main: 'main',
|
|
10
|
-
secondary: 'secondary',
|
|
11
|
-
};
|
|
12
|
-
export const variant = {
|
|
13
|
-
contained: 'contained',
|
|
14
|
-
outlined: 'outlined',
|
|
15
|
-
text: 'text',
|
|
16
|
-
};
|
|
17
|
-
export const color = {
|
|
18
|
-
primary: 'primary',
|
|
19
|
-
black: 'black',
|
|
20
|
-
success: 'success',
|
|
21
|
-
error: 'error',
|
|
22
|
-
warning: 'warning',
|
|
23
|
-
alert: 'alert',
|
|
24
|
-
};
|
|
25
|
-
export const iconPosition = {
|
|
26
|
-
top: 'top',
|
|
27
|
-
bottom: 'bottom',
|
|
28
|
-
left: 'left',
|
|
29
|
-
right: 'right',
|
|
30
|
-
};
|
|
31
|
-
const Button = ({ type = 'main', variant = 'contained', color = 'primary', iconPosition = 'left', isLoading = false, value = '', icon = null, disabled = false, style, iconStyle, textStyle, ...props }) => {
|
|
32
|
-
if (!value && !icon) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const validDisabled = disabled || isLoading;
|
|
36
|
-
const hasIconAndText = !!icon && !!value;
|
|
37
|
-
const borderRadius = variant === 'text' ? 6 : 50;
|
|
38
|
-
const buttonStyles = getButtonStyles({
|
|
39
|
-
type,
|
|
40
|
-
variant,
|
|
41
|
-
color,
|
|
42
|
-
iconPosition,
|
|
43
|
-
isLoading,
|
|
44
|
-
isDisabled: disabled,
|
|
45
|
-
hasIconAndText,
|
|
46
|
-
});
|
|
47
|
-
const styles = StyleSheet.create(buttonStyles);
|
|
48
|
-
const LoadingComponent = <Loading isLoading={isLoading} color={styles.loadingColor} size={24}/>;
|
|
49
|
-
const WrapperComponent = (<View style={styles.direction}>
|
|
50
|
-
{icon && <Icon name={icon} style={[styles.icon, iconStyle]} size={24}/>}
|
|
51
|
-
{!!value && <Typography style={[styles.text, textStyle]}>{value}</Typography>}
|
|
52
|
-
</View>);
|
|
53
|
-
return (<BaseButton style={[styles.container, style]} pressedStyle={!validDisabled && styles.pressed} borderRadius={borderRadius} disabled={validDisabled} {...props}>
|
|
54
|
-
{isLoading ? LoadingComponent : WrapperComponent}
|
|
55
|
-
</BaseButton>);
|
|
56
|
-
};
|
|
57
|
-
export default Button;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { keyColor, keyIconPosition, keyType, keyVariant } from '../';
|
|
2
|
-
export interface SelectedColor {
|
|
3
|
-
main: string;
|
|
4
|
-
dark: string;
|
|
5
|
-
}
|
|
6
|
-
export interface Params {
|
|
7
|
-
type: keyType;
|
|
8
|
-
variant: keyVariant;
|
|
9
|
-
color: keyColor;
|
|
10
|
-
iconPosition: keyIconPosition;
|
|
11
|
-
isLoading: Boolean;
|
|
12
|
-
isDisabled: Boolean;
|
|
13
|
-
hasIconAndText?: Boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ReturnStyles {
|
|
16
|
-
container: object;
|
|
17
|
-
direction: object;
|
|
18
|
-
pressed: object;
|
|
19
|
-
icon: object;
|
|
20
|
-
text: object;
|
|
21
|
-
loadingColor: any;
|
|
22
|
-
}
|
|
23
|
-
export interface ContainerStyle {
|
|
24
|
-
isDisabled: Boolean;
|
|
25
|
-
isLoading: Boolean;
|
|
26
|
-
color: keyColor;
|
|
27
|
-
variant: keyVariant;
|
|
28
|
-
type: keyType;
|
|
29
|
-
iconPosition: keyIconPosition;
|
|
30
|
-
}
|
|
31
|
-
export interface TextStyle {
|
|
32
|
-
type: keyType;
|
|
33
|
-
variant: keyVariant;
|
|
34
|
-
color: keyColor;
|
|
35
|
-
isDisabled: Boolean;
|
|
36
|
-
isLoading: Boolean;
|
|
37
|
-
hasIconAndText?: Boolean;
|
|
38
|
-
iconPosition: keyIconPosition;
|
|
39
|
-
}
|
|
40
|
-
export interface LoadingStyle {
|
|
41
|
-
color: keyColor;
|
|
42
|
-
}
|
|
43
|
-
export interface DirectionStyle {
|
|
44
|
-
iconPosition: keyIconPosition;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { moderateScale, scaledForDevice } from '../../../../../scale';
|
|
2
|
-
import { palette } from '../../../../../theme/palette';
|
|
3
|
-
import { colorConfig, styleConfig } from './utils/styleConfigs';
|
|
4
|
-
import { validTypes, validVariants, validIconPositions, verticalHeights } from './utils/constants';
|
|
5
|
-
import { defaultColor, defaultIconPosition, defaultType, defaultVariant, } from './utils/defaultValues';
|
|
6
|
-
const containerStyle = ({ isDisabled, isLoading, color, variant, type, iconPosition, }) => {
|
|
7
|
-
const selectedColor = palette[color] || palette[defaultColor];
|
|
8
|
-
const { main, disabled } = colorConfig(selectedColor);
|
|
9
|
-
const { container } = styleConfig;
|
|
10
|
-
const validType = validTypes.includes(type) ? type : defaultType;
|
|
11
|
-
const validVariant = validVariants.includes(variant) ? variant : defaultVariant;
|
|
12
|
-
const mainBgColor = main.background[validVariant];
|
|
13
|
-
const mainBorderColor = main.border[validVariant];
|
|
14
|
-
const disabledBgColor = disabled.background[validVariant];
|
|
15
|
-
const disabledBorderColor = disabled.border[validType][validVariant];
|
|
16
|
-
const containerHeight = container.height[validType];
|
|
17
|
-
// validation of height
|
|
18
|
-
const hasVerticalHeight = verticalHeights.includes(iconPosition);
|
|
19
|
-
return {
|
|
20
|
-
borderWidth: 1,
|
|
21
|
-
borderColor: isDisabled || isLoading ? disabledBorderColor : mainBorderColor,
|
|
22
|
-
backgroundColor: isDisabled || isLoading ? disabledBgColor : mainBgColor,
|
|
23
|
-
paddingHorizontal: scaledForDevice(type === 'main' ? 12 : 8, moderateScale),
|
|
24
|
-
...(hasVerticalHeight && { paddingVertical: scaledForDevice(10, moderateScale) }),
|
|
25
|
-
...(!hasVerticalHeight && {
|
|
26
|
-
height: variant !== 'text' ? containerHeight : scaledForDevice(35, moderateScale),
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
const pressedStyle = ({ variant, color }) => {
|
|
31
|
-
const selectedColor = palette[color] || palette[defaultColor];
|
|
32
|
-
const { pressed } = colorConfig(selectedColor);
|
|
33
|
-
const validVariant = validVariants.includes(variant) ? variant : defaultVariant;
|
|
34
|
-
return {
|
|
35
|
-
borderColor: pressed.border[validVariant],
|
|
36
|
-
backgroundColor: pressed.background[validVariant],
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const directionWrapperStyle = ({ iconPosition }) => {
|
|
40
|
-
const { directionWrapper } = styleConfig;
|
|
41
|
-
const flexCenter = directionWrapper.center;
|
|
42
|
-
const validIconPosition = validIconPositions.includes(iconPosition)
|
|
43
|
-
? iconPosition
|
|
44
|
-
: defaultIconPosition;
|
|
45
|
-
const flexDirection = directionWrapper.flexDirection[validIconPosition];
|
|
46
|
-
return {
|
|
47
|
-
...flexCenter,
|
|
48
|
-
flexDirection,
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
const baseTextStyle = ({ isDisabled, type, variant, color, isLoading }) => {
|
|
52
|
-
const selectedColor = palette[color] || palette[defaultColor];
|
|
53
|
-
const { main, disabled } = colorConfig(selectedColor);
|
|
54
|
-
const { text: textStyle } = styleConfig;
|
|
55
|
-
const validType = validTypes.includes(type) ? type : defaultType;
|
|
56
|
-
const validVariant = validVariants.includes(variant) ? variant : defaultVariant;
|
|
57
|
-
const mainTextColor = main.text[validType][validVariant];
|
|
58
|
-
const disabledTextColor = disabled.text[validType][validVariant];
|
|
59
|
-
return {
|
|
60
|
-
...textStyle,
|
|
61
|
-
color: isDisabled || isLoading ? disabledTextColor : mainTextColor,
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
const textStyle = (params) => ({
|
|
65
|
-
...baseTextStyle(params),
|
|
66
|
-
fontSize: scaledForDevice(14, moderateScale),
|
|
67
|
-
});
|
|
68
|
-
const iconStyle = (params) => {
|
|
69
|
-
const { hasIconAndText, iconPosition } = params;
|
|
70
|
-
const { icon } = styleConfig;
|
|
71
|
-
return {
|
|
72
|
-
...baseTextStyle(params),
|
|
73
|
-
...((!!hasIconAndText && icon.margin[iconPosition]) || {}),
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
const getButtonStyles = (params) => ({
|
|
77
|
-
container: containerStyle(params),
|
|
78
|
-
pressed: pressedStyle(params),
|
|
79
|
-
direction: directionWrapperStyle(params),
|
|
80
|
-
text: textStyle(params),
|
|
81
|
-
icon: iconStyle(params),
|
|
82
|
-
loadingColor: palette.primary.main,
|
|
83
|
-
});
|
|
84
|
-
export default getButtonStyles;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const verticalHeights = ['top', 'bottom'];
|
|
2
|
-
const validTypes = ['main', 'secondary'];
|
|
3
|
-
const validVariants = ['contained', 'outlined', 'text'];
|
|
4
|
-
const validIconPositions = ['top', 'bottom', 'left', 'right'];
|
|
5
|
-
export { verticalHeights, validTypes, validVariants, validIconPositions };
|