@gamecp/ui 0.1.32 → 0.1.33

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
@@ -202,8 +202,37 @@ interface InfoBoxProps {
202
202
  children: React__default.ReactNode;
203
203
  variant?: 'default' | 'warning' | 'info' | 'success' | 'danger';
204
204
  className?: string;
205
+ /** Compact mode for inline usage */
206
+ compact?: boolean;
205
207
  }
206
- declare function InfoBox({ title, children, variant, className }: InfoBoxProps): react_jsx_runtime.JSX.Element;
208
+ /**
209
+ * @deprecated Use Notice component instead. InfoBox is now a wrapper around Notice.
210
+ */
211
+ declare function InfoBox({ title, children, variant, className, compact, }: InfoBoxProps): react_jsx_runtime.JSX.Element;
212
+
213
+ interface NoticeProps {
214
+ /** Main content of the notice */
215
+ children: React__default.ReactNode;
216
+ /** Variant type of the notice */
217
+ variant?: 'info' | 'warning' | 'success' | 'danger' | 'default';
218
+ /** Icon to display. If not provided, uses default for variant */
219
+ icon?: React__default.ReactNode;
220
+ /** Optional title */
221
+ title?: string | React__default.ReactNode;
222
+ /** Additional CSS classes */
223
+ className?: string;
224
+ /** Whether to show the icon */
225
+ showIcon?: boolean;
226
+ /** Custom content to the right (e.g., a toggle button) */
227
+ action?: React__default.ReactNode;
228
+ /** Compact mode for inline usage (less padding, smaller text) */
229
+ compact?: boolean;
230
+ }
231
+ declare function Notice({ children, variant, icon, title, className, showIcon, action, compact, }: NoticeProps): react_jsx_runtime.JSX.Element;
232
+ declare function InfoNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
233
+ declare function WarningNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
234
+ declare function SuccessNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
235
+ declare function DangerNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
207
236
 
208
237
  interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
209
238
  href: string;
@@ -652,4 +681,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
652
681
 
653
682
  declare const VERSION = "0.1.3";
654
683
 
655
- 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 };
684
+ export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DangerNotice, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, InfoNotice, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, Notice, 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, SuccessNotice, Switch, type SwitchVariant, Typography, VERSION, ViewToggle, WarningNotice, useConfirmDialog };
package/dist/index.d.ts CHANGED
@@ -202,8 +202,37 @@ interface InfoBoxProps {
202
202
  children: React__default.ReactNode;
203
203
  variant?: 'default' | 'warning' | 'info' | 'success' | 'danger';
204
204
  className?: string;
205
+ /** Compact mode for inline usage */
206
+ compact?: boolean;
205
207
  }
206
- declare function InfoBox({ title, children, variant, className }: InfoBoxProps): react_jsx_runtime.JSX.Element;
208
+ /**
209
+ * @deprecated Use Notice component instead. InfoBox is now a wrapper around Notice.
210
+ */
211
+ declare function InfoBox({ title, children, variant, className, compact, }: InfoBoxProps): react_jsx_runtime.JSX.Element;
212
+
213
+ interface NoticeProps {
214
+ /** Main content of the notice */
215
+ children: React__default.ReactNode;
216
+ /** Variant type of the notice */
217
+ variant?: 'info' | 'warning' | 'success' | 'danger' | 'default';
218
+ /** Icon to display. If not provided, uses default for variant */
219
+ icon?: React__default.ReactNode;
220
+ /** Optional title */
221
+ title?: string | React__default.ReactNode;
222
+ /** Additional CSS classes */
223
+ className?: string;
224
+ /** Whether to show the icon */
225
+ showIcon?: boolean;
226
+ /** Custom content to the right (e.g., a toggle button) */
227
+ action?: React__default.ReactNode;
228
+ /** Compact mode for inline usage (less padding, smaller text) */
229
+ compact?: boolean;
230
+ }
231
+ declare function Notice({ children, variant, icon, title, className, showIcon, action, compact, }: NoticeProps): react_jsx_runtime.JSX.Element;
232
+ declare function InfoNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
233
+ declare function WarningNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
234
+ declare function SuccessNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
235
+ declare function DangerNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
207
236
 
208
237
  interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
209
238
  href: string;
@@ -652,4 +681,4 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
652
681
 
653
682
  declare const VERSION = "0.1.3";
654
683
 
655
- 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 };
684
+ export { ActionButton, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, ConfirmDialog, type ConfirmDialogOptions, Container, DangerNotice, DataTable, DataTableActions, DataTableBody, DataTableCell, DataTableEmptyState, DataTableHeader, DataTableHeaderCell, DataTableLoadingState, DataTableRow, EmptyState, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoBox, InfoNotice, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, Notice, 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, SuccessNotice, Switch, type SwitchVariant, Typography, VERSION, ViewToggle, WarningNotice, useConfirmDialog };
package/dist/index.js CHANGED
@@ -712,7 +712,7 @@ var paddingClasses2 = {
712
712
  none: "",
713
713
  sm: "p-4",
714
714
  md: "p-4 lg:p-6",
715
- lg: "p-4 lg:p-8"
715
+ lg: "px-4 sm:px-6 lg:px-6 py-6"
716
716
  };
717
717
  function Container({
718
718
  children,
@@ -2564,30 +2564,123 @@ function Grid({
2564
2564
  };
2565
2565
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${colClasses[cols]} ${gapClasses[gap]} ${className}`, children });
2566
2566
  }
2567
- var variantConfig = {
2568
- default: { borderAccent: "gray", titleColor: "text-foreground" },
2569
- warning: { borderAccent: "amber", titleColor: "text-amber" },
2570
- info: { borderAccent: "info", titleColor: "text-info" },
2571
- success: { borderAccent: "success", titleColor: "text-success" },
2572
- danger: { borderAccent: "danger", titleColor: "text-danger" }
2567
+ var variantStyles = {
2568
+ info: {
2569
+ bg: "bg-info/5",
2570
+ accent: "bg-info",
2571
+ iconBg: "bg-info/10",
2572
+ iconColor: "text-info",
2573
+ titleColor: "text-info"
2574
+ },
2575
+ warning: {
2576
+ bg: "bg-amber/5",
2577
+ accent: "bg-amber",
2578
+ iconBg: "bg-amber/10",
2579
+ iconColor: "text-amber",
2580
+ titleColor: "text-amber"
2581
+ },
2582
+ success: {
2583
+ bg: "bg-success/5",
2584
+ accent: "bg-success",
2585
+ iconBg: "bg-success/10",
2586
+ iconColor: "text-success",
2587
+ titleColor: "text-success"
2588
+ },
2589
+ danger: {
2590
+ bg: "bg-danger/5",
2591
+ accent: "bg-danger",
2592
+ iconBg: "bg-danger/10",
2593
+ iconColor: "text-danger",
2594
+ titleColor: "text-danger"
2595
+ },
2596
+ default: {
2597
+ bg: "bg-muted/50",
2598
+ accent: "bg-border",
2599
+ iconBg: "bg-muted",
2600
+ iconColor: "text-muted-foreground",
2601
+ titleColor: "text-foreground"
2602
+ }
2603
+ };
2604
+ var defaultIcons = {
2605
+ info: ri.RiInformationLine,
2606
+ warning: ri.RiAlertLine,
2607
+ success: ri.RiCheckLine,
2608
+ danger: ri.RiErrorWarningLine,
2609
+ default: ri.RiInformationLine
2573
2610
  };
2611
+ function Notice({
2612
+ children,
2613
+ variant = "info",
2614
+ icon,
2615
+ title,
2616
+ className = "",
2617
+ showIcon = true,
2618
+ action,
2619
+ compact = false
2620
+ }) {
2621
+ const styles = variantStyles[variant] || variantStyles.default;
2622
+ const IconComponent = defaultIcons[variant] || defaultIcons.default;
2623
+ const padding = compact ? "px-3 py-2.5" : "px-4 py-4";
2624
+ const iconSize = compact ? "w-4 h-4" : "w-5 h-5";
2625
+ const iconPadding = compact ? "p-1.5" : "p-2";
2626
+ const textSize = compact ? "text-xs" : "text-sm";
2627
+ const titleSize = compact ? "text-sm" : "text-base";
2628
+ const gap = compact ? "gap-2.5" : "gap-3";
2629
+ const displayIcon = showIcon ? icon || /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: iconSize }) : null;
2630
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2631
+ "div",
2632
+ {
2633
+ className: `relative flex items-start ${gap} ${padding} rounded-lg overflow-hidden ${styles.bg} ${className}`,
2634
+ children: [
2635
+ /* @__PURE__ */ jsxRuntime.jsx(
2636
+ "div",
2637
+ {
2638
+ className: `absolute left-0 top-0 bottom-0 w-1 ${styles.accent}`
2639
+ }
2640
+ ),
2641
+ displayIcon && /* @__PURE__ */ jsxRuntime.jsx(
2642
+ "div",
2643
+ {
2644
+ className: `flex-shrink-0 ${iconPadding} rounded-lg ${styles.iconBg} ${styles.iconColor}`,
2645
+ children: displayIcon
2646
+ }
2647
+ ),
2648
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
2649
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `font-medium ${titleSize} ${styles.titleColor} mb-1`, children: title }),
2650
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${textSize} text-muted-foreground leading-relaxed space-y-1 [&>ul]:list-disc [&>ul]:list-outside [&>ul]:pl-3 [&>ol]:list-decimal [&>ol]:list-outside [&>ol]:pl-4`, children })
2651
+ ] }),
2652
+ action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: action })
2653
+ ]
2654
+ }
2655
+ );
2656
+ }
2657
+ function InfoNotice(props) {
2658
+ return /* @__PURE__ */ jsxRuntime.jsx(Notice, { variant: "info", ...props });
2659
+ }
2660
+ function WarningNotice(props) {
2661
+ return /* @__PURE__ */ jsxRuntime.jsx(Notice, { variant: "warning", ...props });
2662
+ }
2663
+ function SuccessNotice(props) {
2664
+ return /* @__PURE__ */ jsxRuntime.jsx(Notice, { variant: "success", ...props });
2665
+ }
2666
+ function DangerNotice(props) {
2667
+ return /* @__PURE__ */ jsxRuntime.jsx(Notice, { variant: "danger", ...props });
2668
+ }
2574
2669
  function InfoBox({
2575
2670
  title,
2576
2671
  children,
2577
2672
  variant = "default",
2578
- className = ""
2673
+ className = "",
2674
+ compact = false
2579
2675
  }) {
2580
- const config = variantConfig[variant] || variantConfig.default;
2581
- return /* @__PURE__ */ jsxRuntime.jsxs(
2582
- Card,
2676
+ return /* @__PURE__ */ jsxRuntime.jsx(
2677
+ Notice,
2583
2678
  {
2584
- borderAccent: config.borderAccent,
2585
- padding: "md",
2679
+ variant,
2680
+ title,
2586
2681
  className,
2587
- children: [
2588
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `font-medium mb-2 ${config.titleColor}`, children: title }),
2589
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground space-y-1 [&>ul]:list-disc [&>ul]:list-outside [&>ul]:pl-3 [&>ol]:list-decimal [&>ol]:list-outside [&>ol]:pl-4", children })
2590
- ]
2682
+ compact,
2683
+ children
2591
2684
  }
2592
2685
  );
2593
2686
  }
@@ -3344,7 +3437,7 @@ function ActionButton({
3344
3437
  return null;
3345
3438
  }
3346
3439
  };
3347
- const variantConfig2 = getVariantConfig();
3440
+ const variantConfig = getVariantConfig();
3348
3441
  const variantClasses5 = {
3349
3442
  primary: "btn-primary",
3350
3443
  secondary: "btn-secondary",
@@ -3354,7 +3447,7 @@ function ActionButton({
3354
3447
  info: "bg-muted text-muted-foreground hover:bg-primary hover:text-primary-foreground border border-ring transition-all duration-300 ease-in-out",
3355
3448
  metrics: "bg-purple/10 text-purple hover:bg-purple/20 hover:text-purple-700 border border-purple-200 transition-all duration-300 ease-in-out"
3356
3449
  };
3357
- let variantClass = variantConfig2 ? variantConfig2.className : variant ? variantClasses5[variant] : "";
3450
+ let variantClass = variantConfig ? variantConfig.className : variant ? variantClasses5[variant] : "";
3358
3451
  if (terminalMode && variantClass) {
3359
3452
  const hoverMatch = variantClass.match(/hover:text-(\w+)-(\d+)/);
3360
3453
  const hoverColor = hoverMatch ? `hover:text-${hoverMatch[1]}-${hoverMatch[2]}` : "hover:text-muted-foreground";
@@ -3381,13 +3474,13 @@ function ActionButton({
3381
3474
  }
3382
3475
  )
3383
3476
  }
3384
- ) : (variantConfig2?.icon || IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(
3477
+ ) : (variantConfig?.icon || IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(
3385
3478
  "div",
3386
3479
  {
3387
3480
  className: `${iconSizes[size]} flex items-center justify-center flex-shrink-0`,
3388
3481
  "aria-hidden": "true",
3389
- children: variantConfig2?.icon ? /* @__PURE__ */ jsxRuntime.jsx(
3390
- variantConfig2.icon,
3482
+ children: variantConfig?.icon ? /* @__PURE__ */ jsxRuntime.jsx(
3483
+ variantConfig.icon,
3391
3484
  {
3392
3485
  className: "w-full h-full",
3393
3486
  "aria-hidden": "true"
@@ -3395,11 +3488,11 @@ function ActionButton({
3395
3488
  ) : IconComponent ? /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "w-full h-full", "aria-hidden": "true" }) : null
3396
3489
  }
3397
3490
  ),
3398
- !iconOnly && (restProps.children ? restProps.children : (variantConfig2?.label || label) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: variantConfig2?.label || label }))
3491
+ !iconOnly && (restProps.children ? restProps.children : (variantConfig?.label || label) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: variantConfig?.label || label }))
3399
3492
  ] });
3400
- const accessibleLabel = title || (iconOnly ? variantConfig2?.label || label : void 0);
3401
- const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig2?.label || label || "Action button" : accessibleLabel;
3402
- const tooltipContent = title || (iconOnly ? variantConfig2?.label || label : void 0);
3493
+ const accessibleLabel = title || (iconOnly ? variantConfig?.label || label : void 0);
3494
+ const buttonAriaLabel = iconOnly && !accessibleLabel ? variantConfig?.label || label || "Action button" : accessibleLabel;
3495
+ const tooltipContent = title || (iconOnly ? variantConfig?.label || label : void 0);
3403
3496
  const buttonClassName = `
3404
3497
 
3405
3498
  ${terminalMode ? "btn-terminal" : `btn ${variantClass} ${paddingClasses3} ${heightClasses[size]} ${className} ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`}`;
@@ -3719,6 +3812,7 @@ exports.Button = Button_default;
3719
3812
  exports.Card = Card;
3720
3813
  exports.ConfirmDialog = ConfirmDialog_default;
3721
3814
  exports.Container = Container;
3815
+ exports.DangerNotice = DangerNotice;
3722
3816
  exports.DataTable = DataTable;
3723
3817
  exports.DataTableActions = DataTableActions;
3724
3818
  exports.DataTableBody = DataTableBody;
@@ -3736,10 +3830,12 @@ exports.FormSection = FormSection;
3736
3830
  exports.Grid = Grid;
3737
3831
  exports.IconButtonWithCount = IconButtonWithCount;
3738
3832
  exports.InfoBox = InfoBox;
3833
+ exports.InfoNotice = InfoNotice;
3739
3834
  exports.Link = Link_default;
3740
3835
  exports.LoadingSpinner = LoadingSpinner_default;
3741
3836
  exports.MobileSearchLayout = MobileSearchLayout;
3742
3837
  exports.Modal = Modal;
3838
+ exports.Notice = Notice;
3743
3839
  exports.PageHeader = PageHeader;
3744
3840
  exports.RefreshButton = RefreshButton;
3745
3841
  exports.SearchCard = SearchCard;
@@ -3773,10 +3869,12 @@ exports.SmartSelect = SmartSelect;
3773
3869
  exports.Spinner = Spinner_default;
3774
3870
  exports.StatusBadge = StatusBadge;
3775
3871
  exports.StickyActionsColumn = StickyActionsColumn;
3872
+ exports.SuccessNotice = SuccessNotice;
3776
3873
  exports.Switch = Switch;
3777
3874
  exports.Typography = Typography;
3778
3875
  exports.VERSION = VERSION;
3779
3876
  exports.ViewToggle = ViewToggle;
3877
+ exports.WarningNotice = WarningNotice;
3780
3878
  exports.useConfirmDialog = useConfirmDialog;
3781
3879
  //# sourceMappingURL=index.js.map
3782
3880
  //# sourceMappingURL=index.js.map