@firecms/ui 3.0.0-canary.201 → 3.0.0-canary.203

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.
@@ -5,6 +5,7 @@ export interface AvatarProps {
5
5
  children?: React.ReactNode;
6
6
  className?: string;
7
7
  outerClassName?: string;
8
+ hover?: boolean;
8
9
  style?: React.CSSProperties;
9
10
  }
10
11
  export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLButtonElement>>;
package/dist/index.es.js CHANGED
@@ -614,7 +614,7 @@ const Alert = (t0) => {
614
614
  return t7;
615
615
  };
616
616
  const AvatarInner = (t0, ref) => {
617
- const $ = c(23);
617
+ const $ = c(25);
618
618
  let alt;
619
619
  let children;
620
620
  let className;
@@ -622,6 +622,7 @@ const AvatarInner = (t0, ref) => {
622
622
  let props;
623
623
  let src;
624
624
  let style;
625
+ let t1;
625
626
  if ($[0] !== t0) {
626
627
  ({
627
628
  src,
@@ -630,6 +631,7 @@ const AvatarInner = (t0, ref) => {
630
631
  className,
631
632
  style,
632
633
  outerClassName,
634
+ hover: t1,
633
635
  ...props
634
636
  } = t0);
635
637
  $[0] = t0;
@@ -640,6 +642,7 @@ const AvatarInner = (t0, ref) => {
640
642
  $[5] = props;
641
643
  $[6] = src;
642
644
  $[7] = style;
645
+ $[8] = t1;
643
646
  } else {
644
647
  alt = $[1];
645
648
  children = $[2];
@@ -648,51 +651,55 @@ const AvatarInner = (t0, ref) => {
648
651
  props = $[5];
649
652
  src = $[6];
650
653
  style = $[7];
654
+ t1 = $[8];
651
655
  }
656
+ const hover = t1 === void 0 ? true : t1;
652
657
  const [isImageError, setIsImageError] = useState(false);
653
- let t1;
654
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
655
- t1 = () => {
658
+ let t2;
659
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
660
+ t2 = () => {
656
661
  setIsImageError(true);
657
662
  };
658
- $[8] = t1;
663
+ $[9] = t2;
659
664
  } else {
660
- t1 = $[8];
665
+ t2 = $[9];
661
666
  }
662
- const handleImageError = t1;
663
- let t2;
664
- if ($[9] !== outerClassName) {
665
- t2 = cls("rounded-full flex items-center justify-center overflow-hidden", "p-1 hover:bg-surface-accent-200 hover:dark:bg-surface-accent-700 w-12 h-12 min-w-12 min-h-12", outerClassName);
666
- $[9] = outerClassName;
667
- $[10] = t2;
667
+ const handleImageError = t2;
668
+ const t3 = hover && "hover:bg-surface-accent-200 hover:dark:bg-surface-accent-700";
669
+ let t4;
670
+ if ($[10] !== outerClassName || $[11] !== t3) {
671
+ t4 = cls("rounded-full flex items-center justify-center overflow-hidden", "p-1 w-12 h-12 min-w-12 min-h-12", t3, outerClassName);
672
+ $[10] = outerClassName;
673
+ $[11] = t3;
674
+ $[12] = t4;
668
675
  } else {
669
- t2 = $[10];
676
+ t4 = $[12];
670
677
  }
671
- let t3;
672
- if ($[11] !== alt || $[12] !== children || $[13] !== className || $[14] !== isImageError || $[15] !== src) {
673
- t3 = src && !isImageError ? /* @__PURE__ */ jsx("img", { className: cls("bg-surface-accent-100 dark:bg-surface-accent-800", "w-full h-full object-cover rounded-full", className), src, alt, onError: handleImageError }) : /* @__PURE__ */ jsx("span", { className: cls("bg-surface-accent-100 dark:bg-surface-accent-800", "flex items-center justify-center", "w-full h-full py-1.5 text-lg font-medium text-surface-accent-900 dark:text-white rounded-full", className), children });
674
- $[11] = alt;
675
- $[12] = children;
676
- $[13] = className;
677
- $[14] = isImageError;
678
- $[15] = src;
679
- $[16] = t3;
678
+ let t5;
679
+ if ($[13] !== alt || $[14] !== children || $[15] !== className || $[16] !== isImageError || $[17] !== src) {
680
+ t5 = src && !isImageError ? /* @__PURE__ */ jsx("img", { className: cls("bg-surface-accent-100 dark:bg-surface-accent-800", "w-full h-full object-cover rounded-full", className), src, alt, onError: handleImageError }) : /* @__PURE__ */ jsx("span", { className: cls("bg-surface-accent-100 dark:bg-surface-accent-800", "flex items-center justify-center", "w-full h-full py-1.5 text-lg font-medium text-surface-accent-900 dark:text-white rounded-full", className), children });
681
+ $[13] = alt;
682
+ $[14] = children;
683
+ $[15] = className;
684
+ $[16] = isImageError;
685
+ $[17] = src;
686
+ $[18] = t5;
680
687
  } else {
681
- t3 = $[16];
688
+ t5 = $[18];
682
689
  }
683
- let t4;
684
- if ($[17] !== props || $[18] !== ref || $[19] !== style || $[20] !== t2 || $[21] !== t3) {
685
- t4 = /* @__PURE__ */ jsx("button", { ref, style, ...props, className: t2, children: t3 });
686
- $[17] = props;
687
- $[18] = ref;
688
- $[19] = style;
689
- $[20] = t2;
690
- $[21] = t3;
690
+ let t6;
691
+ if ($[19] !== props || $[20] !== ref || $[21] !== style || $[22] !== t4 || $[23] !== t5) {
692
+ t6 = /* @__PURE__ */ jsx("button", { ref, style, ...props, className: t4, children: t5 });
693
+ $[19] = props;
694
+ $[20] = ref;
695
+ $[21] = style;
691
696
  $[22] = t4;
697
+ $[23] = t5;
698
+ $[24] = t6;
692
699
  } else {
693
- t4 = $[22];
700
+ t6 = $[24];
694
701
  }
695
- return t4;
702
+ return t6;
696
703
  };
697
704
  const Avatar = React__default.forwardRef(AvatarInner);
698
705
  const BooleanSwitch = React__default.forwardRef(function BooleanSwitch2({