@macive/ui 0.0.16 → 0.0.17

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.
@@ -47,7 +47,14 @@ function Icon({ source, color, backdrop, accessibilityLabel, size = 20, theme })
47
47
  }
48
48
  else if (typeof source === 'object' && source !== null) {
49
49
  // Handle objects (e.g., raw SVG data or custom icon objects)
50
- sourceType = 'object';
50
+ // sourceType = 'object'
51
+ const iconToFunction = (IconComponent, props) => {
52
+ const Icon = () => (0, jsx_runtime_1.jsx)(IconComponent, { ...props });
53
+ Icon.displayName = 'Icon';
54
+ return Icon;
55
+ };
56
+ source = iconToFunction(source);
57
+ sourceType = 'function';
51
58
  }
52
59
  else {
53
60
  // Fallback to placeholder for unrecognized types
@@ -55,7 +62,7 @@ function Icon({ source, color, backdrop, accessibilityLabel, size = 20, theme })
55
62
  }
56
63
  // Warn for unsupported recoloring of external SVGs, URLs, or objects
57
64
  if (color &&
58
- (sourceType === 'external' || sourceType === 'url' || sourceType === 'object') &&
65
+ (sourceType === 'external' || sourceType === 'url') &&
59
66
  process.env.NODE_ENV === 'development') {
60
67
  console.warn(`Recoloring ${sourceType} sources is not supported. Set the intended color on your icon source instead.`);
61
68
  }