@gamecp/ui 0.1.21 → 0.1.22

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
@@ -255,16 +255,18 @@ interface PageHeaderProps {
255
255
  }
256
256
  declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
257
257
 
258
+ type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
258
259
  interface SwitchProps {
259
260
  checked: boolean;
260
261
  onChange: (checked: boolean) => void;
261
262
  disabled?: boolean;
262
- label?: string;
263
- description?: string;
263
+ label?: React__default.ReactNode | string;
264
+ description?: React__default.ReactNode | string;
264
265
  className?: string;
265
266
  size?: 'sm' | 'md' | 'lg';
267
+ variant?: SwitchVariant;
266
268
  }
267
- declare function Switch({ checked, onChange, disabled, label, description, className, size, }: SwitchProps): react_jsx_runtime.JSX.Element;
269
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
268
270
 
269
271
  interface SmartDropdownProps {
270
272
  isOpen: boolean;
@@ -632,4 +634,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
632
634
 
633
635
  declare const VERSION = "0.1.3";
634
636
 
635
- export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, PageHeader, RefreshButton, SearchCard, SearchCardContent, SearchCardHeader, SearchInput, SharedTooltip, Skeleton, SkeletonCard, SkeletonEnvironmentsList, SkeletonForm, SkeletonGameCard, SkeletonGameServerCard, SkeletonGameServerCards, SkeletonGameServerTable, SkeletonGamesTable, SkeletonItem, SkeletonList, SkeletonNodeCard, SkeletonNodeCards, SkeletonNodeTable, SkeletonRecentActivity, SkeletonSearchCard, SkeletonStats, SkeletonTable, SkeletonTenantCard, SkeletonUserCard, SmartDropdown, SmartSelect, Spinner, StatusBadge, StickyActionsColumn, Switch, Typography, VERSION, ViewToggle, useConfirmDialog };
637
+ export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, PageHeader, RefreshButton, SearchCard, SearchCardContent, SearchCardHeader, SearchInput, SharedTooltip, Skeleton, SkeletonCard, SkeletonEnvironmentsList, SkeletonForm, SkeletonGameCard, SkeletonGameServerCard, SkeletonGameServerCards, SkeletonGameServerTable, SkeletonGamesTable, SkeletonItem, SkeletonList, SkeletonNodeCard, SkeletonNodeCards, SkeletonNodeTable, SkeletonRecentActivity, SkeletonSearchCard, SkeletonStats, SkeletonTable, SkeletonTenantCard, SkeletonUserCard, SmartDropdown, SmartSelect, Spinner, StatusBadge, StickyActionsColumn, Switch, type SwitchVariant, Typography, VERSION, ViewToggle, useConfirmDialog };
package/dist/index.d.ts CHANGED
@@ -255,16 +255,18 @@ interface PageHeaderProps {
255
255
  }
256
256
  declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
257
257
 
258
+ type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
258
259
  interface SwitchProps {
259
260
  checked: boolean;
260
261
  onChange: (checked: boolean) => void;
261
262
  disabled?: boolean;
262
- label?: string;
263
- description?: string;
263
+ label?: React__default.ReactNode | string;
264
+ description?: React__default.ReactNode | string;
264
265
  className?: string;
265
266
  size?: 'sm' | 'md' | 'lg';
267
+ variant?: SwitchVariant;
266
268
  }
267
- declare function Switch({ checked, onChange, disabled, label, description, className, size, }: SwitchProps): react_jsx_runtime.JSX.Element;
269
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
268
270
 
269
271
  interface SmartDropdownProps {
270
272
  isOpen: boolean;
@@ -632,4 +634,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
632
634
 
633
635
  declare const VERSION = "0.1.3";
634
636
 
635
- export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, PageHeader, RefreshButton, SearchCard, SearchCardContent, SearchCardHeader, SearchInput, SharedTooltip, Skeleton, SkeletonCard, SkeletonEnvironmentsList, SkeletonForm, SkeletonGameCard, SkeletonGameServerCard, SkeletonGameServerCards, SkeletonGameServerTable, SkeletonGamesTable, SkeletonItem, SkeletonList, SkeletonNodeCard, SkeletonNodeCards, SkeletonNodeTable, SkeletonRecentActivity, SkeletonSearchCard, SkeletonStats, SkeletonTable, SkeletonTenantCard, SkeletonUserCard, SmartDropdown, SmartSelect, Spinner, StatusBadge, StickyActionsColumn, Switch, Typography, VERSION, ViewToggle, useConfirmDialog };
637
+ export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, PageHeader, RefreshButton, SearchCard, SearchCardContent, SearchCardHeader, SearchInput, SharedTooltip, Skeleton, SkeletonCard, SkeletonEnvironmentsList, SkeletonForm, SkeletonGameCard, SkeletonGameServerCard, SkeletonGameServerCards, SkeletonGameServerTable, SkeletonGamesTable, SkeletonItem, SkeletonList, SkeletonNodeCard, SkeletonNodeCards, SkeletonNodeTable, SkeletonRecentActivity, SkeletonSearchCard, SkeletonStats, SkeletonTable, SkeletonTenantCard, SkeletonUserCard, SmartDropdown, SmartSelect, Spinner, StatusBadge, StickyActionsColumn, Switch, type SwitchVariant, Typography, VERSION, ViewToggle, useConfirmDialog };
package/dist/index.js CHANGED
@@ -2664,7 +2664,8 @@ function Switch({
2664
2664
  label,
2665
2665
  description,
2666
2666
  className = "",
2667
- size = "md"
2667
+ size = "md",
2668
+ variant = "default"
2668
2669
  }) {
2669
2670
  const toggle = () => {
2670
2671
  if (!disabled) {
@@ -2676,7 +2677,40 @@ function Switch({
2676
2677
  md: { track: "w-11 h-6", thumb: "w-5 h-5", translate: "translate-x-5" },
2677
2678
  lg: { track: "w-14 h-8", thumb: "w-7 h-7", translate: "translate-x-6" }
2678
2679
  };
2680
+ const variants = {
2681
+ default: {
2682
+ checked: "bg-primary",
2683
+ unchecked: "bg-muted",
2684
+ ring: "focus:ring-primary"
2685
+ },
2686
+ success: {
2687
+ checked: "bg-success",
2688
+ unchecked: "bg-muted",
2689
+ ring: "focus:ring-success"
2690
+ },
2691
+ danger: {
2692
+ checked: "bg-destructive",
2693
+ unchecked: "bg-muted",
2694
+ ring: "focus:ring-destructive"
2695
+ },
2696
+ warning: {
2697
+ checked: "bg-warning",
2698
+ unchecked: "bg-muted",
2699
+ ring: "focus:ring-warning"
2700
+ },
2701
+ info: {
2702
+ checked: "bg-info",
2703
+ unchecked: "bg-muted",
2704
+ ring: "focus:ring-info"
2705
+ },
2706
+ embedded: {
2707
+ checked: "bg-success",
2708
+ unchecked: "bg-gray-300 dark:bg-gray-600",
2709
+ ring: "focus:ring-success"
2710
+ }
2711
+ };
2679
2712
  const currentSize = sizes[size];
2713
+ const currentVariant = variants[variant];
2680
2714
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start ${className}`, children: [
2681
2715
  /* @__PURE__ */ jsxRuntime.jsx(
2682
2716
  "button",
@@ -2688,8 +2722,8 @@ function Switch({
2688
2722
  onClick: toggle,
2689
2723
  className: `
2690
2724
  relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
2691
- transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
2692
- ${checked ? "bg-primary" : "bg-muted"}
2725
+ transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 ${currentVariant.ring} focus:ring-offset-2
2726
+ ${checked ? currentVariant.checked : currentVariant.unchecked}
2693
2727
  ${disabled ? "opacity-50 cursor-not-allowed" : ""}
2694
2728
  ${currentSize.track}
2695
2729
  `,
@@ -2949,8 +2983,8 @@ function SharedTooltip({
2949
2983
  offset,
2950
2984
  delayShow,
2951
2985
  delayHide,
2952
- className: `!bg-popover !text-popover-foreground !border !border-border !shadow-md !text-xs !px-2 !py-1 !rounded-md z-50 ${className}`,
2953
- style,
2986
+ className: `!bg-popover !text-popover-foreground !border !border-border !shadow-md !text-xs !px-2 !py-1 !rounded-md ${className}`,
2987
+ style: { zIndex: 9999, ...style },
2954
2988
  positionStrategy: "fixed",
2955
2989
  render: children ? () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : void 0
2956
2990
  }