@gamecp/ui 0.1.25 → 0.1.27

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.mjs CHANGED
@@ -467,7 +467,7 @@ function Modal({
467
467
  }
468
468
  document.removeEventListener("keydown", handleTab);
469
469
  document.removeEventListener("keydown", handleEsc);
470
- document.body.style.overflow = "unset";
470
+ document.body.style.overflow = "";
471
471
  if (!isOpen && previousActiveElementRef.current) {
472
472
  previousActiveElementRef.current.focus();
473
473
  }
@@ -1300,7 +1300,7 @@ function SmartSelect({
1300
1300
  e.stopPropagation();
1301
1301
  handleSelect(option.value);
1302
1302
  },
1303
- 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" : ""}`,
1303
+ 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" : ""}`,
1304
1304
  children: [
1305
1305
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
1306
1306
  option.icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: option.icon }),
@@ -1923,9 +1923,9 @@ function SkeletonGamesTable({
1923
1923
  /* @__PURE__ */ jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Mode" }),
1924
1924
  /* @__PURE__ */ jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Status" }),
1925
1925
  /* @__PURE__ */ jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Created" }),
1926
- /* @__PURE__ */ 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" })
1926
+ /* @__PURE__ */ 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" })
1927
1927
  ] }) }),
1928
- /* @__PURE__ */ jsx("tbody", { className: "table-body-card", children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-muted", children: [
1928
+ /* @__PURE__ */ jsx("tbody", { className: "table-body-card", children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-muted/50", children: [
1929
1929
  /* @__PURE__ */ jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
1930
1930
  /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 h-10 w-10", children: /* @__PURE__ */ jsx(SkeletonItem, { width: "w-10", height: "h-10", rounded: true }) }),
1931
1931
  /* @__PURE__ */ jsxs("div", { className: "ml-4 min-w-0 flex-1", children: [
@@ -2531,17 +2531,12 @@ function Grid({
2531
2531
  };
2532
2532
  return /* @__PURE__ */ jsx("div", { className: `grid ${colClasses[cols]} ${gapClasses[gap]} ${className}`, children });
2533
2533
  }
2534
- var variantStyles = {
2535
- default: "bg-accent border-border text-muted-foreground",
2536
- warning: "bg-amber/10 border-amber text-amber",
2537
- info: "bg-info/10 border-info text-info",
2538
- success: "bg-success/10 border-success text-success"
2539
- };
2540
- var titleStyles = {
2541
- default: "text-foreground",
2542
- warning: "text-amber",
2543
- info: "text-info",
2544
- success: "text-success"
2534
+ var variantConfig = {
2535
+ default: { borderAccent: "gray", titleColor: "text-foreground" },
2536
+ warning: { borderAccent: "amber", titleColor: "text-amber" },
2537
+ info: { borderAccent: "info", titleColor: "text-info" },
2538
+ success: { borderAccent: "success", titleColor: "text-success" },
2539
+ danger: { borderAccent: "danger", titleColor: "text-danger" }
2545
2540
  };
2546
2541
  function InfoBox({
2547
2542
  title,
@@ -2549,10 +2544,19 @@ function InfoBox({
2549
2544
  variant = "default",
2550
2545
  className = ""
2551
2546
  }) {
2552
- return /* @__PURE__ */ jsxs("div", { className: `border rounded-md p-4 ${variantStyles[variant]} ${className}`, children: [
2553
- /* @__PURE__ */ jsx("h4", { className: `font-medium mb-2 ${titleStyles[variant]}`, children: title }),
2554
- /* @__PURE__ */ 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 })
2555
- ] });
2547
+ const config = variantConfig[variant] || variantConfig.default;
2548
+ return /* @__PURE__ */ jsxs(
2549
+ Card,
2550
+ {
2551
+ borderAccent: config.borderAccent,
2552
+ padding: "md",
2553
+ className,
2554
+ children: [
2555
+ /* @__PURE__ */ jsx("h4", { className: `font-medium mb-2 ${config.titleColor}`, children: title }),
2556
+ /* @__PURE__ */ 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 })
2557
+ ]
2558
+ }
2559
+ );
2556
2560
  }
2557
2561
  var variantClasses3 = {
2558
2562
  default: "text-foreground hover:text-primary",
@@ -2660,7 +2664,8 @@ function Switch({
2660
2664
  description,
2661
2665
  className = "",
2662
2666
  size = "md",
2663
- variant = "default"
2667
+ variant = "default",
2668
+ labelPosition = "right"
2664
2669
  }) {
2665
2670
  const toggle = () => {
2666
2671
  if (!disabled) {
@@ -2675,38 +2680,43 @@ function Switch({
2675
2680
  const variants = {
2676
2681
  default: {
2677
2682
  checked: "bg-primary",
2678
- unchecked: "bg-muted",
2683
+ unchecked: "bg-input",
2679
2684
  ring: "focus:ring-primary"
2680
2685
  },
2681
2686
  success: {
2682
2687
  checked: "bg-success",
2683
- unchecked: "bg-muted",
2688
+ unchecked: "bg-input",
2684
2689
  ring: "focus:ring-success"
2685
2690
  },
2686
2691
  danger: {
2687
2692
  checked: "bg-destructive",
2688
- unchecked: "bg-muted",
2693
+ unchecked: "bg-input",
2689
2694
  ring: "focus:ring-destructive"
2690
2695
  },
2691
2696
  warning: {
2692
2697
  checked: "bg-warning",
2693
- unchecked: "bg-muted",
2698
+ unchecked: "bg-input",
2694
2699
  ring: "focus:ring-warning"
2695
2700
  },
2696
2701
  info: {
2697
2702
  checked: "bg-info",
2698
- unchecked: "bg-muted",
2703
+ unchecked: "bg-input",
2699
2704
  ring: "focus:ring-info"
2700
2705
  },
2701
2706
  embedded: {
2702
2707
  checked: "bg-success",
2703
- unchecked: "bg-gray-300 dark:bg-gray-600",
2708
+ unchecked: "bg-input",
2704
2709
  ring: "focus:ring-success"
2705
2710
  }
2706
2711
  };
2707
2712
  const currentSize = sizes[size];
2708
2713
  const currentVariant = variants[variant];
2709
- return /* @__PURE__ */ jsxs("div", { className: `flex items-start ${className}`, children: [
2714
+ const LabelContent = /* @__PURE__ */ jsxs("div", { className: `${labelPosition === "left" ? "mr-3 flex-1 text-left" : "ml-3 w-fit"} flex flex-col justify-center gap-1`, children: [
2715
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
2716
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground leading-snug", children: description })
2717
+ ] });
2718
+ return /* @__PURE__ */ jsxs("div", { className: `flex items-center ${labelPosition === "left" ? "justify-between" : ""} ${className}`, children: [
2719
+ labelPosition === "left" && (label || description) && LabelContent,
2710
2720
  /* @__PURE__ */ jsx(
2711
2721
  "button",
2712
2722
  {
@@ -2736,10 +2746,7 @@ function Switch({
2736
2746
  )
2737
2747
  }
2738
2748
  ),
2739
- (label || description) && /* @__PURE__ */ jsxs("div", { className: "ml-3 text-sm leading-6", children: [
2740
- label && /* @__PURE__ */ jsx("label", { className: "font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
2741
- description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: description })
2742
- ] })
2749
+ labelPosition === "right" && (label || description) && LabelContent
2743
2750
  ] });
2744
2751
  }
2745
2752
  var variantClasses4 = {
@@ -2824,7 +2831,7 @@ function DataTableRow({
2824
2831
  onClick,
2825
2832
  hover = true
2826
2833
  }) {
2827
- const baseClasses = "hover:bg-muted transition-colors duration-150";
2834
+ const baseClasses = "hover:bg-muted/50 transition-colors duration-150";
2828
2835
  const clickableClasses = onClick ? "cursor-pointer" : "";
2829
2836
  const hoverClasses = hover ? baseClasses : "";
2830
2837
  return /* @__PURE__ */ jsx(
@@ -2945,7 +2952,7 @@ function DataTableActions({
2945
2952
  enhanced = false
2946
2953
  }) {
2947
2954
  const baseClasses = "flex items-center justify-end space-x-2 dt-actions";
2948
- const enhancedClasses = enhanced ? "px-2 py-1 rounded-md bg-card backdrop-blur-sm" : "";
2955
+ const enhancedClasses = enhanced ? "px-2 py-1" : "";
2949
2956
  return /* @__PURE__ */ jsx("div", { className: `${baseClasses} ${enhancedClasses} ${className}`, children });
2950
2957
  }
2951
2958
  function StickyActionsColumn({
@@ -3162,25 +3169,25 @@ function ActionButton({
3162
3169
  return {
3163
3170
  icon: fill ? RiStopCircleFill : RiStopCircleLine,
3164
3171
  label: "Deactivate",
3165
- 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"
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"
3166
3173
  };
3167
3174
  case "activate":
3168
3175
  return {
3169
3176
  icon: fill ? RiPlayCircleFill : RiPlayCircleLine,
3170
3177
  label: "Activate",
3171
- 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"
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"
3172
3179
  };
3173
3180
  case "view":
3174
3181
  return {
3175
3182
  icon: fill ? RiEyeFill : RiEyeLine,
3176
3183
  label: "View",
3177
- className: "bg-muted text-muted-foreground hover:bg-muted hover:text-foreground border border-border transition-all duration-300 ease-in-out"
3184
+ className: "bg-muted text-muted-foreground hover:bg-muted hover:text-foreground border border-border transition-all duration-300 ease-in-out"
3178
3185
  };
3179
3186
  case "metrics":
3180
3187
  return {
3181
3188
  icon: fill ? RiBarChartFill : RiBarChartLine,
3182
3189
  label: "Metrics",
3183
- 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"
3190
+ 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"
3184
3191
  };
3185
3192
  case "start":
3186
3193
  return {
@@ -3198,7 +3205,7 @@ function ActionButton({
3198
3205
  return {
3199
3206
  icon: fill ? RiRestartFill : RiRestartLine,
3200
3207
  label: "Restart",
3201
- 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"
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"
3202
3209
  };
3203
3210
  case "pause":
3204
3211
  return {
@@ -3210,23 +3217,23 @@ function ActionButton({
3210
3217
  return {
3211
3218
  icon: fill ? RiFileCopyFill : RiFileCopyLine,
3212
3219
  label: "Clone",
3213
- 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"
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"
3214
3221
  };
3215
3222
  default:
3216
3223
  return null;
3217
3224
  }
3218
3225
  };
3219
- const variantConfig = getVariantConfig();
3226
+ const variantConfig2 = getVariantConfig();
3220
3227
  const variantClasses5 = {
3221
3228
  primary: "btn-primary",
3222
3229
  secondary: "btn-secondary",
3223
3230
  danger: "btn-danger",
3224
3231
  success: "bg-success/10 text-success hover:bg-success/20 hover:text-success border border-success transition-all duration-300 ease-in-out",
3225
3232
  warning: "bg-amber/10 text-amber hover:bg-amber/20 hover:text-amber border border-amber transition-all duration-300 ease-in-out",
3226
- info: "bg-muted text-muted-foreground hover:bg-primary hover:text-primary-foreground border border-ring transition-all duration-300 ease-in-out",
3227
- 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"
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 hover:bg-purple/20 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3228
3235
  };
3229
- let variantClass = variantConfig ? variantConfig.className : variant ? variantClasses5[variant] : "";
3236
+ let variantClass = variantConfig2 ? variantConfig2.className : variant ? variantClasses5[variant] : "";
3230
3237
  if (terminalMode && variantClass) {
3231
3238
  const hoverMatch = variantClass.match(/hover:text-(\w+)-(\d+)/);
3232
3239
  const hoverColor = hoverMatch ? `hover:text-${hoverMatch[1]}-${hoverMatch[2]}` : "hover:text-muted-foreground";
@@ -3253,13 +3260,13 @@ function ActionButton({
3253
3260
  }
3254
3261
  )
3255
3262
  }
3256
- ) : (variantConfig?.icon || IconComponent) && /* @__PURE__ */ jsx(
3263
+ ) : (variantConfig2?.icon || IconComponent) && /* @__PURE__ */ jsx(
3257
3264
  "div",
3258
3265
  {
3259
3266
  className: `${iconSizes[size]} flex items-center justify-center flex-shrink-0`,
3260
3267
  "aria-hidden": "true",
3261
- children: variantConfig?.icon ? /* @__PURE__ */ jsx(
3262
- variantConfig.icon,
3268
+ children: variantConfig2?.icon ? /* @__PURE__ */ jsx(
3269
+ variantConfig2.icon,
3263
3270
  {
3264
3271
  className: "w-full h-full",
3265
3272
  "aria-hidden": "true"
@@ -3267,11 +3274,11 @@ function ActionButton({
3267
3274
  ) : IconComponent ? /* @__PURE__ */ jsx(IconComponent, { className: "w-full h-full", "aria-hidden": "true" }) : null
3268
3275
  }
3269
3276
  ),
3270
- !iconOnly && (restProps.children ? restProps.children : (variantConfig?.label || label) && /* @__PURE__ */ jsx("span", { className: "flex items-center", children: variantConfig?.label || label }))
3277
+ !iconOnly && (restProps.children ? restProps.children : (variantConfig2?.label || label) && /* @__PURE__ */ jsx("span", { className: "flex items-center", children: variantConfig2?.label || label }))
3271
3278
  ] });
3272
- const accessibleLabel = title || (iconOnly ? variantConfig?.label || label : void 0);
3273
- const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig?.label || label || "Action button" : accessibleLabel;
3274
- const tooltipContent = title || (iconOnly ? variantConfig?.label || label : void 0);
3279
+ const accessibleLabel = title || (iconOnly ? variantConfig2?.label || label : void 0);
3280
+ const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig2?.label || label || "Action button" : accessibleLabel;
3281
+ const tooltipContent = title || (iconOnly ? variantConfig2?.label || label : void 0);
3275
3282
  const buttonClassName = `
3276
3283
 
3277
3284
  ${terminalMode ? "btn-terminal" : `btn ${variantClass} ${paddingClasses3} ${heightClasses[size]} ${className} ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`}`;