@gamecp/ui 0.1.41 → 0.1.43
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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +39 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2277,39 +2277,39 @@ function Switch({
|
|
|
2277
2277
|
const labelId = label ? `${switchId}-label` : void 0;
|
|
2278
2278
|
const descriptionId = description ? `${switchId}-description` : void 0;
|
|
2279
2279
|
const sizes = {
|
|
2280
|
-
sm: { track: "w-8 h-
|
|
2281
|
-
md: { track: "w-
|
|
2282
|
-
lg: { track: "w-
|
|
2280
|
+
sm: { track: "w-8 h-[18px]", thumb: "w-3.5 h-3.5", translate: "translate-x-[14px]" },
|
|
2281
|
+
md: { track: "w-[44px] h-[24px]", thumb: "w-5 h-5", translate: "translate-x-5" },
|
|
2282
|
+
lg: { track: "w-[56px] h-[32px]", thumb: "w-7 h-7", translate: "translate-x-[24px]" }
|
|
2283
2283
|
};
|
|
2284
2284
|
const variants = {
|
|
2285
2285
|
default: {
|
|
2286
|
-
checked: "bg-primary/
|
|
2287
|
-
unchecked: "bg-muted-foreground/
|
|
2286
|
+
checked: "bg-primary/60",
|
|
2287
|
+
unchecked: "bg-muted-foreground/20",
|
|
2288
2288
|
ring: "focus:ring-primary"
|
|
2289
2289
|
},
|
|
2290
2290
|
success: {
|
|
2291
|
-
checked: "bg-success",
|
|
2292
|
-
unchecked: "bg-muted-foreground/
|
|
2291
|
+
checked: "bg-success/60",
|
|
2292
|
+
unchecked: "bg-muted-foreground/20",
|
|
2293
2293
|
ring: "focus:ring-success"
|
|
2294
2294
|
},
|
|
2295
2295
|
danger: {
|
|
2296
|
-
checked: "bg-destructive",
|
|
2297
|
-
unchecked: "bg-muted-foreground/
|
|
2296
|
+
checked: "bg-destructive/60",
|
|
2297
|
+
unchecked: "bg-muted-foreground/20",
|
|
2298
2298
|
ring: "focus:ring-destructive"
|
|
2299
2299
|
},
|
|
2300
2300
|
warning: {
|
|
2301
|
-
checked: "bg-warning",
|
|
2302
|
-
unchecked: "bg-muted-foreground/
|
|
2301
|
+
checked: "bg-warning/60",
|
|
2302
|
+
unchecked: "bg-muted-foreground/20",
|
|
2303
2303
|
ring: "focus:ring-warning"
|
|
2304
2304
|
},
|
|
2305
2305
|
info: {
|
|
2306
|
-
checked: "bg-info",
|
|
2307
|
-
unchecked: "bg-muted-foreground/
|
|
2306
|
+
checked: "bg-info/60",
|
|
2307
|
+
unchecked: "bg-muted-foreground/20",
|
|
2308
2308
|
ring: "focus:ring-info"
|
|
2309
2309
|
},
|
|
2310
2310
|
embedded: {
|
|
2311
|
-
checked: "bg-success",
|
|
2312
|
-
unchecked: "bg-muted-foreground/
|
|
2311
|
+
checked: "bg-success/60",
|
|
2312
|
+
unchecked: "bg-muted-foreground/20",
|
|
2313
2313
|
ring: "focus:ring-success"
|
|
2314
2314
|
}
|
|
2315
2315
|
};
|
|
@@ -4118,12 +4118,34 @@ function SidebarNavItem({
|
|
|
4118
4118
|
title,
|
|
4119
4119
|
exact = false,
|
|
4120
4120
|
onClick,
|
|
4121
|
-
isButton = false
|
|
4121
|
+
isButton = false,
|
|
4122
|
+
disabled = false
|
|
4122
4123
|
}) {
|
|
4123
4124
|
const pathname = usePathname();
|
|
4124
4125
|
const isActive = active !== void 0 ? active : exact ? pathname === href : pathname === href || pathname?.startsWith(`${href}/`);
|
|
4125
|
-
const commonClasses = `group flex items-center gap-0 overflow-hidden rounded-md px-3 py-2 text-sm font-medium outline-hidden ring-sidebar-ring transition-all duration-300 focus-visible:ring-2 disabled
|
|
4126
|
+
const commonClasses = `group flex items-center gap-0 overflow-hidden rounded-md px-3 py-2 text-sm font-medium outline-hidden ring-sidebar-ring transition-all duration-300 focus-visible:ring-2 ${disabled ? "pointer-events-none opacity-35 cursor-not-allowed" : ""} ${isActive ? "bg-primary/15 backdrop-blur-md border border-primary/30 text-primary shadow-[0_0_12px_-3px_hsl(var(--primary)/0.2)] hover:bg-primary/20 hover:border-primary/50 hover:shadow-[0_0_16px_-2px_hsl(var(--primary)/0.3)]" : "border border-transparent text-sidebar-foreground hover:bg-sidebar-accent/50 hover:backdrop-blur-sm hover:border-sidebar-foreground/10 hover:text-sidebar-accent-foreground active:bg-sidebar-accent"} ${className}`;
|
|
4126
4127
|
const iconClasses = `mr-3 h-5 w-5 shrink-0 transition-all duration-300 ease-in-out${isActive ? " text-primary" : ""}`;
|
|
4128
|
+
if (disabled) {
|
|
4129
|
+
return /* @__PURE__ */ jsxs(
|
|
4130
|
+
"span",
|
|
4131
|
+
{
|
|
4132
|
+
"data-tooltip-id": "global-tooltip",
|
|
4133
|
+
"data-tooltip-content": title || "Not available",
|
|
4134
|
+
"aria-disabled": "true",
|
|
4135
|
+
className: commonClasses,
|
|
4136
|
+
children: [
|
|
4137
|
+
Icon && /* @__PURE__ */ jsx(
|
|
4138
|
+
Icon,
|
|
4139
|
+
{
|
|
4140
|
+
className: iconClasses,
|
|
4141
|
+
"aria-hidden": "true"
|
|
4142
|
+
}
|
|
4143
|
+
),
|
|
4144
|
+
/* @__PURE__ */ jsx("span", { children })
|
|
4145
|
+
]
|
|
4146
|
+
}
|
|
4147
|
+
);
|
|
4148
|
+
}
|
|
4127
4149
|
if (isButton) {
|
|
4128
4150
|
return /* @__PURE__ */ jsxs(
|
|
4129
4151
|
"button",
|