react-native-ui-lib 7.39.0-snapshot.6721 → 7.39.0-snapshot.6726

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": "react-native-ui-lib",
3
- "version": "7.39.0-snapshot.6721",
3
+ "version": "7.39.0-snapshot.6726",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -25,7 +25,10 @@ export type IconProps = Omit<RNImageProps, 'source' | 'tintColor'> & MarginModif
25
25
  /**
26
26
  * the icon size
27
27
  */
28
- size?: number;
28
+ size?: number | {
29
+ width: number;
30
+ height: number;
31
+ };
29
32
  /**
30
33
  * whether the icon should flip horizontally on RTL
31
34
  */
@@ -52,7 +55,10 @@ declare const _default: React.ForwardRefExoticComponent<Omit<RNImageProps, "sour
52
55
  /**
53
56
  * the icon size
54
57
  */
55
- size?: number | undefined;
58
+ size?: number | {
59
+ width: number;
60
+ height: number;
61
+ } | undefined;
56
62
  /**
57
63
  * whether the icon should flip horizontally on RTL
58
64
  */
@@ -78,7 +84,10 @@ declare const _default: React.ForwardRefExoticComponent<Omit<RNImageProps, "sour
78
84
  /**
79
85
  * the icon size
80
86
  */
81
- size?: number | undefined;
87
+ size?: number | {
88
+ width: number;
89
+ height: number;
90
+ } | undefined;
82
91
  /**
83
92
  * whether the icon should flip horizontally on RTL
84
93
  */
@@ -29,10 +29,6 @@ const Icon = forwardRef((props, ref) => {
29
29
  const {
30
30
  margins
31
31
  } = modifiers;
32
- const iconSize = size ? {
33
- width: size,
34
- height: size
35
- } : undefined;
36
32
  const shouldFlipRTL = supportRTL && Constants.isRTL;
37
33
  const getBadgeStyling = () => {
38
34
  const containerStyle = badgeProps?.containerStyle;
@@ -45,6 +41,18 @@ const Icon = forwardRef((props, ref) => {
45
41
  badgePosition.top = position;
46
42
  return [badgePosition, containerStyle];
47
43
  };
44
+ const iconSize = useMemo(() => {
45
+ if (typeof size === 'number') {
46
+ return {
47
+ width: size,
48
+ height: size
49
+ };
50
+ }
51
+ if (typeof size === 'object') {
52
+ return size;
53
+ }
54
+ return undefined;
55
+ }, [size]);
48
56
  const iconSource = useMemo(() => {
49
57
  if (!isUndefined(assetName)) {
50
58
  return getAsset(assetName, assetGroup);