@janiscommerce/ui-native 1.11.0 → 1.12.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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TextInput, TextInputProps } from 'react-native';
3
- interface BaseInputProps extends TextInputProps {
3
+ export interface BaseInputProps extends TextInputProps {
4
4
  placeholder?: string;
5
5
  onChangeText?: (text: string) => void;
6
6
  style?: any;
@@ -1,20 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { StyleSheet, TextInput } from 'react-native';
2
+ import { TextInput } from 'react-native';
3
3
  import { palette } from '../../../theme/palette';
4
- import { moderateScale, scaledForDevice } from '../../../scale';
5
4
  const BaseInput = forwardRef(({ value, placeholder, onChangeText, style, textAlign, ...props }, ref) => {
6
- const styles = StyleSheet.create({
7
- input: {
8
- padding: 0,
9
- height: scaledForDevice(70, moderateScale),
10
- borderColor: palette.primary.main,
11
- borderWidth: 2,
12
- borderRadius: 8,
13
- fontSize: scaledForDevice(42, moderateScale),
14
- backgroundColor: palette.white.light,
15
- color: palette.black.main,
16
- },
17
- });
18
- return (<TextInput style={[styles.input, style]} ref={ref} value={value} placeholder={placeholder} textAlign={textAlign || 'center'} onChangeText={onChangeText} selectionColor={palette.primary.main} placeholderTextColor={palette.grey[500]} {...props}/>);
5
+ return (<TextInput style={[style]} ref={ref} value={value} placeholder={placeholder} textAlign={textAlign || 'center'} onChangeText={onChangeText} selectionColor={palette.primary.main} placeholderTextColor={palette.grey[500]} {...props}/>);
19
6
  });
20
7
  export default BaseInput;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
- import Text from '../Text';
3
+ import Typography from '../Typography';
4
4
  import CheckBox from '../CheckBox';
5
5
  import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
6
  const checkLocation = ['left', 'right'];
@@ -45,7 +45,7 @@ const RadioButton = ({ children, onPress, selected = false, checkPosition = 'lef
45
45
  return (<TouchableOpacity style={[container, checkLeft ? row : reverseRow, style]} disabled={disabled} onPress={onPress} {...props}>
46
46
  <CheckBox checked={selected} disabled={disabled} customSize={customSize} borderRadius={customSize / 2} onPress={onPress}/>
47
47
  <View style={checkLeft ? checkToLeft : checkToRight}>
48
- {isStringChild ? <Text>{children}</Text> : children}
48
+ {isStringChild ? <Typography>{children}</Typography> : children}
49
49
  </View>
50
50
  </TouchableOpacity>);
51
51
  };
@@ -1,7 +1,7 @@
1
1
  import React, { isValidElement } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import { base, grey, primary } from '../../../theme/palette';
4
- import Text from '../Text';
4
+ import Typography from '../Typography';
5
5
  import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
6
  const validHeight = scaledForDevice(24, moderateScale);
7
7
  const validPadding = scaledForDevice(12, horizontalScale);
@@ -38,7 +38,7 @@ const StatusChip = ({ children, ...props }) => {
38
38
  return null;
39
39
  }
40
40
  return (<View style={styles(props).ViewStyles} {...props}>
41
- {isCustomComponent ? children : <Text style={styles(props).TextStyles}>{children}</Text>}
41
+ {isCustomComponent ? (children) : (<Typography style={styles(props).TextStyles}>{children}</Typography>)}
42
42
  </View>);
43
43
  };
44
44
  export default StatusChip;
@@ -1,6 +1,6 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  import { StyleProp, TextProps as TextComponentProps, TextStyle } from 'react-native';
3
- interface TextProps extends TextComponentProps {
3
+ export interface TextProps extends TextComponentProps {
4
4
  children?: ReactElement | string;
5
5
  style?: StyleProp<TextStyle>;
6
6
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, Text as TextComponent, } from 'react-native';
3
3
  import { moderateScale, scaledForDevice } from '../../../scale';
4
+ import { isDevEnv } from '../../../utils/index';
4
5
  const Text = ({ children, style, ...props }) => {
5
6
  if (!children) {
6
7
  return null;
@@ -12,6 +13,10 @@ const Text = ({ children, style, ...props }) => {
12
13
  fontFamily: 'Roboto',
13
14
  },
14
15
  });
16
+ // istanbul ignore next
17
+ if (isDevEnv()) {
18
+ console.warn('This component is going to be deprecated soon.');
19
+ }
15
20
  return (<TextComponent style={[styles.TextStyles, style]} {...props}>
16
21
  {children}
17
22
  </TextComponent>);
@@ -0,0 +1,12 @@
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
+ }
11
+ declare const Typography: ({ children, style, type, size, ...props }: TypographyProps) => React.JSX.Element | null;
12
+ export default Typography;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Text } from 'react-native';
3
+ import getStyleByTypography from './utils/getStyleByTypography';
4
+ const Typography = ({ children, style, type, size, ...props }) => {
5
+ if (!children) {
6
+ return null;
7
+ }
8
+ const typographyStyles = getStyleByTypography(type, size);
9
+ return (<Text style={[style, typographyStyles.typography]} {...props}>
10
+ {children}
11
+ </Text>);
12
+ };
13
+ export default Typography;
@@ -0,0 +1,17 @@
1
+ import { TextStyle } from 'react-native';
2
+ import { Typography } from '../../../../../theme/typography';
3
+ type TypographyType = keyof Typography;
4
+ type TypographySize = 'large' | 'medium' | 'small';
5
+ export declare const defaultStyles: {
6
+ typography: TextStyle;
7
+ };
8
+ declare const getStyleByTypography: (type: TypographyType | string, size: TypographySize | string) => {
9
+ typography: TextStyle;
10
+ } | {
11
+ typography: {
12
+ fontWeight: "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
13
+ fontSize: number;
14
+ lineHeight: number;
15
+ };
16
+ };
17
+ export default getStyleByTypography;
@@ -0,0 +1,54 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import typography from '../../../../../theme/typography';
3
+ const validTypes = Object.keys(typography);
4
+ const validSizes = ['large', 'medium', 'small'];
5
+ export const defaultStyles = StyleSheet.create({
6
+ typography: {
7
+ fontWeight: typography.body.medium.weight,
8
+ fontSize: typography.body.medium.size,
9
+ lineHeight: typography.body.medium.lineHeight,
10
+ },
11
+ });
12
+ const getStyleByTypography = (type, size) => {
13
+ if (!validTypes.includes(type) ||
14
+ !validSizes.includes(size)) {
15
+ return defaultStyles;
16
+ }
17
+ const typographyType = type;
18
+ const typographySize = size;
19
+ if (typographyType === 'display') {
20
+ return StyleSheet.create({
21
+ typography: {
22
+ fontWeight: typography.display.weight,
23
+ fontSize: typography.display.size,
24
+ lineHeight: typography.display.lineHeight,
25
+ },
26
+ });
27
+ }
28
+ if (typographyType === 'overline' && typographySize === 'medium') {
29
+ return StyleSheet.create({
30
+ typography: {
31
+ fontWeight: typography.overline.large.weight,
32
+ fontSize: typography.overline.large.size,
33
+ lineHeight: typography.overline.large.lineHeight,
34
+ letterSpacing: typography.overline.large.spacing,
35
+ },
36
+ });
37
+ }
38
+ const typographyObject = typography[typographyType];
39
+ // istanbul ignore next
40
+ if (typographyObject && typographySize in typographyObject) {
41
+ const typographyStyle = typographyObject[typographySize];
42
+ return StyleSheet.create({
43
+ typography: {
44
+ fontWeight: typographyStyle.weight,
45
+ fontSize: typographyStyle.size,
46
+ lineHeight: typographyStyle.lineHeight,
47
+ letterSpacing: typographyStyle.spacing,
48
+ },
49
+ });
50
+ }
51
+ // istanbul ignore next
52
+ return defaultStyles;
53
+ };
54
+ export default getStyleByTypography;
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import Image from '../../atoms/Image';
4
- import Text from '../../atoms/Text';
4
+ import Typography from '../../atoms/Typography';
5
5
  import { formatPlaceholder } from './utils/formatPlaceholder/index';
6
6
  import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
7
7
  export const sizeValues = {
@@ -56,7 +56,9 @@ const Avatar = ({ size = 'sm', textColor = '#FFFFFF', bgColor = '#E8EAF6', image
56
56
  width: validWidth,
57
57
  }}/>)}
58
58
 
59
- {(showInitials || !imageUrl) && !!initials.length && (<Text style={[styles.text, { color: textColor, fontSize: validFontSize }]}>{initials}</Text>)}
59
+ {(showInitials || !imageUrl) && !!initials.length && (<Typography style={[styles.text, { color: textColor, fontSize: validFontSize }]}>
60
+ {initials}
61
+ </Typography>)}
60
62
  </View>);
61
63
  };
62
64
  export default Avatar;
@@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native';
3
3
  import BaseButton from '../../atoms/BaseButton';
4
4
  import getButtonStyles from './utils/getButtonStyles';
5
5
  import Loading from '../../atoms/Loading';
6
- import Text from '../../atoms/Text';
6
+ import Typography from '../../atoms/Typography';
7
7
  import Icon from '../../atoms/Icon';
8
8
  export const types = {
9
9
  main: 'main',
@@ -48,7 +48,7 @@ const Button = ({ type = 'main', variant = 'contained', color = 'primary', iconP
48
48
  const LoadingComponent = <Loading isLoading={isLoading} color={styles.loadingColor} size={24}/>;
49
49
  const WrapperComponent = (<View style={styles.direction}>
50
50
  {icon && <Icon name={icon} style={[styles.icon, iconStyle]} size={24}/>}
51
- {!!value && <Text style={[styles.text, textStyle]}>{value}</Text>}
51
+ {!!value && <Typography style={[styles.text, textStyle]}>{value}</Typography>}
52
52
  </View>);
53
53
  return (<BaseButton style={[styles.container, style]} pressedStyle={!validDisabled && styles.pressed} borderRadius={borderRadius} disabled={validDisabled} {...props}>
54
54
  {isLoading ? LoadingComponent : WrapperComponent}
@@ -4,7 +4,7 @@ import { CarouselProps } from '../';
4
4
  declare const useCarouselControls: ({ pages, isLoop, autoplay, autoPlayReverse, intervalTime, customWidth, buttonsCallback, pagesCallback, }: CarouselProps) => {
5
5
  activePage: number;
6
6
  slider: import("react").MutableRefObject<ScrollView | null>;
7
- intervalId: import("react").MutableRefObject<number | null>;
7
+ intervalId: import("react").MutableRefObject<any>;
8
8
  width: number;
9
9
  goPrev: () => void;
10
10
  goNext: () => void;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { TextInput } from 'react-native';
3
+ import { BaseInputProps } from '../../atoms/BaseInput';
4
+ interface InputProps extends BaseInputProps {
5
+ type: 'currency' | 'number' | 'text' | 'email' | 'phone';
6
+ }
7
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInput>>;
8
+ export default Input;
@@ -0,0 +1,29 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import BaseInput from '../../atoms/BaseInput';
4
+ import { palette } from '../../../theme/palette';
5
+ import { moderateScale, scaledForDevice } from '../../../scale';
6
+ var InputType;
7
+ (function (InputType) {
8
+ InputType["currency"] = "numeric";
9
+ InputType["number"] = "numeric";
10
+ InputType["text"] = "default";
11
+ InputType["email"] = "email-address";
12
+ InputType["phone"] = "phone-pad";
13
+ })(InputType || (InputType = {}));
14
+ const Input = forwardRef(({ style, type, ...props }, ref) => {
15
+ const styles = StyleSheet.create({
16
+ input: {
17
+ padding: 0,
18
+ height: scaledForDevice(70, moderateScale),
19
+ borderColor: palette.primary.main,
20
+ borderWidth: 2,
21
+ borderRadius: 8,
22
+ fontSize: scaledForDevice(42, moderateScale),
23
+ backgroundColor: palette.white.light,
24
+ color: palette.black.main,
25
+ },
26
+ });
27
+ return (<BaseInput style={[styles.input, style]} ref={ref} keyboardType={InputType[type]} {...props}/>);
28
+ });
29
+ export default Input;
@@ -4,7 +4,7 @@ import { StyleSheet, View, ScrollView, FlatList } from 'react-native';
4
4
  import { moderateScale, scaledForDevice, viewportWidth } from '../../../scale';
5
5
  import { base, black, grey, primary } from '../../../theme/palette';
6
6
  import BaseButton from '../../atoms/BaseButton';
7
- import Text from '../../atoms/Text';
7
+ import Typography from '../../atoms/Typography';
8
8
  import { isObject } from '../../../utils';
9
9
  export const positions = {
10
10
  top: 'top',
@@ -90,9 +90,9 @@ const Tabs = ({ scenes, initialTab = null, position = positions.top, onPressTabC
90
90
  return onPressTabCb(idx);
91
91
  };
92
92
  return (<BaseButton key={title + index} style={{ ...styles.tabButton, borderBottomColor }} disabled={disabled} onPress={() => handleOnPress(index)}>
93
- <Text style={{ ...styles.title, color: textColor }} selectable={false} numberOfLines={1}>
93
+ <Typography style={{ ...styles.title, color: textColor }} selectable={false} numberOfLines={1}>
94
94
  {title}
95
- </Text>
95
+ </Typography>
96
96
  </BaseButton>);
97
97
  };
98
98
  const renderItem = ({ item, index }) => (<TitleTab title={item.title} disabled={item.disabled} index={index}/>);
@@ -6,7 +6,7 @@ import { defaultIcon } from './utils';
6
6
  import { base, black } from '../../../theme/palette';
7
7
  import BaseToast from '../../atoms/BaseToast';
8
8
  import ToastAction from 'react-native-toast-message';
9
- import Text from '../../atoms/Text';
9
+ import Typography from '../../atoms/Typography';
10
10
  import Icon from '../../atoms/Icon';
11
11
  const Toast = ({ type, text1, text2, style, props }) => {
12
12
  const validType = type && typeof type === 'string';
@@ -78,13 +78,13 @@ const Toast = ({ type, text1, text2, style, props }) => {
78
78
  {showIcon && (<Icon name={selectedIconName} color={validColor} size={24} style={{ ...styles.icon, ...iconStyle }}/>)}
79
79
 
80
80
  <View style={styles.textWrapper}>
81
- {validTitle && <Text style={styles.title}>{text1}</Text>}
82
- {validMessage && <Text style={styles.message}>{text2}</Text>}
81
+ {validTitle && <Typography style={styles.title}>{text1}</Typography>}
82
+ {validMessage && <Typography style={styles.message}>{text2}</Typography>}
83
83
  </View>
84
84
 
85
85
  <View style={styles.feedbackWrapper}>
86
86
  {actionTitle && (<TouchableOpacity style={styles.actionWrapper} onPress={handleActionCb} activeOpacity={0.6}>
87
- <Text style={styles.actionTitle}>{actionTitle}</Text>
87
+ <Typography style={styles.actionTitle}>{actionTitle}</Typography>
88
88
  </TouchableOpacity>)}
89
89
  {showCloseIcon && (<TouchableOpacity style={styles.closeIconWrapper} onPress={handleCloseCb} activeOpacity={0.6}>
90
90
  <Icon name="cross_light" color={validColor} size={24}/>
@@ -3,7 +3,7 @@ import { Modal, StyleSheet, View } from 'react-native';
3
3
  import { moderateScale, scaledForDevice } from '../../../scale';
4
4
  import { base, primary } from '../../../theme/palette';
5
5
  import Icon from '../../atoms/Icon';
6
- import Text from '../../atoms/Text';
6
+ import Typography from '../../atoms/Typography';
7
7
  export var animationTypes;
8
8
  (function (animationTypes) {
9
9
  animationTypes["Slide"] = "slide";
@@ -59,8 +59,12 @@ const FullScreenMessage = ({ backgroundColor = primary.main, title = '', isVisib
59
59
  return (<Modal visible={isVisible} animationType={animationType} transparent {...props}>
60
60
  <View style={styles.container}>
61
61
  {children ?? (<>
62
- {validTitle && <Text style={styles.title}>{title}</Text>}
63
- {validSubtitle && <Text style={styles.subtitle}>{subtitle}</Text>}
62
+ {validTitle && (<Typography style={styles.title} type="heading" size="large">
63
+ {title}
64
+ </Typography>)}
65
+ {validSubtitle && (<Typography style={styles.subtitle} type="body" size="large">
66
+ {subtitle}
67
+ </Typography>)}
64
68
  {validIconName && <Icon color={iconColor} size={130} name={iconName}/>}
65
69
  </>)}
66
70
  </View>
@@ -28,7 +28,7 @@ const SwipeItemSelectionList = React.forwardRef(({ data, radioButton = false, mu
28
28
  checkIfElementIsSelected(id, isElementSelected);
29
29
  return onSelection(id);
30
30
  };
31
- return (<ItemSelectionButton radioButton={radioButton} leftSelection={leftSelection} rightSelection={rightSelection} selected={isElementSelected} onSelection={onSelectElement} name={name}/>);
31
+ return (<ItemSelectionButton key={id} radioButton={radioButton} leftSelection={leftSelection} rightSelection={rightSelection} selected={isElementSelected} onSelection={onSelectElement} name={name}/>);
32
32
  };
33
33
  return (<SwipeList ref={ref} {...props}>
34
34
  {data.map((element) => renderItem(element))}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import BaseButton from './components/atoms/BaseButton';
2
2
  import CheckBox from './components/atoms/CheckBox';
3
3
  import Icon from './components/atoms/Icon';
4
4
  import Image from './components/atoms/Image';
5
- import Input from './components/atoms/Input';
6
5
  import List from './components/atoms/List';
7
6
  import Loading from './components/atoms/Loading';
8
7
  import RadioButton from './components/atoms/RadioButton';
@@ -12,6 +11,7 @@ import SwipeUp from './components/atoms/SwipeUp';
12
11
  import { SwipeUpFlatList, SwipeUpScrollView, SwipeUpView } from './components/atoms/SwipeUp/childComponents';
13
12
  import Text from './components/atoms/Text';
14
13
  import BaseInput from './components/atoms/BaseInput';
14
+ import Typography from './components/atoms/Typography';
15
15
  import Avatar from './components/molecules/Avatar';
16
16
  import Button from './components/molecules/Button';
17
17
  import Carousel from './components/molecules/Carousel';
@@ -23,9 +23,10 @@ import { configToast } from './components/molecules/Toast/utils';
23
23
  import SwipeList from './components/molecules/SwipeList';
24
24
  import ItemSelectionButton from './components/molecules/ItemSelectionButton';
25
25
  import MainCardList from './components/molecules/MainCardList';
26
+ import Input from './components/molecules/Input';
26
27
  import LoadingFullScreen from './components/organisms/LoadingFullScreen';
27
28
  import FullScreenMessage from './components/organisms/FullScreenMessage';
28
29
  import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionList';
29
30
  import { palette } from './theme/palette';
30
31
  import * as getScale from './scale';
31
- export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, };
32
+ export { Text, Avatar, CheckBox, Icon, Image, Input, Loading, Svg, StatusChip, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, Typography, };
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ import BaseButton from './components/atoms/BaseButton';
3
3
  import CheckBox from './components/atoms/CheckBox';
4
4
  import Icon from './components/atoms/Icon';
5
5
  import Image from './components/atoms/Image';
6
- import Input from './components/atoms/Input';
7
6
  import List from './components/atoms/List';
8
7
  import Loading from './components/atoms/Loading';
9
8
  import RadioButton from './components/atoms/RadioButton';
@@ -13,6 +12,7 @@ import SwipeUp from './components/atoms/SwipeUp';
13
12
  import { SwipeUpFlatList, SwipeUpScrollView, SwipeUpView } from './components/atoms/SwipeUp/childComponents';
14
13
  import Text from './components/atoms/Text';
15
14
  import BaseInput from './components/atoms/BaseInput';
15
+ import Typography from './components/atoms/Typography';
16
16
  // Molecules
17
17
  import Avatar from './components/molecules/Avatar';
18
18
  import Button from './components/molecules/Button';
@@ -25,6 +25,7 @@ import { configToast } from './components/molecules/Toast/utils';
25
25
  import SwipeList from './components/molecules/SwipeList';
26
26
  import ItemSelectionButton from './components/molecules/ItemSelectionButton';
27
27
  import MainCardList from './components/molecules/MainCardList';
28
+ import Input from './components/molecules/Input';
28
29
  // Organisms
29
30
  import LoadingFullScreen from './components/organisms/LoadingFullScreen';
30
31
  import FullScreenMessage from './components/organisms/FullScreenMessage';
@@ -32,4 +33,4 @@ import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionLis
32
33
  // Misc
33
34
  import { palette } from './theme/palette';
34
35
  import * as getScale from './scale';
35
- export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, };
36
+ export { Text, Avatar, CheckBox, Icon, Image, Input, Loading, Svg, StatusChip, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, Typography, };
@@ -0,0 +1,35 @@
1
+ export type TypographyItem = {
2
+ weight: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
3
+ size: number;
4
+ lineHeight: number;
5
+ spacing?: number;
6
+ };
7
+ export type Typography = {
8
+ display: TypographyItem;
9
+ heading: {
10
+ large: TypographyItem;
11
+ medium: TypographyItem;
12
+ small: TypographyItem;
13
+ };
14
+ title: {
15
+ large: TypographyItem;
16
+ medium: TypographyItem;
17
+ small: TypographyItem;
18
+ };
19
+ label: {
20
+ large: TypographyItem;
21
+ medium: TypographyItem;
22
+ small: TypographyItem;
23
+ };
24
+ body: {
25
+ large: TypographyItem;
26
+ medium: TypographyItem;
27
+ small: TypographyItem;
28
+ };
29
+ overline: {
30
+ large: TypographyItem;
31
+ small: TypographyItem;
32
+ };
33
+ };
34
+ declare const typography: Typography;
35
+ export default typography;
@@ -0,0 +1,28 @@
1
+ const typography = {
2
+ display: { weight: '400', size: 42, lineHeight: 50 },
3
+ heading: {
4
+ large: { weight: '500', size: 34, lineHeight: 40 },
5
+ medium: { weight: '500', size: 26, lineHeight: 32 },
6
+ small: { weight: '400', size: 24, lineHeight: 28 },
7
+ },
8
+ title: {
9
+ large: { weight: '400', size: 20, lineHeight: 24 },
10
+ medium: { weight: '700', size: 18, lineHeight: 22 },
11
+ small: { weight: '700', size: 14, lineHeight: 16 },
12
+ },
13
+ label: {
14
+ large: { weight: '500', size: 16, lineHeight: 18 },
15
+ medium: { weight: '500', size: 14, lineHeight: 16 },
16
+ small: { weight: '500', size: 12, lineHeight: 14 },
17
+ },
18
+ body: {
19
+ large: { weight: '400', size: 16, lineHeight: 20 },
20
+ medium: { weight: '400', size: 14, lineHeight: 18 },
21
+ small: { weight: '400', size: 12, lineHeight: 16 },
22
+ },
23
+ overline: {
24
+ large: { weight: '500', size: 14, lineHeight: 16, spacing: 1 },
25
+ small: { weight: '500', size: 12, lineHeight: 14, spacing: 0.7 },
26
+ },
27
+ };
28
+ export default typography;
@@ -1 +1,2 @@
1
1
  export declare const isObject: (obj: Object) => boolean;
2
+ export declare const isDevEnv: () => boolean;
@@ -1 +1,6 @@
1
1
  export const isObject = (obj) => !!(obj && obj.constructor === Object);
2
+ export const isDevEnv = () => {
3
+ const { env } = process;
4
+ const { NODE_ENV } = env;
5
+ return NODE_ENV !== 'production';
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janiscommerce/ui-native",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "components library for Janis app",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -68,6 +68,7 @@
68
68
  "@testing-library/react-hooks": "^8.0.1",
69
69
  "@testing-library/react-native": "^7.2.0",
70
70
  "@types/jest": "^25.2.3",
71
+ "@types/node": "^22.9.0",
71
72
  "@types/react": "^17.0.2",
72
73
  "@types/react-native": "^0.63.2",
73
74
  "@types/react-native-vector-icons": "^6.4.14",