@algorithm-shift/design-system 1.2.983 → 1.2.984
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.js +20 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -782,28 +782,12 @@ function SplitButton({ style, textContent, className, list = [] }) {
|
|
|
782
782
|
|
|
783
783
|
// src/components/Basic/Icon/Icon.tsx
|
|
784
784
|
var import_react8 = require("react");
|
|
785
|
+
var SolidIcons = __toESM(require("@fortawesome/free-solid-svg-icons"));
|
|
786
|
+
var RegularIcons = __toESM(require("@fortawesome/free-regular-svg-icons"));
|
|
787
|
+
var BrandIcons = __toESM(require("@fortawesome/free-brands-svg-icons"));
|
|
785
788
|
var import_react_fontawesome2 = require("@fortawesome/react-fontawesome");
|
|
786
789
|
var LucideIcons = __toESM(require("lucide-react"));
|
|
787
790
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
788
|
-
async function loadFAIcon(iconName, prefix = "fas") {
|
|
789
|
-
const pkgMap = {
|
|
790
|
-
fas: "@fortawesome/free-solid-svg-icons",
|
|
791
|
-
// Solid
|
|
792
|
-
far: "@fortawesome/free-regular-svg-icons",
|
|
793
|
-
// Regular
|
|
794
|
-
fab: "@fortawesome/free-brands-svg-icons"
|
|
795
|
-
// Brands
|
|
796
|
-
};
|
|
797
|
-
const basePackage = pkgMap[prefix] || pkgMap["fas"];
|
|
798
|
-
const modulePath = `${basePackage}`;
|
|
799
|
-
try {
|
|
800
|
-
const mod = await import(modulePath);
|
|
801
|
-
return mod[iconName] || Object.values(mod)[0];
|
|
802
|
-
} catch {
|
|
803
|
-
console.warn(`FA icon not found in ${modulePath}`);
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
791
|
function Icon(props) {
|
|
808
792
|
const {
|
|
809
793
|
iconSet = "fontawesome",
|
|
@@ -819,6 +803,15 @@ function Icon(props) {
|
|
|
819
803
|
...rest
|
|
820
804
|
} = props;
|
|
821
805
|
const [dynamicIcon, setDynamicIcon] = (0, import_react8.useState)(icon || null);
|
|
806
|
+
async function loadFAIcon(iconName, prefix2 = "fas") {
|
|
807
|
+
const pkgMap = {
|
|
808
|
+
fas: SolidIcons,
|
|
809
|
+
far: RegularIcons,
|
|
810
|
+
fab: BrandIcons
|
|
811
|
+
};
|
|
812
|
+
const basePackage = pkgMap[prefix2] ?? SolidIcons;
|
|
813
|
+
return basePackage[iconName] ?? null;
|
|
814
|
+
}
|
|
822
815
|
(0, import_react8.useEffect)(() => {
|
|
823
816
|
if (icon && iconSet === "fontawesome") {
|
|
824
817
|
loadFAIcon(icon, prefix).then((ico) => setDynamicIcon(ico));
|
|
@@ -835,7 +828,10 @@ function Icon(props) {
|
|
|
835
828
|
Comp,
|
|
836
829
|
{
|
|
837
830
|
size: numericSize,
|
|
838
|
-
className
|
|
831
|
+
className: cn(
|
|
832
|
+
className,
|
|
833
|
+
props.onClick ? "cursor-pointer" : ""
|
|
834
|
+
),
|
|
839
835
|
title,
|
|
840
836
|
style,
|
|
841
837
|
"aria-hidden": title ? void 0 : true,
|
|
@@ -857,7 +853,10 @@ function Icon(props) {
|
|
|
857
853
|
spin,
|
|
858
854
|
spinPulse: pulse,
|
|
859
855
|
widthAuto: fixedWidth,
|
|
860
|
-
className: cn(
|
|
856
|
+
className: cn(
|
|
857
|
+
className,
|
|
858
|
+
props.onClick ? "cursor-pointer" : ""
|
|
859
|
+
),
|
|
861
860
|
title,
|
|
862
861
|
style: {
|
|
863
862
|
...tempStyle
|