@gamecp/ui 0.1.25 → 0.1.26

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
@@ -200,7 +200,7 @@ declare function Grid({ children, cols, gap, className, }: GridProps): react_jsx
200
200
  interface InfoBoxProps {
201
201
  title: string;
202
202
  children: React__default.ReactNode;
203
- variant?: 'default' | 'warning' | 'info' | 'success';
203
+ variant?: 'default' | 'warning' | 'info' | 'success' | 'danger';
204
204
  className?: string;
205
205
  }
206
206
  declare function InfoBox({ title, children, variant, className }: InfoBoxProps): react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -200,7 +200,7 @@ declare function Grid({ children, cols, gap, className, }: GridProps): react_jsx
200
200
  interface InfoBoxProps {
201
201
  title: string;
202
202
  children: React__default.ReactNode;
203
- variant?: 'default' | 'warning' | 'info' | 'success';
203
+ variant?: 'default' | 'warning' | 'info' | 'success' | 'danger';
204
204
  className?: string;
205
205
  }
206
206
  declare function InfoBox({ title, children, variant, className }: InfoBoxProps): react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -474,7 +474,7 @@ function Modal({
474
474
  }
475
475
  document.removeEventListener("keydown", handleTab);
476
476
  document.removeEventListener("keydown", handleEsc);
477
- document.body.style.overflow = "unset";
477
+ document.body.style.overflow = "";
478
478
  if (!isOpen && previousActiveElementRef.current) {
479
479
  previousActiveElementRef.current.focus();
480
480
  }
@@ -1307,7 +1307,7 @@ function SmartSelect({
1307
1307
  e.stopPropagation();
1308
1308
  handleSelect(option.value);
1309
1309
  },
1310
- className: `w-full px-3 py-2 text-left text-sm hover:bg-accent flex items-center justify-between min-h-[40px] transition-colors ${selectedValues.includes(option.value) ? "bg-accent border-l-2 border-l-ring" : index === focusedIndex ? "bg-muted ring-2 ring-ring" : ""}`,
1310
+ className: `w-full px-3 py-2 text-left text-sm hover:bg-accent flex items-center justify-between min-h-[40px] transition-colors ${selectedValues.includes(option.value) ? "bg-accent border-l-2 border-l-ring" : index === focusedIndex ? "bg-muted text-muted-foreground ring-2 ring-ring" : ""}`,
1311
1311
  children: [
1312
1312
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
1313
1313
  option.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: option.icon }),
@@ -1930,9 +1930,9 @@ function SkeletonGamesTable({
1930
1930
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Mode" }),
1931
1931
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Status" }),
1932
1932
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Created" }),
1933
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 rounded-md bg-muted backdrop-blur-sm text-center text-xs font-medium text-muted-foreground uppercase tracking-wider sticky right-0", children: "Actions" })
1933
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 rounded-md backdrop-blur-sm text-center text-xs font-medium text-muted-foreground uppercase tracking-wider sticky right-0", children: "Actions" })
1934
1934
  ] }) }),
1935
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "table-body-card", children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-muted", children: [
1935
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "table-body-card", children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-muted hover:text-muted-foreground", children: [
1936
1936
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
1937
1937
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 h-10 w-10", children: /* @__PURE__ */ jsxRuntime.jsx(SkeletonItem, { width: "w-10", height: "h-10", rounded: true }) }),
1938
1938
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 min-w-0 flex-1", children: [
@@ -2538,17 +2538,12 @@ function Grid({
2538
2538
  };
2539
2539
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${colClasses[cols]} ${gapClasses[gap]} ${className}`, children });
2540
2540
  }
2541
- var variantStyles = {
2542
- default: "bg-accent border-border text-muted-foreground",
2543
- warning: "bg-amber/10 border-amber text-amber",
2544
- info: "bg-info/10 border-info text-info",
2545
- success: "bg-success/10 border-success text-success"
2546
- };
2547
- var titleStyles = {
2548
- default: "text-foreground",
2549
- warning: "text-amber",
2550
- info: "text-info",
2551
- success: "text-success"
2541
+ var variantConfig = {
2542
+ default: { borderAccent: "gray", titleColor: "text-foreground" },
2543
+ warning: { borderAccent: "amber", titleColor: "text-amber" },
2544
+ info: { borderAccent: "info", titleColor: "text-info" },
2545
+ success: { borderAccent: "success", titleColor: "text-success" },
2546
+ danger: { borderAccent: "danger", titleColor: "text-danger" }
2552
2547
  };
2553
2548
  function InfoBox({
2554
2549
  title,
@@ -2556,10 +2551,19 @@ function InfoBox({
2556
2551
  variant = "default",
2557
2552
  className = ""
2558
2553
  }) {
2559
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `border rounded-md p-4 ${variantStyles[variant]} ${className}`, children: [
2560
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium mb-2 ${titleStyles[variant]}`, children: title }),
2561
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm space-y-1 [&>ul]:list-disc [&>ul]:list-outside [&>ul]:pl-3 [&>ol]:list-decimal [&>ol]:list-outside [&>ol]:pl-4", children })
2562
- ] });
2554
+ const config = variantConfig[variant] || variantConfig.default;
2555
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2556
+ Card,
2557
+ {
2558
+ borderAccent: config.borderAccent,
2559
+ padding: "md",
2560
+ className,
2561
+ children: [
2562
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium mb-2 ${config.titleColor}`, children: title }),
2563
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground space-y-1 [&>ul]:list-disc [&>ul]:list-outside [&>ul]:pl-3 [&>ol]:list-decimal [&>ol]:list-outside [&>ol]:pl-4", children })
2564
+ ]
2565
+ }
2566
+ );
2563
2567
  }
2564
2568
  var variantClasses3 = {
2565
2569
  default: "text-foreground hover:text-primary",
@@ -2831,7 +2835,7 @@ function DataTableRow({
2831
2835
  onClick,
2832
2836
  hover = true
2833
2837
  }) {
2834
- const baseClasses = "hover:bg-muted transition-colors duration-150";
2838
+ const baseClasses = "hover:bg-muted/50 transition-colors duration-150";
2835
2839
  const clickableClasses = onClick ? "cursor-pointer" : "";
2836
2840
  const hoverClasses = hover ? baseClasses : "";
2837
2841
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2952,7 +2956,7 @@ function DataTableActions({
2952
2956
  enhanced = false
2953
2957
  }) {
2954
2958
  const baseClasses = "flex items-center justify-end space-x-2 dt-actions";
2955
- const enhancedClasses = enhanced ? "px-2 py-1 rounded-md bg-card backdrop-blur-sm" : "";
2959
+ const enhancedClasses = enhanced ? "px-2 py-1" : "";
2956
2960
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${baseClasses} ${enhancedClasses} ${className}`, children });
2957
2961
  }
2958
2962
  function StickyActionsColumn({
@@ -3169,25 +3173,25 @@ function ActionButton({
3169
3173
  return {
3170
3174
  icon: fill ? ri.RiStopCircleFill : ri.RiStopCircleLine,
3171
3175
  label: "Deactivate",
3172
- className: "bg-slate-50 text-slate-600 hover:bg-slate-100 hover:text-slate-700 border border-slate-200 transition-all duration-300 ease-in-out"
3176
+ className: "bg-slate-50 text-slate-600 hover:bg-slate-100 hover:text-slate-700 border border-slate-200 transition-all duration-300 ease-in-out"
3173
3177
  };
3174
3178
  case "activate":
3175
3179
  return {
3176
3180
  icon: fill ? ri.RiPlayCircleFill : ri.RiPlayCircleLine,
3177
3181
  label: "Activate",
3178
- className: "bg-emerald/10 text-emerald hover:bg-emerald/20 hover:text-emerald-700 border border-emerald-200 transition-all duration-300 ease-in-out"
3182
+ className: "bg-emerald/10 text-emerald hover:bg-emerald/20 hover:text-emerald-700 border border-emerald-200 transition-all duration-300 ease-in-out"
3179
3183
  };
3180
3184
  case "view":
3181
3185
  return {
3182
3186
  icon: fill ? ri.RiEyeFill : ri.RiEyeLine,
3183
3187
  label: "View",
3184
- className: "bg-muted text-muted-foreground hover:bg-muted hover:text-foreground border border-border transition-all duration-300 ease-in-out"
3188
+ className: "bg-muted text-muted-foreground hover:bg-muted hover:text-foreground border border-border transition-all duration-300 ease-in-out"
3185
3189
  };
3186
3190
  case "metrics":
3187
3191
  return {
3188
3192
  icon: fill ? ri.RiBarChartFill : ri.RiBarChartLine,
3189
3193
  label: "Metrics",
3190
- className: "bg-purple/10 text-purple-600 hover:bg-purple-100 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3194
+ className: "bg-purple/10 text-purple hover:bg-purple-100 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3191
3195
  };
3192
3196
  case "start":
3193
3197
  return {
@@ -3205,7 +3209,7 @@ function ActionButton({
3205
3209
  return {
3206
3210
  icon: fill ? ri.RiRestartFill : ri.RiRestartLine,
3207
3211
  label: "Restart",
3208
- className: "bg-orange/10 text-orange hover:bg-orange/20 hover:text-orange-700 border border-orange/30 transition-all duration-300 ease-in-out"
3212
+ className: "bg-orange/10 text-orange hover:bg-orange/20 hover:text-orange-700 border border-orange/30 transition-all duration-300 ease-in-out"
3209
3213
  };
3210
3214
  case "pause":
3211
3215
  return {
@@ -3217,23 +3221,23 @@ function ActionButton({
3217
3221
  return {
3218
3222
  icon: fill ? ri.RiFileCopyFill : ri.RiFileCopyLine,
3219
3223
  label: "Clone",
3220
- className: "bg-indigo/10 text-indigo hover:bg-indigo/20 hover:text-indigo-700 border border-indigo-200 transition-all duration-300 ease-in-out"
3224
+ className: "bg-indigo/10 text-indigo hover:bg-indigo/20 hover:text-indigo-700 border border-indigo-200 transition-all duration-300 ease-in-out"
3221
3225
  };
3222
3226
  default:
3223
3227
  return null;
3224
3228
  }
3225
3229
  };
3226
- const variantConfig = getVariantConfig();
3230
+ const variantConfig2 = getVariantConfig();
3227
3231
  const variantClasses5 = {
3228
3232
  primary: "btn-primary",
3229
3233
  secondary: "btn-secondary",
3230
3234
  danger: "btn-danger",
3231
3235
  success: "bg-success/10 text-success hover:bg-success/20 hover:text-success border border-success transition-all duration-300 ease-in-out",
3232
3236
  warning: "bg-amber/10 text-amber hover:bg-amber/20 hover:text-amber border border-amber transition-all duration-300 ease-in-out",
3233
- info: "bg-muted text-muted-foreground hover:bg-primary hover:text-primary-foreground border border-ring transition-all duration-300 ease-in-out",
3234
- metrics: "bg-purple/10 text-purple-600 hover:bg-purple-100 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3237
+ info: "bg-muted text-muted-foreground hover:bg-primary hover:text-primary-foreground border border-ring transition-all duration-300 ease-in-out",
3238
+ metrics: "bg-purple/10 text-purple hover:bg-purple/20 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3235
3239
  };
3236
- let variantClass = variantConfig ? variantConfig.className : variant ? variantClasses5[variant] : "";
3240
+ let variantClass = variantConfig2 ? variantConfig2.className : variant ? variantClasses5[variant] : "";
3237
3241
  if (terminalMode && variantClass) {
3238
3242
  const hoverMatch = variantClass.match(/hover:text-(\w+)-(\d+)/);
3239
3243
  const hoverColor = hoverMatch ? `hover:text-${hoverMatch[1]}-${hoverMatch[2]}` : "hover:text-muted-foreground";
@@ -3260,13 +3264,13 @@ function ActionButton({
3260
3264
  }
3261
3265
  )
3262
3266
  }
3263
- ) : (variantConfig?.icon || IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(
3267
+ ) : (variantConfig2?.icon || IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(
3264
3268
  "div",
3265
3269
  {
3266
3270
  className: `${iconSizes[size]} flex items-center justify-center flex-shrink-0`,
3267
3271
  "aria-hidden": "true",
3268
- children: variantConfig?.icon ? /* @__PURE__ */ jsxRuntime.jsx(
3269
- variantConfig.icon,
3272
+ children: variantConfig2?.icon ? /* @__PURE__ */ jsxRuntime.jsx(
3273
+ variantConfig2.icon,
3270
3274
  {
3271
3275
  className: "w-full h-full",
3272
3276
  "aria-hidden": "true"
@@ -3274,11 +3278,11 @@ function ActionButton({
3274
3278
  ) : IconComponent ? /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "w-full h-full", "aria-hidden": "true" }) : null
3275
3279
  }
3276
3280
  ),
3277
- !iconOnly && (restProps.children ? restProps.children : (variantConfig?.label || label) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: variantConfig?.label || label }))
3281
+ !iconOnly && (restProps.children ? restProps.children : (variantConfig2?.label || label) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: variantConfig2?.label || label }))
3278
3282
  ] });
3279
- const accessibleLabel = title || (iconOnly ? variantConfig?.label || label : void 0);
3280
- const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig?.label || label || "Action button" : accessibleLabel;
3281
- const tooltipContent = title || (iconOnly ? variantConfig?.label || label : void 0);
3283
+ const accessibleLabel = title || (iconOnly ? variantConfig2?.label || label : void 0);
3284
+ const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig2?.label || label || "Action button" : accessibleLabel;
3285
+ const tooltipContent = title || (iconOnly ? variantConfig2?.label || label : void 0);
3282
3286
  const buttonClassName = `
3283
3287
 
3284
3288
  ${terminalMode ? "btn-terminal" : `btn ${variantClass} ${paddingClasses3} ${heightClasses[size]} ${className} ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`}`;