@gamecp/ui 0.1.21 → 0.1.23

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
@@ -8,27 +8,27 @@ import { Tooltip } from 'react-tooltip';
8
8
 
9
9
  // src/Badge.tsx
10
10
  var badgeVariants = {
11
- default: "bg-muted text-foreground border-border",
12
- primary: "bg-primary-100 text-primary-800 border-primary-200",
13
- secondary: "bg-muted text-foreground border-border",
14
- success: "bg-success text-success-dark border-success-light",
15
- warning: "bg-amber/20 text-yellow-800 border-amber/30",
16
- error: "bg-danger/20 text-danger border-danger/30",
17
- info: "bg-muted text-muted-foreground border-ring",
18
- gray: "bg-muted text-foreground border-border",
19
- purple: "bg-purple-100 text-purple-800 border-purple-200",
20
- pink: "bg-pink/20 text-pink border-pink-200",
21
- indigo: "bg-indigo/20 text-indigo border-indigo-200",
22
- orange: "bg-orange/20 text-orange-800 border-orange/30",
23
- teal: "bg-teal-100 text-teal-800 border-teal-200",
24
- cyan: "bg-cyan/20 text-cyan-800 border-cyan-200",
25
- lime: "bg-lime-100 text-lime-800 border-lime-200",
26
- emerald: "bg-emerald/20 text-emerald-800 border-emerald-200",
27
- rose: "bg-rose-100 text-rose-800 border-rose-200",
28
- sky: "bg-sky-100 text-sky-800 border-sky-200",
29
- violet: "bg-violet-100 text-violet-800 border-violet-200",
30
- fuchsia: "bg-fuchsia-100 text-fuchsia-800 border-fuchsia-200",
31
- amber: "bg-amber/20 text-amber-800 border-amber/30"
11
+ default: "bg-muted text-muted-foreground border-border",
12
+ primary: "bg-primary/10 text-primary border-primary/30",
13
+ secondary: "bg-muted text-muted-foreground border-border",
14
+ success: "bg-success/10 text-success border-success/30",
15
+ warning: "bg-amber/10 text-amber border-amber/30",
16
+ error: "bg-danger/10 text-danger border-danger/30",
17
+ info: "bg-info/10 text-info border-info/30",
18
+ gray: "bg-gray/10 text-gray border-gray/30",
19
+ purple: "bg-purple/10 text-purple border-purple/30",
20
+ pink: "bg-pink/10 text-pink border-pink/30",
21
+ indigo: "bg-indigo/10 text-indigo border-indigo/30",
22
+ orange: "bg-orange/10 text-orange border-orange/30",
23
+ teal: "bg-teal/10 text-teal border-teal/30",
24
+ cyan: "bg-cyan/10 text-cyan border-cyan/30",
25
+ lime: "bg-lime/10 text-lime border-lime/30",
26
+ emerald: "bg-emerald/10 text-emerald border-emerald/30",
27
+ rose: "bg-rose/10 text-rose border-rose/30",
28
+ sky: "bg-sky/10 text-sky border-sky/30",
29
+ violet: "bg-violet/10 text-violet border-violet/30",
30
+ fuchsia: "bg-fuchsia/10 text-fuchsia border-fuchsia/30",
31
+ amber: "bg-amber/10 text-amber border-amber/30"
32
32
  };
33
33
  var badgeSizes = {
34
34
  sm: "px-2 py-0.5 text-xs",
@@ -63,7 +63,7 @@ var variantClasses = {
63
63
  primary: "bg-primary text-primary-foreground hover:bg-primary/90 border-transparent",
64
64
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
65
65
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 border-transparent",
66
- danger: "bg-danger text-white hover:bg-danger border-transparent",
66
+ danger: "bg-danger text-danger-foreground hover:bg-danger/90 border-transparent",
67
67
  ghost: "bg-transparent hover:bg-muted hover:text-foreground border-transparent",
68
68
  link: "bg-transparent text-primary underline-offset-4 hover:underline border-transparent p-0",
69
69
  outline: "bg-transparent border-border hover:bg-muted hover:text-foreground"
@@ -2657,7 +2657,8 @@ function Switch({
2657
2657
  label,
2658
2658
  description,
2659
2659
  className = "",
2660
- size = "md"
2660
+ size = "md",
2661
+ variant = "default"
2661
2662
  }) {
2662
2663
  const toggle = () => {
2663
2664
  if (!disabled) {
@@ -2669,7 +2670,40 @@ function Switch({
2669
2670
  md: { track: "w-11 h-6", thumb: "w-5 h-5", translate: "translate-x-5" },
2670
2671
  lg: { track: "w-14 h-8", thumb: "w-7 h-7", translate: "translate-x-6" }
2671
2672
  };
2673
+ const variants = {
2674
+ default: {
2675
+ checked: "bg-primary",
2676
+ unchecked: "bg-muted",
2677
+ ring: "focus:ring-primary"
2678
+ },
2679
+ success: {
2680
+ checked: "bg-success",
2681
+ unchecked: "bg-muted",
2682
+ ring: "focus:ring-success"
2683
+ },
2684
+ danger: {
2685
+ checked: "bg-destructive",
2686
+ unchecked: "bg-muted",
2687
+ ring: "focus:ring-destructive"
2688
+ },
2689
+ warning: {
2690
+ checked: "bg-warning",
2691
+ unchecked: "bg-muted",
2692
+ ring: "focus:ring-warning"
2693
+ },
2694
+ info: {
2695
+ checked: "bg-info",
2696
+ unchecked: "bg-muted",
2697
+ ring: "focus:ring-info"
2698
+ },
2699
+ embedded: {
2700
+ checked: "bg-success",
2701
+ unchecked: "bg-gray-300 dark:bg-gray-600",
2702
+ ring: "focus:ring-success"
2703
+ }
2704
+ };
2672
2705
  const currentSize = sizes[size];
2706
+ const currentVariant = variants[variant];
2673
2707
  return /* @__PURE__ */ jsxs("div", { className: `flex items-start ${className}`, children: [
2674
2708
  /* @__PURE__ */ jsx(
2675
2709
  "button",
@@ -2681,8 +2715,8 @@ function Switch({
2681
2715
  onClick: toggle,
2682
2716
  className: `
2683
2717
  relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
2684
- transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
2685
- ${checked ? "bg-primary" : "bg-muted"}
2718
+ transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 ${currentVariant.ring} focus:ring-offset-2
2719
+ ${checked ? currentVariant.checked : currentVariant.unchecked}
2686
2720
  ${disabled ? "opacity-50 cursor-not-allowed" : ""}
2687
2721
  ${currentSize.track}
2688
2722
  `,
@@ -2942,8 +2976,8 @@ function SharedTooltip({
2942
2976
  offset,
2943
2977
  delayShow,
2944
2978
  delayHide,
2945
- className: `!bg-popover !text-popover-foreground !border !border-border !shadow-md !text-xs !px-2 !py-1 !rounded-md z-50 ${className}`,
2946
- style,
2979
+ className: `!bg-popover !text-popover-foreground !border !border-border !shadow-md !text-xs !px-2 !py-1 !rounded-md ${className}`,
2980
+ style: { zIndex: 9999, ...style },
2947
2981
  positionStrategy: "fixed",
2948
2982
  render: children ? () => /* @__PURE__ */ jsx(Fragment, { children }) : void 0
2949
2983
  }