@fixefy/fixefy-ui-components 0.2.33 → 0.2.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.
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
120
120
  fontSize: "small"
121
121
  });
122
122
  const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
123
- const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride } = props;
123
+ const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, logo_placeholder, logo_folder_name } = props;
124
124
  const ref = (0, _react.useRef)(null);
125
125
  const theme = (0, _material.useTheme)();
126
126
  const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
@@ -397,6 +397,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
397
397
  }, option._id);
398
398
  break;
399
399
  case 'logo':
400
+ var _option_name;
400
401
  rv = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
401
402
  sx: {
402
403
  display: 'flex',
@@ -411,7 +412,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
411
412
  width: '70px'
412
413
  },
413
414
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
414
- icon: `companies/${option.logo ? option.logo : 'logo_placeholder/logo_placeholder.svg'}`,
415
+ icon: `${option.logo ? `${logo_folder_name}/${option.logo}` : logo_placeholder ? logo_placeholder : (_option_name = option === null || option === void 0 ? void 0 : option[name]) !== null && _option_name !== void 0 ? _option_name : 'x'}`,
415
416
  width: 70,
416
417
  height: 16
417
418
  })
@@ -1,6 +1,7 @@
1
- export declare const FxIcon: ({ icon, width, height, onClick, }: {
1
+ export declare const FxIcon: ({ icon, width, height, onClick, variant, }: {
2
2
  icon: string;
3
3
  width: number;
4
4
  height: number;
5
5
  onClick?: () => void;
6
+ variant?: "circular" | "rounded" | "square";
6
7
  }) => JSX.Element;
@@ -59,11 +59,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
59
59
  }
60
60
  return newObj;
61
61
  }
62
- const PublicIcon = ({ icon, width, height, onClick })=>{
62
+ const PublicIcon = ({ icon, width, height, onClick, variant })=>{
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
68
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
68
69
  fontSize: 29,
69
70
  fontWeight: 600,
@@ -82,21 +83,23 @@ const PublicIcon = ({ icon, width, height, onClick })=>{
82
83
  onClick: onClick
83
84
  });
84
85
  };
85
- const FxIcon = ({ icon, width, height, onClick })=>{
86
+ const FxIcon = ({ icon, width, height, onClick, variant })=>{
86
87
  if (!icon) throw Error('Provide a property `icon`');
87
88
  return parseIconFromLibrary({
88
89
  icon,
89
90
  width,
90
91
  height,
91
- onClick
92
+ onClick,
93
+ variant
92
94
  });
93
95
  };
94
- const parseIconFromLibrary = ({ icon, width, height, onClick })=>{
96
+ const parseIconFromLibrary = ({ icon, width, height, onClick, variant })=>{
95
97
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(PublicIcon, {
96
98
  icon: icon,
97
99
  width: width,
98
100
  height: height,
99
- onClick: onClick
101
+ onClick: onClick,
102
+ variant: variant
100
103
  });
101
104
  };
102
105
  const imageLoader = ({ src })=>{
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.33"
68
+ "version": "0.2.35"
69
69
  }