@gamecp/ui 0.1.29 → 0.1.32
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 +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +103 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -265,8 +265,9 @@ interface PageHeaderProps {
|
|
|
265
265
|
subtitle?: string;
|
|
266
266
|
rightContent?: React__default.ReactNode;
|
|
267
267
|
className?: string;
|
|
268
|
+
size?: 'sm' | 'md' | 'lg';
|
|
268
269
|
}
|
|
269
|
-
declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
270
|
+
declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, size, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
270
271
|
|
|
271
272
|
type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
|
|
272
273
|
interface SwitchProps {
|
|
@@ -301,11 +302,12 @@ declare function SmartDropdown({ isOpen, onClose, trigger, children, className,
|
|
|
301
302
|
interface Option {
|
|
302
303
|
value: string;
|
|
303
304
|
label: string;
|
|
304
|
-
description?:
|
|
305
|
+
description?: React.ReactNode;
|
|
305
306
|
icon?: React.ReactNode;
|
|
306
307
|
metadata?: {
|
|
307
308
|
isDefault?: boolean;
|
|
308
309
|
args?: string[];
|
|
310
|
+
commandType?: 'command' | 'bash' | 'sh' | 'powershell';
|
|
309
311
|
};
|
|
310
312
|
}
|
|
311
313
|
interface SmartSelectProps {
|
|
@@ -314,19 +316,21 @@ interface SmartSelectProps {
|
|
|
314
316
|
onChange: (value: string | string[]) => void;
|
|
315
317
|
placeholder?: string;
|
|
316
318
|
className?: string;
|
|
317
|
-
description?:
|
|
319
|
+
description?: React.ReactNode;
|
|
318
320
|
disabled?: boolean;
|
|
319
321
|
multiple?: boolean;
|
|
320
|
-
width?: number;
|
|
322
|
+
width?: number | 'auto' | 'fit-content';
|
|
321
323
|
searchable?: boolean;
|
|
322
324
|
keepOpen?: boolean;
|
|
323
325
|
clearable?: boolean;
|
|
326
|
+
variant?: 'default' | 'compact';
|
|
327
|
+
renderSelected?: (option: Option) => React.ReactNode;
|
|
324
328
|
onOpen?: () => void;
|
|
325
329
|
onClose?: () => void;
|
|
326
330
|
onSearch?: (search: string) => void;
|
|
327
331
|
isLoading?: boolean;
|
|
328
332
|
}
|
|
329
|
-
declare function SmartSelect({ options, value, onChange, placeholder, className, description, disabled, multiple, width, searchable, keepOpen, clearable, onOpen, onClose, onSearch, isLoading, }: SmartSelectProps): react_jsx_runtime.JSX.Element;
|
|
333
|
+
declare function SmartSelect({ options, value, onChange, placeholder, className, description, disabled, multiple, width, searchable, keepOpen, clearable, variant, renderSelected, onOpen, onClose, onSearch, isLoading, }: SmartSelectProps): react_jsx_runtime.JSX.Element;
|
|
330
334
|
|
|
331
335
|
interface SkeletonProps {
|
|
332
336
|
className?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -265,8 +265,9 @@ interface PageHeaderProps {
|
|
|
265
265
|
subtitle?: string;
|
|
266
266
|
rightContent?: React__default.ReactNode;
|
|
267
267
|
className?: string;
|
|
268
|
+
size?: 'sm' | 'md' | 'lg';
|
|
268
269
|
}
|
|
269
|
-
declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
270
|
+
declare function PageHeader({ icon: Icon, title, subtitle, rightContent, className, size, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
270
271
|
|
|
271
272
|
type SwitchVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'embedded';
|
|
272
273
|
interface SwitchProps {
|
|
@@ -301,11 +302,12 @@ declare function SmartDropdown({ isOpen, onClose, trigger, children, className,
|
|
|
301
302
|
interface Option {
|
|
302
303
|
value: string;
|
|
303
304
|
label: string;
|
|
304
|
-
description?:
|
|
305
|
+
description?: React.ReactNode;
|
|
305
306
|
icon?: React.ReactNode;
|
|
306
307
|
metadata?: {
|
|
307
308
|
isDefault?: boolean;
|
|
308
309
|
args?: string[];
|
|
310
|
+
commandType?: 'command' | 'bash' | 'sh' | 'powershell';
|
|
309
311
|
};
|
|
310
312
|
}
|
|
311
313
|
interface SmartSelectProps {
|
|
@@ -314,19 +316,21 @@ interface SmartSelectProps {
|
|
|
314
316
|
onChange: (value: string | string[]) => void;
|
|
315
317
|
placeholder?: string;
|
|
316
318
|
className?: string;
|
|
317
|
-
description?:
|
|
319
|
+
description?: React.ReactNode;
|
|
318
320
|
disabled?: boolean;
|
|
319
321
|
multiple?: boolean;
|
|
320
|
-
width?: number;
|
|
322
|
+
width?: number | 'auto' | 'fit-content';
|
|
321
323
|
searchable?: boolean;
|
|
322
324
|
keepOpen?: boolean;
|
|
323
325
|
clearable?: boolean;
|
|
326
|
+
variant?: 'default' | 'compact';
|
|
327
|
+
renderSelected?: (option: Option) => React.ReactNode;
|
|
324
328
|
onOpen?: () => void;
|
|
325
329
|
onClose?: () => void;
|
|
326
330
|
onSearch?: (search: string) => void;
|
|
327
331
|
isLoading?: boolean;
|
|
328
332
|
}
|
|
329
|
-
declare function SmartSelect({ options, value, onChange, placeholder, className, description, disabled, multiple, width, searchable, keepOpen, clearable, onOpen, onClose, onSearch, isLoading, }: SmartSelectProps): react_jsx_runtime.JSX.Element;
|
|
333
|
+
declare function SmartSelect({ options, value, onChange, placeholder, className, description, disabled, multiple, width, searchable, keepOpen, clearable, variant, renderSelected, onOpen, onClose, onSearch, isLoading, }: SmartSelectProps): react_jsx_runtime.JSX.Element;
|
|
330
334
|
|
|
331
335
|
interface SkeletonProps {
|
|
332
336
|
className?: string;
|
package/dist/index.js
CHANGED
|
@@ -812,7 +812,7 @@ function SmartDropdown({
|
|
|
812
812
|
trigger,
|
|
813
813
|
children,
|
|
814
814
|
className = "",
|
|
815
|
-
width =
|
|
815
|
+
width = 300,
|
|
816
816
|
maxHeight = 450,
|
|
817
817
|
offset = 8,
|
|
818
818
|
margin = 16,
|
|
@@ -860,7 +860,7 @@ function SmartDropdown({
|
|
|
860
860
|
const availableLeftSpace = triggerRect.left - margin;
|
|
861
861
|
const dynamicOffset = Math.max(20, availableLeftSpace * 0.2);
|
|
862
862
|
right = viewportWidth - triggerRect.left + dynamicOffset;
|
|
863
|
-
left = 0;
|
|
863
|
+
left = void 0;
|
|
864
864
|
calculatedWidth = Math.min(
|
|
865
865
|
calculatedWidth,
|
|
866
866
|
triggerRect.left - dynamicOffset - margin
|
|
@@ -912,13 +912,13 @@ function SmartDropdown({
|
|
|
912
912
|
finalMaxHeight = Math.min(maxHeight, spaceBelow);
|
|
913
913
|
} else if (position === "top-left-aligned") {
|
|
914
914
|
right = viewportWidth - triggerRect.right;
|
|
915
|
-
left = 0;
|
|
915
|
+
left = void 0;
|
|
916
916
|
top = triggerRect.top - offset;
|
|
917
917
|
isAbove = true;
|
|
918
918
|
finalMaxHeight = Math.min(maxHeight, spaceAbove);
|
|
919
919
|
} else if (position === "bottom-left-aligned") {
|
|
920
920
|
right = viewportWidth - triggerRect.right;
|
|
921
|
-
left = 0;
|
|
921
|
+
left = void 0;
|
|
922
922
|
top = triggerRect.bottom + offset;
|
|
923
923
|
isAbove = false;
|
|
924
924
|
finalMaxHeight = Math.min(maxHeight, spaceBelow);
|
|
@@ -1017,20 +1017,13 @@ function SmartDropdown({
|
|
|
1017
1017
|
top: dropdownPosition.top,
|
|
1018
1018
|
...dropdownPosition.left !== void 0 ? { left: dropdownPosition.left } : {},
|
|
1019
1019
|
...dropdownPosition.right !== void 0 ? { right: dropdownPosition.right } : {},
|
|
1020
|
-
width: width
|
|
1020
|
+
width: width ?? dropdownPosition.width,
|
|
1021
1021
|
maxHeight: dropdownPosition.maxHeight
|
|
1022
1022
|
},
|
|
1023
1023
|
onClick: (e) => {
|
|
1024
1024
|
e.stopPropagation();
|
|
1025
1025
|
},
|
|
1026
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1027
|
-
"div",
|
|
1028
|
-
{
|
|
1029
|
-
className: className ? className : "overflow-y-auto",
|
|
1030
|
-
style: { maxHeight: dropdownPosition.maxHeight },
|
|
1031
|
-
children: typeof children === "function" ? children({ isAbove: dropdownPosition.isAbove }) : children
|
|
1032
|
-
}
|
|
1033
|
-
)
|
|
1026
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: className ? className : "overflow-y-auto h-full", children: typeof children === "function" ? children({ isAbove: dropdownPosition.isAbove }) : children })
|
|
1034
1027
|
}
|
|
1035
1028
|
),
|
|
1036
1029
|
document.body
|
|
@@ -1050,6 +1043,8 @@ function SmartSelect({
|
|
|
1050
1043
|
searchable = false,
|
|
1051
1044
|
keepOpen = false,
|
|
1052
1045
|
clearable = true,
|
|
1046
|
+
variant = "default",
|
|
1047
|
+
renderSelected,
|
|
1053
1048
|
// API integration props
|
|
1054
1049
|
onOpen,
|
|
1055
1050
|
onClose,
|
|
@@ -1070,7 +1065,7 @@ function SmartSelect({
|
|
|
1070
1065
|
);
|
|
1071
1066
|
const hasSelection = multiple ? selectedValues.length > 0 : value && value !== "";
|
|
1072
1067
|
const filteredOptions = searchable && searchTerm.trim() ? options.filter(
|
|
1073
|
-
(option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()) || option.value.toLowerCase().includes(searchTerm.toLowerCase()) || option.description
|
|
1068
|
+
(option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()) || option.value.toLowerCase().includes(searchTerm.toLowerCase()) || typeof option.description === "string" && option.description.toLowerCase().includes(searchTerm.toLowerCase())
|
|
1074
1069
|
) : options;
|
|
1075
1070
|
const { focusedIndex, handleKeyDown, resetFocus } = useKeyboardNavigation({
|
|
1076
1071
|
isOpen,
|
|
@@ -1179,10 +1174,10 @@ function SmartSelect({
|
|
|
1179
1174
|
"aria-controls": "dropdown-listbox",
|
|
1180
1175
|
"aria-autocomplete": "list",
|
|
1181
1176
|
"aria-activedescendant": focusedIndex >= 0 ? `option-${focusedIndex}` : void 0,
|
|
1182
|
-
className: `form-input truncate ${hasSelection ? "pr-12" : "pr-8"} ${disabled ? "
|
|
1177
|
+
className: `form-input truncate ${hasSelection ? "pr-12" : "pr-8"} ${disabled ? "cursor-not-allowed" : ""} ${className}`
|
|
1183
1178
|
}
|
|
1184
1179
|
),
|
|
1185
|
-
hasSelection && clearable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1180
|
+
hasSelection && clearable && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1186
1181
|
"button",
|
|
1187
1182
|
{
|
|
1188
1183
|
type: "button",
|
|
@@ -1238,7 +1233,7 @@ function SmartSelect({
|
|
|
1238
1233
|
"aria-controls": "dropdown-listbox",
|
|
1239
1234
|
"aria-label": placeholder,
|
|
1240
1235
|
"aria-activedescendant": focusedIndex >= 0 ? `option-${focusedIndex}` : void 0,
|
|
1241
|
-
className:
|
|
1236
|
+
className: `${variant === "compact" ? "bg-background border border-border rounded-lg px-2 py-1 text-xs h-auto min-h-0 hover:bg-muted/50" : "form-input"} flex items-center justify-between text-left ${hasSelection ? "pr-12" : "pr-8"} ${disabled ? "cursor-not-allowed" : ""} ${className}`,
|
|
1242
1237
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
1238
|
"span",
|
|
1244
1239
|
{
|
|
@@ -1249,7 +1244,7 @@ function SmartSelect({
|
|
|
1249
1244
|
selectedOptions[0].icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: selectedOptions[0].icon }),
|
|
1250
1245
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: displayText })
|
|
1251
1246
|
] });
|
|
1252
|
-
})() : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: placeholder }) : selectedOptions[0] ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
1247
|
+
})() : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: placeholder }) : selectedOptions[0] ? renderSelected ? renderSelected(selectedOptions[0]) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
1253
1248
|
selectedOptions[0].icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: selectedOptions[0].icon }),
|
|
1254
1249
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: selectedOptions[0].label })
|
|
1255
1250
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: placeholder })
|
|
@@ -1257,7 +1252,7 @@ function SmartSelect({
|
|
|
1257
1252
|
)
|
|
1258
1253
|
}
|
|
1259
1254
|
),
|
|
1260
|
-
hasSelection && clearable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1255
|
+
hasSelection && clearable && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1261
1256
|
"button",
|
|
1262
1257
|
{
|
|
1263
1258
|
type: "button",
|
|
@@ -1308,18 +1303,42 @@ function SmartSelect({
|
|
|
1308
1303
|
e.stopPropagation();
|
|
1309
1304
|
handleSelect(option.value);
|
|
1310
1305
|
},
|
|
1311
|
-
className: `w-full px-
|
|
1306
|
+
className: `w-full ${variant === "compact" ? "px-2 py-1.5 text-xs" : "px-3 py-1.5 text-sm"} text-left hover:bg-muted/50 flex items-center justify-between transition-colors ${selectedValues.includes(option.value) ? "bg-primary" : index === focusedIndex ? "bg-muted/50" : ""}`,
|
|
1312
1307
|
children: [
|
|
1313
1308
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
1314
|
-
option.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1309
|
+
option.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1310
|
+
"span",
|
|
1311
|
+
{
|
|
1312
|
+
className: `flex-shrink-0 ${selectedValues.includes(option.value) ? "text-primary-foreground" : ""}`,
|
|
1313
|
+
children: option.icon
|
|
1314
|
+
}
|
|
1315
|
+
),
|
|
1315
1316
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1316
1317
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1317
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1318
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1319
|
+
"div",
|
|
1320
|
+
{
|
|
1321
|
+
className: `font-medium truncate ${selectedValues.includes(option.value) ? "text-primary-foreground" : "text-foreground"}`,
|
|
1322
|
+
children: option.label
|
|
1323
|
+
}
|
|
1324
|
+
),
|
|
1318
1325
|
option.metadata?.isDefault && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium success-badge flex-shrink-0", children: "Default" })
|
|
1319
1326
|
] }),
|
|
1320
|
-
option.description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1321
|
-
|
|
1322
|
-
|
|
1327
|
+
option.description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1328
|
+
"div",
|
|
1329
|
+
{
|
|
1330
|
+
className: `text-xs truncate ${selectedValues.includes(option.value) ? "text-primary-foreground/80" : "text-muted-foreground"}`,
|
|
1331
|
+
children: option.description
|
|
1332
|
+
}
|
|
1333
|
+
),
|
|
1334
|
+
option.metadata?.args && option.metadata.args.length > 0 && (!option.metadata.commandType || option.metadata.commandType === "command") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1", children: [
|
|
1335
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
className: `text-xs mb-1 ${selectedValues.includes(option.value) ? "text-primary-foreground/80" : "text-muted-foreground"}`,
|
|
1339
|
+
children: "Arguments:"
|
|
1340
|
+
}
|
|
1341
|
+
),
|
|
1323
1342
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-1", children: [
|
|
1324
1343
|
option.metadata.args.slice(0, 3).map((arg, argIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
1344
|
"span",
|
|
@@ -1329,11 +1348,17 @@ function SmartSelect({
|
|
|
1329
1348
|
},
|
|
1330
1349
|
argIndex
|
|
1331
1350
|
)),
|
|
1332
|
-
option.metadata.args.length > 3 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1333
|
-
"
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1351
|
+
option.metadata.args.length > 3 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1352
|
+
"span",
|
|
1353
|
+
{
|
|
1354
|
+
className: `text-xs ${selectedValues.includes(option.value) ? "text-primary-foreground/80" : "text-muted-foreground"}`,
|
|
1355
|
+
children: [
|
|
1356
|
+
"+",
|
|
1357
|
+
option.metadata.args.length - 3,
|
|
1358
|
+
" more"
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
)
|
|
1337
1362
|
] })
|
|
1338
1363
|
] })
|
|
1339
1364
|
] })
|
|
@@ -1347,11 +1372,11 @@ function SmartSelect({
|
|
|
1347
1372
|
},
|
|
1348
1373
|
className: "w-4 h-4 text-primary bg-muted border-border rounded focus:ring-primary focus:ring-2"
|
|
1349
1374
|
}
|
|
1350
|
-
) : selectedValues.includes(option.value) && /* @__PURE__ */ jsxRuntime.jsx(ri.RiCheckLine, { className: "w-4 h-4 text-primary flex-shrink-0" })
|
|
1375
|
+
) : selectedValues.includes(option.value) && /* @__PURE__ */ jsxRuntime.jsx(ri.RiCheckLine, { className: "w-4 h-4 text-primary-foreground flex-shrink-0" })
|
|
1351
1376
|
]
|
|
1352
1377
|
},
|
|
1353
1378
|
option.value
|
|
1354
|
-
)) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-sm text-
|
|
1379
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground flex items-center gap-2", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1355
1380
|
/* @__PURE__ */ jsxRuntime.jsx(ri.RiLoader4Line, { className: "w-4 h-4 animate-spin" }),
|
|
1356
1381
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading..." })
|
|
1357
1382
|
] }) : searchTerm.trim() ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: "No results found" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "No options available" }) }) })
|
|
@@ -2496,7 +2521,7 @@ function FormInput({
|
|
|
2496
2521
|
}
|
|
2497
2522
|
)
|
|
2498
2523
|
] }),
|
|
2499
|
-
footerDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs mt-1", children: footerDescription }),
|
|
2524
|
+
footerDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: footerDescription }),
|
|
2500
2525
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { id: `${name}-error`, className: "form-error", role: "alert", children: typeof error === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: error }) : error })
|
|
2501
2526
|
] }) });
|
|
2502
2527
|
}
|
|
@@ -2708,17 +2733,48 @@ function PageHeader({
|
|
|
2708
2733
|
title,
|
|
2709
2734
|
subtitle,
|
|
2710
2735
|
rightContent,
|
|
2711
|
-
className = ""
|
|
2736
|
+
className = "",
|
|
2737
|
+
size = "lg"
|
|
2712
2738
|
}) {
|
|
2713
|
-
|
|
2739
|
+
const sizeClasses5 = {
|
|
2740
|
+
sm: {
|
|
2741
|
+
container: "mb-6",
|
|
2742
|
+
icon: "w-5 h-5 lg:w-6 lg:h-6",
|
|
2743
|
+
title: "text-lg lg:text-xl",
|
|
2744
|
+
subtitle: "text-sm",
|
|
2745
|
+
spacing: "space-x-2 lg:space-x-3"
|
|
2746
|
+
},
|
|
2747
|
+
md: {
|
|
2748
|
+
container: "mb-6 lg:mb-8",
|
|
2749
|
+
icon: "w-6 h-6 lg:w-7 lg:h-7",
|
|
2750
|
+
title: "text-xl lg:text-2xl",
|
|
2751
|
+
subtitle: "text-sm",
|
|
2752
|
+
spacing: "space-x-2 lg:space-x-3"
|
|
2753
|
+
},
|
|
2754
|
+
lg: {
|
|
2755
|
+
container: "mb-6 lg:mb-8",
|
|
2756
|
+
icon: "w-6 h-6 lg:w-8 lg:h-8",
|
|
2757
|
+
title: "text-xl lg:text-3xl",
|
|
2758
|
+
subtitle: "text-sm",
|
|
2759
|
+
spacing: "space-x-2 lg:space-x-3"
|
|
2760
|
+
}
|
|
2761
|
+
};
|
|
2762
|
+
const currentSize = sizeClasses5[size];
|
|
2763
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${currentSize.container} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "header-layout", children: [
|
|
2714
2764
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2715
|
-
Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className:
|
|
2765
|
+
Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: `${currentSize.icon} flex-shrink-0` }),
|
|
2716
2766
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
2717
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className:
|
|
2718
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
2767
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: `${currentSize.title} font-bold truncate`, children: title }),
|
|
2768
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${currentSize.subtitle} text-muted-foreground`, children: subtitle })
|
|
2719
2769
|
] })
|
|
2720
2770
|
] }),
|
|
2721
|
-
rightContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2771
|
+
rightContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2772
|
+
"div",
|
|
2773
|
+
{
|
|
2774
|
+
className: `flex items-center ${currentSize.spacing} flex-shrink-0`,
|
|
2775
|
+
children: rightContent
|
|
2776
|
+
}
|
|
2777
|
+
)
|
|
2722
2778
|
] }) });
|
|
2723
2779
|
}
|
|
2724
2780
|
function Switch({
|
|
@@ -2745,32 +2801,32 @@ function Switch({
|
|
|
2745
2801
|
const variants = {
|
|
2746
2802
|
default: {
|
|
2747
2803
|
checked: "bg-primary",
|
|
2748
|
-
unchecked: "bg-
|
|
2804
|
+
unchecked: "bg-muted-foreground/40",
|
|
2749
2805
|
ring: "focus:ring-primary"
|
|
2750
2806
|
},
|
|
2751
2807
|
success: {
|
|
2752
2808
|
checked: "bg-success",
|
|
2753
|
-
unchecked: "bg-
|
|
2809
|
+
unchecked: "bg-muted-foreground/40",
|
|
2754
2810
|
ring: "focus:ring-success"
|
|
2755
2811
|
},
|
|
2756
2812
|
danger: {
|
|
2757
2813
|
checked: "bg-destructive",
|
|
2758
|
-
unchecked: "bg-
|
|
2814
|
+
unchecked: "bg-muted-foreground/40",
|
|
2759
2815
|
ring: "focus:ring-destructive"
|
|
2760
2816
|
},
|
|
2761
2817
|
warning: {
|
|
2762
2818
|
checked: "bg-warning",
|
|
2763
|
-
unchecked: "bg-
|
|
2819
|
+
unchecked: "bg-muted-foreground/40",
|
|
2764
2820
|
ring: "focus:ring-warning"
|
|
2765
2821
|
},
|
|
2766
2822
|
info: {
|
|
2767
2823
|
checked: "bg-info",
|
|
2768
|
-
unchecked: "bg-
|
|
2824
|
+
unchecked: "bg-muted-foreground/40",
|
|
2769
2825
|
ring: "focus:ring-info"
|
|
2770
2826
|
},
|
|
2771
2827
|
embedded: {
|
|
2772
2828
|
checked: "bg-success",
|
|
2773
|
-
unchecked: "bg-
|
|
2829
|
+
unchecked: "bg-muted-foreground/40",
|
|
2774
2830
|
ring: "focus:ring-success"
|
|
2775
2831
|
}
|
|
2776
2832
|
};
|
|
@@ -2791,9 +2847,9 @@ function Switch({
|
|
|
2791
2847
|
disabled,
|
|
2792
2848
|
onClick: toggle,
|
|
2793
2849
|
className: `
|
|
2794
|
-
relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2
|
|
2850
|
+
relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-2
|
|
2795
2851
|
transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 ${currentVariant.ring} focus:ring-offset-2
|
|
2796
|
-
${checked ? currentVariant.checked : currentVariant.unchecked}
|
|
2852
|
+
${checked ? `${currentVariant.checked} border-transparent` : `${currentVariant.unchecked} border-muted-foreground/30`}
|
|
2797
2853
|
${disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
2798
2854
|
${currentSize.track}
|
|
2799
2855
|
`,
|