@fixefy/fixefy-ui-components 0.3.42 → 0.3.44

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.
@@ -1,4 +1,4 @@
1
- export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize, background, initials, }: {
1
+ export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize, background, initials, path }: {
2
2
  icon: string;
3
3
  width: number;
4
4
  height: number;
@@ -7,4 +7,5 @@ export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize,
7
7
  fontSize?: number;
8
8
  background?: string;
9
9
  initials?: string;
10
+ path?: string;
10
11
  }) => JSX.Element;
@@ -59,7 +59,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
59
59
  }
60
60
  return newObj;
61
61
  }
62
- const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
62
+ const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials, path })=>{
63
63
  const [isError, setError] = (0, _react.useState)(false);
64
64
  const handleError = (isError)=>setError(isError);
65
65
  if (isError) {
@@ -81,17 +81,27 @@ const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, backgroun
81
81
  alt: "",
82
82
  width: width,
83
83
  height: height,
84
- loader: ()=>//@ts-ignore
85
- (0, _fixefyuiutils.imageLoader)({
86
- src: icon
87
- }),
84
+ loader: ()=>{
85
+ if (path) {
86
+ //@ts-ignore
87
+ return (0, _fixefyuiutils.imageLoader)({
88
+ src: icon
89
+ });
90
+ } else {
91
+ return (0, _fixefyuiutils.imageLoader)({
92
+ src: icon,
93
+ //@ts-ignore
94
+ path
95
+ });
96
+ }
97
+ },
88
98
  src: icon,
89
99
  onLoad: ()=>handleError(false),
90
100
  onError: ()=>handleError(true),
91
101
  onClick: onClick
92
102
  });
93
103
  };
94
- const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
104
+ const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials, path })=>{
95
105
  if (!icon) throw Error('Provide a property `icon`');
96
106
  return parseIconFromLibrary({
97
107
  icon,
@@ -101,10 +111,11 @@ const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background, i
101
111
  variant,
102
112
  fontSize,
103
113
  background,
104
- initials
114
+ initials,
115
+ path
105
116
  });
106
117
  };
107
- const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
118
+ const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize, background, initials, path })=>{
108
119
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(PublicIcon, {
109
120
  icon: icon,
110
121
  width: width,
@@ -113,6 +124,7 @@ const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize,
113
124
  variant: variant,
114
125
  fontSize: fontSize,
115
126
  background: background,
116
- initials: initials
127
+ initials: initials,
128
+ path: path
117
129
  });
118
130
  };
package/package.json CHANGED
@@ -68,5 +68,5 @@
68
68
  "require": "./dist/index.js"
69
69
  }
70
70
  },
71
- "version": "0.3.42"
71
+ "version": "0.3.44"
72
72
  }