@firecms/ui 3.0.0-canary.143 → 3.0.0-canary.144

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/index.umd.js CHANGED
@@ -377,6 +377,10 @@
377
377
  outerClassName,
378
378
  ...props
379
379
  }, ref) => {
380
+ const [isImageError, setIsImageError] = React.useState(false);
381
+ const handleImageError = () => {
382
+ setIsImageError(true);
383
+ };
380
384
  return /* @__PURE__ */ jsxRuntime.jsx(
381
385
  "button",
382
386
  {
@@ -388,7 +392,7 @@
388
392
  "p-1 hover:bg-slate-200 hover:dark:bg-slate-700 w-12 h-12 min-w-12 min-h-12",
389
393
  outerClassName
390
394
  ),
391
- children: src ? /* @__PURE__ */ jsxRuntime.jsx(
395
+ children: src && !isImageError ? /* @__PURE__ */ jsxRuntime.jsx(
392
396
  "img",
393
397
  {
394
398
  className: cls(
@@ -397,7 +401,8 @@
397
401
  className
398
402
  ),
399
403
  src,
400
- alt
404
+ alt,
405
+ onError: handleImageError
401
406
  }
402
407
  ) : /* @__PURE__ */ jsxRuntime.jsx(
403
408
  "span",
@@ -520,7 +525,7 @@
520
525
  !invisible && fieldBackgroundMixin,
521
526
  !invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin),
522
527
  disabled ? "cursor-default" : "cursor-pointer",
523
- "rounded-md max-w-full justify-between box-border relative inline-flex items-center",
528
+ "rounded-md max-w-full justify-between box-border relative inline-flex items-center",
524
529
  !invisible && focus && !disabled ? focusedClasses : "",
525
530
  error ? "text-red-500 dark:text-red-600" : focus && !disabled ? "text-primary" : !disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark",
526
531
  size === "smallest" ? "min-h-[40px]" : size === "small" ? "min-h-[48px]" : "min-h-[64px]",