@refineui/react-native-icons 0.3.26 → 0.3.27
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/IconUtils.d.ts.map +1 -1
- package/dist/index.esm.js +19 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +19 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/IconUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconUtils.d.ts","sourceRoot":"","sources":["../src/IconUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IconUtils.d.ts","sourceRoot":"","sources":["../src/IconUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,cAAc,EAAE,GAAG,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,GAAG,CAAC;IAClB,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;CACpC;AAED,cAAM,oBAAoB;IACxB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,YAAY,CAAM;;IAO1B,OAAO,CAAC,WAAW;IAenB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,SAAc,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI;IAoBpF,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,eAAe;IAsBvB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,SAAS,GAAG,QAAoB,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,GAAG,IAAI;IAUxG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,SAAS,GAAG,QAAoB,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,GAAG,IAAI;IAUzG,aAAa,CAAC,KAAK,GAAE,SAAS,GAAG,QAAoB,GAAG,MAAM;IAI9D,iBAAiB,IAAI,MAAM,EAAE;IAI7B,eAAe,IAAI,GAAG;IAItB,iBAAiB,IAAI,MAAM,EAAE;IAI7B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAI9C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAOrC;AAGD,QAAA,MAAM,oBAAoB,sBAA6B,CAAC;AAExD,eAAe,oBAAoB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -57180,15 +57180,23 @@ function nameToSlug(name) {
|
|
|
57180
57180
|
function pascalToSlug(name) {
|
|
57181
57181
|
return String(name).replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
|
|
57182
57182
|
}
|
|
57183
|
+
function normalizeIconName(name) {
|
|
57184
|
+
return String(name).trim().replace(/\s+/g, ' ');
|
|
57185
|
+
}
|
|
57183
57186
|
class ReactNativeIconUtils {
|
|
57184
57187
|
constructor() {
|
|
57185
57188
|
this.metadata = metadata;
|
|
57186
57189
|
this.fontFamilies = metadata.fontFamilies;
|
|
57187
57190
|
}
|
|
57188
57191
|
getIconData(iconName) {
|
|
57192
|
+
if (!iconName || typeof iconName !== 'string')
|
|
57193
|
+
return null;
|
|
57189
57194
|
const direct = this.metadata.icons[iconName];
|
|
57190
57195
|
if (direct)
|
|
57191
57196
|
return direct;
|
|
57197
|
+
const normalized = normalizeIconName(iconName);
|
|
57198
|
+
if (normalized && this.metadata.icons[normalized])
|
|
57199
|
+
return this.metadata.icons[normalized];
|
|
57192
57200
|
const slug = nameToSlug(iconName);
|
|
57193
57201
|
const bySlug = Object.values(this.metadata.icons).find((icon) => icon.slug === slug);
|
|
57194
57202
|
if (bySlug)
|
|
@@ -57217,11 +57225,11 @@ class ReactNativeIconUtils {
|
|
|
57217
57225
|
// Create unsized icon (default 24px)
|
|
57218
57226
|
createUnsizedIcon(iconName, style, props = {}) {
|
|
57219
57227
|
const iconData = this.getIconData(iconName);
|
|
57220
|
-
if (!iconData)
|
|
57228
|
+
if (!iconData?.unicodeMapping)
|
|
57221
57229
|
return null;
|
|
57222
57230
|
const defaultSize = 24;
|
|
57223
|
-
const unicodeInfo = iconData.unicodeMapping[defaultSize]?.[style];
|
|
57224
|
-
if (!unicodeInfo)
|
|
57231
|
+
const unicodeInfo = iconData.unicodeMapping[String(defaultSize)]?.[style];
|
|
57232
|
+
if (!unicodeInfo || unicodeInfo.unicode == null)
|
|
57225
57233
|
return null;
|
|
57226
57234
|
const fontFamily = this.fontFamilies[style].font_family;
|
|
57227
57235
|
return React.createElement('Text', {
|
|
@@ -57238,10 +57246,10 @@ class ReactNativeIconUtils {
|
|
|
57238
57246
|
// Create sized icon
|
|
57239
57247
|
createSizedIcon(iconName, size, style, props = {}) {
|
|
57240
57248
|
const iconData = this.getIconData(iconName);
|
|
57241
|
-
if (!iconData)
|
|
57249
|
+
if (!iconData?.unicodeMapping)
|
|
57242
57250
|
return null;
|
|
57243
|
-
const unicodeInfo = iconData.unicodeMapping[size]?.[style];
|
|
57244
|
-
if (!unicodeInfo)
|
|
57251
|
+
const unicodeInfo = iconData.unicodeMapping[String(size)]?.[style];
|
|
57252
|
+
if (!unicodeInfo || unicodeInfo.unicode == null)
|
|
57245
57253
|
return null;
|
|
57246
57254
|
const fontFamily = this.fontFamilies[style].font_family;
|
|
57247
57255
|
return React.createElement('Text', {
|
|
@@ -57258,18 +57266,18 @@ class ReactNativeIconUtils {
|
|
|
57258
57266
|
// Utility methods
|
|
57259
57267
|
getIconChar(iconName, style = 'regular', size = 24) {
|
|
57260
57268
|
const iconData = this.getIconData(iconName);
|
|
57261
|
-
if (!iconData)
|
|
57269
|
+
if (!iconData?.unicodeMapping)
|
|
57262
57270
|
return null;
|
|
57263
|
-
const unicodeInfo = iconData.unicodeMapping[size]?.[style];
|
|
57264
|
-
if (!unicodeInfo)
|
|
57271
|
+
const unicodeInfo = iconData.unicodeMapping[String(size)]?.[style];
|
|
57272
|
+
if (!unicodeInfo || unicodeInfo.unicode == null)
|
|
57265
57273
|
return null;
|
|
57266
57274
|
return String.fromCodePoint(unicodeInfo.unicode);
|
|
57267
57275
|
}
|
|
57268
57276
|
getIconClass(iconName, style = 'regular', size = 24) {
|
|
57269
57277
|
const iconData = this.getIconData(iconName);
|
|
57270
|
-
if (!iconData)
|
|
57278
|
+
if (!iconData?.unicodeMapping)
|
|
57271
57279
|
return null;
|
|
57272
|
-
const unicodeInfo = iconData.unicodeMapping[size]?.[style];
|
|
57280
|
+
const unicodeInfo = iconData.unicodeMapping[String(size)]?.[style];
|
|
57273
57281
|
if (!unicodeInfo)
|
|
57274
57282
|
return null;
|
|
57275
57283
|
return unicodeInfo.cssClass;
|