@gamecp/ui 0.1.26 → 0.1.29

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
@@ -213,6 +213,19 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
213
213
  }
214
214
  declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLAnchorElement>>;
215
215
 
216
+ interface SidebarNavItemProps {
217
+ href: string;
218
+ icon?: IconType;
219
+ children: React__default.ReactNode;
220
+ active?: boolean;
221
+ className?: string;
222
+ title?: string;
223
+ exact?: boolean;
224
+ onClick?: () => void;
225
+ isButton?: boolean;
226
+ }
227
+ declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
228
+
216
229
  interface LoadingSpinnerProps {
217
230
  message?: string;
218
231
  className?: string;
@@ -265,8 +278,9 @@ interface SwitchProps {
265
278
  className?: string;
266
279
  size?: 'sm' | 'md' | 'lg';
267
280
  variant?: SwitchVariant;
281
+ labelPosition?: 'left' | 'right';
268
282
  }
269
- declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
283
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
284
 
271
285
  interface SmartDropdownProps {
272
286
  isOpen: boolean;
@@ -634,4 +648,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
634
648
 
635
649
  declare const VERSION = "0.1.3";
636
650
 
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 };
651
+ 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, SidebarNavItem, type SidebarNavItemProps, 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
@@ -213,6 +213,19 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
213
213
  }
214
214
  declare const Link: React__default.ForwardRefExoticComponent<LinkProps & React__default.RefAttributes<HTMLAnchorElement>>;
215
215
 
216
+ interface SidebarNavItemProps {
217
+ href: string;
218
+ icon?: IconType;
219
+ children: React__default.ReactNode;
220
+ active?: boolean;
221
+ className?: string;
222
+ title?: string;
223
+ exact?: boolean;
224
+ onClick?: () => void;
225
+ isButton?: boolean;
226
+ }
227
+ declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
228
+
216
229
  interface LoadingSpinnerProps {
217
230
  message?: string;
218
231
  className?: string;
@@ -265,8 +278,9 @@ interface SwitchProps {
265
278
  className?: string;
266
279
  size?: 'sm' | 'md' | 'lg';
267
280
  variant?: SwitchVariant;
281
+ labelPosition?: 'left' | 'right';
268
282
  }
269
- declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, }: SwitchProps): react_jsx_runtime.JSX.Element;
283
+ declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, }: SwitchProps): react_jsx_runtime.JSX.Element;
270
284
 
271
285
  interface SmartDropdownProps {
272
286
  isOpen: boolean;
@@ -634,4 +648,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
634
648
 
635
649
  declare const VERSION = "0.1.3";
636
650
 
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 };
651
+ 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, SidebarNavItem, type SidebarNavItemProps, 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
@@ -6,6 +6,7 @@ var ri = require('react-icons/ri');
6
6
  var reactDom = require('react-dom');
7
7
  var framerMotion = require('framer-motion');
8
8
  var NextLink = require('next/link');
9
+ var navigation = require('next/navigation');
9
10
  var reactTooltip = require('react-tooltip');
10
11
 
11
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -291,7 +292,7 @@ function Card({
291
292
  variantClasses2[variant],
292
293
  paddingClasses[padding],
293
294
  borderAccentClasses[borderAccent],
294
- overflow !== "visible" || activeHeaderBorder ? `overflow-${overflow === "visible" && activeHeaderBorder ? "hidden" : overflow}` : "",
295
+ overflow !== "visible" ? `overflow-${overflow}` : "",
295
296
  activeHeaderBorder ? "relative" : "",
296
297
  hover ? "hover:shadow-md transition-shadow" : "",
297
298
  clickable || onClick ? "cursor-pointer" : "",
@@ -1932,7 +1933,7 @@ function SkeletonGamesTable({
1932
1933
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Created" }),
1933
1934
  /* @__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
1935
  ] }) }),
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: [
1936
+ /* @__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
1937
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
1937
1938
  /* @__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
1939
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 min-w-0 flex-1", children: [
@@ -2605,6 +2606,63 @@ var Link = React4.forwardRef(
2605
2606
  );
2606
2607
  Link.displayName = "Link";
2607
2608
  var Link_default = Link;
2609
+ function SidebarNavItem({
2610
+ href,
2611
+ icon: Icon,
2612
+ children,
2613
+ active,
2614
+ className = "",
2615
+ title,
2616
+ exact = false,
2617
+ onClick,
2618
+ isButton = false
2619
+ }) {
2620
+ const pathname = navigation.usePathname();
2621
+ const isActive = active !== void 0 ? active : exact ? pathname === href : pathname === href || pathname?.startsWith(`${href}/`);
2622
+ const commonClasses = `group flex items-center px-3 py-2 text-sm font-medium rounded-md transition-all duration-150 ease-in-out ${isActive ? "" : "hover:bg-muted"} ${className}`;
2623
+ if (isButton) {
2624
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2625
+ "button",
2626
+ {
2627
+ type: "button",
2628
+ onClick,
2629
+ title,
2630
+ "aria-current": isActive ? "page" : void 0,
2631
+ className: `w-full text-left ${commonClasses}`,
2632
+ children: [
2633
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(
2634
+ Icon,
2635
+ {
2636
+ className: `mr-3 h-5 w-5 shrink-0 transition-all duration-150 ease-in-out`,
2637
+ "aria-hidden": "true"
2638
+ }
2639
+ ),
2640
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2641
+ ]
2642
+ }
2643
+ );
2644
+ }
2645
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2646
+ NextLink__default.default,
2647
+ {
2648
+ href,
2649
+ onClick,
2650
+ title,
2651
+ "aria-current": isActive ? "page" : void 0,
2652
+ className: commonClasses,
2653
+ children: [
2654
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(
2655
+ Icon,
2656
+ {
2657
+ className: `mr-3 h-5 w-5 shrink-0 transition-all duration-150 ease-in-out`,
2658
+ "aria-hidden": "true"
2659
+ }
2660
+ ),
2661
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2662
+ ]
2663
+ }
2664
+ );
2665
+ }
2608
2666
  var LoadingSpinner = ({
2609
2667
  message = "Initializing...",
2610
2668
  className,
@@ -2671,7 +2729,8 @@ function Switch({
2671
2729
  description,
2672
2730
  className = "",
2673
2731
  size = "md",
2674
- variant = "default"
2732
+ variant = "default",
2733
+ labelPosition = "right"
2675
2734
  }) {
2676
2735
  const toggle = () => {
2677
2736
  if (!disabled) {
@@ -2686,38 +2745,43 @@ function Switch({
2686
2745
  const variants = {
2687
2746
  default: {
2688
2747
  checked: "bg-primary",
2689
- unchecked: "bg-muted",
2748
+ unchecked: "bg-input",
2690
2749
  ring: "focus:ring-primary"
2691
2750
  },
2692
2751
  success: {
2693
2752
  checked: "bg-success",
2694
- unchecked: "bg-muted",
2753
+ unchecked: "bg-input",
2695
2754
  ring: "focus:ring-success"
2696
2755
  },
2697
2756
  danger: {
2698
2757
  checked: "bg-destructive",
2699
- unchecked: "bg-muted",
2758
+ unchecked: "bg-input",
2700
2759
  ring: "focus:ring-destructive"
2701
2760
  },
2702
2761
  warning: {
2703
2762
  checked: "bg-warning",
2704
- unchecked: "bg-muted",
2763
+ unchecked: "bg-input",
2705
2764
  ring: "focus:ring-warning"
2706
2765
  },
2707
2766
  info: {
2708
2767
  checked: "bg-info",
2709
- unchecked: "bg-muted",
2768
+ unchecked: "bg-input",
2710
2769
  ring: "focus:ring-info"
2711
2770
  },
2712
2771
  embedded: {
2713
2772
  checked: "bg-success",
2714
- unchecked: "bg-gray-300 dark:bg-gray-600",
2773
+ unchecked: "bg-input",
2715
2774
  ring: "focus:ring-success"
2716
2775
  }
2717
2776
  };
2718
2777
  const currentSize = sizes[size];
2719
2778
  const currentVariant = variants[variant];
2720
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start ${className}`, children: [
2779
+ 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: [
2780
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-foreground cursor-pointer", onClick: toggle, children: label }),
2781
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground leading-snug", children: description })
2782
+ ] });
2783
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center ${labelPosition === "left" ? "justify-between" : ""} ${className}`, children: [
2784
+ labelPosition === "left" && (label || description) && LabelContent,
2721
2785
  /* @__PURE__ */ jsxRuntime.jsx(
2722
2786
  "button",
2723
2787
  {
@@ -2747,10 +2811,7 @@ function Switch({
2747
2811
  )
2748
2812
  }
2749
2813
  ),
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
- ] })
2814
+ labelPosition === "right" && (label || description) && LabelContent
2754
2815
  ] });
2755
2816
  }
2756
2817
  var variantClasses4 = {
@@ -3630,6 +3691,7 @@ exports.SearchCardContent = SearchCardContent;
3630
3691
  exports.SearchCardHeader = SearchCardHeader;
3631
3692
  exports.SearchInput = SearchInput;
3632
3693
  exports.SharedTooltip = SharedTooltip;
3694
+ exports.SidebarNavItem = SidebarNavItem;
3633
3695
  exports.Skeleton = Skeleton;
3634
3696
  exports.SkeletonCard = SkeletonCard;
3635
3697
  exports.SkeletonEnvironmentsList = SkeletonEnvironmentsList;