@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.d.mts
CHANGED
|
@@ -261,8 +261,9 @@ interface SidebarNavItemProps {
|
|
|
261
261
|
exact?: boolean;
|
|
262
262
|
onClick?: () => void;
|
|
263
263
|
isButton?: boolean;
|
|
264
|
+
disabled?: boolean;
|
|
264
265
|
}
|
|
265
|
-
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, disabled, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
267
|
|
|
267
268
|
interface LoadingSpinnerProps {
|
|
268
269
|
message?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -261,8 +261,9 @@ interface SidebarNavItemProps {
|
|
|
261
261
|
exact?: boolean;
|
|
262
262
|
onClick?: () => void;
|
|
263
263
|
isButton?: boolean;
|
|
264
|
+
disabled?: boolean;
|
|
264
265
|
}
|
|
265
|
-
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, disabled, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
267
|
|
|
267
268
|
interface LoadingSpinnerProps {
|
|
268
269
|
message?: string;
|
package/dist/index.js
CHANGED
|
@@ -2284,39 +2284,39 @@ function Switch({
|
|
|
2284
2284
|
const labelId = label ? `${switchId}-label` : void 0;
|
|
2285
2285
|
const descriptionId = description ? `${switchId}-description` : void 0;
|
|
2286
2286
|
const sizes = {
|
|
2287
|
-
sm: { track: "w-8 h-
|
|
2288
|
-
md: { track: "w-
|
|
2289
|
-
lg: { track: "w-
|
|
2287
|
+
sm: { track: "w-8 h-[18px]", thumb: "w-3.5 h-3.5", translate: "translate-x-[14px]" },
|
|
2288
|
+
md: { track: "w-[44px] h-[24px]", thumb: "w-5 h-5", translate: "translate-x-5" },
|
|
2289
|
+
lg: { track: "w-[56px] h-[32px]", thumb: "w-7 h-7", translate: "translate-x-[24px]" }
|
|
2290
2290
|
};
|
|
2291
2291
|
const variants = {
|
|
2292
2292
|
default: {
|
|
2293
|
-
checked: "bg-primary/
|
|
2294
|
-
unchecked: "bg-muted-foreground/
|
|
2293
|
+
checked: "bg-primary/60",
|
|
2294
|
+
unchecked: "bg-muted-foreground/20",
|
|
2295
2295
|
ring: "focus:ring-primary"
|
|
2296
2296
|
},
|
|
2297
2297
|
success: {
|
|
2298
|
-
checked: "bg-success",
|
|
2299
|
-
unchecked: "bg-muted-foreground/
|
|
2298
|
+
checked: "bg-success/60",
|
|
2299
|
+
unchecked: "bg-muted-foreground/20",
|
|
2300
2300
|
ring: "focus:ring-success"
|
|
2301
2301
|
},
|
|
2302
2302
|
danger: {
|
|
2303
|
-
checked: "bg-destructive",
|
|
2304
|
-
unchecked: "bg-muted-foreground/
|
|
2303
|
+
checked: "bg-destructive/60",
|
|
2304
|
+
unchecked: "bg-muted-foreground/20",
|
|
2305
2305
|
ring: "focus:ring-destructive"
|
|
2306
2306
|
},
|
|
2307
2307
|
warning: {
|
|
2308
|
-
checked: "bg-warning",
|
|
2309
|
-
unchecked: "bg-muted-foreground/
|
|
2308
|
+
checked: "bg-warning/60",
|
|
2309
|
+
unchecked: "bg-muted-foreground/20",
|
|
2310
2310
|
ring: "focus:ring-warning"
|
|
2311
2311
|
},
|
|
2312
2312
|
info: {
|
|
2313
|
-
checked: "bg-info",
|
|
2314
|
-
unchecked: "bg-muted-foreground/
|
|
2313
|
+
checked: "bg-info/60",
|
|
2314
|
+
unchecked: "bg-muted-foreground/20",
|
|
2315
2315
|
ring: "focus:ring-info"
|
|
2316
2316
|
},
|
|
2317
2317
|
embedded: {
|
|
2318
|
-
checked: "bg-success",
|
|
2319
|
-
unchecked: "bg-muted-foreground/
|
|
2318
|
+
checked: "bg-success/60",
|
|
2319
|
+
unchecked: "bg-muted-foreground/20",
|
|
2320
2320
|
ring: "focus:ring-success"
|
|
2321
2321
|
}
|
|
2322
2322
|
};
|
|
@@ -4125,12 +4125,34 @@ function SidebarNavItem({
|
|
|
4125
4125
|
title,
|
|
4126
4126
|
exact = false,
|
|
4127
4127
|
onClick,
|
|
4128
|
-
isButton = false
|
|
4128
|
+
isButton = false,
|
|
4129
|
+
disabled = false
|
|
4129
4130
|
}) {
|
|
4130
4131
|
const pathname = navigation.usePathname();
|
|
4131
4132
|
const isActive = active !== void 0 ? active : exact ? pathname === href : pathname === href || pathname?.startsWith(`${href}/`);
|
|
4132
|
-
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
|
|
4133
|
+
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}`;
|
|
4133
4134
|
const iconClasses = `mr-3 h-5 w-5 shrink-0 transition-all duration-300 ease-in-out${isActive ? " text-primary" : ""}`;
|
|
4135
|
+
if (disabled) {
|
|
4136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4137
|
+
"span",
|
|
4138
|
+
{
|
|
4139
|
+
"data-tooltip-id": "global-tooltip",
|
|
4140
|
+
"data-tooltip-content": title || "Not available",
|
|
4141
|
+
"aria-disabled": "true",
|
|
4142
|
+
className: commonClasses,
|
|
4143
|
+
children: [
|
|
4144
|
+
Icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4145
|
+
Icon,
|
|
4146
|
+
{
|
|
4147
|
+
className: iconClasses,
|
|
4148
|
+
"aria-hidden": "true"
|
|
4149
|
+
}
|
|
4150
|
+
),
|
|
4151
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
4152
|
+
]
|
|
4153
|
+
}
|
|
4154
|
+
);
|
|
4155
|
+
}
|
|
4134
4156
|
if (isButton) {
|
|
4135
4157
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4136
4158
|
"button",
|