@stevederico/skateboard-ui 2.16.0 → 2.18.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ 2.18.0
4
+
5
+ Fix DynamicIcon single-word icon name resolution
6
+
7
+ 2.17.0
8
+
9
+ Fix DynamicIcon forwardRef detection
10
+
11
+ 2.16.0
12
+
13
+ Fix DynamicIcon static imports
14
+
3
15
  2.15.0
4
16
 
5
17
  Add authOverlay 401 retry logic
@@ -41,7 +41,7 @@ function toIconName(name) {
41
41
  if (stripped.startsWith("Icon") && stripped.length > 4 && stripped[4] === stripped[4].toUpperCase()) {
42
42
  stripped = stripped.slice(4);
43
43
  }
44
- const pascal = /[-_\s]/.test(stripped) ? toPascalCase(stripped) : stripped;
44
+ const pascal = /[-_\s]/.test(stripped) ? toPascalCase(stripped) : stripped.charAt(0).toUpperCase() + stripped.slice(1);
45
45
  const kebab = toKebabCase(pascal);
46
46
  return { pascal, kebab };
47
47
  }
@@ -54,7 +54,8 @@ function toIconName(name) {
54
54
  */
55
55
  export function canResolveIcon(name) {
56
56
  const { pascal } = toIconName(name);
57
- return pascal in LucideIcons && typeof LucideIcons[pascal] === "function";
57
+ const icon = LucideIcons[pascal];
58
+ return !!icon && (typeof icon === "function" || typeof icon?.render === "function");
58
59
  }
59
60
 
60
61
  /**
@@ -93,7 +94,7 @@ const DynamicIcon = ({
93
94
  const { pascal } = toIconName(name);
94
95
  const Icon = LucideIcons[pascal];
95
96
 
96
- if (!Icon || typeof Icon !== "function") return null;
97
+ if (!Icon || (typeof Icon !== "function" && typeof Icon?.render !== "function")) return null;
97
98
 
98
99
  return (
99
100
  <Icon
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stevederico/skateboard-ui",
3
3
  "private": false,
4
- "version": "2.16.0",
4
+ "version": "2.18.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./Sidebar": {