@fixefy/fixefy-ui-components 0.3.33 → 0.3.35

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,11 +1,12 @@
1
1
  import React from 'react';
2
- export declare const FxButtonModalWithComponent: ({ btnType, btnValue, modalData, onClick, disabled, icon, sx, iconSize, }: {
2
+ export declare const FxButtonModalWithComponent: ({ btnType, btnValue, modalData, onClick, disabled, startIcon, endIcon, sx, iconSize, }: {
3
3
  btnType?: 'text' | 'icon';
4
4
  btnValue?: string;
5
5
  modalData: any;
6
6
  onClick?: any;
7
7
  disabled?: boolean;
8
- icon?: string;
8
+ startIcon?: string;
9
+ endIcon?: string;
9
10
  sx?: any;
10
11
  iconSize?: number;
11
12
  }) => React.JSX.Element;
@@ -53,7 +53,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
53
53
  }
54
54
  return newObj;
55
55
  }
56
- const FxButtonModalWithComponent = ({ btnType = 'text', btnValue, modalData, onClick, disabled, icon, sx, iconSize })=>{
56
+ const FxButtonModalWithComponent = ({ btnType = 'text', btnValue, modalData, onClick, disabled, startIcon, endIcon, sx, iconSize })=>{
57
57
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
58
58
  const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
59
59
  const handleClick = (e)=>{
@@ -82,7 +82,8 @@ const FxButtonModalWithComponent = ({ btnType = 'text', btnValue, modalData, onC
82
82
  btnType: btnType,
83
83
  btnValue: btnValue,
84
84
  onClick: handleClick,
85
- startIcon: icon,
85
+ startIcon: startIcon,
86
+ endIcon: endIcon,
86
87
  disabled: disabled,
87
88
  iconSize: iconSize || 20
88
89
  }),
@@ -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;
@@ -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 || 'circular',
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
  };
package/package.json CHANGED
@@ -67,5 +67,5 @@
67
67
  "require": "./dist/index.js"
68
68
  }
69
69
  },
70
- "version": "0.3.33"
70
+ "version": "0.3.35"
71
71
  }