@allxsmith/bestax-bulma 5.2.0 → 5.2.1

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.cjs.js CHANGED
@@ -1157,6 +1157,18 @@ Pagination.Ellipsis = PaginationEllipsis;
1157
1157
  Pagination.Previous = PaginationPrevious;
1158
1158
  Pagination.Next = PaginationNext;
1159
1159
 
1160
+ function stripRedundantLibraryPrefix(name, library) {
1161
+ if (!name) {
1162
+ return name;
1163
+ }
1164
+ if (library === 'fa' && name.startsWith('fa-')) {
1165
+ return name.substring(3);
1166
+ }
1167
+ if (library === 'mdi' && name.startsWith('mdi-')) {
1168
+ return name.substring(4);
1169
+ }
1170
+ return name;
1171
+ }
1160
1172
  function getIconClasses(library, name, variant, features) {
1161
1173
  let baseClass;
1162
1174
  let iconClass;
@@ -1230,6 +1242,7 @@ const Icon = ({ className, textColor, bgColor, name, library, variant, features,
1230
1242
  }
1231
1243
  const defaultLibrary = useIconLibrary();
1232
1244
  const finalLibrary = library || defaultLibrary || 'fa';
1245
+ finalName = stripRedundantLibraryPrefix(finalName, finalLibrary);
1233
1246
  const { bulmaHelperClasses, rest } = useBulmaClasses({
1234
1247
  color: textColor,
1235
1248
  backgroundColor: bgColor,