@refineui/react-native-icons 0.3.29 → 0.3.30

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.esm.js CHANGED
@@ -57177,6 +57177,9 @@ var metadata = {
57177
57177
  function nameToSlug(name) {
57178
57178
  return String(name).toLowerCase().trim().replace(/\s+/g, '-');
57179
57179
  }
57180
+ function normalizeSlug(s) {
57181
+ return nameToSlug(String(s).replace(/_/g, '-'));
57182
+ }
57180
57183
  function pascalToSlug(name) {
57181
57184
  return String(name).replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
57182
57185
  }
@@ -57188,21 +57191,44 @@ class ReactNativeIconUtils {
57188
57191
  this.metadata = metadata;
57189
57192
  this.fontFamilies = metadata.fontFamilies;
57190
57193
  }
57194
+ /** Resolve icon data by name or by slug (handles "weather-sunny" / "weather_sunny", extra spaces) */
57191
57195
  getIconData(iconName) {
57192
57196
  if (!iconName || typeof iconName !== 'string')
57193
57197
  return null;
57194
57198
  const direct = this.metadata.icons[iconName];
57195
57199
  if (direct)
57196
57200
  return direct;
57201
+ const slugForDirect = nameToSlug(iconName);
57202
+ if (this.metadata.icons[slugForDirect])
57203
+ return this.metadata.icons[slugForDirect];
57204
+ if (this.metadata.icons[iconName.replace(/-/g, '_')])
57205
+ return this.metadata.icons[iconName.replace(/-/g, '_')];
57206
+ if (this.metadata.icons[iconName.replace(/_/g, '-')])
57207
+ return this.metadata.icons[iconName.replace(/_/g, '-')];
57208
+ const keys = Object.keys(this.metadata.icons);
57209
+ const matchKey = keys.find((k) => k === iconName ||
57210
+ normalizeSlug(k) === slugForDirect ||
57211
+ k.replace(/-/g, '_') === iconName ||
57212
+ k.replace(/_/g, '-') === iconName);
57213
+ if (matchKey)
57214
+ return this.metadata.icons[matchKey];
57197
57215
  const normalized = normalizeIconName(iconName);
57198
57216
  if (normalized && this.metadata.icons[normalized])
57199
57217
  return this.metadata.icons[normalized];
57200
- const slug = nameToSlug(iconName);
57201
- const bySlug = Object.values(this.metadata.icons).find((icon) => icon.slug === slug);
57218
+ const slug = slugForDirect;
57219
+ const bySlug = Object.values(this.metadata.icons).find((icon) => icon.slug === slug ||
57220
+ icon.slug === slug.replace(/-/g, '_') ||
57221
+ icon.slug === slug.replace(/_/g, '-') ||
57222
+ normalizeSlug(icon.slug) === slug ||
57223
+ normalizeSlug(icon.name) === slug);
57202
57224
  if (bySlug)
57203
57225
  return bySlug;
57204
57226
  const slugPascal = pascalToSlug(iconName);
57205
- return Object.values(this.metadata.icons).find((icon) => icon.slug === slugPascal) || null;
57227
+ return Object.values(this.metadata.icons).find((icon) => icon.slug === slugPascal ||
57228
+ icon.slug === slugPascal.replace(/-/g, '_') ||
57229
+ icon.slug === slugPascal.replace(/_/g, '-') ||
57230
+ normalizeSlug(icon.slug) === slugPascal ||
57231
+ normalizeSlug(icon.name) === slugPascal) || null;
57206
57232
  }
57207
57233
  // === Icon Style Method ===
57208
57234
  // Dynamic icon creation method