@underverse-ui/underverse 0.2.51 → 0.2.53
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 +62 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +62 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
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-
|
|
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
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
"
|
|
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
|
-
"
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
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
|
);
|
|
@@ -5516,33 +5552,15 @@ var variantClasses = {
|
|
|
5516
5552
|
primary: "bg-primary/5",
|
|
5517
5553
|
accent: "bg-accent/10"
|
|
5518
5554
|
};
|
|
5519
|
-
var spacingClasses2 = {
|
|
5520
|
-
none: "",
|
|
5521
|
-
sm: "p-2",
|
|
5522
|
-
md: "p-4",
|
|
5523
|
-
lg: "p-6",
|
|
5524
|
-
xl: "p-8"
|
|
5525
|
-
};
|
|
5526
5555
|
var ScrollArea = (0, import_react14.forwardRef)(
|
|
5527
|
-
({ className, contentClassName, children, variant = "default",
|
|
5556
|
+
({ className, contentClassName, children, variant = "default", outlined = false, ...props }, ref) => {
|
|
5528
5557
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5529
5558
|
"div",
|
|
5530
5559
|
{
|
|
5531
5560
|
ref,
|
|
5532
5561
|
className: cn("relative overflow-hidden", variantClasses[variant], outlined && "rounded-lg border border-border/60", className),
|
|
5533
5562
|
...props,
|
|
5534
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5535
|
-
"div",
|
|
5536
|
-
{
|
|
5537
|
-
className: cn(
|
|
5538
|
-
"h-full w-full overflow-y-auto scroll-area-viewport",
|
|
5539
|
-
spacingClasses2[spacing],
|
|
5540
|
-
!fullWidth && "container mx-auto px-4 md:px-6",
|
|
5541
|
-
contentClassName
|
|
5542
|
-
),
|
|
5543
|
-
children
|
|
5544
|
-
}
|
|
5545
|
-
)
|
|
5563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport", contentClassName), children })
|
|
5546
5564
|
}
|
|
5547
5565
|
);
|
|
5548
5566
|
}
|