@gamecp/ui 0.1.20 → 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
@@ -7,7 +7,6 @@ var reactDom = require('react-dom');
7
7
  var framerMotion = require('framer-motion');
8
8
  var NextLink = require('next/link');
9
9
  var reactTooltip = require('react-tooltip');
10
- var nextIntlayer = require('next-intlayer');
11
10
 
12
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
12
 
@@ -2665,7 +2664,8 @@ function Switch({
2665
2664
  label,
2666
2665
  description,
2667
2666
  className = "",
2668
- size = "md"
2667
+ size = "md",
2668
+ variant = "default"
2669
2669
  }) {
2670
2670
  const toggle = () => {
2671
2671
  if (!disabled) {
@@ -2677,7 +2677,40 @@ function Switch({
2677
2677
  md: { track: "w-11 h-6", thumb: "w-5 h-5", translate: "translate-x-5" },
2678
2678
  lg: { track: "w-14 h-8", thumb: "w-7 h-7", translate: "translate-x-6" }
2679
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
+ };
2680
2712
  const currentSize = sizes[size];
2713
+ const currentVariant = variants[variant];
2681
2714
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start ${className}`, children: [
2682
2715
  /* @__PURE__ */ jsxRuntime.jsx(
2683
2716
  "button",
@@ -2689,8 +2722,8 @@ function Switch({
2689
2722
  onClick: toggle,
2690
2723
  className: `
2691
2724
  relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
2692
- transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
2693
- ${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}
2694
2727
  ${disabled ? "opacity-50 cursor-not-allowed" : ""}
2695
2728
  ${currentSize.track}
2696
2729
  `,
@@ -2950,8 +2983,8 @@ function SharedTooltip({
2950
2983
  offset,
2951
2984
  delayShow,
2952
2985
  delayHide,
2953
- className: `!bg-popover !text-popover-foreground !border !border-border !shadow-md !text-xs !px-2 !py-1 !rounded-md z-50 ${className}`,
2954
- 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 },
2955
2988
  positionStrategy: "fixed",
2956
2989
  render: children ? () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : void 0
2957
2990
  }
@@ -3116,73 +3149,72 @@ function ActionButton({
3116
3149
  lg: terminalMode ? "" : "btn-lg"
3117
3150
  };
3118
3151
  const paddingClasses3 = iconOnly ? terminalMode ? "" : "p-2" : "px-3 py-1.5";
3119
- const t = nextIntlayer.useIntlayer("action-button");
3120
3152
  const getVariantConfig = () => {
3121
3153
  switch (variant) {
3122
3154
  case "edit":
3123
3155
  return {
3124
3156
  icon: fill ? ri.RiEditFill : ri.RiEditLine,
3125
- label: t.edit,
3157
+ label: "Edit",
3126
3158
  className: "btn-secondary"
3127
3159
  };
3128
3160
  case "delete":
3129
3161
  return {
3130
3162
  icon: fill ? ri.RiDeleteBinFill : ri.RiDeleteBinLine,
3131
- label: t.delete,
3163
+ label: "Delete",
3132
3164
  className: "btn-danger"
3133
3165
  };
3134
3166
  case "deactivate":
3135
3167
  return {
3136
3168
  icon: fill ? ri.RiStopCircleFill : ri.RiStopCircleLine,
3137
- label: t.deactivate,
3169
+ label: "Deactivate",
3138
3170
  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"
3139
3171
  };
3140
3172
  case "activate":
3141
3173
  return {
3142
3174
  icon: fill ? ri.RiPlayCircleFill : ri.RiPlayCircleLine,
3143
- label: t.activate,
3175
+ label: "Activate",
3144
3176
  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"
3145
3177
  };
3146
3178
  case "view":
3147
3179
  return {
3148
3180
  icon: fill ? ri.RiEyeFill : ri.RiEyeLine,
3149
- label: t.view,
3181
+ label: "View",
3150
3182
  className: "bg-muted text-muted-foreground hover:bg-muted hover:text-foreground border border-border transition-all duration-300 ease-in-out"
3151
3183
  };
3152
3184
  case "metrics":
3153
3185
  return {
3154
3186
  icon: fill ? ri.RiBarChartFill : ri.RiBarChartLine,
3155
- label: t.metrics,
3187
+ label: "Metrics",
3156
3188
  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"
3157
3189
  };
3158
3190
  case "start":
3159
3191
  return {
3160
3192
  icon: fill ? ri.RiPlayFill : ri.RiPlayLine,
3161
- label: t.start,
3193
+ label: "Start",
3162
3194
  className: "bg-success/10 text-success hover:bg-success/20 hover:text-success border border-success transition-all duration-300 ease-in-out"
3163
3195
  };
3164
3196
  case "stop":
3165
3197
  return {
3166
3198
  icon: fill ? ri.RiStopFill : ri.RiStopLine,
3167
- label: t.stop,
3199
+ label: "Stop",
3168
3200
  className: "bg-danger/10 text-danger hover:bg-danger/20 hover:text-danger border border-danger transition-all duration-300 ease-in-out"
3169
3201
  };
3170
3202
  case "restart":
3171
3203
  return {
3172
3204
  icon: fill ? ri.RiRestartFill : ri.RiRestartLine,
3173
- label: t.restart,
3205
+ label: "Restart",
3174
3206
  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"
3175
3207
  };
3176
3208
  case "pause":
3177
3209
  return {
3178
3210
  icon: fill ? ri.RiPauseFill : ri.RiPauseLine,
3179
- label: t.pause,
3211
+ label: "Pause",
3180
3212
  className: "bg-amber/10 text-amber hover:bg-amber/20 hover:text-amber border border-amber transition-all duration-300 ease-in-out"
3181
3213
  };
3182
3214
  case "clone":
3183
3215
  return {
3184
3216
  icon: fill ? ri.RiFileCopyFill : ri.RiFileCopyLine,
3185
- label: t.clone,
3217
+ label: "Clone",
3186
3218
  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"
3187
3219
  };
3188
3220
  default: