@fixefy/fixefy-ui-components 0.3.34 → 0.3.36
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/FxIcon/FxIcon.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize, background, }: {
|
|
1
|
+
export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize, background, initials, }: {
|
|
2
2
|
icon: string;
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
@@ -6,4 +6,5 @@ export declare const FxIcon: ({ icon, width, height, onClick, variant, fontSize,
|
|
|
6
6
|
variant?: 'circular' | 'rounded' | 'square';
|
|
7
7
|
fontSize?: number;
|
|
8
8
|
background?: string;
|
|
9
|
+
initials?: string;
|
|
9
10
|
}) => JSX.Element;
|
package/dist/FxIcon/FxIcon.js
CHANGED
|
@@ -59,19 +59,21 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
59
|
}
|
|
60
60
|
return newObj;
|
|
61
61
|
}
|
|
62
|
-
const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, background })=>{
|
|
62
|
+
const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
|
|
63
63
|
const [isError, setError] = (0, _react.useState)(false);
|
|
64
64
|
const handleError = (isError)=>setError(isError);
|
|
65
65
|
if (isError) {
|
|
66
66
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Avatar, {
|
|
67
|
-
variant: variant || '
|
|
67
|
+
variant: variant || 'rounded',
|
|
68
68
|
sx: {
|
|
69
|
-
background: background || '#bdbdbd'
|
|
69
|
+
background: background || '#bdbdbd',
|
|
70
|
+
width,
|
|
71
|
+
height
|
|
70
72
|
},
|
|
71
73
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
72
74
|
fontSize: fontSize || 29,
|
|
73
75
|
fontWeight: 600,
|
|
74
|
-
children: (0, _fixefyuiutils.toInitials)(icon)
|
|
76
|
+
children: initials || (0, _fixefyuiutils.toInitials)(icon)
|
|
75
77
|
})
|
|
76
78
|
});
|
|
77
79
|
}
|
|
@@ -89,7 +91,7 @@ const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, backgroun
|
|
|
89
91
|
onClick: onClick
|
|
90
92
|
});
|
|
91
93
|
};
|
|
92
|
-
const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background })=>{
|
|
94
|
+
const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
|
|
93
95
|
if (!icon) throw Error('Provide a property `icon`');
|
|
94
96
|
return parseIconFromLibrary({
|
|
95
97
|
icon,
|
|
@@ -98,10 +100,11 @@ const FxIcon = ({ icon, width, height, onClick, variant, fontSize, background })
|
|
|
98
100
|
onClick,
|
|
99
101
|
variant,
|
|
100
102
|
fontSize,
|
|
101
|
-
background
|
|
103
|
+
background,
|
|
104
|
+
initials
|
|
102
105
|
});
|
|
103
106
|
};
|
|
104
|
-
const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize, background })=>{
|
|
107
|
+
const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize, background, initials })=>{
|
|
105
108
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(PublicIcon, {
|
|
106
109
|
icon: icon,
|
|
107
110
|
width: width,
|
|
@@ -109,6 +112,7 @@ const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize,
|
|
|
109
112
|
onClick: onClick,
|
|
110
113
|
variant: variant,
|
|
111
114
|
fontSize: fontSize,
|
|
112
|
-
background: background
|
|
115
|
+
background: background,
|
|
116
|
+
initials: initials
|
|
113
117
|
});
|
|
114
118
|
};
|
|
@@ -39,6 +39,8 @@ const FxStyledButton = ({ btnValue, btnType = 'text', disabled, onClick, startIc
|
|
|
39
39
|
children: (0, _fixefyuiutils.titleCase)(btnValue)
|
|
40
40
|
}) : btnType == 'icon' && startIcon && iconSize && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.IconButton, {
|
|
41
41
|
onClick: onClick,
|
|
42
|
+
sx: sx,
|
|
43
|
+
disabled: disabled,
|
|
42
44
|
children: [
|
|
43
45
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
44
46
|
icon: startIcon,
|
package/package.json
CHANGED