@gamecp/ui 0.1.27 → 0.1.30

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;
@@ -252,8 +265,9 @@ interface PageHeaderProps {
252
265
  subtitle?: string;
253
266
  rightContent?: React__default.ReactNode;
254
267
  className?: string;
268
+ size?: 'sm' | 'md' | 'lg';
255
269
  }
256
- declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
270
+ declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, size, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
257
271
 
258
272
  type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
259
273
  interface SwitchProps {
@@ -635,4 +649,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
635
649
 
636
650
  declare const VERSION = "0.1.3";
637
651
 
638
- 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 };
652
+ 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;
@@ -252,8 +265,9 @@ interface PageHeaderProps {
252
265
  subtitle?: string;
253
266
  rightContent?: React__default.ReactNode;
254
267
  className?: string;
268
+ size?: 'sm' | 'md' | 'lg';
255
269
  }
256
- declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
270
+ declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, size, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
257
271
 
258
272
  type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
259
273
  interface SwitchProps {
@@ -635,4 +649,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
635
649
 
636
650
  declare const VERSION = "0.1.3";
637
651
 
638
- 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 };
652
+ 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" : "",
@@ -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,
@@ -2650,17 +2708,48 @@ function PageHeader({
2650
2708
  title,
2651
2709
  subtitle,
2652
2710
  rightContent,
2653
- className = ""
2711
+ className = "",
2712
+ size = "lg"
2654
2713
  }) {
2655
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `mb-6 lg:mb-8 ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "header-layout", children: [
2714
+ const sizeClasses5 = {
2715
+ sm: {
2716
+ container: "mb-6",
2717
+ icon: "w-5 h-5 lg:w-6 lg:h-6",
2718
+ title: "text-lg lg:text-xl",
2719
+ subtitle: "text-sm",
2720
+ spacing: "space-x-2 lg:space-x-3"
2721
+ },
2722
+ md: {
2723
+ container: "mb-6 lg:mb-8",
2724
+ icon: "w-6 h-6 lg:w-7 lg:h-7",
2725
+ title: "text-xl lg:text-2xl",
2726
+ subtitle: "text-sm",
2727
+ spacing: "space-x-2 lg:space-x-3"
2728
+ },
2729
+ lg: {
2730
+ container: "mb-6 lg:mb-8",
2731
+ icon: "w-6 h-6 lg:w-8 lg:h-8",
2732
+ title: "text-xl lg:text-3xl",
2733
+ subtitle: "text-sm",
2734
+ spacing: "space-x-2 lg:space-x-3"
2735
+ }
2736
+ };
2737
+ const currentSize = sizeClasses5[size];
2738
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${currentSize.container} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "header-layout", children: [
2656
2739
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
2657
- Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-6 h-6 lg:w-8 lg:h-8 flex-shrink-0" }),
2740
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: `${currentSize.icon} flex-shrink-0` }),
2658
2741
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2659
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl lg:text-3xl font-bold text-foreground truncate", children: title }),
2660
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm lg:text-base text-muted-foreground", children: subtitle })
2742
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: `${currentSize.title} font-bold truncate`, children: title }),
2743
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${currentSize.subtitle} text-muted-foreground`, children: subtitle })
2661
2744
  ] })
2662
2745
  ] }),
2663
- rightContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center space-x-2 lg:space-x-3 flex-shrink-0", children: rightContent })
2746
+ rightContent && /* @__PURE__ */ jsxRuntime.jsx(
2747
+ "div",
2748
+ {
2749
+ className: `flex items-center ${currentSize.spacing} flex-shrink-0`,
2750
+ children: rightContent
2751
+ }
2752
+ )
2664
2753
  ] }) });
2665
2754
  }
2666
2755
  function Switch({
@@ -3633,6 +3722,7 @@ exports.SearchCardContent = SearchCardContent;
3633
3722
  exports.SearchCardHeader = SearchCardHeader;
3634
3723
  exports.SearchInput = SearchInput;
3635
3724
  exports.SharedTooltip = SharedTooltip;
3725
+ exports.SidebarNavItem = SidebarNavItem;
3636
3726
  exports.Skeleton = Skeleton;
3637
3727
  exports.SkeletonCard = SkeletonCard;
3638
3728
  exports.SkeletonEnvironmentsList = SkeletonEnvironmentsList;