@gamecp/ui 0.1.27 → 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;
@@ -635,4 +648,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
635
648
 
636
649
  declare const VERSION = "0.1.3";
637
650
 
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 };
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;
@@ -635,4 +648,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
635
648
 
636
649
  declare const VERSION = "0.1.3";
637
650
 
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 };
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" : "",
@@ -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,
@@ -3633,6 +3691,7 @@ exports.SearchCardContent = SearchCardContent;
3633
3691
  exports.SearchCardHeader = SearchCardHeader;
3634
3692
  exports.SearchInput = SearchInput;
3635
3693
  exports.SharedTooltip = SharedTooltip;
3694
+ exports.SidebarNavItem = SidebarNavItem;
3636
3695
  exports.Skeleton = Skeleton;
3637
3696
  exports.SkeletonCard = SkeletonCard;
3638
3697
  exports.SkeletonEnvironmentsList = SkeletonEnvironmentsList;