@gamecp/ui 0.1.26 → 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.d.mts CHANGED
@@ -265,8 +265,9 @@ interface SwitchProps {
265
265
  className?: string;
266
266
  size?: 'sm' | 'md' | 'lg';
267
267
  variant?: SwitchVariant;
268
+ labelPosition?: 'left' | 'right';
268
269
  }
269
- declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
271
 
271
272
  interface SmartDropdownProps {
272
273
  isOpen: boolean;
package/dist/index.d.ts CHANGED
@@ -265,8 +265,9 @@ interface SwitchProps {
265
265
  className?: string;
266
266
  size?: 'sm' | 'md' | 'lg';
267
267
  variant?: SwitchVariant;
268
+ labelPosition?: 'left' | 'right';
268
269
  }
269
- declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
271
 
271
272
  interface SmartDropdownProps {
272
273
  isOpen: boolean;
package/dist/index.js CHANGED
@@ -1932,7 +1932,7 @@ function SkeletonGamesTable({
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
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 hover:text-muted-foreground", 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/50", 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: [
@@ -2671,7 +2671,8 @@ function Switch({
2671
2671
  description,
2672
2672
  className = "",
2673
2673
  size = "md",
2674
- variant = "default"
2674
+ variant = "default",
2675
+ labelPosition = "right"
2675
2676
  }) {
2676
2677
  const toggle = () => {
2677
2678
  if (!disabled) {
@@ -2686,38 +2687,43 @@ function Switch({
2686
2687
  const variants = {
2687
2688
  default: {
2688
2689
  checked: "bg-primary",
2689
- unchecked: "bg-muted",
2690
+ unchecked: "bg-input",
2690
2691
  ring: "focus:ring-primary"
2691
2692
  },
2692
2693
  success: {
2693
2694
  checked: "bg-success",
2694
- unchecked: "bg-muted",
2695
+ unchecked: "bg-input",
2695
2696
  ring: "focus:ring-success"
2696
2697
  },
2697
2698
  danger: {
2698
2699
  checked: "bg-destructive",
2699
- unchecked: "bg-muted",
2700
+ unchecked: "bg-input",
2700
2701
  ring: "focus:ring-destructive"
2701
2702
  },
2702
2703
  warning: {
2703
2704
  checked: "bg-warning",
2704
- unchecked: "bg-muted",
2705
+ unchecked: "bg-input",
2705
2706
  ring: "focus:ring-warning"
2706
2707
  },
2707
2708
  info: {
2708
2709
  checked: "bg-info",
2709
- unchecked: "bg-muted",
2710
+ unchecked: "bg-input",
2710
2711
  ring: "focus:ring-info"
2711
2712
  },
2712
2713
  embedded: {
2713
2714
  checked: "bg-success",
2714
- unchecked: "bg-gray-300 dark:bg-gray-600",
2715
+ unchecked: "bg-input",
2715
2716
  ring: "focus:ring-success"
2716
2717
  }
2717
2718
  };
2718
2719
  const currentSize = sizes[size];
2719
2720
  const currentVariant = variants[variant];
2720
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start ${className}`, children: [
2721
+ const LabelContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${labelPosition === "left" ? "mr-3 flex-1 text-left" : "ml-3 w-fit"} flex flex-col justify-center gap-1`, children: [
2722
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
2723
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground leading-snug", children: description })
2724
+ ] });
2725
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center ${labelPosition === "left" ? "justify-between" : ""} ${className}`, children: [
2726
+ labelPosition === "left" && (label || description) && LabelContent,
2721
2727
  /* @__PURE__ */ jsxRuntime.jsx(
2722
2728
  "button",
2723
2729
  {
@@ -2747,10 +2753,7 @@ function Switch({
2747
2753
  )
2748
2754
  }
2749
2755
  ),
2750
- (label || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-3 text-sm leading-6", children: [
2751
- label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
2752
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: description })
2753
- ] })
2756
+ labelPosition === "right" && (label || description) && LabelContent
2754
2757
  ] });
2755
2758
  }
2756
2759
  var variantClasses4 = {