@gamecp/ui 0.1.40 → 0.1.42
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -261,8 +261,9 @@ interface SidebarNavItemProps {
|
|
|
261
261
|
exact?: boolean;
|
|
262
262
|
onClick?: () => void;
|
|
263
263
|
isButton?: boolean;
|
|
264
|
+
disabled?: boolean;
|
|
264
265
|
}
|
|
265
|
-
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, disabled, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
267
|
|
|
267
268
|
interface LoadingSpinnerProps {
|
|
268
269
|
message?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -261,8 +261,9 @@ interface SidebarNavItemProps {
|
|
|
261
261
|
exact?: boolean;
|
|
262
262
|
onClick?: () => void;
|
|
263
263
|
isButton?: boolean;
|
|
264
|
+
disabled?: boolean;
|
|
264
265
|
}
|
|
265
|
-
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function SidebarNavItem({ href, icon: Icon, children, active, className, title, exact, onClick, isButton, disabled, }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
266
267
|
|
|
267
268
|
interface LoadingSpinnerProps {
|
|
268
269
|
message?: string;
|
package/dist/index.js
CHANGED
|
@@ -3556,7 +3556,7 @@ function FormInput({
|
|
|
3556
3556
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3557
3557
|
"div",
|
|
3558
3558
|
{
|
|
3559
|
-
className: `relative flex-1 ${footerDescription ? "
|
|
3559
|
+
className: `relative flex-1 ${footerDescription ? "cursor-help" : ""}`,
|
|
3560
3560
|
"data-tooltip-id": footerDescription ? `${uniqueId}-help` : void 0,
|
|
3561
3561
|
children: [
|
|
3562
3562
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3575,7 +3575,7 @@ function FormInput({
|
|
|
3575
3575
|
} : handleSelectChange,
|
|
3576
3576
|
options: options || [],
|
|
3577
3577
|
placeholder: placeholder || "Select an option...",
|
|
3578
|
-
className: `${error ? "form-input-error" : ""} ${inputClassName}`,
|
|
3578
|
+
className: `${error ? "form-input-error" : ""} ${footerDescription ? "border-r-2 border-r-info/50 hover:border-r-info transition-colors" : ""} ${inputClassName}`,
|
|
3579
3579
|
multiple: multiSelect,
|
|
3580
3580
|
width: selectWidth,
|
|
3581
3581
|
searchable,
|
|
@@ -3607,7 +3607,7 @@ function FormInput({
|
|
|
3607
3607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3608
3608
|
"div",
|
|
3609
3609
|
{
|
|
3610
|
-
className: `relative flex-1 ${footerDescription ? "
|
|
3610
|
+
className: `relative flex-1 ${footerDescription ? "cursor-help" : ""}`,
|
|
3611
3611
|
"data-tooltip-id": footerDescription ? `${uniqueId}-help` : void 0,
|
|
3612
3612
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3613
3613
|
"textarea",
|
|
@@ -3626,7 +3626,7 @@ function FormInput({
|
|
|
3626
3626
|
maxLength,
|
|
3627
3627
|
"aria-invalid": error ? "true" : "false",
|
|
3628
3628
|
"aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
|
|
3629
|
-
className: `form-input ${error ? "form-input-error" : ""} ${inputClassName}`
|
|
3629
|
+
className: `form-input ${error ? "form-input-error" : ""} ${footerDescription ? "border-r-2 border-r-info/50 hover:border-r-info transition-colors" : ""} ${inputClassName}`
|
|
3630
3630
|
}
|
|
3631
3631
|
)
|
|
3632
3632
|
}
|
|
@@ -3644,7 +3644,7 @@ function FormInput({
|
|
|
3644
3644
|
] }) : type === "color" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3645
3645
|
"div",
|
|
3646
3646
|
{
|
|
3647
|
-
className: `flex items-center space-x-3 ${footerDescription ? "
|
|
3647
|
+
className: `flex items-center space-x-3 ${footerDescription ? "cursor-help" : ""}`,
|
|
3648
3648
|
"data-tooltip-id": footerDescription ? `${uniqueId}-help` : void 0,
|
|
3649
3649
|
children: [
|
|
3650
3650
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-10 h-10 border border-input rounded-md overflow-hidden bg-card", children: [
|
|
@@ -3714,7 +3714,7 @@ function FormInput({
|
|
|
3714
3714
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3715
3715
|
"div",
|
|
3716
3716
|
{
|
|
3717
|
-
className: `relative flex-1 ${footerDescription ? "
|
|
3717
|
+
className: `relative flex-1 ${footerDescription ? "cursor-help" : ""}`,
|
|
3718
3718
|
"data-tooltip-id": footerDescription ? `${uniqueId}-help` : void 0,
|
|
3719
3719
|
children: [
|
|
3720
3720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3736,7 +3736,7 @@ function FormInput({
|
|
|
3736
3736
|
onBlur,
|
|
3737
3737
|
"aria-invalid": error ? "true" : "false",
|
|
3738
3738
|
"aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
|
|
3739
|
-
className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-20" : "pr-10"} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
|
|
3739
|
+
className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-20" : "pr-10"} ${footerDescription ? "border-r-2 border-r-info/50 hover:border-r-info transition-colors" : ""} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
|
|
3740
3740
|
}
|
|
3741
3741
|
),
|
|
3742
3742
|
shouldShowIcons(type) && (() => {
|
|
@@ -3804,7 +3804,7 @@ function FormInput({
|
|
|
3804
3804
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3805
3805
|
"div",
|
|
3806
3806
|
{
|
|
3807
|
-
className: `flex items-center ${variablePicker ? "input-group" : ""} ${footerDescription ? "
|
|
3807
|
+
className: `flex items-center ${variablePicker ? "input-group" : ""} ${footerDescription ? "cursor-help" : ""}`,
|
|
3808
3808
|
"data-tooltip-id": footerDescription ? `${uniqueId}-help` : void 0,
|
|
3809
3809
|
children: [
|
|
3810
3810
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group flex-1", children: [
|
|
@@ -3831,7 +3831,7 @@ function FormInput({
|
|
|
3831
3831
|
onBlur,
|
|
3832
3832
|
"aria-invalid": error ? "true" : "false",
|
|
3833
3833
|
"aria-describedby": error ? `${name}-error` : description ? `${name}-description` : void 0,
|
|
3834
|
-
className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-10" : ""} ${variablePicker ? "rounded-r-none border-r-0" : ""} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
|
|
3834
|
+
className: `form-input ${error ? "form-input-error" : ""} ${readOnly ? "bg-muted cursor-default" : ""} ${copyable ? "pr-10" : ""} ${variablePicker ? "rounded-r-none border-r-0" : ""} ${footerDescription && !variablePicker ? "border-r-2 border-r-info/50 hover:border-r-info transition-colors" : ""} ${getInputPaddingClasses(type, getIconConfig(icon))} ${inputClassName}`
|
|
3835
3835
|
}
|
|
3836
3836
|
),
|
|
3837
3837
|
shouldShowIcons(type) && (() => {
|
|
@@ -4125,19 +4125,42 @@ function SidebarNavItem({
|
|
|
4125
4125
|
title,
|
|
4126
4126
|
exact = false,
|
|
4127
4127
|
onClick,
|
|
4128
|
-
isButton = false
|
|
4128
|
+
isButton = false,
|
|
4129
|
+
disabled = false
|
|
4129
4130
|
}) {
|
|
4130
4131
|
const pathname = navigation.usePathname();
|
|
4131
4132
|
const isActive = active !== void 0 ? active : exact ? pathname === href : pathname === href || pathname?.startsWith(`${href}/`);
|
|
4132
|
-
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
|
|
4133
|
+
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}`;
|
|
4133
4134
|
const iconClasses = `mr-3 h-5 w-5 shrink-0 transition-all duration-300 ease-in-out${isActive ? " text-primary" : ""}`;
|
|
4135
|
+
if (disabled) {
|
|
4136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4137
|
+
"span",
|
|
4138
|
+
{
|
|
4139
|
+
"data-tooltip-id": "global-tooltip",
|
|
4140
|
+
"data-tooltip-content": title || "Not available",
|
|
4141
|
+
"aria-disabled": "true",
|
|
4142
|
+
className: commonClasses,
|
|
4143
|
+
children: [
|
|
4144
|
+
Icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4145
|
+
Icon,
|
|
4146
|
+
{
|
|
4147
|
+
className: iconClasses,
|
|
4148
|
+
"aria-hidden": "true"
|
|
4149
|
+
}
|
|
4150
|
+
),
|
|
4151
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
4152
|
+
]
|
|
4153
|
+
}
|
|
4154
|
+
);
|
|
4155
|
+
}
|
|
4134
4156
|
if (isButton) {
|
|
4135
4157
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4136
4158
|
"button",
|
|
4137
4159
|
{
|
|
4138
4160
|
type: "button",
|
|
4139
4161
|
onClick,
|
|
4140
|
-
title,
|
|
4162
|
+
"data-tooltip-id": title ? "global-tooltip" : void 0,
|
|
4163
|
+
"data-tooltip-content": title,
|
|
4141
4164
|
"aria-current": isActive ? "page" : void 0,
|
|
4142
4165
|
className: `w-full text-left ${commonClasses}`,
|
|
4143
4166
|
children: [
|
|
@@ -4158,6 +4181,8 @@ function SidebarNavItem({
|
|
|
4158
4181
|
{
|
|
4159
4182
|
href,
|
|
4160
4183
|
onClick,
|
|
4184
|
+
"data-tooltip-id": title ? "global-tooltip" : void 0,
|
|
4185
|
+
"data-tooltip-content": title,
|
|
4161
4186
|
className: commonClasses,
|
|
4162
4187
|
children: [
|
|
4163
4188
|
Icon && /* @__PURE__ */ jsxRuntime.jsx(
|