@hero-design/rn 8.93.0 → 8.94.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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +6 -0
- package/es/index.js +809 -57
- package/lib/index.js +808 -56
- package/package.json +1 -1
- package/src/components/{Empty → StatusScreens/Empty}/StyledEmpty.tsx +11 -2
- package/src/components/StatusScreens/Empty/__tests__/__snapshots__/index.spec.tsx.snap +468 -0
- package/src/components/{Empty → StatusScreens/Empty}/__tests__/index.spec.tsx +16 -2
- package/src/components/StatusScreens/Empty/index.tsx +97 -0
- package/src/components/{Error → StatusScreens/Error}/StyledError.tsx +4 -4
- package/src/components/{Error → StatusScreens/Error}/__tests__/__snapshots__/index.spec.tsx.snap +300 -0
- package/src/components/{Error → StatusScreens/Error}/__tests__/index.spec.tsx +13 -3
- package/src/components/{Error → StatusScreens/Error}/index.tsx +39 -7
- package/src/components/StatusScreens/StatusIcon/__tests__/index.spec.tsx +31 -0
- package/src/components/StatusScreens/StatusIcon/assets/Add.tsx +49 -0
- package/src/components/StatusScreens/StatusIcon/assets/Boom.tsx +61 -0
- package/src/components/StatusScreens/StatusIcon/assets/Build.tsx +45 -0
- package/src/components/StatusScreens/StatusIcon/assets/Clock.tsx +38 -0
- package/src/components/StatusScreens/StatusIcon/assets/Confetti.tsx +78 -0
- package/src/components/StatusScreens/StatusIcon/assets/Connections.tsx +57 -0
- package/src/components/StatusScreens/StatusIcon/assets/Error.tsx +55 -0
- package/src/components/StatusScreens/StatusIcon/assets/Info.tsx +35 -0
- package/src/components/StatusScreens/StatusIcon/assets/List.tsx +37 -0
- package/src/components/StatusScreens/StatusIcon/assets/Location.tsx +37 -0
- package/src/components/StatusScreens/StatusIcon/assets/Merge.tsx +59 -0
- package/src/components/StatusScreens/StatusIcon/assets/Notifications.tsx +26 -0
- package/src/components/StatusScreens/StatusIcon/assets/Search.tsx +36 -0
- package/src/components/StatusScreens/StatusIcon/assets/Star.tsx +37 -0
- package/src/components/StatusScreens/StatusIcon/assets/Success.tsx +41 -0
- package/src/components/StatusScreens/StatusIcon/assets/User.tsx +43 -0
- package/src/components/StatusScreens/StatusIcon/index.tsx +63 -0
- package/src/components/StatusScreens/StatusIcon/types.ts +5 -0
- package/src/components/{Success → StatusScreens/Success}/StyledSuccess.tsx +4 -4
- package/src/components/{Success → StatusScreens/Success}/__tests__/__snapshots__/index.spec.tsx.snap +263 -0
- package/src/components/{Success → StatusScreens/Success}/__tests__/index.spec.tsx +13 -4
- package/src/components/{Success → StatusScreens/Success}/index.tsx +38 -7
- package/src/index.ts +3 -3
- package/stats/8.94.0/rn-stats.html +4842 -0
- package/types/components/{Empty → StatusScreens/Empty}/StyledEmpty.d.ts +9 -3
- package/types/components/{Empty → StatusScreens/Empty}/index.d.ts +8 -3
- package/types/components/{Error → StatusScreens/Error}/StyledError.d.ts +6 -6
- package/types/components/{Error → StatusScreens/Error}/index.d.ts +6 -1
- package/types/components/StatusScreens/StatusIcon/assets/Add.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Boom.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Build.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Clock.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Confetti.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Connections.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Error.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Info.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/List.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Location.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Merge.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Notifications.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Search.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Star.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/Success.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/assets/User.d.ts +4 -0
- package/types/components/StatusScreens/StatusIcon/index.d.ts +26 -0
- package/types/components/StatusScreens/StatusIcon/types.d.ts +5 -0
- package/types/components/{Success → StatusScreens/Success}/StyledSuccess.d.ts +5 -5
- package/types/components/{Success → StatusScreens/Success}/index.d.ts +6 -1
- package/types/index.d.ts +3 -3
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +0 -218
- package/src/components/Empty/index.tsx +0 -73
|
@@ -6,16 +6,22 @@ declare const StyledWrapper: import("@emotion/native").StyledComponent<import("r
|
|
|
6
6
|
}, {}, {
|
|
7
7
|
ref?: import("react").Ref<View> | undefined;
|
|
8
8
|
}>;
|
|
9
|
-
declare const StyledTitle: import("@emotion/native").StyledComponent<import("
|
|
9
|
+
declare const StyledTitle: import("@emotion/native").StyledComponent<import("../../Typography/Title").TitleProps & {
|
|
10
10
|
theme?: import("@emotion/react").Theme;
|
|
11
11
|
as?: React.ElementType;
|
|
12
12
|
} & {
|
|
13
13
|
themeVariant: ThemeVariant;
|
|
14
14
|
}, {}, {}>;
|
|
15
|
-
declare const StyledDescription: import("@emotion/native").StyledComponent<import("
|
|
15
|
+
declare const StyledDescription: import("@emotion/native").StyledComponent<import("../../Typography/Body").BodyProps & {
|
|
16
16
|
theme?: import("@emotion/react").Theme;
|
|
17
17
|
as?: React.ElementType;
|
|
18
18
|
} & {
|
|
19
19
|
themeVariant: ThemeVariant;
|
|
20
20
|
}, {}, {}>;
|
|
21
|
-
|
|
21
|
+
declare const StyledEmptyImageContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
22
|
+
theme?: import("@emotion/react").Theme;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}, {}, {
|
|
25
|
+
ref?: import("react").Ref<View> | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export { StyledWrapper, StyledTitle, StyledDescription, StyledEmptyImageContainer, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import { ImageProps } from '
|
|
2
|
+
import type { ImageProps as RNImageProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { ImageProps } from '../../Image';
|
|
4
|
+
import { StatusIconName } from '../StatusIcon';
|
|
4
5
|
interface EmptyProps {
|
|
5
6
|
/**
|
|
6
7
|
* Image to be displayed.
|
|
@@ -26,6 +27,10 @@ interface EmptyProps {
|
|
|
26
27
|
* Testing id of the component.
|
|
27
28
|
*/
|
|
28
29
|
testID?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Status icon to be displayed, this will replace the image prop.
|
|
32
|
+
*/
|
|
33
|
+
icon?: StatusIconName;
|
|
29
34
|
}
|
|
30
|
-
declare const Empty: ({ image, title, description, style, testID, variant, }: EmptyProps) =>
|
|
35
|
+
declare const Empty: ({ image, title, description, style, testID, variant, icon, }: EmptyProps) => ReactElement;
|
|
31
36
|
export default Empty;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
type ErrorVariant = 'full-screen' | 'in-page';
|
|
3
|
-
declare const StyledErrorModal: import("@emotion/native").StyledComponent<import("
|
|
3
|
+
declare const StyledErrorModal: import("@emotion/native").StyledComponent<import("../../Modal").ModalProps & {
|
|
4
4
|
theme?: import("@emotion/react").Theme;
|
|
5
5
|
as?: React.ElementType;
|
|
6
6
|
}, {}, {}>;
|
|
@@ -24,11 +24,11 @@ declare const StyledErrorButtonContainer: import("@emotion/native").StyledCompon
|
|
|
24
24
|
}, {}, {
|
|
25
25
|
ref?: import("react").Ref<View> | undefined;
|
|
26
26
|
}>;
|
|
27
|
-
declare const StyledErrorButtonPrimary: import("@emotion/native").StyledComponent<import("
|
|
27
|
+
declare const StyledErrorButtonPrimary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
28
28
|
theme?: import("@emotion/react").Theme;
|
|
29
29
|
as?: React.ElementType;
|
|
30
30
|
}, {}, {}>;
|
|
31
|
-
declare const StyledErrorButtonSecondary: import("@emotion/native").StyledComponent<import("
|
|
31
|
+
declare const StyledErrorButtonSecondary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
32
32
|
theme?: import("@emotion/react").Theme;
|
|
33
33
|
as?: React.ElementType;
|
|
34
34
|
}, {}, {}>;
|
|
@@ -38,15 +38,15 @@ declare const StyledErrorImageContainer: import("@emotion/native").StyledCompone
|
|
|
38
38
|
}, {}, {
|
|
39
39
|
ref?: import("react").Ref<View> | undefined;
|
|
40
40
|
}>;
|
|
41
|
-
declare const StyledErrorImage: import("@emotion/native").StyledComponent<import("
|
|
41
|
+
declare const StyledErrorImage: import("@emotion/native").StyledComponent<import("../../Image").ImageProps & {
|
|
42
42
|
theme?: import("@emotion/react").Theme;
|
|
43
43
|
as?: React.ElementType;
|
|
44
44
|
}, {}, {}>;
|
|
45
|
-
declare const StyledErrorTitle: import("@emotion/native").StyledComponent<import("
|
|
45
|
+
declare const StyledErrorTitle: import("@emotion/native").StyledComponent<import("../../Typography/Title").TitleProps & {
|
|
46
46
|
theme?: import("@emotion/react").Theme;
|
|
47
47
|
as?: React.ElementType;
|
|
48
48
|
}, {}, {}>;
|
|
49
|
-
declare const StyledErrorDescription: import("@emotion/native").StyledComponent<import("
|
|
49
|
+
declare const StyledErrorDescription: import("@emotion/native").StyledComponent<import("../../Typography/Body").BodyProps & {
|
|
50
50
|
theme?: import("@emotion/react").Theme;
|
|
51
51
|
as?: React.ElementType;
|
|
52
52
|
}, {}, {}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import type { ImageSourcePropType, ViewProps, ImageProps as RNImageProps } from 'react-native';
|
|
3
3
|
import { ErrorVariant } from './StyledError';
|
|
4
|
-
import { ImageProps } from '
|
|
4
|
+
import { ImageProps } from '../../Image/index';
|
|
5
|
+
import type { StatusIconName } from '../StatusIcon';
|
|
5
6
|
interface ErrorProps extends ViewProps {
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated use conditional rendering instead
|
|
@@ -45,6 +46,10 @@ interface ErrorProps extends ViewProps {
|
|
|
45
46
|
* Callback when the secondary button is pressed.
|
|
46
47
|
*/
|
|
47
48
|
onSecondaryCtaPress?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Status icon to be displayed, this will replace the image prop.
|
|
51
|
+
*/
|
|
52
|
+
icon?: StatusIconName;
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
50
55
|
* Renders error page
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const StatusIcons: {
|
|
3
|
+
readonly add: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
4
|
+
readonly boom: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
5
|
+
readonly build: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
6
|
+
readonly clock: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
7
|
+
readonly connections: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
8
|
+
readonly list: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
9
|
+
readonly location: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
10
|
+
readonly merge: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
11
|
+
readonly notifications: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
12
|
+
readonly search: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
13
|
+
readonly star: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
14
|
+
readonly user: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
15
|
+
readonly confetti: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
16
|
+
readonly error: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
17
|
+
readonly info: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
18
|
+
readonly success: ({ stroke, fill, testID }: import("./types").StatusSvgProps) => React.JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export type StatusIconName = keyof typeof StatusIcons;
|
|
21
|
+
interface StatusIconProps {
|
|
22
|
+
icon: StatusIconName;
|
|
23
|
+
testID?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const StatusIcon: ({ icon, testID }: StatusIconProps) => React.JSX.Element;
|
|
26
|
+
export default StatusIcon;
|
|
@@ -8,7 +8,7 @@ declare const StyledSuccessContainer: import("@emotion/native").StyledComponent<
|
|
|
8
8
|
}, {}, {
|
|
9
9
|
ref?: import("react").Ref<View> | undefined;
|
|
10
10
|
}>;
|
|
11
|
-
declare const StyledSuccessImage: import("@emotion/native").StyledComponent<import("
|
|
11
|
+
declare const StyledSuccessImage: import("@emotion/native").StyledComponent<import("../../Image").ImageProps & {
|
|
12
12
|
theme?: import("@emotion/react").Theme;
|
|
13
13
|
as?: React.ElementType;
|
|
14
14
|
}, {}, {}>;
|
|
@@ -24,11 +24,11 @@ declare const StyledSuccessImageContainer: import("@emotion/native").StyledCompo
|
|
|
24
24
|
}, {}, {
|
|
25
25
|
ref?: import("react").Ref<View> | undefined;
|
|
26
26
|
}>;
|
|
27
|
-
declare const StyledSuccessTitle: import("@emotion/native").StyledComponent<import("
|
|
27
|
+
declare const StyledSuccessTitle: import("@emotion/native").StyledComponent<import("../../Typography/Title").TitleProps & {
|
|
28
28
|
theme?: import("@emotion/react").Theme;
|
|
29
29
|
as?: React.ElementType;
|
|
30
30
|
}, {}, {}>;
|
|
31
|
-
declare const StyledSuccessDescription: import("@emotion/native").StyledComponent<import("
|
|
31
|
+
declare const StyledSuccessDescription: import("@emotion/native").StyledComponent<import("../../Typography/Body").BodyProps & {
|
|
32
32
|
theme?: import("@emotion/react").Theme;
|
|
33
33
|
as?: React.ElementType;
|
|
34
34
|
}, {}, {}>;
|
|
@@ -38,11 +38,11 @@ declare const StyledSuccessButtonContainer: import("@emotion/native").StyledComp
|
|
|
38
38
|
}, {}, {
|
|
39
39
|
ref?: import("react").Ref<View> | undefined;
|
|
40
40
|
}>;
|
|
41
|
-
declare const StyledSuccessButtonPrimary: import("@emotion/native").StyledComponent<import("
|
|
41
|
+
declare const StyledSuccessButtonPrimary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
42
42
|
theme?: import("@emotion/react").Theme;
|
|
43
43
|
as?: React.ElementType;
|
|
44
44
|
}, {}, {}>;
|
|
45
|
-
declare const StyledSuccessModal: import("@emotion/native").StyledComponent<import("
|
|
45
|
+
declare const StyledSuccessModal: import("@emotion/native").StyledComponent<import("../../Modal").ModalProps & {
|
|
46
46
|
theme?: import("@emotion/react").Theme;
|
|
47
47
|
as?: React.ElementType;
|
|
48
48
|
}, {}, {}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import type { ViewProps, ImageSourcePropType, ImageProps as RNImageProps } from 'react-native';
|
|
3
3
|
import { SuccessVariant } from './StyledSuccess';
|
|
4
|
-
import { ImageProps } from '
|
|
4
|
+
import { ImageProps } from '../../Image';
|
|
5
|
+
import { StatusIconName } from '../StatusIcon';
|
|
5
6
|
export interface SuccessProps extends ViewProps {
|
|
6
7
|
/**
|
|
7
8
|
* Image to be displayed.
|
|
@@ -39,6 +40,10 @@ export interface SuccessProps extends ViewProps {
|
|
|
39
40
|
* Testing id of the component.
|
|
40
41
|
*/
|
|
41
42
|
testID?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Status icon to be displayed, this will replace the image prop.
|
|
45
|
+
*/
|
|
46
|
+
icon?: StatusIconName;
|
|
42
47
|
}
|
|
43
48
|
/**
|
|
44
49
|
* Renders success page
|
package/types/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ import ContentNavigator from './components/ContentNavigator';
|
|
|
20
20
|
import DatePicker from './components/DatePicker';
|
|
21
21
|
import Divider from './components/Divider';
|
|
22
22
|
import Drawer from './components/Drawer';
|
|
23
|
-
import Empty from './components/Empty';
|
|
24
|
-
import Error from './components/Error';
|
|
23
|
+
import Empty from './components/StatusScreens/Empty';
|
|
24
|
+
import Error from './components/StatusScreens/Error';
|
|
25
25
|
import FAB from './components/FAB';
|
|
26
26
|
import HeroDesignProvider from './components/HeroDesignProvider';
|
|
27
27
|
import MapPin from './components/MapPin';
|
|
@@ -37,7 +37,7 @@ import Radio from './components/Radio';
|
|
|
37
37
|
import SectionHeading from './components/SectionHeading';
|
|
38
38
|
import Select from './components/Select';
|
|
39
39
|
import Skeleton from './components/Skeleton';
|
|
40
|
-
import Success from './components/Success';
|
|
40
|
+
import Success from './components/StatusScreens/Success';
|
|
41
41
|
import Switch from './components/Switch';
|
|
42
42
|
import Tabs from './components/Tabs';
|
|
43
43
|
import Tag from './components/Tag';
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Empty renders empty state content correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
{
|
|
7
|
-
"flex": 1,
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
>
|
|
11
|
-
<View
|
|
12
|
-
style={
|
|
13
|
-
[
|
|
14
|
-
{
|
|
15
|
-
"alignItems": "center",
|
|
16
|
-
"display": "flex",
|
|
17
|
-
"flex": 1,
|
|
18
|
-
"flexDirection": "column",
|
|
19
|
-
"justifyContent": "center",
|
|
20
|
-
"padding": 16,
|
|
21
|
-
},
|
|
22
|
-
undefined,
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
>
|
|
26
|
-
<Text
|
|
27
|
-
allowFontScaling={false}
|
|
28
|
-
style={
|
|
29
|
-
[
|
|
30
|
-
{
|
|
31
|
-
"color": "#001f23",
|
|
32
|
-
"fontFamily": "Saiga-Medium",
|
|
33
|
-
"fontSize": 24,
|
|
34
|
-
"letterSpacing": 0.24,
|
|
35
|
-
"lineHeight": 32,
|
|
36
|
-
},
|
|
37
|
-
[
|
|
38
|
-
{
|
|
39
|
-
"color": "#001f23",
|
|
40
|
-
"marginBottom": 8,
|
|
41
|
-
"textAlign": "center",
|
|
42
|
-
},
|
|
43
|
-
undefined,
|
|
44
|
-
],
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
themeIntent="body"
|
|
48
|
-
themeLevel="h4"
|
|
49
|
-
themeTypeface="playful"
|
|
50
|
-
themeVariant="light"
|
|
51
|
-
>
|
|
52
|
-
You have no notification at this time
|
|
53
|
-
</Text>
|
|
54
|
-
<Text
|
|
55
|
-
allowFontScaling={false}
|
|
56
|
-
style={
|
|
57
|
-
[
|
|
58
|
-
{
|
|
59
|
-
"color": "#001f23",
|
|
60
|
-
"fontFamily": "BeVietnamPro-Regular",
|
|
61
|
-
"fontSize": 14,
|
|
62
|
-
"letterSpacing": 0.48,
|
|
63
|
-
"lineHeight": 22,
|
|
64
|
-
},
|
|
65
|
-
[
|
|
66
|
-
{
|
|
67
|
-
"color": "#4d6265",
|
|
68
|
-
"textAlign": "center",
|
|
69
|
-
},
|
|
70
|
-
undefined,
|
|
71
|
-
],
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
themeIntent="body"
|
|
75
|
-
themeTypeface="neutral"
|
|
76
|
-
themeVariant="small"
|
|
77
|
-
>
|
|
78
|
-
We'll notify you later.
|
|
79
|
-
</Text>
|
|
80
|
-
</View>
|
|
81
|
-
<View
|
|
82
|
-
pointerEvents="box-none"
|
|
83
|
-
position="bottom"
|
|
84
|
-
style={
|
|
85
|
-
[
|
|
86
|
-
{
|
|
87
|
-
"bottom": 0,
|
|
88
|
-
"elevation": 9999,
|
|
89
|
-
"flexDirection": "column-reverse",
|
|
90
|
-
"left": 0,
|
|
91
|
-
"paddingHorizontal": 24,
|
|
92
|
-
"paddingVertical": 16,
|
|
93
|
-
"position": "absolute",
|
|
94
|
-
"right": 0,
|
|
95
|
-
"top": 0,
|
|
96
|
-
},
|
|
97
|
-
undefined,
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
/>
|
|
101
|
-
</View>
|
|
102
|
-
`;
|
|
103
|
-
|
|
104
|
-
exports[`Empty renders empty state with image correctly 1`] = `
|
|
105
|
-
<View
|
|
106
|
-
style={
|
|
107
|
-
{
|
|
108
|
-
"flex": 1,
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
>
|
|
112
|
-
<View
|
|
113
|
-
style={
|
|
114
|
-
[
|
|
115
|
-
{
|
|
116
|
-
"alignItems": "center",
|
|
117
|
-
"display": "flex",
|
|
118
|
-
"flex": 1,
|
|
119
|
-
"flexDirection": "column",
|
|
120
|
-
"justifyContent": "center",
|
|
121
|
-
"padding": 16,
|
|
122
|
-
},
|
|
123
|
-
undefined,
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
>
|
|
127
|
-
<Image
|
|
128
|
-
source={
|
|
129
|
-
{
|
|
130
|
-
"uri": "path_to_image",
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
style={
|
|
134
|
-
[
|
|
135
|
-
{
|
|
136
|
-
"marginBottom": 24,
|
|
137
|
-
},
|
|
138
|
-
undefined,
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
/>
|
|
142
|
-
<Text
|
|
143
|
-
allowFontScaling={false}
|
|
144
|
-
style={
|
|
145
|
-
[
|
|
146
|
-
{
|
|
147
|
-
"color": "#001f23",
|
|
148
|
-
"fontFamily": "Saiga-Medium",
|
|
149
|
-
"fontSize": 24,
|
|
150
|
-
"letterSpacing": 0.24,
|
|
151
|
-
"lineHeight": 32,
|
|
152
|
-
},
|
|
153
|
-
[
|
|
154
|
-
{
|
|
155
|
-
"color": "#001f23",
|
|
156
|
-
"marginBottom": 8,
|
|
157
|
-
"textAlign": "center",
|
|
158
|
-
},
|
|
159
|
-
undefined,
|
|
160
|
-
],
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
themeIntent="body"
|
|
164
|
-
themeLevel="h4"
|
|
165
|
-
themeTypeface="playful"
|
|
166
|
-
themeVariant="light"
|
|
167
|
-
>
|
|
168
|
-
You have no notification at this time
|
|
169
|
-
</Text>
|
|
170
|
-
<Text
|
|
171
|
-
allowFontScaling={false}
|
|
172
|
-
style={
|
|
173
|
-
[
|
|
174
|
-
{
|
|
175
|
-
"color": "#001f23",
|
|
176
|
-
"fontFamily": "BeVietnamPro-Regular",
|
|
177
|
-
"fontSize": 14,
|
|
178
|
-
"letterSpacing": 0.48,
|
|
179
|
-
"lineHeight": 22,
|
|
180
|
-
},
|
|
181
|
-
[
|
|
182
|
-
{
|
|
183
|
-
"color": "#4d6265",
|
|
184
|
-
"textAlign": "center",
|
|
185
|
-
},
|
|
186
|
-
undefined,
|
|
187
|
-
],
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
themeIntent="body"
|
|
191
|
-
themeTypeface="neutral"
|
|
192
|
-
themeVariant="small"
|
|
193
|
-
>
|
|
194
|
-
We'll notify you later.
|
|
195
|
-
</Text>
|
|
196
|
-
</View>
|
|
197
|
-
<View
|
|
198
|
-
pointerEvents="box-none"
|
|
199
|
-
position="bottom"
|
|
200
|
-
style={
|
|
201
|
-
[
|
|
202
|
-
{
|
|
203
|
-
"bottom": 0,
|
|
204
|
-
"elevation": 9999,
|
|
205
|
-
"flexDirection": "column-reverse",
|
|
206
|
-
"left": 0,
|
|
207
|
-
"paddingHorizontal": 24,
|
|
208
|
-
"paddingVertical": 16,
|
|
209
|
-
"position": "absolute",
|
|
210
|
-
"right": 0,
|
|
211
|
-
"top": 0,
|
|
212
|
-
},
|
|
213
|
-
undefined,
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
/>
|
|
217
|
-
</View>
|
|
218
|
-
`;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
3
|
-
import type {
|
|
4
|
-
StyleProp,
|
|
5
|
-
ViewStyle,
|
|
6
|
-
ImageProps as RNImageProps,
|
|
7
|
-
} from 'react-native';
|
|
8
|
-
|
|
9
|
-
import { useTheme } from '../../theme';
|
|
10
|
-
import { ImageProps } from '../Image';
|
|
11
|
-
import { StyledWrapper, StyledTitle, StyledDescription } from './StyledEmpty';
|
|
12
|
-
|
|
13
|
-
interface EmptyProps {
|
|
14
|
-
/**
|
|
15
|
-
* Image to be displayed.
|
|
16
|
-
*/
|
|
17
|
-
image?: ReactElement<ImageProps | RNImageProps>;
|
|
18
|
-
/**
|
|
19
|
-
* Empty's title.
|
|
20
|
-
*/
|
|
21
|
-
title: string;
|
|
22
|
-
/**
|
|
23
|
-
* Empty's description.
|
|
24
|
-
*/
|
|
25
|
-
description?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Empty's variant.
|
|
28
|
-
*/
|
|
29
|
-
variant?: 'light' | 'dark';
|
|
30
|
-
/**
|
|
31
|
-
* Additional style.
|
|
32
|
-
*/
|
|
33
|
-
style?: StyleProp<ViewStyle>;
|
|
34
|
-
/**
|
|
35
|
-
* Testing id of the component.
|
|
36
|
-
*/
|
|
37
|
-
testID?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const Empty = ({
|
|
41
|
-
image,
|
|
42
|
-
title,
|
|
43
|
-
description,
|
|
44
|
-
style,
|
|
45
|
-
testID,
|
|
46
|
-
variant = 'light',
|
|
47
|
-
}: EmptyProps): JSX.Element => {
|
|
48
|
-
const theme = useTheme();
|
|
49
|
-
return (
|
|
50
|
-
<StyledWrapper style={style} testID={testID}>
|
|
51
|
-
{image !== undefined &&
|
|
52
|
-
React.cloneElement(image, {
|
|
53
|
-
...image.props,
|
|
54
|
-
style: [
|
|
55
|
-
{
|
|
56
|
-
marginBottom: theme.__hd__.empty.space.imageMargin,
|
|
57
|
-
},
|
|
58
|
-
image.props.style,
|
|
59
|
-
],
|
|
60
|
-
})}
|
|
61
|
-
<StyledTitle themeVariant={variant} level="h4" typeface="playful">
|
|
62
|
-
{title}
|
|
63
|
-
</StyledTitle>
|
|
64
|
-
{!!description && (
|
|
65
|
-
<StyledDescription variant="small" themeVariant={variant}>
|
|
66
|
-
{description}
|
|
67
|
-
</StyledDescription>
|
|
68
|
-
)}
|
|
69
|
-
</StyledWrapper>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export default Empty;
|