@underverse-ui/underverse 0.2.51 → 0.2.52

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
@@ -2225,13 +2225,36 @@ var sizeClasses = {
2225
2225
  md: "h-10 w-10 text-base",
2226
2226
  lg: "h-14 w-14 text-lg"
2227
2227
  };
2228
- var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onClick, ...props }) => {
2228
+ var statusColors = {
2229
+ online: "bg-success",
2230
+ offline: "bg-muted-foreground",
2231
+ busy: "bg-destructive",
2232
+ away: "bg-warning",
2233
+ none: "bg-transparent"
2234
+ };
2235
+ var statusDotSizes = {
2236
+ sm: "w-2 h-2 border",
2237
+ md: "w-3 h-3 border-2",
2238
+ lg: "w-4 h-4 border-2"
2239
+ };
2240
+ var Avatar = ({
2241
+ src,
2242
+ alt = "avatar",
2243
+ fallback = "?",
2244
+ size = "md",
2245
+ showStatus = true,
2246
+ status = "online",
2247
+ hideStatusOnHover = true,
2248
+ className,
2249
+ onClick,
2250
+ ...props
2251
+ }) => {
2229
2252
  const hasValidSrc = !!(src && src.trim().length > 0);
2230
2253
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2231
2254
  "div",
2232
2255
  {
2233
2256
  className: cn(
2234
- "relative inline-flex items-center justify-center overflow-hidden rounded-full bg-muted text-foreground select-none transition-all duration-200 ease-soft",
2257
+ "group relative inline-flex items-center justify-center overflow-visible rounded-full bg-muted text-foreground select-none transition-all duration-200 ease-soft",
2235
2258
  onClick && "cursor-pointer hover:ring-2 hover:ring-primary/50 hover:ring-offset-2 hover:shadow-lg active:scale-95",
2236
2259
  sizeClasses[size],
2237
2260
  className
@@ -2239,31 +2262,44 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
2239
2262
  onClick,
2240
2263
  ...props,
2241
2264
  children: [
2242
- hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2243
- SmartImage,
2244
- {
2245
- src,
2246
- alt,
2247
- fill: true,
2248
- ratioClass: void 0,
2249
- className: "h-full w-full",
2250
- roundedClass: "rounded-full",
2251
- fit: "cover",
2252
- objectPosition: "center",
2253
- quality: 80
2254
- }
2255
- ) }),
2256
- !hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2257
- "span",
2265
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "absolute inset-0 overflow-hidden rounded-full", children: [
2266
+ hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2267
+ SmartImage,
2268
+ {
2269
+ src,
2270
+ alt,
2271
+ fill: true,
2272
+ ratioClass: void 0,
2273
+ className: "h-full w-full",
2274
+ roundedClass: "rounded-full",
2275
+ fit: "cover",
2276
+ objectPosition: "center",
2277
+ quality: 80
2278
+ }
2279
+ ),
2280
+ !hasValidSrc && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2281
+ "span",
2282
+ {
2283
+ className: cn(
2284
+ "font-bold uppercase bg-linear-to-br from-primary to-primary/80 bg-clip-text text-transparent",
2285
+ "transition-all duration-200 animate-fade-in"
2286
+ ),
2287
+ children: fallback
2288
+ }
2289
+ ) })
2290
+ ] }),
2291
+ showStatus && status !== "none" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2292
+ "div",
2258
2293
  {
2259
2294
  className: cn(
2260
- "font-bold uppercase bg-linear-to-br from-primary to-primary/80 bg-clip-text text-transparent",
2261
- "transition-all duration-200 animate-fade-in"
2262
- ),
2263
- children: fallback
2295
+ "absolute bottom-0 right-0 rounded-full border-background z-10",
2296
+ statusColors[status],
2297
+ statusDotSizes[size],
2298
+ "transition-opacity duration-200",
2299
+ hideStatusOnHover ? "opacity-100 group-hover:opacity-50" : "opacity-100"
2300
+ )
2264
2301
  }
2265
- ),
2266
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-success border-2 border-background rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" })
2302
+ )
2267
2303
  ]
2268
2304
  }
2269
2305
  );