@janiscommerce/ui-native 1.18.0 → 1.19.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/dist/components/atoms/Modal/index.d.ts +2 -2
- package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.d.ts +8 -0
- package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.js +12 -0
- package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.d.ts +7 -0
- package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.js +12 -0
- package/dist/components/molecules/BaseDetail/components/index.d.ts +3 -0
- package/dist/components/molecules/BaseDetail/components/index.js +3 -0
- package/dist/components/molecules/BaseDetail/index.d.ts +8 -0
- package/dist/components/molecules/BaseDetail/index.js +9 -0
- package/dist/components/molecules/BaseDetail/types/index.d.ts +15 -0
- package/dist/components/molecules/BaseDetail/types/index.js +1 -0
- package/dist/components/organisms/ProductDetail/components/ProductInfo/index.d.ts +9 -0
- package/dist/components/organisms/ProductDetail/components/ProductInfo/index.js +45 -0
- package/dist/components/organisms/ProductDetail/index.d.ts +9 -0
- package/dist/components/organisms/ProductDetail/index.js +10 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ export interface UIModalProps extends NativeModalProps {
|
|
|
7
7
|
modalContainerStyle?: ViewStyle;
|
|
8
8
|
canClose?: boolean;
|
|
9
9
|
}
|
|
10
|
-
interface
|
|
10
|
+
export interface ModalMethods {
|
|
11
11
|
open?: () => void;
|
|
12
12
|
close?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const Modal: React.ForwardRefExoticComponent<UIModalProps & React.RefAttributes<
|
|
14
|
+
declare const Modal: React.ForwardRefExoticComponent<UIModalProps & React.RefAttributes<ModalMethods>>;
|
|
15
15
|
export default Modal;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ProductProps {
|
|
3
|
+
brand?: string;
|
|
4
|
+
productName?: string;
|
|
5
|
+
refId?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ProductInfo: ({ brand, productName, refId, image }: ProductProps) => React.JSX.Element;
|
|
9
|
+
export default ProductInfo;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Image from '../../../../atoms/Image';
|
|
3
|
+
import Typography from '../../../../atoms/Typography';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import { horizontalScale, moderateScale, verticalScale } from '../../../../../scale';
|
|
6
|
+
import { palette } from '../../../../../theme/palette';
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
Wrapper: {
|
|
9
|
+
flex: 1,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
paddingBottom: verticalScale(12),
|
|
12
|
+
marginHorizontal: horizontalScale(24),
|
|
13
|
+
},
|
|
14
|
+
productImage: {
|
|
15
|
+
height: moderateScale(312),
|
|
16
|
+
width: moderateScale(312),
|
|
17
|
+
marginTop: verticalScale(16),
|
|
18
|
+
},
|
|
19
|
+
productInfo: {
|
|
20
|
+
height: 'auto',
|
|
21
|
+
width: moderateScale(312),
|
|
22
|
+
marginTop: verticalScale(24),
|
|
23
|
+
},
|
|
24
|
+
productName: {
|
|
25
|
+
marginTop: verticalScale(16),
|
|
26
|
+
},
|
|
27
|
+
referenceId: {
|
|
28
|
+
marginTop: verticalScale(16),
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const ProductInfo = ({ brand, productName, refId, image }) => {
|
|
32
|
+
return (<View style={styles.Wrapper}>
|
|
33
|
+
{!!image && <Image source={{ uri: String(image) }} style={styles.productImage}/>}
|
|
34
|
+
<View style={styles.productInfo}>
|
|
35
|
+
{!!brand && (<Typography color={palette.primary.main} type="overline" size="large">
|
|
36
|
+
{String(brand)}
|
|
37
|
+
</Typography>)}
|
|
38
|
+
{!!productName && (<Typography color={palette.black.main} type="heading" size="medium" style={styles.productName}>
|
|
39
|
+
{String(productName)}
|
|
40
|
+
</Typography>)}
|
|
41
|
+
{!!refId && (<Typography color={palette.black.main} type="heading" size="small" style={styles.referenceId}>{`# ${String(refId)}`}</Typography>)}
|
|
42
|
+
</View>
|
|
43
|
+
</View>);
|
|
44
|
+
};
|
|
45
|
+
export default ProductInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseModalProps, BaseSwipeUpProps } from '../../molecules/BaseDetail/types';
|
|
3
|
+
import { ProductProps } from './components/ProductInfo';
|
|
4
|
+
import { ModalMethods } from '../../atoms/Modal';
|
|
5
|
+
import { BottomSheetMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
|
|
6
|
+
type ProductDetailProps = (ProductProps & BaseModalProps) | (ProductProps & BaseSwipeUpProps);
|
|
7
|
+
type BaseDetailMethods = ModalMethods & BottomSheetMethods;
|
|
8
|
+
declare const ProductDetail: React.ForwardRefExoticComponent<ProductDetailProps & React.RefAttributes<BaseDetailMethods>>;
|
|
9
|
+
export default ProductDetail;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import BaseDetail from '../../molecules/BaseDetail';
|
|
3
|
+
import ProductInfo from './components/ProductInfo';
|
|
4
|
+
const ProductDetail = forwardRef((props, ref) => {
|
|
5
|
+
const { brand, productName, refId, image, ...rest } = props;
|
|
6
|
+
return (<BaseDetail ref={ref} {...rest}>
|
|
7
|
+
<ProductInfo image={image} refId={refId} productName={productName} brand={brand}/>
|
|
8
|
+
</BaseDetail>);
|
|
9
|
+
});
|
|
10
|
+
export default ProductDetail;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,10 +26,12 @@ import SwipeList from './components/molecules/SwipeList';
|
|
|
26
26
|
import ItemSelectionButton from './components/molecules/ItemSelectionButton';
|
|
27
27
|
import MainCardList from './components/molecules/MainCardList';
|
|
28
28
|
import Input from './components/molecules/Input';
|
|
29
|
+
import BaseDetail from './components/molecules/BaseDetail';
|
|
29
30
|
import LoadingFullScreen from './components/organisms/LoadingFullScreen';
|
|
30
31
|
import FullScreenMessage from './components/organisms/FullScreenMessage';
|
|
31
32
|
import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionList';
|
|
32
33
|
import ErrorBoundary from './components/organisms/ErrorBoundary';
|
|
34
|
+
import ProductDetail from './components/organisms/ProductDetail';
|
|
33
35
|
import { palette } from './theme/palette';
|
|
34
36
|
import * as getScale from './scale';
|
|
35
|
-
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, Collapsible, ErrorBoundary, Modal, };
|
|
37
|
+
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, Collapsible, ErrorBoundary, Modal, BaseDetail, ProductDetail, };
|
package/dist/index.js
CHANGED
|
@@ -28,12 +28,14 @@ import SwipeList from './components/molecules/SwipeList';
|
|
|
28
28
|
import ItemSelectionButton from './components/molecules/ItemSelectionButton';
|
|
29
29
|
import MainCardList from './components/molecules/MainCardList';
|
|
30
30
|
import Input from './components/molecules/Input';
|
|
31
|
+
import BaseDetail from './components/molecules/BaseDetail';
|
|
31
32
|
// Organisms
|
|
32
33
|
import LoadingFullScreen from './components/organisms/LoadingFullScreen';
|
|
33
34
|
import FullScreenMessage from './components/organisms/FullScreenMessage';
|
|
34
35
|
import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionList';
|
|
35
36
|
import ErrorBoundary from './components/organisms/ErrorBoundary';
|
|
37
|
+
import ProductDetail from './components/organisms/ProductDetail';
|
|
36
38
|
// Misc
|
|
37
39
|
import { palette } from './theme/palette';
|
|
38
40
|
import * as getScale from './scale';
|
|
39
|
-
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, Collapsible, ErrorBoundary, Modal, };
|
|
41
|
+
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, Collapsible, ErrorBoundary, Modal, BaseDetail, ProductDetail, };
|