@cashub/ui 0.9.3 → 0.9.5

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.
@@ -48,6 +48,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
48
48
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
49
 
50
50
  var UploadImage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
51
+ var _ref$current, _ref$current$files;
52
+
51
53
  var id = _ref.id,
52
54
  src = _ref.src,
53
55
  _ref$alt = _ref.alt,
@@ -55,7 +57,10 @@ var UploadImage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
55
57
  _ref$roundedCircle = _ref.roundedCircle,
56
58
  roundedCircle = _ref$roundedCircle === void 0 ? false : _ref$roundedCircle,
57
59
  cropperHandler = _ref.cropperHandler,
58
- onBlur = _ref.onBlur;
60
+ onBlur = _ref.onBlur,
61
+ onClear = _ref.onClear,
62
+ _ref$allowClear = _ref.allowClear,
63
+ allowClear = _ref$allowClear === void 0 ? false : _ref$allowClear;
59
64
 
60
65
  var _useTranslation = (0, _reactI18next.useTranslation)(),
61
66
  t = _useTranslation.t;
@@ -217,6 +222,10 @@ var UploadImage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
217
222
  onClick: handleAvatarRemove,
218
223
  roundedCircle: roundedCircle,
219
224
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaTimes, {})
225
+ }), allowClear && src && ref && !((_ref$current = ref.current) !== null && _ref$current !== void 0 && (_ref$current$files = _ref$current.files) !== null && _ref$current$files !== void 0 && _ref$current$files.length) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(RemoveIcon, {
226
+ onClick: onClear,
227
+ roundedCircle: roundedCircle,
228
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaTimes, {})
220
229
  })]
221
230
  });
222
231
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "private": false,
5
5
  "author": "CASHUB Team",
6
6
  "description": "CASHUB UI components library",