@gamecp/ui 0.1.45 → 0.1.46

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import React6, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, useId } from 'react';
3
- import { RiArrowDownSLine, RiCloseLine, RiSaveLine, RiCheckLine, RiSearchLine, RiAddLine, RiCodeLine, RiSettings3Line, RiFileCopyLine, RiEyeOffLine, RiEyeLine, RiRefreshLine, RiLoader4Line, RiFilterLine, RiGridFill, RiListUnordered, RiErrorWarningLine, RiInformationLine, RiAlertLine, RiShieldLine, RiLeafLine, RiGamepadLine, RiServerLine, RiWifiLine, RiArrowLeftSLine, RiArrowRightSLine, RiFileCopyFill, RiPauseFill, RiPauseLine, RiRestartFill, RiRestartLine, RiStopFill, RiStopLine, RiPlayFill, RiPlayLine, RiBarChartFill, RiBarChartLine, RiEyeFill, RiPlayCircleFill, RiPlayCircleLine, RiStopCircleFill, RiStopCircleLine, RiDeleteBinFill, RiDeleteBinLine, RiEditFill, RiEditLine } from 'react-icons/ri';
3
+ import { RiArrowDownSLine, RiCloseLine, RiSaveLine, RiErrorWarningLine, RiCheckLine, RiSearchLine, RiAddLine, RiCodeLine, RiSettings3Line, RiFileCopyLine, RiEyeOffLine, RiEyeLine, RiRefreshLine, RiLoader4Line, RiFilterLine, RiGridFill, RiListUnordered, RiInformationLine, RiAlertLine, RiShieldLine, RiLeafLine, RiGamepadLine, RiServerLine, RiWifiLine, RiArrowLeftSLine, RiArrowRightSLine, RiFileCopyFill, RiPauseFill, RiPauseLine, RiRestartFill, RiRestartLine, RiStopFill, RiStopLine, RiPlayFill, RiPlayLine, RiBarChartFill, RiBarChartLine, RiEyeFill, RiPlayCircleFill, RiPlayCircleLine, RiStopCircleFill, RiStopCircleLine, RiDeleteBinFill, RiDeleteBinLine, RiEditFill, RiEditLine } from 'react-icons/ri';
4
4
  import { createPortal } from 'react-dom';
5
5
  import { AnimatePresence, motion } from 'framer-motion';
6
6
  import { Tooltip } from 'react-tooltip';
@@ -9,19 +9,19 @@ import { usePathname } from 'next/navigation';
9
9
 
10
10
  // src/Badge.tsx
11
11
  var badgeVariants = {
12
- default: "bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",
13
- primary: "bg-primary text-primary-foreground border-transparent hover:bg-primary/80",
14
- secondary: "bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",
15
- success: "status-running-badge border-transparent",
16
- warning: "status-starting-badge border-transparent",
17
- error: "status-error-badge border-transparent",
18
- info: "bg-muted text-muted-foreground border-ring",
19
- gray: "bg-muted text-muted-foreground border-border",
12
+ default: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
13
+ primary: "badge-primary",
14
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ success: "status-running-badge",
16
+ warning: "status-starting-badge",
17
+ error: "status-error-badge",
18
+ info: "bg-muted text-muted-foreground",
19
+ gray: "bg-muted text-muted-foreground",
20
20
  purple: "badge-purple",
21
21
  pink: "badge-pink",
22
22
  indigo: "badge-indigo",
23
- yellow: "status-starting-badge border-transparent",
24
- orange: "status-restarting-badge border-transparent",
23
+ yellow: "status-starting-badge",
24
+ orange: "status-restarting-badge",
25
25
  teal: "badge-teal",
26
26
  cyan: "badge-cyan",
27
27
  lime: "badge-lime",
@@ -30,7 +30,7 @@ var badgeVariants = {
30
30
  sky: "badge-sky",
31
31
  violet: "badge-violet",
32
32
  fuchsia: "badge-fuchsia",
33
- amber: "status-starting-badge border-transparent"
33
+ amber: "status-starting-badge"
34
34
  };
35
35
  var badgeSizes = {
36
36
  sm: "px-2 py-0.5 text-xs",
@@ -44,7 +44,7 @@ function Badge({
44
44
  className = "",
45
45
  customColors
46
46
  }) {
47
- const baseClasses = "inline-flex items-center font-medium rounded-full border";
47
+ const baseClasses = "inline-flex items-center font-medium rounded-full";
48
48
  const variantClasses5 = variant === "custom" ? "" : badgeVariants[variant];
49
49
  const sizeClasses5 = badgeSizes[size];
50
50
  const customStyles = variant === "custom" && customColors ? {
@@ -941,9 +941,12 @@ function ConfirmDialog({ isOpen, options, onConfirm, onCancel }) {
941
941
  return "primary";
942
942
  }
943
943
  };
944
- return /* @__PURE__ */ jsx(Modal, { isOpen, onClose: onCancel, title, children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
945
- /* @__PURE__ */ jsx("p", { className: "text-foreground", children: message }),
946
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-end", children: [
944
+ const isDanger = confirmButtonColor === "danger";
945
+ return /* @__PURE__ */ jsx(Modal, { isOpen, onClose: onCancel, title: "", className: "max-w-md", footer: null, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center py-4 px-2", children: [
946
+ /* @__PURE__ */ jsx("div", { className: `w-12 h-12 rounded-full flex items-center justify-center mb-4 ${isDanger ? "bg-danger/10" : "bg-info/10"}`, children: /* @__PURE__ */ jsx(RiErrorWarningLine, { className: `w-6 h-6 ${isDanger ? "text-danger" : "text-info"}` }) }),
947
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: title }),
948
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed mb-6", children: message }),
949
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 w-full justify-center", children: [
947
950
  /* @__PURE__ */ jsx(Button_default, { variant: "secondary", onClick: onCancel, children: cancelText }),
948
951
  /* @__PURE__ */ jsx(Button_default, { variant: getConfirmVariant(), onClick: onConfirm, autoFocus: true, children: confirmText })
949
952
  ] })
@@ -4123,8 +4126,10 @@ function SidebarNavItem({
4123
4126
  }) {
4124
4127
  const pathname = usePathname();
4125
4128
  const isActive = active !== void 0 ? active : exact ? pathname === href : pathname === href || pathname?.startsWith(`${href}/`);
4126
- const commonClasses = `group flex items-center gap-0 overflow-hidden rounded-md px-3 py-2 text-sm font-medium outline-hidden ring-sidebar-ring transition-all duration-300 focus-visible:ring-2 ${disabled ? "pointer-events-none opacity-35 cursor-not-allowed" : ""} ${isActive ? "bg-primary/15 backdrop-blur-md border border-primary/30 text-primary shadow-[0_0_12px_-3px_hsl(var(--primary)/0.2)] hover:bg-primary/20 hover:border-primary/50 hover:shadow-[0_0_16px_-2px_hsl(var(--primary)/0.3)]" : "border border-transparent text-sidebar-foreground hover:bg-sidebar-accent/50 hover:backdrop-blur-sm hover:border-sidebar-foreground/10 hover:text-sidebar-accent-foreground active:bg-sidebar-accent"} ${className}`;
4127
- const iconClasses = `mr-3 h-5 w-5 shrink-0 transition-all duration-300 ease-in-out${isActive ? " text-primary" : ""}`;
4129
+ const dataProps = {
4130
+ "data-active": String(isActive),
4131
+ "data-disabled": String(disabled)
4132
+ };
4128
4133
  if (disabled) {
4129
4134
  return /* @__PURE__ */ jsxs(
4130
4135
  "span",
@@ -4132,16 +4137,11 @@ function SidebarNavItem({
4132
4137
  "data-tooltip-id": "global-tooltip",
4133
4138
  "data-tooltip-content": title || "Not available",
4134
4139
  "aria-disabled": "true",
4135
- className: commonClasses,
4140
+ className: `nav-item ${className}`,
4141
+ ...dataProps,
4136
4142
  children: [
4137
- Icon && /* @__PURE__ */ jsx(
4138
- Icon,
4139
- {
4140
- className: iconClasses,
4141
- "aria-hidden": "true"
4142
- }
4143
- ),
4144
- /* @__PURE__ */ jsx("span", { children })
4143
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "nav-item-icon", "aria-hidden": "true" }),
4144
+ /* @__PURE__ */ jsx("span", { className: "nav-item-label", children })
4145
4145
  ]
4146
4146
  }
4147
4147
  );
@@ -4155,16 +4155,11 @@ function SidebarNavItem({
4155
4155
  "data-tooltip-id": title ? "global-tooltip" : void 0,
4156
4156
  "data-tooltip-content": title,
4157
4157
  "aria-current": isActive ? "page" : void 0,
4158
- className: `w-full text-left ${commonClasses}`,
4158
+ className: `nav-item w-full text-left ${className}`,
4159
+ ...dataProps,
4159
4160
  children: [
4160
- Icon && /* @__PURE__ */ jsx(
4161
- Icon,
4162
- {
4163
- className: iconClasses,
4164
- "aria-hidden": "true"
4165
- }
4166
- ),
4167
- /* @__PURE__ */ jsx("span", { children })
4161
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "nav-item-icon", "aria-hidden": "true" }),
4162
+ /* @__PURE__ */ jsx("span", { className: "nav-item-label", children })
4168
4163
  ]
4169
4164
  }
4170
4165
  );
@@ -4176,16 +4171,11 @@ function SidebarNavItem({
4176
4171
  onClick,
4177
4172
  "data-tooltip-id": title ? "global-tooltip" : void 0,
4178
4173
  "data-tooltip-content": title,
4179
- className: commonClasses,
4174
+ className: `nav-item ${className}`,
4175
+ ...dataProps,
4180
4176
  children: [
4181
- Icon && /* @__PURE__ */ jsx(
4182
- Icon,
4183
- {
4184
- className: iconClasses,
4185
- "aria-hidden": "true"
4186
- }
4187
- ),
4188
- /* @__PURE__ */ jsx("span", { children })
4177
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "nav-item-icon", "aria-hidden": "true" }),
4178
+ /* @__PURE__ */ jsx("span", { className: "nav-item-label", children })
4189
4179
  ]
4190
4180
  }
4191
4181
  );