@gamecp/ui 0.1.41 → 0.1.42

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 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
@@ -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:pointer-events-none disabled:opacity-50 ${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
+ 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",