@ecohouse/ui 0.1.17 → 0.1.18
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/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/StatCard/StatCard.tsx +14 -3
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type ViewProps,
|
|
8
8
|
type ViewStyle,
|
|
9
9
|
} from "react-native";
|
|
10
|
-
import type { IconComponent } from "../../icons";
|
|
10
|
+
import type { IconComponent, IconProps } from "../../icons";
|
|
11
11
|
import { colors, statCardTypography } from "../../theme";
|
|
12
12
|
import { mergeRefs } from "../../utils/mergeRefs";
|
|
13
13
|
import { useApplyWebClassName } from "../../utils/useApplyWebClassName";
|
|
@@ -15,6 +15,8 @@ import { useApplyWebClassName } from "../../utils/useApplyWebClassName";
|
|
|
15
15
|
export interface StatCardProps extends Omit<ViewProps, "style" | "children"> {
|
|
16
16
|
label: string;
|
|
17
17
|
icon: IconComponent;
|
|
18
|
+
iconProps?: Omit<IconProps, "size">;
|
|
19
|
+
iconSize?: number;
|
|
18
20
|
style?: StyleProp<ViewStyle>;
|
|
19
21
|
className?: string;
|
|
20
22
|
}
|
|
@@ -22,7 +24,16 @@ export interface StatCardProps extends Omit<ViewProps, "style" | "children"> {
|
|
|
22
24
|
const ICON_SIZE = 28;
|
|
23
25
|
|
|
24
26
|
export const StatCard = forwardRef<ComponentRef<typeof View>, StatCardProps>(function StatCard(
|
|
25
|
-
{
|
|
27
|
+
{
|
|
28
|
+
label,
|
|
29
|
+
icon: Icon,
|
|
30
|
+
iconProps,
|
|
31
|
+
iconSize = ICON_SIZE,
|
|
32
|
+
style,
|
|
33
|
+
className,
|
|
34
|
+
accessibilityLabel,
|
|
35
|
+
...rest
|
|
36
|
+
},
|
|
26
37
|
forwardedRef,
|
|
27
38
|
) {
|
|
28
39
|
const containerRef = useRef<ComponentRef<typeof View>>(null);
|
|
@@ -39,7 +50,7 @@ export const StatCard = forwardRef<ComponentRef<typeof View>, StatCardProps>(fun
|
|
|
39
50
|
accessibilityRole="text"
|
|
40
51
|
accessibilityLabel={accessibilityLabel ?? label}
|
|
41
52
|
>
|
|
42
|
-
<Icon size={
|
|
53
|
+
<Icon {...iconProps} size={iconSize} color={iconProps?.color ?? colors.white} />
|
|
43
54
|
<Text style={styles.label}>{label}</Text>
|
|
44
55
|
</View>
|
|
45
56
|
);
|