@financinha/ui 0.13.1 → 0.14.1

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.cjs CHANGED
@@ -2911,6 +2911,25 @@ var SIZE = {
2911
2911
  default: "size-10 text-sm",
2912
2912
  lg: "size-12 text-base"
2913
2913
  };
2914
+ var ICON_SIZE = {
2915
+ sm: "text-base leading-none [&>svg]:size-4",
2916
+ default: "text-xl leading-none [&>svg]:size-5",
2917
+ lg: "text-xl leading-none [&>svg]:size-5"
2918
+ };
2919
+ var OWNER_SIZE = {
2920
+ sm: { circle: "h-4 w-4", count: "h-4 min-w-4 px-1" },
2921
+ default: { circle: "h-5 w-5", count: "h-5 min-w-5 px-1" },
2922
+ lg: { circle: "h-5 w-5", count: "h-5 min-w-5 px-1" }
2923
+ };
2924
+ var STATUS_SIZE = {
2925
+ sm: "size-2.5",
2926
+ default: "size-3",
2927
+ lg: "size-3"
2928
+ };
2929
+ var TONE = {
2930
+ neutral: "bg-muted text-muted-foreground",
2931
+ success: "bg-success-50 text-success-500 dark:bg-success-800/40 dark:text-success-300"
2932
+ };
2914
2933
  var STATUS_COLOR = {
2915
2934
  success: "bg-success-400",
2916
2935
  warning: "bg-warning-400",
@@ -2926,6 +2945,8 @@ function BankAvatar({
2926
2945
  name,
2927
2946
  src,
2928
2947
  initials,
2948
+ icon,
2949
+ tone = "neutral",
2929
2950
  color,
2930
2951
  textColor,
2931
2952
  size = "default",
@@ -2959,7 +2980,8 @@ function BankAvatar({
2959
2980
  className: (0, import_cn28.cn)(
2960
2981
  "flex items-center justify-center overflow-hidden rounded-lg font-semibold",
2961
2982
  SIZE[size],
2962
- showLogo ? "bg-white ring-1 ring-border" : !color && "bg-muted text-muted-foreground"
2983
+ showLogo ? "bg-white ring-1 ring-border" : !color && TONE[tone],
2984
+ !showLogo && icon != null && ICON_SIZE[size]
2963
2985
  ),
2964
2986
  style: showLogo ? void 0 : { backgroundColor: color, color: textColor },
2965
2987
  children: showLogo ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
@@ -2970,7 +2992,7 @@ function BankAvatar({
2970
2992
  className: "size-full object-contain",
2971
2993
  onError: () => setFailed(true)
2972
2994
  }
2973
- ) : initials ?? initialsOf(name)
2995
+ ) : icon ?? initials ?? initialsOf(name)
2974
2996
  }
2975
2997
  ),
2976
2998
  status ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
@@ -2979,7 +3001,8 @@ function BankAvatar({
2979
3001
  "aria-hidden": true,
2980
3002
  "data-slot": "bank-avatar-status",
2981
3003
  className: (0, import_cn28.cn)(
2982
- "absolute -top-1 -right-1 size-3 rounded-full ring-2 ring-background",
3004
+ "absolute -top-1 -right-1 rounded-full ring-2 ring-background",
3005
+ STATUS_SIZE[size],
2983
3006
  STATUS_COLOR[status]
2984
3007
  )
2985
3008
  }
@@ -2992,10 +3015,10 @@ function BankAvatar({
2992
3015
  className: (0, import_cn28.cn)(
2993
3016
  // Cinza escuro com texto branco, como o "+3" do Avatar group: o lilás é só da opção escolhida e
2994
3017
  // da IA, e o roxo 500 só da ação principal.
2995
- "absolute -right-1 -bottom-1 flex h-5 items-center justify-center overflow-hidden rounded-full bg-neutral-400 text-xs font-semibold text-white ring-2 ring-background dark:bg-neutral-300 dark:text-neutral-800",
3018
+ "absolute -right-1 -bottom-1 flex items-center justify-center overflow-hidden rounded-full bg-neutral-400 text-xs font-semibold text-white ring-2 ring-background dark:bg-neutral-300 dark:text-neutral-800",
2996
3019
  // Só o número cresce na largura; foto e inicial ficam num círculo fixo (sem isso a foto
2997
3020
  // esticava o selo até a largura dela).
2998
- "count" in owner ? "min-w-5 px-1" : "w-5"
3021
+ "count" in owner ? OWNER_SIZE[size].count : OWNER_SIZE[size].circle
2999
3022
  ),
3000
3023
  children: "count" in owner ? owner.count : owner.src ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { src: owner.src, alt: "", className: "size-full object-cover" }) : initialsOf(owner.name).charAt(0)
3001
3024
  }