@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecohouse/ui",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Cross-platform presentation-only UI components for EcoHouse (React Native + React Native Web)",
@@ -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
- { label, icon: Icon, style, className, accessibilityLabel, ...rest },
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={ICON_SIZE} color={colors.white} />
53
+ <Icon {...iconProps} size={iconSize} color={iconProps?.color ?? colors.white} />
43
54
  <Text style={styles.label}>{label}</Text>
44
55
  </View>
45
56
  );