@hero-design/rn 8.92.3 → 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 +16 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +961 -140
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +960 -139
- package/package.json +1 -1
- package/src/components/Badge/Count.tsx +60 -0
- package/src/components/Badge/StyledBadge.tsx +33 -2
- package/src/components/Badge/__tests__/Count.spec.tsx +38 -0
- package/src/components/Badge/__tests__/__snapshots__/Count.spec.tsx.snap +310 -0
- package/src/components/Badge/constants.ts +1 -0
- package/src/components/Badge/index.tsx +3 -2
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- 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/src/theme/__tests__/__snapshots__/index.spec.ts.snap +11 -0
- package/src/theme/components/badge.ts +26 -1
- package/stats/8.94.0/rn-stats.html +4842 -0
- package/types/components/Badge/Count.d.ts +27 -0
- package/types/components/Badge/StyledBadge.d.ts +14 -4
- package/types/components/Badge/constants.d.ts +1 -0
- package/types/components/Badge/index.d.ts +1 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- 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/components/TextInput/index.d.ts +1 -1
- package/types/index.d.ts +3 -3
- package/types/theme/components/badge.d.ts +11 -0
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +0 -218
- package/src/components/Empty/index.tsx +0 -73
|
@@ -9,6 +9,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
9
9
|
archived: string;
|
|
10
10
|
text: string;
|
|
11
11
|
border: string;
|
|
12
|
+
countText: string;
|
|
12
13
|
};
|
|
13
14
|
fonts: {
|
|
14
15
|
medium: string;
|
|
@@ -21,6 +22,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
21
22
|
medium: number;
|
|
22
23
|
small: number;
|
|
23
24
|
};
|
|
25
|
+
count: number;
|
|
24
26
|
};
|
|
25
27
|
sizes: {
|
|
26
28
|
medium: {
|
|
@@ -33,6 +35,10 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
33
35
|
};
|
|
34
36
|
statusHeight: number;
|
|
35
37
|
statusWidth: number;
|
|
38
|
+
count: {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
};
|
|
36
42
|
};
|
|
37
43
|
space: {
|
|
38
44
|
medium: {
|
|
@@ -43,14 +49,19 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
43
49
|
};
|
|
44
50
|
statusPositionTop: number;
|
|
45
51
|
statusPositionRight: number;
|
|
52
|
+
countPaddingHorizontal: number;
|
|
46
53
|
};
|
|
47
54
|
lineHeights: {
|
|
48
55
|
medium: number;
|
|
49
56
|
small: number;
|
|
57
|
+
count: number;
|
|
50
58
|
};
|
|
51
59
|
borderWidths: {
|
|
52
60
|
default: number;
|
|
53
61
|
};
|
|
62
|
+
radii: {
|
|
63
|
+
count: number;
|
|
64
|
+
};
|
|
54
65
|
};
|
|
55
66
|
export type BadgeThemeType = ReturnType<typeof getBadgeTheme>;
|
|
56
67
|
export default getBadgeTheme;
|
|
@@ -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;
|