@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.js +34 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,
|
|
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
|
|
13
|
-
primary: "
|
|
14
|
-
secondary: "bg-secondary text-secondary-foreground
|
|
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
|
|
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
|
|
24
|
-
orange: "status-restarting-badge
|
|
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
|
|
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
|
|
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
|
-
|
|
945
|
-
|
|
946
|
-
/* @__PURE__ */
|
|
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
|
|
4127
|
-
|
|
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:
|
|
4140
|
+
className: `nav-item ${className}`,
|
|
4141
|
+
...dataProps,
|
|
4136
4142
|
children: [
|
|
4137
|
-
Icon && /* @__PURE__ */ jsx(
|
|
4138
|
-
|
|
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 ${
|
|
4158
|
+
className: `nav-item w-full text-left ${className}`,
|
|
4159
|
+
...dataProps,
|
|
4159
4160
|
children: [
|
|
4160
|
-
Icon && /* @__PURE__ */ jsx(
|
|
4161
|
-
|
|
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:
|
|
4174
|
+
className: `nav-item ${className}`,
|
|
4175
|
+
...dataProps,
|
|
4180
4176
|
children: [
|
|
4181
|
-
Icon && /* @__PURE__ */ jsx(
|
|
4182
|
-
|
|
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
|
);
|