@momo-kits/badge 0.77.5 → 0.77.6
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/package.json +1 -1
- package/types.ts +43 -0
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,20 +1,63 @@
|
|
|
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
|
+
*/
|
|
3
6
|
export type BadgeType = 'badge' | 'badge_number' | 'dot' | 'dot_small';
|
|
4
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Props for a general Badge component. It can display a wide range of badges including simple labels, numbers, or dots.
|
|
10
|
+
*/
|
|
5
11
|
export type BadgeProps = {
|
|
12
|
+
/**
|
|
13
|
+
* Optional. The text to display on the badge. This could be a number or string, depending on the badge's purpose.
|
|
14
|
+
*/
|
|
6
15
|
label?: string | number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Custom styles to apply to the badge component. Can be a single style or an array of styles.
|
|
19
|
+
*/
|
|
7
20
|
style?: ViewStyle | ViewStyle[];
|
|
8
21
|
};
|
|
9
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Props for a BadgeDot component. It specifically represents a dot-style badge, typically used for notification indicators.
|
|
25
|
+
*/
|
|
10
26
|
export type BadgeDotProps = {
|
|
27
|
+
/**
|
|
28
|
+
* Optional. The size of the dot, either 'small' or 'large'. This allows for better visual alignment with different UI elements.
|
|
29
|
+
*/
|
|
11
30
|
size?: 'small' | 'large';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional. Custom styles to apply to the badge dot component. Can be a single style or an array of styles.
|
|
34
|
+
*/
|
|
12
35
|
style?: ViewStyle | ViewStyle[];
|
|
13
36
|
};
|
|
14
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Props for a BadgeRibbon component. It represents a more specialized badge in the shape of a ribbon, allowing for placement around containers.
|
|
40
|
+
*/
|
|
15
41
|
export type BadgeRibbonProps = {
|
|
42
|
+
/**
|
|
43
|
+
* The text to display on the ribbon-style badge. Unlike other badges, ribbons typically carry more descriptive text.
|
|
44
|
+
*/
|
|
16
45
|
label: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Optional. Determines the placement of the ribbon on its parent container. The position can be any corner of the container.
|
|
49
|
+
* Defaults to 'top_right' if not specified.
|
|
50
|
+
*/
|
|
17
51
|
position?: 'top_right' | 'top_left' | 'bottom_right' | 'bottom_left';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Optional. If true, the edges of the ribbon badge will be rounded. This is purely a stylistic choice.
|
|
55
|
+
* Defaults to `false` if not provided, resulting in a flat-edged ribbon.
|
|
56
|
+
*/
|
|
18
57
|
isRound?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Optional. Custom styles to apply to the ribbon badge component. Can be a single style or an array of styles.
|
|
61
|
+
*/
|
|
19
62
|
style?: ViewStyle | ViewStyle[];
|
|
20
63
|
};
|