@momo-kits/badge 0.81.23 → 0.92.1-beta.16
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/Badge.tsx +2 -2
- package/BadgeRibbon.tsx +3 -9
- package/Shape.tsx +1 -1
- package/package.json +17 -15
- package/publish.sh +2 -1
- package/styles.ts +2 -1
- package/types.ts +3 -5
package/Badge.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const Badge: FC<BadgeProps> = ({label = 'Label', style, backgroundColor}) => {
|
|
|
13
13
|
if (backgroundColor) {
|
|
14
14
|
const colorIndex = colorValue.indexOf(backgroundColor);
|
|
15
15
|
if (colorIndex !== -1) {
|
|
16
|
-
if (colorKeys[colorIndex]
|
|
16
|
+
if (colorKeys[colorIndex]?.includes('_03')) {
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -43,7 +43,7 @@ const Badge: FC<BadgeProps> = ({label = 'Label', style, backgroundColor}) => {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<View style={[style, styles.badge, {backgroundColor: badgeColor}]}>
|
|
46
|
-
<Text color={Colors.black_01} typography={'
|
|
46
|
+
<Text color={Colors.black_01} typography={'action_xxs_bold'}>
|
|
47
47
|
{formatTitle()}
|
|
48
48
|
</Text>
|
|
49
49
|
</View>
|
package/BadgeRibbon.tsx
CHANGED
|
@@ -3,13 +3,7 @@ import {View} from 'react-native';
|
|
|
3
3
|
import {DownTail, UpTail} from './Shape';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import {BadgeRibbonProps} from './types';
|
|
6
|
-
import {
|
|
7
|
-
ApplicationContext,
|
|
8
|
-
Colors,
|
|
9
|
-
Image,
|
|
10
|
-
Spacing,
|
|
11
|
-
Text,
|
|
12
|
-
} from '@momo-kits/foundation';
|
|
6
|
+
import {Text, Colors, Image, ApplicationContext} from '@momo-kits/foundation';
|
|
13
7
|
|
|
14
8
|
const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
15
9
|
position = 'top_right',
|
|
@@ -57,7 +51,7 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
57
51
|
},
|
|
58
52
|
]}
|
|
59
53
|
color={Colors.black_01}
|
|
60
|
-
typography={'
|
|
54
|
+
typography={'label_xs_medium'}>
|
|
61
55
|
{label}
|
|
62
56
|
</Text>
|
|
63
57
|
</View>
|
|
@@ -90,7 +84,7 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
90
84
|
},
|
|
91
85
|
]}
|
|
92
86
|
color={Colors.black_01}
|
|
93
|
-
typography={'
|
|
87
|
+
typography={'label_xs_medium'}>
|
|
94
88
|
{label}
|
|
95
89
|
</Text>
|
|
96
90
|
</View>
|
package/Shape.tsx
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
"name": "@momo-kits/badge",
|
|
3
|
+
"version": "0.92.1-beta.16",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@momo-kits/foundation": "latest",
|
|
8
|
+
"react": "16.9.0",
|
|
9
|
+
"react-native": ">=0.55",
|
|
10
|
+
"prop-types": "^15.7.2"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@momo-platform/versions": "4.1.11"
|
|
14
|
+
},
|
|
15
|
+
"license": "MoMo",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"moment": "^2.24.0"
|
|
18
|
+
}
|
|
17
19
|
}
|
package/publish.sh
CHANGED
|
@@ -25,4 +25,5 @@ npm publish --tag beta --access=public
|
|
|
25
25
|
cd ..
|
|
26
26
|
rm -rf dist
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
##curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/calendar new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/calendar"}'
|
package/styles.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {StyleSheet} from 'react-native';
|
|
2
|
-
import {Colors, Radius,
|
|
2
|
+
import {Colors, Radius, Spacing, scaleSize} from '@momo-kits/foundation';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
badge: {
|
|
@@ -8,6 +8,7 @@ export default StyleSheet.create({
|
|
|
8
8
|
justifyContent: 'center',
|
|
9
9
|
alignItems: 'center',
|
|
10
10
|
height: scaleSize(16),
|
|
11
|
+
minWidth: scaleSize(16),
|
|
11
12
|
flexDirection: 'row',
|
|
12
13
|
borderWidth: 1,
|
|
13
14
|
borderColor: Colors.black_01,
|
package/types.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import {ViewStyle} from 'react-native';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Defines the types of badges that can be used. This helps in rendering the appropriate badge style.
|
|
5
|
-
*/
|
|
6
|
-
export type BadgeType = 'badge' | 'badge_number' | 'dot' | 'dot_small';
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* Props for a general Badge component. It can display a wide range of badges including simple labels, numbers, or dots.
|
|
10
5
|
*/
|
|
@@ -19,6 +14,9 @@ export type BadgeProps = {
|
|
|
19
14
|
*/
|
|
20
15
|
style?: ViewStyle | ViewStyle[];
|
|
21
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Custom background badge.
|
|
19
|
+
*/
|
|
22
20
|
backgroundColor?: string;
|
|
23
21
|
};
|
|
24
22
|
|