@gamecp/ui 0.1.32 → 0.1.34
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 +366 -19
- package/dist/index.d.ts +366 -19
- package/dist/index.js +3590 -1922
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3672 -2022
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default, { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes } from 'react';
|
|
4
4
|
import { IconType } from 'react-icons';
|
|
5
5
|
|
|
6
|
-
type BadgeVariant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'gray' | 'purple' | 'pink' | 'indigo' | 'amber' | '
|
|
6
|
+
type BadgeVariant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'gray' | 'purple' | 'pink' | 'indigo' | 'amber' | 'yellow' | 'orange' | 'teal' | 'cyan' | 'lime' | 'emerald' | 'rose' | 'sky' | 'violet' | 'fuchsia' | 'amber' | 'custom';
|
|
7
7
|
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
interface BadgeProps {
|
|
9
9
|
children: React__default.ReactNode;
|
|
@@ -71,12 +71,11 @@ interface CardProps extends AccordionCardProps, StatusCardProps {
|
|
|
71
71
|
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
72
72
|
minHeight?: string;
|
|
73
73
|
maxHeight?: string;
|
|
74
|
-
id?: string;
|
|
75
74
|
headerBorder?: string;
|
|
76
75
|
headerBg?: string;
|
|
77
76
|
headerStatus?: 'online' | 'offline' | 'maintenance' | 'error' | 'restarting' | 'starting' | 'success' | 'info' | 'updating' | 'unknown';
|
|
78
77
|
}
|
|
79
|
-
declare function Card({ children, className, onClick, disabled, padding, borderAccent, variant, overflow, minHeight, maxHeight, hover, clickable, title, subtitle, description, icon: Icon, iconColor, iconSize, actionButton, headerClassName, accordion, defaultExpanded, onToggle, contentClassName, status, statusIcon, statusText, headerBorder, headerBg, headerStatus,
|
|
78
|
+
declare function Card({ children, className, onClick, disabled, padding, borderAccent, variant, overflow, minHeight, maxHeight, hover, clickable, title, subtitle, description, icon: Icon, iconColor, iconSize, actionButton, headerClassName, accordion, defaultExpanded, onToggle, contentClassName, status, statusIcon, statusText, headerBorder, headerBg, headerStatus, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
80
79
|
|
|
81
80
|
interface ConfirmDialogOptions {
|
|
82
81
|
title: string;
|
|
@@ -138,18 +137,18 @@ declare const EmptyState: React__default.FC<EmptyStateProps>;
|
|
|
138
137
|
interface SelectOption {
|
|
139
138
|
value: string;
|
|
140
139
|
label: string;
|
|
141
|
-
description?:
|
|
140
|
+
description?: React__default.ReactNode;
|
|
142
141
|
}
|
|
143
142
|
type IconConfig = React__default.ReactNode | {
|
|
144
143
|
left?: React__default.ReactNode;
|
|
145
144
|
right?: React__default.ReactNode;
|
|
146
145
|
};
|
|
147
146
|
interface FormInputProps {
|
|
148
|
-
label
|
|
147
|
+
label: string;
|
|
149
148
|
name: string;
|
|
150
149
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'select' | 'checkbox' | 'textarea' | 'color';
|
|
151
150
|
value: string | number | boolean;
|
|
152
|
-
onChange: (e: React__default.ChangeEvent<HTMLInputElement | HTMLTextAreaElement
|
|
151
|
+
onChange: (e: React__default.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
153
152
|
placeholder?: string;
|
|
154
153
|
required?: boolean;
|
|
155
154
|
disabled?: boolean;
|
|
@@ -178,8 +177,16 @@ interface FormInputProps {
|
|
|
178
177
|
isLoading?: boolean;
|
|
179
178
|
copyable?: boolean;
|
|
180
179
|
readOnly?: boolean;
|
|
180
|
+
sideActionTabbable?: boolean;
|
|
181
|
+
inputRef?: React__default.RefObject<HTMLInputElement | HTMLTextAreaElement>;
|
|
182
|
+
variablePicker?: {
|
|
183
|
+
mode?: 'predefined' | 'fields' | 'both' | 'environment' | 'admin' | 'all';
|
|
184
|
+
fields?: any[];
|
|
185
|
+
environmentVars?: Record<string, any>;
|
|
186
|
+
adminEnvironmentVars?: Record<string, any>;
|
|
187
|
+
};
|
|
181
188
|
}
|
|
182
|
-
declare function FormInput({ label, name, type, value, onChange, placeholder, required, disabled, error, className, inputClassName, min, max, step, maxLength, autoComplete, description, footerDescription, autoFocus, onKeyDown, onBlur, icon, options, multiSelect, selectWidth, searchable, clearable, rows, showHidePassword, onGeneratePassword, isLoading, copyable, readOnly, }: FormInputProps): react_jsx_runtime.JSX.Element;
|
|
189
|
+
declare function FormInput({ label, name, type, value, onChange, placeholder, required, disabled, error, className, inputClassName, min, max, step, maxLength, autoComplete, description, footerDescription, autoFocus, onKeyDown, onBlur, icon, options, multiSelect, selectWidth, searchable, clearable, rows, showHidePassword, onGeneratePassword, isLoading, copyable, readOnly, sideActionTabbable, inputRef, variablePicker, }: FormInputProps): react_jsx_runtime.JSX.Element;
|
|
183
190
|
|
|
184
191
|
interface FormSectionProps {
|
|
185
192
|
title: string;
|
|
@@ -202,8 +209,37 @@ interface InfoBoxProps {
|
|
|
202
209
|
children: React__default.ReactNode;
|
|
203
210
|
variant?: 'default' | 'warning' | 'info' | 'success' | 'danger';
|
|
204
211
|
className?: string;
|
|
212
|
+
/** Compact mode for inline usage */
|
|
213
|
+
compact?: boolean;
|
|
205
214
|
}
|
|
206
|
-
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated Use Notice component instead. InfoBox is now a wrapper around Notice.
|
|
217
|
+
*/
|
|
218
|
+
declare function InfoBox({ title, children, variant, className, compact, }: InfoBoxProps): react_jsx_runtime.JSX.Element;
|
|
219
|
+
|
|
220
|
+
interface NoticeProps {
|
|
221
|
+
/** Main content of the notice */
|
|
222
|
+
children: React__default.ReactNode;
|
|
223
|
+
/** Variant type of the notice */
|
|
224
|
+
variant?: 'info' | 'warning' | 'success' | 'danger' | 'default';
|
|
225
|
+
/** Icon to display. If not provided, uses default for variant */
|
|
226
|
+
icon?: React__default.ReactNode;
|
|
227
|
+
/** Optional title */
|
|
228
|
+
title?: string | React__default.ReactNode;
|
|
229
|
+
/** Additional CSS classes */
|
|
230
|
+
className?: string;
|
|
231
|
+
/** Whether to show the icon */
|
|
232
|
+
showIcon?: boolean;
|
|
233
|
+
/** Custom content to the right (e.g., a toggle button) */
|
|
234
|
+
action?: React__default.ReactNode;
|
|
235
|
+
/** Compact mode for inline usage (less padding, smaller text) */
|
|
236
|
+
compact?: boolean;
|
|
237
|
+
}
|
|
238
|
+
declare function Notice({ children, variant, icon, title, className, showIcon, action, compact, }: NoticeProps): react_jsx_runtime.JSX.Element;
|
|
239
|
+
declare function InfoNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
|
|
240
|
+
declare function WarningNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
|
|
241
|
+
declare function SuccessNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
|
|
242
|
+
declare function DangerNotice(props: Omit<NoticeProps, 'variant'>): react_jsx_runtime.JSX.Element;
|
|
207
243
|
|
|
208
244
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
209
245
|
href: string;
|
|
@@ -244,10 +280,12 @@ interface ModalProps {
|
|
|
244
280
|
className?: string;
|
|
245
281
|
footer?: ReactNode;
|
|
246
282
|
fullScreen?: boolean;
|
|
283
|
+
fullHeight?: boolean;
|
|
247
284
|
noPadding?: boolean;
|
|
248
285
|
footerBg?: 'white' | 'gray';
|
|
249
286
|
variant?: 'default' | 'plain';
|
|
250
287
|
scrollable?: boolean;
|
|
288
|
+
hasUnsavedChanges?: boolean;
|
|
251
289
|
'aria-describedby'?: string;
|
|
252
290
|
customStyles?: {
|
|
253
291
|
container?: string;
|
|
@@ -257,7 +295,7 @@ interface ModalProps {
|
|
|
257
295
|
footer?: string;
|
|
258
296
|
};
|
|
259
297
|
}
|
|
260
|
-
declare function Modal({ isOpen, onClose, children, title, header, blocking, size, className, footer, fullScreen, noPadding, footerBg, variant, scrollable, 'aria-describedby': ariaDescribedBy, customStyles, }: ModalProps): React$1.ReactPortal | null;
|
|
298
|
+
declare function Modal({ isOpen, onClose, children, title, header, blocking, size, className, footer, fullScreen, fullHeight, noPadding, footerBg, variant, scrollable, hasUnsavedChanges, 'aria-describedby': ariaDescribedBy, customStyles, }: ModalProps): React$1.ReactPortal | null;
|
|
261
299
|
|
|
262
300
|
interface PageHeaderProps {
|
|
263
301
|
icon?: IconType;
|
|
@@ -279,9 +317,12 @@ interface SwitchProps {
|
|
|
279
317
|
className?: string;
|
|
280
318
|
size?: 'sm' | 'md' | 'lg';
|
|
281
319
|
variant?: SwitchVariant;
|
|
282
|
-
|
|
320
|
+
tooltipId?: string;
|
|
321
|
+
tooltipContent?: string;
|
|
283
322
|
}
|
|
284
|
-
declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, }: SwitchProps
|
|
323
|
+
declare function Switch({ checked, onChange, disabled, label, description, className, size, variant, labelPosition, tooltipId, tooltipContent, }: SwitchProps & {
|
|
324
|
+
labelPosition?: 'left' | 'right';
|
|
325
|
+
}): react_jsx_runtime.JSX.Element;
|
|
285
326
|
|
|
286
327
|
interface SmartDropdownProps {
|
|
287
328
|
isOpen: boolean;
|
|
@@ -557,7 +598,7 @@ declare function FilterToggleButton({ isOpen, onClick, onClear, activeCount, cla
|
|
|
557
598
|
}): react_jsx_runtime.JSX.Element;
|
|
558
599
|
declare function MobileSearchLayout({ searchInput, filters, viewControls, activeFilterCount, onClearFilters, className, filterInline, searchButton, }: {
|
|
559
600
|
searchInput: ReactNode;
|
|
560
|
-
filters
|
|
601
|
+
filters?: ReactNode;
|
|
561
602
|
viewControls?: ReactNode;
|
|
562
603
|
activeFilterCount?: number;
|
|
563
604
|
onClearFilters?: () => void;
|
|
@@ -576,32 +617,37 @@ declare function ViewToggle({ currentView, onViewChange, className, }: ViewToggl
|
|
|
576
617
|
interface ActionButtonProps {
|
|
577
618
|
icon?: React__default.ComponentType<{
|
|
578
619
|
className?: string;
|
|
620
|
+
size?: number;
|
|
621
|
+
style?: React__default.CSSProperties;
|
|
579
622
|
}>;
|
|
580
623
|
label?: string;
|
|
581
|
-
onClick?: () => void | Promise<
|
|
624
|
+
onClick?: () => void | Promise<any>;
|
|
582
625
|
href?: string;
|
|
583
626
|
disabled?: boolean;
|
|
584
627
|
loading?: boolean;
|
|
585
628
|
loadingIcon?: React__default.ComponentType<{
|
|
586
629
|
className?: string;
|
|
630
|
+
size?: number;
|
|
631
|
+
style?: React__default.CSSProperties;
|
|
587
632
|
}>;
|
|
588
633
|
disableLoadingSpin?: boolean;
|
|
589
|
-
size?: 'sm' | 'md' | 'lg';
|
|
634
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
590
635
|
iconOnly?: boolean;
|
|
591
636
|
className?: string;
|
|
592
637
|
title?: string;
|
|
593
638
|
tooltipId?: string;
|
|
639
|
+
tooltipContent?: string;
|
|
594
640
|
tooltipPlace?: 'top' | 'bottom' | 'left' | 'right';
|
|
595
641
|
tooltipOffset?: number;
|
|
596
642
|
tooltipDelayShow?: number;
|
|
597
643
|
tooltipDelayHide?: number;
|
|
598
644
|
type?: 'button' | 'submit' | 'reset';
|
|
599
|
-
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'edit' | 'delete' | 'deactivate' | 'activate' | 'view' | 'metrics' | 'start' | 'stop' | 'restart' | 'pause' | 'clone';
|
|
645
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'edit' | 'delete' | 'deactivate' | 'activate' | 'view' | 'metrics' | 'start' | 'stop' | 'restart' | 'pause' | 'clone' | 'input';
|
|
600
646
|
terminalMode?: boolean;
|
|
601
647
|
fill?: boolean;
|
|
602
648
|
[key: string]: any;
|
|
603
649
|
}
|
|
604
|
-
declare function ActionButton({ icon: IconComponent, label, onClick, href, disabled, size, iconOnly, className, title, tooltipId, tooltipPlace, tooltipOffset, tooltipDelayShow, tooltipDelayHide, type, variant, terminalMode, fill, loading: externalLoading, // Extract loading prop to prevent it from being passed to DOM
|
|
650
|
+
declare function ActionButton({ icon: IconComponent, label, onClick, href, disabled, size, iconOnly, className, title, tooltipId, tooltipContent, tooltipPlace, tooltipOffset, tooltipDelayShow, tooltipDelayHide, type, variant, terminalMode, fill, loading: externalLoading, // Extract loading prop to prevent it from being passed to DOM
|
|
605
651
|
loadingIcon: LoadingIconComponent, // Custom loading icon
|
|
606
652
|
disableLoadingSpin, // Disable spin animation for custom loading icons
|
|
607
653
|
...restProps }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
@@ -615,8 +661,9 @@ interface SharedTooltipProps {
|
|
|
615
661
|
className?: string;
|
|
616
662
|
style?: React__default.CSSProperties;
|
|
617
663
|
children?: React__default.ReactNode;
|
|
664
|
+
variant?: 'default' | 'help';
|
|
618
665
|
}
|
|
619
|
-
declare function SharedTooltip({ id, place, offset, delayShow, delayHide, className, style, children, }: SharedTooltipProps): react_jsx_runtime.JSX.Element;
|
|
666
|
+
declare function SharedTooltip({ id, place, offset, delayShow, delayHide, className, style, children, variant, }: SharedTooltipProps): react_jsx_runtime.JSX.Element;
|
|
620
667
|
|
|
621
668
|
interface SpinnerProps {
|
|
622
669
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -643,6 +690,306 @@ interface IconButtonWithCountProps {
|
|
|
643
690
|
}
|
|
644
691
|
declare function IconButtonWithCount({ icon, label, count, onClick, onClear, showLabel, className, buttonClassName, countVariant, clearVariant, tooltipId, tooltipContent, clearTooltipId, clearTooltipContent, }: IconButtonWithCountProps): react_jsx_runtime.JSX.Element;
|
|
645
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Single dropdown item - flexible to support menus, selects, filters
|
|
695
|
+
*/
|
|
696
|
+
interface DropdownItem$1 {
|
|
697
|
+
/** Unique value for selection */
|
|
698
|
+
value: string;
|
|
699
|
+
/** Display label - string or ReactNode */
|
|
700
|
+
label: ReactNode;
|
|
701
|
+
/** Optional description/subtitle */
|
|
702
|
+
description?: ReactNode;
|
|
703
|
+
/** Optional icon (React component, element, or null) */
|
|
704
|
+
icon?: ReactNode;
|
|
705
|
+
/** Whether this item is disabled */
|
|
706
|
+
disabled?: boolean;
|
|
707
|
+
/** Visual variant for the item */
|
|
708
|
+
variant?: 'default' | 'danger' | 'success' | 'warning';
|
|
709
|
+
/** Optional example text (for variable inputs) */
|
|
710
|
+
example?: string;
|
|
711
|
+
/** Any additional metadata */
|
|
712
|
+
metadata?: Record<string, unknown>;
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Pagination info for dropdown footer
|
|
716
|
+
*/
|
|
717
|
+
interface DropdownPaginationInfo {
|
|
718
|
+
page: number;
|
|
719
|
+
limit: number;
|
|
720
|
+
total: number;
|
|
721
|
+
pages: number;
|
|
722
|
+
hasNext: boolean;
|
|
723
|
+
hasPrev: boolean;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Position options for dropdown placement
|
|
727
|
+
*/
|
|
728
|
+
type DropdownPosition = 'auto' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-left-aligned' | 'bottom-left-aligned';
|
|
729
|
+
/**
|
|
730
|
+
* Base props shared by all dropdown variants
|
|
731
|
+
*/
|
|
732
|
+
interface DropdownBaseProps {
|
|
733
|
+
/** The trigger element that opens the dropdown */
|
|
734
|
+
trigger: ReactNode;
|
|
735
|
+
/** Whether the dropdown is disabled */
|
|
736
|
+
disabled?: boolean;
|
|
737
|
+
/** Width of dropdown panel */
|
|
738
|
+
width?: number | 'auto' | 'fit-content';
|
|
739
|
+
/** Max height before scrolling */
|
|
740
|
+
maxHeight?: number;
|
|
741
|
+
/** Offset from trigger */
|
|
742
|
+
offset?: number;
|
|
743
|
+
/** Position preference */
|
|
744
|
+
position?: DropdownPosition;
|
|
745
|
+
/** Custom className for dropdown panel */
|
|
746
|
+
className?: string;
|
|
747
|
+
/** Custom className for trigger wrapper (for width classes like w-full) */
|
|
748
|
+
triggerClassName?: string;
|
|
749
|
+
/** ID for accessibility */
|
|
750
|
+
id?: string;
|
|
751
|
+
/** Called when dropdown opens - useful for lazy loading */
|
|
752
|
+
onOpen?: () => void;
|
|
753
|
+
/** Called when dropdown closes */
|
|
754
|
+
onClose?: () => void;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Props for item-based dropdowns (menus, selects)
|
|
758
|
+
*/
|
|
759
|
+
interface DropdownItemsProps {
|
|
760
|
+
/** Array of items to display */
|
|
761
|
+
items: DropdownItem$1[];
|
|
762
|
+
/** Currently selected value(s) */
|
|
763
|
+
value?: string | string[];
|
|
764
|
+
/** Selection change handler */
|
|
765
|
+
onChange?: (value: string | string[]) => void;
|
|
766
|
+
/** Allow multiple selections */
|
|
767
|
+
multiple?: boolean;
|
|
768
|
+
/** Close dropdown after selection (default: true for single, false for multiple) */
|
|
769
|
+
closeOnSelect?: boolean;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Props for custom content dropdowns
|
|
773
|
+
*/
|
|
774
|
+
interface DropdownContentProps {
|
|
775
|
+
/** Custom children content */
|
|
776
|
+
children: ReactNode;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Slot props for header/footer
|
|
780
|
+
*/
|
|
781
|
+
interface DropdownSlotProps {
|
|
782
|
+
/** Header content (search, filters, etc.) */
|
|
783
|
+
header?: ReactNode;
|
|
784
|
+
/** Footer content (pagination, actions, etc.) */
|
|
785
|
+
footer?: ReactNode;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Full Dropdown component props - supports items OR children
|
|
789
|
+
*/
|
|
790
|
+
type DropdownProps = DropdownBaseProps & DropdownSlotProps & ((DropdownItemsProps & {
|
|
791
|
+
children?: never;
|
|
792
|
+
}) | (DropdownContentProps & {
|
|
793
|
+
items?: never;
|
|
794
|
+
value?: never;
|
|
795
|
+
onChange?: never;
|
|
796
|
+
multiple?: never;
|
|
797
|
+
closeOnSelect?: never;
|
|
798
|
+
}));
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Core Dropdown component
|
|
802
|
+
*
|
|
803
|
+
* Handles:
|
|
804
|
+
* - Open/close state management
|
|
805
|
+
* - Portal-based positioning
|
|
806
|
+
* - Animation
|
|
807
|
+
* - Click-outside-to-close
|
|
808
|
+
* - Resize/scroll repositioning
|
|
809
|
+
* - Keyboard (Escape to close)
|
|
810
|
+
*
|
|
811
|
+
* Use with `items` for standard menus/selects,
|
|
812
|
+
* or `children` for custom content.
|
|
813
|
+
*/
|
|
814
|
+
declare function Dropdown({ trigger, disabled, width, maxHeight, offset, position, className, triggerClassName, id, header, footer, onOpen, onClose, items, value, onChange, multiple, closeOnSelect, children, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
815
|
+
|
|
816
|
+
interface DropdownItemProps {
|
|
817
|
+
item: DropdownItem$1;
|
|
818
|
+
selected?: boolean;
|
|
819
|
+
multiple?: boolean;
|
|
820
|
+
onClick: () => void;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Single dropdown item renderer
|
|
824
|
+
* Supports icon, label, description, and selection state
|
|
825
|
+
*/
|
|
826
|
+
declare function DropdownItem({ item, selected, multiple, onClick, }: DropdownItemProps): react_jsx_runtime.JSX.Element;
|
|
827
|
+
|
|
828
|
+
interface SelectProps {
|
|
829
|
+
/** Options to choose from */
|
|
830
|
+
options: DropdownItem$1[];
|
|
831
|
+
/** Currently selected value (string for single, string[] for multiple) */
|
|
832
|
+
value?: string | string[];
|
|
833
|
+
/** Selection change handler */
|
|
834
|
+
onChange: (value: string | string[]) => void;
|
|
835
|
+
/** Placeholder when nothing selected */
|
|
836
|
+
placeholder?: string;
|
|
837
|
+
/** Enable search/filter */
|
|
838
|
+
searchable?: boolean;
|
|
839
|
+
/** Server-side search callback */
|
|
840
|
+
onSearch?: (search: string) => void;
|
|
841
|
+
/** Show loading state */
|
|
842
|
+
isLoading?: boolean;
|
|
843
|
+
/** Allow multiple selections */
|
|
844
|
+
multiple?: boolean;
|
|
845
|
+
/** Allow clearing selection */
|
|
846
|
+
clearable?: boolean;
|
|
847
|
+
/** Dropdown width */
|
|
848
|
+
width?: number | 'auto';
|
|
849
|
+
/** Max dropdown height */
|
|
850
|
+
maxHeight?: number;
|
|
851
|
+
/** Disabled state */
|
|
852
|
+
disabled?: boolean;
|
|
853
|
+
/** Additional className for trigger */
|
|
854
|
+
className?: string;
|
|
855
|
+
/** Optional icon for trigger */
|
|
856
|
+
icon?: React.ReactNode;
|
|
857
|
+
/** Pagination data */
|
|
858
|
+
pagination?: DropdownPaginationInfo;
|
|
859
|
+
/** Page change handler */
|
|
860
|
+
onPageChange?: (page: number) => void;
|
|
861
|
+
/** Called when dropdown opens */
|
|
862
|
+
onOpen?: () => void;
|
|
863
|
+
/** Called when dropdown closes */
|
|
864
|
+
onClose?: () => void;
|
|
865
|
+
/** Visual variant */
|
|
866
|
+
variant?: 'default' | 'compact';
|
|
867
|
+
/** Custom render for selected value display */
|
|
868
|
+
renderSelected?: (option: DropdownItem$1) => ReactNode;
|
|
869
|
+
/** Keep dropdown open after selection (useful for multi-select) */
|
|
870
|
+
keepOpen?: boolean;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Select preset - combines Dropdown with SelectTrigger
|
|
874
|
+
* Replaces SmartSelect with a cleaner API
|
|
875
|
+
*/
|
|
876
|
+
declare function Select({ options, value, onChange, placeholder, searchable, onSearch, isLoading, multiple, clearable, width, maxHeight, disabled, className, icon, pagination, onPageChange, onOpen, onClose, variant, renderSelected, keepOpen, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
877
|
+
|
|
878
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2' | '3' | '4' | '5' | '6';
|
|
879
|
+
interface DropDownArrowProps {
|
|
880
|
+
isOpen: boolean;
|
|
881
|
+
disabled?: boolean;
|
|
882
|
+
size?: Size;
|
|
883
|
+
color?: 'default' | 'gray' | 'primary' | 'secondary' | 'destructive' | 'currentColor' | 'danger';
|
|
884
|
+
className?: string;
|
|
885
|
+
'aria-hidden'?: boolean;
|
|
886
|
+
}
|
|
887
|
+
declare const colorClasses: {
|
|
888
|
+
default: string;
|
|
889
|
+
currentColor: string;
|
|
890
|
+
gray: string;
|
|
891
|
+
primary: string;
|
|
892
|
+
secondary: string;
|
|
893
|
+
destructive: string;
|
|
894
|
+
danger: string;
|
|
895
|
+
};
|
|
896
|
+
declare function DropDownArrow({ isOpen, disabled, size, color, className, 'aria-hidden': ariaHidden, }: DropDownArrowProps & {
|
|
897
|
+
color?: keyof typeof colorClasses;
|
|
898
|
+
}): react_jsx_runtime.JSX.Element;
|
|
899
|
+
|
|
900
|
+
interface ErrorMessageProps {
|
|
901
|
+
message: string | React__default.ReactNode;
|
|
902
|
+
type?: 'error' | 'warning' | 'success' | 'info' | 'unsaved';
|
|
903
|
+
className?: string;
|
|
904
|
+
icon?: React__default.ReactNode;
|
|
905
|
+
dismissible?: boolean;
|
|
906
|
+
onDismiss?: () => void;
|
|
907
|
+
/** Action button configuration for unsaved type */
|
|
908
|
+
actionButton?: {
|
|
909
|
+
text: string;
|
|
910
|
+
loadingText?: string;
|
|
911
|
+
isLoading?: boolean;
|
|
912
|
+
onClick: () => void;
|
|
913
|
+
icon?: React__default.ReactNode;
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
declare function ErrorMessage({ message, type, className, icon, dismissible, onDismiss, actionButton, }: ErrorMessageProps): react_jsx_runtime.JSX.Element;
|
|
917
|
+
declare function ErrorAlert({ message, className, dismissible, onDismiss, }: Omit<ErrorMessageProps, 'type'>): react_jsx_runtime.JSX.Element;
|
|
918
|
+
declare function SuccessAlert({ message, className, dismissible, onDismiss, }: Omit<ErrorMessageProps, 'type'>): react_jsx_runtime.JSX.Element;
|
|
919
|
+
declare function WarningAlert({ message, className, dismissible, onDismiss, }: Omit<ErrorMessageProps, 'type'>): react_jsx_runtime.JSX.Element;
|
|
920
|
+
declare function InfoAlert({ message, className, dismissible, onDismiss, icon, }: Omit<ErrorMessageProps, 'type'>): react_jsx_runtime.JSX.Element;
|
|
921
|
+
declare function UnsavedAlert({ message, className, actionButton, }: Omit<ErrorMessageProps, 'type' | 'dismissible' | 'onDismiss'>): react_jsx_runtime.JSX.Element;
|
|
922
|
+
|
|
923
|
+
interface UnsavedChangesNotificationProps {
|
|
924
|
+
/** Whether to show the notification */
|
|
925
|
+
show: boolean;
|
|
926
|
+
/** Variant style - 'banner' for full-width banner, 'compact' for inline notification */
|
|
927
|
+
variant?: 'banner' | 'compact';
|
|
928
|
+
/** Custom message text */
|
|
929
|
+
message?: string;
|
|
930
|
+
/** Custom subtitle text (only used in banner variant) */
|
|
931
|
+
subtitle?: string;
|
|
932
|
+
/** Whether the save button is loading */
|
|
933
|
+
isSaving?: boolean;
|
|
934
|
+
/** Save button text */
|
|
935
|
+
saveButtonText?: string;
|
|
936
|
+
/** Save button loading text */
|
|
937
|
+
saveButtonLoadingText?: string;
|
|
938
|
+
/** Callback when save button is clicked */
|
|
939
|
+
onSave?: () => void;
|
|
940
|
+
/** Additional CSS classes */
|
|
941
|
+
className?: string;
|
|
942
|
+
/** Whether to show the save button */
|
|
943
|
+
showSaveButton?: boolean;
|
|
944
|
+
}
|
|
945
|
+
declare function UnsavedChangesNotification({ show, variant, message, subtitle, isSaving, saveButtonText, saveButtonLoadingText, onSave, className, showSaveButton, }: UnsavedChangesNotificationProps): react_jsx_runtime.JSX.Element | null;
|
|
946
|
+
|
|
947
|
+
interface VariableItem {
|
|
948
|
+
key: string;
|
|
949
|
+
name: string;
|
|
950
|
+
description: string;
|
|
951
|
+
example: string;
|
|
952
|
+
category: 'server' | 'network' | 'game' | 'system' | 'field' | 'environment' | 'admin';
|
|
953
|
+
type?: 'predefined' | 'field' | 'environment' | 'admin';
|
|
954
|
+
}
|
|
955
|
+
interface VariableSelectorProps {
|
|
956
|
+
onSelectVariable: (variable: VariableItem) => void;
|
|
957
|
+
className?: string;
|
|
958
|
+
buttonText?: string;
|
|
959
|
+
buttonClassName?: string;
|
|
960
|
+
buttonTitle?: string;
|
|
961
|
+
tooltipId?: string;
|
|
962
|
+
mode?: 'predefined' | 'fields' | 'both' | 'environment' | 'admin' | 'all';
|
|
963
|
+
fields?: any[];
|
|
964
|
+
environmentVars?: Record<string, any>;
|
|
965
|
+
adminEnvironmentVars?: Record<string, any>;
|
|
966
|
+
showSearch?: boolean;
|
|
967
|
+
showCategories?: boolean;
|
|
968
|
+
placeholder?: string;
|
|
969
|
+
}
|
|
970
|
+
declare function VariableSelector({ onSelectVariable, className, buttonText, buttonClassName, buttonTitle, tooltipId, mode, fields, environmentVars, adminEnvironmentVars, showSearch, showCategories, placeholder, }: VariableSelectorProps): react_jsx_runtime.JSX.Element;
|
|
971
|
+
interface VariableInputProps {
|
|
972
|
+
name?: string;
|
|
973
|
+
label?: string;
|
|
974
|
+
value: string;
|
|
975
|
+
onChange: (value: string) => void;
|
|
976
|
+
placeholder?: string;
|
|
977
|
+
error?: string;
|
|
978
|
+
className?: string;
|
|
979
|
+
autoFocus?: boolean;
|
|
980
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
981
|
+
multiline?: boolean;
|
|
982
|
+
rows?: number;
|
|
983
|
+
disabled?: boolean;
|
|
984
|
+
description?: string | React.ReactNode;
|
|
985
|
+
footerDescription?: string | React.ReactNode;
|
|
986
|
+
mode?: 'predefined' | 'fields' | 'both' | 'environment' | 'admin' | 'all';
|
|
987
|
+
fields?: any[];
|
|
988
|
+
environmentVars?: Record<string, any>;
|
|
989
|
+
adminEnvironmentVars?: Record<string, any>;
|
|
990
|
+
}
|
|
991
|
+
declare function VariableInput({ name, label, value, onChange, placeholder, error, className, autoFocus, onKeyDown, multiline, rows, disabled, description, footerDescription, mode, fields, environmentVars, adminEnvironmentVars, }: VariableInputProps): react_jsx_runtime.JSX.Element;
|
|
992
|
+
|
|
646
993
|
/**
|
|
647
994
|
* @gamecp/ui - GameCP UI Component Library
|
|
648
995
|
*
|
|
@@ -650,6 +997,6 @@ declare function IconButtonWithCount({ icon, label, count, onClick, onClear, sho
|
|
|
650
997
|
* All components are built with TypeScript and Tailwind CSS.
|
|
651
998
|
*/
|
|
652
999
|
|
|
653
|
-
declare const VERSION = "0.1.
|
|
1000
|
+
declare const VERSION = "0.1.35";
|
|
654
1001
|
|
|
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 };
|
|
1002
|
+
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, DropDownArrow, Dropdown, DropdownItem, EmptyState, ErrorAlert, ErrorMessage, FilterSelect, FilterToggleButton, FormInput, FormSection, Grid, IconButtonWithCount, InfoAlert, InfoBox, InfoNotice, Link, type LinkProps, LoadingSpinner, MobileSearchLayout, Modal, Notice, PageHeader, RefreshButton, SearchCard, SearchCardContent, SearchCardHeader, SearchInput, Select, 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, SuccessAlert, SuccessNotice, Switch, type SwitchVariant, Typography, UnsavedAlert, UnsavedChangesNotification, VERSION, VariableInput, VariableSelector, ViewToggle, WarningAlert, WarningNotice, useConfirmDialog };
|