@underverse-ui/underverse 2.0.2 → 2.0.4
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/CHANGELOG.md +6 -0
- package/api-reference.json +9 -2
- package/dist/{chunk-Y7SQKJ7X.js → chunk-2UQ7H5GR.js} +3 -3
- package/dist/{chunk-Z6WE65J2.js → chunk-JXE7JBQV.js} +24 -6
- package/dist/chunk-JXE7JBQV.js.map +1 -0
- package/dist/{chunk-UNDGI6ZI.js → chunk-OZH3EDGZ.js} +2 -2
- package/dist/index.cjs +271 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -21
- package/dist/index.d.ts +72 -21
- package/dist/index.js +251 -134
- package/dist/index.js.map +1 -1
- package/dist/{menu-bar-AAD3LQTN.js → menu-bar-6HZDCX44.js} +3 -3
- package/dist/ueditor.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-Z6WE65J2.js.map +0 -1
- /package/dist/{chunk-Y7SQKJ7X.js.map → chunk-2UQ7H5GR.js.map} +0 -0
- /package/dist/{chunk-UNDGI6ZI.js.map → chunk-OZH3EDGZ.js.map} +0 -0
- /package/dist/{menu-bar-AAD3LQTN.js.map → menu-bar-6HZDCX44.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -36,17 +36,26 @@ var init_form_control_size = __esm({
|
|
|
36
36
|
"src/constants/form-control-size.ts"() {
|
|
37
37
|
"use strict";
|
|
38
38
|
formControlSizeStyles = {
|
|
39
|
+
xs: {
|
|
40
|
+
control: "h-6 px-2 text-xs leading-none",
|
|
41
|
+
compactControl: "h-6 px-2 text-xs leading-none",
|
|
42
|
+
input: "h-6 px-2 text-xs leading-none",
|
|
43
|
+
label: "text-xs",
|
|
44
|
+
icon: "h-3.5 w-3.5",
|
|
45
|
+
iconButton: "h-6 w-6",
|
|
46
|
+
tag: "h-4 max-w-20 px-1.5 text-[10px] leading-none"
|
|
47
|
+
},
|
|
39
48
|
sm: {
|
|
40
|
-
control: "h-8 px-3 text-sm leading-none
|
|
41
|
-
compactControl: "h-8 px-2.5 text-sm leading-none
|
|
42
|
-
input: "h-8 px-3 text-sm leading-none
|
|
49
|
+
control: "h-8 px-3 text-sm leading-none",
|
|
50
|
+
compactControl: "h-8 px-2.5 text-sm leading-none",
|
|
51
|
+
input: "h-8 px-3 text-sm leading-none",
|
|
43
52
|
label: "text-xs",
|
|
44
53
|
icon: "h-4 w-4 md:h-3.5 md:w-3.5",
|
|
45
54
|
iconButton: "h-7 w-7 md:h-6 md:w-6",
|
|
46
55
|
tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
|
|
47
56
|
},
|
|
48
57
|
md: {
|
|
49
|
-
control: "h-10 px-
|
|
58
|
+
control: "h-10 px-4 text-sm leading-none",
|
|
50
59
|
compactControl: "h-10 px-3 text-sm leading-none",
|
|
51
60
|
input: "h-10 px-4 text-sm leading-none",
|
|
52
61
|
label: "text-sm",
|
|
@@ -55,13 +64,22 @@ var init_form_control_size = __esm({
|
|
|
55
64
|
tag: "h-6 max-w-28 px-2 text-xs leading-none"
|
|
56
65
|
},
|
|
57
66
|
lg: {
|
|
58
|
-
control: "h-12 px-
|
|
67
|
+
control: "h-12 px-6 text-base leading-none",
|
|
59
68
|
compactControl: "h-12 px-4 text-base leading-none",
|
|
60
69
|
input: "h-12 px-5 text-base leading-none",
|
|
61
70
|
label: "text-base",
|
|
62
71
|
icon: "h-5 w-5",
|
|
63
72
|
iconButton: "h-10 w-10",
|
|
64
73
|
tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
|
|
74
|
+
},
|
|
75
|
+
xl: {
|
|
76
|
+
control: "h-14 px-8 text-base leading-none",
|
|
77
|
+
compactControl: "h-14 px-5 text-base leading-none",
|
|
78
|
+
input: "h-14 px-6 text-base leading-none",
|
|
79
|
+
label: "text-base",
|
|
80
|
+
icon: "h-5 w-5",
|
|
81
|
+
iconButton: "h-12 w-12",
|
|
82
|
+
tag: "h-8 max-w-36 px-3 text-sm leading-none"
|
|
65
83
|
}
|
|
66
84
|
};
|
|
67
85
|
formControlFixedClass = "min-h-0 overflow-hidden";
|
|
@@ -9531,9 +9549,11 @@ var VARIANT_STYLES_BTN = {
|
|
|
9531
9549
|
gradient: "bg-linear-to-r from-primary via-primary/80 to-secondary text-primary-foreground hover:opacity-90 shadow-md border-0"
|
|
9532
9550
|
};
|
|
9533
9551
|
var SIZE_STYLES_BTN = {
|
|
9552
|
+
xs: `${formControlSizeStyles.xs.control} min-w-6`,
|
|
9534
9553
|
sm: `${formControlSizeStyles.sm.control} min-w-8`,
|
|
9535
|
-
md: `${formControlSizeStyles.md.
|
|
9536
|
-
lg: `${formControlSizeStyles.lg.
|
|
9554
|
+
md: `${formControlSizeStyles.md.control} min-w-10`,
|
|
9555
|
+
lg: `${formControlSizeStyles.lg.control} min-w-12`,
|
|
9556
|
+
xl: `${formControlSizeStyles.xl.control} min-w-14`,
|
|
9537
9557
|
smx: "h-9 min-w-9 px-3.5 text-[13px] leading-none md:h-8 md:text-xs",
|
|
9538
9558
|
icon: "w-11 h-11 p-0 rounded-full flex items-center justify-center md:w-10 md:h-10"
|
|
9539
9559
|
};
|
|
@@ -9577,7 +9597,7 @@ var Button = (0, import_react.forwardRef)(
|
|
|
9577
9597
|
const finalVariant = gradient ? "gradient" : variant;
|
|
9578
9598
|
const variantStyle = VARIANT_STYLES_BTN[finalVariant] || VARIANT_STYLES_BTN.default;
|
|
9579
9599
|
const sizeStyle = SIZE_STYLES_BTN[size] || SIZE_STYLES_BTN.md;
|
|
9580
|
-
const iconSizeStyle = size === "sm" ? formControlSizeStyles.sm.icon : size === "lg" || size === "icon" ? formControlSizeStyles.lg.icon : formControlSizeStyles.md.icon;
|
|
9600
|
+
const iconSizeStyle = size === "xs" || size === "sm" ? formControlSizeStyles.sm.icon : size === "lg" || size === "xl" || size === "icon" ? formControlSizeStyles.lg.icon : formControlSizeStyles.md.icon;
|
|
9581
9601
|
const globalConfig = useUnderverseUIConfig();
|
|
9582
9602
|
const resolvedBorderMode = borderMode ?? globalConfig.button?.borderMode ?? "full";
|
|
9583
9603
|
const SpinnerIcon = Spinner ?? import_lucide_react.Activity;
|
|
@@ -10351,7 +10371,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10351
10371
|
const charCount = typeof value === "string" ? value.length : 0;
|
|
10352
10372
|
const errorId = errMsg && resolvedId ? `${resolvedId}-error` : void 0;
|
|
10353
10373
|
const descId = !errMsg && (description || hint) && resolvedId ? `${resolvedId}-desc` : void 0;
|
|
10354
|
-
const containerSpacing = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
10374
|
+
const containerSpacing = size === "xs" || size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
10355
10375
|
const variantStyles6 = {
|
|
10356
10376
|
default: {
|
|
10357
10377
|
container: "bg-background border border-input hover:border-accent-foreground/20",
|
|
@@ -10510,8 +10530,8 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10510
10530
|
variantStyles6[variant].container,
|
|
10511
10531
|
errMsg ? variantStyles6[variant].error : variantStyles6[variant].focus,
|
|
10512
10532
|
// Reduce visual weight for sm: no default drop shadows
|
|
10513
|
-
size !== "sm" && variant !== "minimal" && "shadow-sm",
|
|
10514
|
-
size !== "sm" && isFocused && "shadow-md",
|
|
10533
|
+
size !== "xs" && size !== "sm" && variant !== "minimal" && "shadow-sm",
|
|
10534
|
+
size !== "xs" && size !== "sm" && isFocused && "shadow-md",
|
|
10515
10535
|
className
|
|
10516
10536
|
),
|
|
10517
10537
|
disabled,
|
|
@@ -10706,9 +10726,11 @@ var NumberInput = (0, import_react4.forwardRef)(
|
|
|
10706
10726
|
};
|
|
10707
10727
|
const inputSize = props.size || "md";
|
|
10708
10728
|
const stepperSizeStyles = {
|
|
10729
|
+
xs: { width: "w-6", icon: { width: 7, height: 4, path: { up: "M3.5 1L6 3H1L3.5 1Z", down: "M3.5 3L1 1H6L3.5 3Z" } } },
|
|
10709
10730
|
sm: { width: "w-7", icon: { width: 8, height: 5, path: { up: "M4 1L7 4H1L4 1Z", down: "M4 4L1 1H7L4 4Z" } } },
|
|
10710
10731
|
md: { width: "w-9", icon: { width: 10, height: 6, path: { up: "M5 1L9 5H1L5 1Z", down: "M5 5L1 1H9L5 5Z" } } },
|
|
10711
|
-
lg: { width: "w-11", icon: { width: 12, height: 7, path: { up: "M6 1L11 6H1L6 1Z", down: "M6 6L1 1H11L6 6Z" } } }
|
|
10732
|
+
lg: { width: "w-11", icon: { width: 12, height: 7, path: { up: "M6 1L11 6H1L6 1Z", down: "M6 6L1 1H11L6 6Z" } } },
|
|
10733
|
+
xl: { width: "w-12", icon: { width: 14, height: 8, path: { up: "M7 1L13 7H1L7 1Z", down: "M7 7L1 1H13L7 7Z" } } }
|
|
10712
10734
|
};
|
|
10713
10735
|
const ss = stepperSizeStyles[inputSize];
|
|
10714
10736
|
const stepperAddon = showSteppers ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("absolute right-0 inset-y-0 flex flex-col border-l border-border/50 rounded-r-full overflow-hidden", ss.width), children: [
|
|
@@ -11714,6 +11736,13 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
11714
11736
|
const visibleTags = hiddenCount > 0 ? value.slice(0, maxVisibleTags) : value;
|
|
11715
11737
|
const moreLabel = labels?.moreCount?.replace("{count}", String(hiddenCount)) ?? `+${hiddenCount} more`;
|
|
11716
11738
|
const sizeStyles8 = {
|
|
11739
|
+
xs: {
|
|
11740
|
+
container: formControlSizeStyles.xs.control,
|
|
11741
|
+
input: formControlSizeStyles.xs.label,
|
|
11742
|
+
tag: formControlSizeStyles.xs.tag,
|
|
11743
|
+
tagIcon: "h-2.5 w-2.5",
|
|
11744
|
+
button: "h-6 text-xs px-1.5"
|
|
11745
|
+
},
|
|
11717
11746
|
sm: {
|
|
11718
11747
|
container: formControlSizeStyles.sm.control,
|
|
11719
11748
|
input: formControlSizeStyles.sm.label,
|
|
@@ -11734,6 +11763,13 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
11734
11763
|
tag: formControlSizeStyles.lg.tag,
|
|
11735
11764
|
tagIcon: "h-4 w-4",
|
|
11736
11765
|
button: "h-11 text-base px-4"
|
|
11766
|
+
},
|
|
11767
|
+
xl: {
|
|
11768
|
+
container: formControlSizeStyles.xl.control,
|
|
11769
|
+
input: formControlSizeStyles.xl.label,
|
|
11770
|
+
tag: formControlSizeStyles.xl.tag,
|
|
11771
|
+
tagIcon: "h-4 w-4",
|
|
11772
|
+
button: "h-12 text-base px-5"
|
|
11737
11773
|
}
|
|
11738
11774
|
};
|
|
11739
11775
|
const addTag = (tagValue) => {
|
|
@@ -14189,19 +14225,25 @@ var Combobox = ({
|
|
|
14189
14225
|
return groups;
|
|
14190
14226
|
}, [renderLimitedOptions, groupBy]);
|
|
14191
14227
|
const itemSizeStyles = {
|
|
14228
|
+
xs: "px-2 py-1 text-xs gap-1.5",
|
|
14192
14229
|
sm: "px-2.5 py-1.5 text-xs gap-2",
|
|
14193
14230
|
md: "px-3 py-2.5 text-sm gap-3",
|
|
14194
|
-
lg: "px-4 py-3 text-base gap-3"
|
|
14231
|
+
lg: "px-4 py-3 text-base gap-3",
|
|
14232
|
+
xl: "px-5 py-3.5 text-base gap-3"
|
|
14195
14233
|
};
|
|
14196
14234
|
const iconSizeStyles = {
|
|
14235
|
+
xs: formControlSizeStyles.xs.icon,
|
|
14197
14236
|
sm: formControlSizeStyles.sm.icon,
|
|
14198
14237
|
md: formControlSizeStyles.md.icon,
|
|
14199
|
-
lg: formControlSizeStyles.lg.icon
|
|
14238
|
+
lg: formControlSizeStyles.lg.icon,
|
|
14239
|
+
xl: formControlSizeStyles.xl.icon
|
|
14200
14240
|
};
|
|
14201
14241
|
const checkIconSizeStyles = {
|
|
14242
|
+
xs: "h-3 w-3",
|
|
14202
14243
|
sm: "h-3.5 w-3.5",
|
|
14203
14244
|
md: "h-4 w-4",
|
|
14204
|
-
lg: "h-5 w-5"
|
|
14245
|
+
lg: "h-5 w-5",
|
|
14246
|
+
xl: "h-5 w-5"
|
|
14205
14247
|
};
|
|
14206
14248
|
const renderOptionItem = (item, index, virtualItem) => {
|
|
14207
14249
|
const itemValue = getOptionValue(item);
|
|
@@ -14257,7 +14299,7 @@ var Combobox = ({
|
|
|
14257
14299
|
),
|
|
14258
14300
|
renderOption ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 min-w-0", children: renderOption(item, isSelected) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
14259
14301
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "block truncate", children: itemLabel }),
|
|
14260
|
-
itemDescription && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("block text-muted-foreground truncate mt-0.5", size === "sm" ? "text-[10px]" : "text-xs"), children: itemDescription })
|
|
14302
|
+
itemDescription && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("block text-muted-foreground truncate mt-0.5", size === "xs" || size === "sm" ? "text-[10px]" : "text-xs"), children: itemDescription })
|
|
14261
14303
|
] }),
|
|
14262
14304
|
isSelected && showSelectedIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "shrink-0 ml-auto", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react15.Check, { className: cn(checkIconSizeStyles[size], "text-primary") }) })
|
|
14263
14305
|
]
|
|
@@ -14274,13 +14316,13 @@ var Combobox = ({
|
|
|
14274
14316
|
"data-state": open ? "open" : "closed",
|
|
14275
14317
|
className: cn("w-full overflow-hidden", getPanelBorderRadiusClass(resolvedBorderMode)),
|
|
14276
14318
|
children: [
|
|
14277
|
-
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("relative border-b border-border/30", size === "sm" ? "p-2" : size === "lg" ? "p-3" : "p-2.5"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
14319
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("relative border-b border-border/30", size === "xs" ? "p-1.5" : size === "sm" ? "p-2" : size === "lg" ? "p-3" : size === "xl" ? "p-3.5" : "p-2.5"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
14278
14320
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
14279
14321
|
import_lucide_react15.Search,
|
|
14280
14322
|
{
|
|
14281
14323
|
className: cn(
|
|
14282
14324
|
"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 transition-colors peer-focus:text-primary",
|
|
14283
|
-
size === "sm" ? "h-3.5 w-3.5" : size === "lg" ? "h-5 w-5" : "h-4 w-4"
|
|
14325
|
+
size === "xs" ? "h-3 w-3" : size === "sm" ? "h-3.5 w-3.5" : size === "lg" || size === "xl" ? "h-5 w-5" : "h-4 w-4"
|
|
14284
14326
|
)
|
|
14285
14327
|
}
|
|
14286
14328
|
),
|
|
@@ -14314,7 +14356,7 @@ var Combobox = ({
|
|
|
14314
14356
|
placeholder: searchPlaceholder,
|
|
14315
14357
|
className: cn(
|
|
14316
14358
|
"peer w-full rounded-xl bg-muted/40 pr-3",
|
|
14317
|
-
size === "sm" ? "py-1.5 pl-8 text-xs" : size === "lg" ? "py-3 pl-10 text-base" : "py-2.5 pl-9 text-sm",
|
|
14359
|
+
size === "xs" ? "py-1 pl-7 text-xs" : size === "sm" ? "py-1.5 pl-8 text-xs" : size === "lg" ? "py-3 pl-10 text-base" : size === "xl" ? "py-3.5 pl-10 text-base" : "py-2.5 pl-9 text-sm",
|
|
14318
14360
|
"border border-transparent",
|
|
14319
14361
|
"focus:outline-none focus:bg-background focus:border-primary/30 focus:ring-2 focus:ring-primary/10",
|
|
14320
14362
|
"transition-all duration-200",
|
|
@@ -14332,7 +14374,7 @@ var Combobox = ({
|
|
|
14332
14374
|
scrollVirtualListToStart();
|
|
14333
14375
|
},
|
|
14334
14376
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-0.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
|
|
14335
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react15.X, { className: cn(size === "sm" ? "h-3 w-3" : size === "lg" ? "h-4 w-4" : "h-3.5 w-3.5") })
|
|
14377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react15.X, { className: cn(size === "xs" ? "h-3 w-3" : size === "sm" ? "h-3 w-3" : size === "lg" || size === "xl" ? "h-4 w-4" : "h-3.5 w-3.5") })
|
|
14336
14378
|
}
|
|
14337
14379
|
)
|
|
14338
14380
|
] }) }),
|
|
@@ -14346,7 +14388,7 @@ var Combobox = ({
|
|
|
14346
14388
|
"data-os-ignore": virtualized ? "" : void 0,
|
|
14347
14389
|
className: cn("overflow-y-auto overscroll-contain", (!useOverlayScrollbar || virtualized) && comboboxScrollClassName),
|
|
14348
14390
|
style: { maxHeight },
|
|
14349
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn(size === "sm" ? "p-1" : size === "lg" ? "p-2" : "p-1.5"), children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-10 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
14391
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn(size === "xs" ? "p-1" : size === "sm" ? "p-1" : size === "lg" || size === "xl" ? "p-2" : "p-1.5"), children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-10 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
14350
14392
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-10 h-10 rounded-full border-2 border-primary/20 border-t-primary animate-spin" }) }),
|
|
14351
14393
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-muted-foreground", children: loadingText })
|
|
14352
14394
|
] }) }) : shouldPromptForSearch ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-10 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
@@ -14403,9 +14445,11 @@ var Combobox = ({
|
|
|
14403
14445
|
}
|
|
14404
14446
|
);
|
|
14405
14447
|
const sizeStyles8 = {
|
|
14448
|
+
xs: formControlSizeStyles.xs.control,
|
|
14406
14449
|
sm: formControlSizeStyles.sm.control,
|
|
14407
14450
|
md: formControlSizeStyles.md.control,
|
|
14408
|
-
lg: formControlSizeStyles.lg.control
|
|
14451
|
+
lg: formControlSizeStyles.lg.control,
|
|
14452
|
+
xl: formControlSizeStyles.xl.control
|
|
14409
14453
|
};
|
|
14410
14454
|
const variantStyles6 = {
|
|
14411
14455
|
default: "border border-input bg-background hover:bg-accent/5 hover:border-primary/40",
|
|
@@ -14414,7 +14458,7 @@ var Combobox = ({
|
|
|
14414
14458
|
filled: "border-0 bg-muted/50 hover:bg-muted/80"
|
|
14415
14459
|
};
|
|
14416
14460
|
const labelSize = formControlSizeStyles[size].label;
|
|
14417
|
-
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
14461
|
+
const verticalGap = size === "xs" || size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
14418
14462
|
const dropdownBackgroundStyle = matchTriggerBackground && triggerBackgroundColor ? { backgroundColor: triggerBackgroundColor } : void 0;
|
|
14419
14463
|
const triggerButtonBaseProps = {
|
|
14420
14464
|
ref: triggerRef,
|
|
@@ -15323,7 +15367,7 @@ var DatePicker = ({
|
|
|
15323
15367
|
placeholder,
|
|
15324
15368
|
className,
|
|
15325
15369
|
disabled = false,
|
|
15326
|
-
size = "md",
|
|
15370
|
+
size: requestedSize = "md",
|
|
15327
15371
|
label,
|
|
15328
15372
|
labelClassName,
|
|
15329
15373
|
required,
|
|
@@ -15335,6 +15379,7 @@ var DatePicker = ({
|
|
|
15335
15379
|
maxDate,
|
|
15336
15380
|
borderMode
|
|
15337
15381
|
}) => {
|
|
15382
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
15338
15383
|
const t = useSmartTranslations("DatePicker");
|
|
15339
15384
|
const tv = useSmartTranslations("ValidationInput");
|
|
15340
15385
|
const locale = useSmartLocale();
|
|
@@ -15845,6 +15890,7 @@ var DatePicker = ({
|
|
|
15845
15890
|
formControlFixedClass,
|
|
15846
15891
|
getBorderRadiusClass(resolvedBorderMode),
|
|
15847
15892
|
sizeStyles8[size].trigger,
|
|
15893
|
+
formControlSizeStyles[requestedSize].control,
|
|
15848
15894
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
15849
15895
|
"border-border/60 hover:border-primary/40",
|
|
15850
15896
|
"focus-within:ring-2 focus-within:ring-primary/50 focus-within:ring-offset-2 focus-within:ring-offset-background focus-within:border-transparent focus-within:hover:border-transparent",
|
|
@@ -15960,10 +16006,11 @@ var DateRangePicker = ({
|
|
|
15960
16006
|
disablePastDates = false,
|
|
15961
16007
|
minDate,
|
|
15962
16008
|
maxDate,
|
|
15963
|
-
size = "md",
|
|
16009
|
+
size: requestedSize = "md",
|
|
15964
16010
|
disabled = false,
|
|
15965
16011
|
borderMode
|
|
15966
16012
|
}) => {
|
|
16013
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
15967
16014
|
const locale = useSmartLocale();
|
|
15968
16015
|
const t = useSmartTranslations("DatePicker");
|
|
15969
16016
|
const tv = useSmartTranslations("ValidationInput");
|
|
@@ -16601,6 +16648,7 @@ var DateRangePicker = ({
|
|
|
16601
16648
|
formControlFixedClass,
|
|
16602
16649
|
getBorderRadiusClass(resolvedBorderMode),
|
|
16603
16650
|
sizeStyles8[size].trigger,
|
|
16651
|
+
formControlSizeStyles[requestedSize].control,
|
|
16604
16652
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
16605
16653
|
"border-border/60 hover:border-primary/40",
|
|
16606
16654
|
"focus-within:ring-2 focus-within:ring-primary/50 focus-within:ring-offset-2 focus-within:ring-offset-background focus-within:border-transparent focus-within:hover:border-transparent",
|
|
@@ -16985,7 +17033,7 @@ var LunarDatePicker = ({
|
|
|
16985
17033
|
placeholder,
|
|
16986
17034
|
className,
|
|
16987
17035
|
disabled = false,
|
|
16988
|
-
size = "md",
|
|
17036
|
+
size: requestedSize = "md",
|
|
16989
17037
|
label,
|
|
16990
17038
|
labelClassName,
|
|
16991
17039
|
required,
|
|
@@ -16997,6 +17045,7 @@ var LunarDatePicker = ({
|
|
|
16997
17045
|
maxDate,
|
|
16998
17046
|
borderMode
|
|
16999
17047
|
}) => {
|
|
17048
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
17000
17049
|
const globalConfig = useUnderverseUIConfig();
|
|
17001
17050
|
const resolvedBorderMode = borderMode ?? globalConfig.input?.borderMode ?? globalConfig.borderMode ?? "full";
|
|
17002
17051
|
const t = useSmartTranslations("DatePicker");
|
|
@@ -17545,6 +17594,7 @@ var LunarDatePicker = ({
|
|
|
17545
17594
|
formControlFixedClass,
|
|
17546
17595
|
getBorderRadiusClass(resolvedBorderMode),
|
|
17547
17596
|
sizeStyles8[size].trigger,
|
|
17597
|
+
formControlSizeStyles[requestedSize].control,
|
|
17548
17598
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
17549
17599
|
"border-border/60 hover:border-primary/40",
|
|
17550
17600
|
"focus-within:ring-2 focus-within:ring-primary/50 focus-within:ring-offset-2 focus-within:ring-offset-background focus-within:border-transparent focus-within:hover:border-transparent",
|
|
@@ -17666,10 +17716,11 @@ var LunarDateRangePicker = ({
|
|
|
17666
17716
|
disablePastDates = false,
|
|
17667
17717
|
minDate,
|
|
17668
17718
|
maxDate,
|
|
17669
|
-
size = "md",
|
|
17719
|
+
size: requestedSize = "md",
|
|
17670
17720
|
disabled = false,
|
|
17671
17721
|
borderMode
|
|
17672
17722
|
}) => {
|
|
17723
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
17673
17724
|
const locale = useSmartLocale();
|
|
17674
17725
|
const t = useSmartTranslations("DatePicker");
|
|
17675
17726
|
const tv = useSmartTranslations("ValidationInput");
|
|
@@ -18182,6 +18233,7 @@ var LunarDateRangePicker = ({
|
|
|
18182
18233
|
formControlFixedClass,
|
|
18183
18234
|
getBorderRadiusClass(borderMode ?? "full"),
|
|
18184
18235
|
sizeStyles8[size].trigger,
|
|
18236
|
+
formControlSizeStyles[requestedSize].control,
|
|
18185
18237
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
18186
18238
|
"border-border/60 hover:border-primary/40",
|
|
18187
18239
|
"focus-within:ring-2 focus-within:ring-primary/50 focus-within:ring-offset-2 focus-within:ring-offset-background focus-within:border-transparent focus-within:hover:border-transparent",
|
|
@@ -18687,7 +18739,7 @@ function MonthYearPicker({
|
|
|
18687
18739
|
onChange,
|
|
18688
18740
|
placeholder = "Select month/year",
|
|
18689
18741
|
disabled = false,
|
|
18690
|
-
size = "md",
|
|
18742
|
+
size: requestedSize = "md",
|
|
18691
18743
|
label,
|
|
18692
18744
|
labelClassName,
|
|
18693
18745
|
required,
|
|
@@ -18712,6 +18764,7 @@ function MonthYearPicker({
|
|
|
18712
18764
|
borderMode,
|
|
18713
18765
|
...rest
|
|
18714
18766
|
}) {
|
|
18767
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
18715
18768
|
const globalConfig = useUnderverseUIConfig();
|
|
18716
18769
|
const resolvedBorderMode = borderMode ?? globalConfig.input?.borderMode ?? globalConfig.borderMode ?? "full";
|
|
18717
18770
|
const gi18n = useGlobalI18n();
|
|
@@ -18880,6 +18933,7 @@ function MonthYearPicker({
|
|
|
18880
18933
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
18881
18934
|
getBorderRadiusClass(resolvedBorderMode),
|
|
18882
18935
|
sz.control,
|
|
18936
|
+
formControlSizeStyles[requestedSize].control,
|
|
18883
18937
|
formControlFixedClass,
|
|
18884
18938
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
18885
18939
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -20226,7 +20280,7 @@ function TimePicker({
|
|
|
20226
20280
|
onChange,
|
|
20227
20281
|
placeholder = "Select time",
|
|
20228
20282
|
disabled = false,
|
|
20229
|
-
size = "md",
|
|
20283
|
+
size: requestedSize = "md",
|
|
20230
20284
|
label,
|
|
20231
20285
|
required,
|
|
20232
20286
|
format = "24",
|
|
@@ -20255,6 +20309,7 @@ function TimePicker({
|
|
|
20255
20309
|
borderMode,
|
|
20256
20310
|
...rest
|
|
20257
20311
|
}) {
|
|
20312
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
20258
20313
|
const tv = useSmartTranslations("ValidationInput");
|
|
20259
20314
|
const gi18n = useGlobalI18n();
|
|
20260
20315
|
const globalConfig = useUnderverseUIConfig();
|
|
@@ -20601,6 +20656,7 @@ function TimePicker({
|
|
|
20601
20656
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
20602
20657
|
getBorderRadiusClass(resolvedBorderMode),
|
|
20603
20658
|
sz.control,
|
|
20659
|
+
formControlSizeStyles[requestedSize].control,
|
|
20604
20660
|
formControlFixedClass,
|
|
20605
20661
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
20606
20662
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -21086,9 +21142,10 @@ var DateTimePicker = ({
|
|
|
21086
21142
|
required,
|
|
21087
21143
|
doneLabel,
|
|
21088
21144
|
clearLabel,
|
|
21089
|
-
size = "md",
|
|
21145
|
+
size: requestedSize = "md",
|
|
21090
21146
|
borderMode
|
|
21091
21147
|
}) => {
|
|
21148
|
+
const size = requestedSize === "xs" ? "sm" : requestedSize === "xl" ? "lg" : requestedSize;
|
|
21092
21149
|
const globalConfig = useUnderverseUIConfig();
|
|
21093
21150
|
const resolvedBorderMode = borderMode ?? globalConfig.input?.borderMode ?? globalConfig.borderMode ?? "full";
|
|
21094
21151
|
const t = useSmartTranslations("DateTimePicker");
|
|
@@ -21293,6 +21350,7 @@ var DateTimePicker = ({
|
|
|
21293
21350
|
formControlFixedClass,
|
|
21294
21351
|
getBorderRadiusClass(resolvedBorderMode),
|
|
21295
21352
|
sizeStyles8[size].trigger,
|
|
21353
|
+
formControlSizeStyles[requestedSize].control,
|
|
21296
21354
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
21297
21355
|
disabled && "opacity-50 cursor-not-allowed",
|
|
21298
21356
|
!displayValue && "text-muted-foreground",
|
|
@@ -24515,6 +24573,13 @@ var MultiCombobox = ({
|
|
|
24515
24573
|
}
|
|
24516
24574
|
}, [maxInitialOptions, normalizedOptions.length, searchMode, virtualized]);
|
|
24517
24575
|
const sizeStyles8 = {
|
|
24576
|
+
xs: {
|
|
24577
|
+
trigger: formControlSizeStyles.xs.control,
|
|
24578
|
+
icon: formControlSizeStyles.xs.icon,
|
|
24579
|
+
search: "px-7 py-1 text-xs",
|
|
24580
|
+
item: "text-xs px-2 py-1",
|
|
24581
|
+
tag: formControlSizeStyles.xs.tag
|
|
24582
|
+
},
|
|
24518
24583
|
sm: {
|
|
24519
24584
|
trigger: formControlSizeStyles.sm.control,
|
|
24520
24585
|
icon: formControlSizeStyles.sm.icon,
|
|
@@ -24535,6 +24600,13 @@ var MultiCombobox = ({
|
|
|
24535
24600
|
search: "px-10 py-3 text-base",
|
|
24536
24601
|
item: "text-base px-3 py-3",
|
|
24537
24602
|
tag: formControlSizeStyles.lg.tag
|
|
24603
|
+
},
|
|
24604
|
+
xl: {
|
|
24605
|
+
trigger: formControlSizeStyles.xl.control,
|
|
24606
|
+
icon: formControlSizeStyles.xl.icon,
|
|
24607
|
+
search: "px-10 py-3.5 text-base",
|
|
24608
|
+
item: "text-base px-4 py-3.5",
|
|
24609
|
+
tag: formControlSizeStyles.xl.tag
|
|
24538
24610
|
}
|
|
24539
24611
|
};
|
|
24540
24612
|
const variantStyles6 = {
|
|
@@ -26978,6 +27050,15 @@ function CategoryTreeSelect(props) {
|
|
|
26978
27050
|
}
|
|
26979
27051
|
const selectedCount = valueArray.length;
|
|
26980
27052
|
const triggerSizeStyles = {
|
|
27053
|
+
xs: {
|
|
27054
|
+
button: formControlSizeStyles.xs.control,
|
|
27055
|
+
iconWrap: "p-0.5",
|
|
27056
|
+
icon: formControlSizeStyles.xs.icon,
|
|
27057
|
+
text: formControlSizeStyles.xs.label,
|
|
27058
|
+
badge: formControlSizeStyles.xs.tag,
|
|
27059
|
+
actionIcon: formControlSizeStyles.xs.icon,
|
|
27060
|
+
clearIcon: "h-2.5 w-2.5"
|
|
27061
|
+
},
|
|
26981
27062
|
sm: {
|
|
26982
27063
|
button: formControlSizeStyles.sm.control,
|
|
26983
27064
|
iconWrap: "p-1",
|
|
@@ -27004,6 +27085,15 @@ function CategoryTreeSelect(props) {
|
|
|
27004
27085
|
badge: formControlSizeStyles.lg.tag,
|
|
27005
27086
|
actionIcon: "w-5 h-5",
|
|
27006
27087
|
clearIcon: "h-4 w-4"
|
|
27088
|
+
},
|
|
27089
|
+
xl: {
|
|
27090
|
+
button: formControlSizeStyles.xl.control,
|
|
27091
|
+
iconWrap: "p-2",
|
|
27092
|
+
icon: formControlSizeStyles.xl.icon,
|
|
27093
|
+
text: formControlSizeStyles.xl.label,
|
|
27094
|
+
badge: formControlSizeStyles.xl.tag,
|
|
27095
|
+
actionIcon: formControlSizeStyles.xl.icon,
|
|
27096
|
+
clearIcon: "h-4 w-4"
|
|
27007
27097
|
}
|
|
27008
27098
|
};
|
|
27009
27099
|
const triggerVariantStyles = {
|
|
@@ -29697,9 +29787,11 @@ var Swatch = ({
|
|
|
29697
29787
|
size = "md"
|
|
29698
29788
|
}) => {
|
|
29699
29789
|
const sizeClasses2 = {
|
|
29790
|
+
xs: "h-4 w-4",
|
|
29700
29791
|
sm: "h-5 w-5",
|
|
29701
29792
|
md: "h-6 w-6",
|
|
29702
|
-
lg: "h-8 w-8"
|
|
29793
|
+
lg: "h-8 w-8",
|
|
29794
|
+
xl: "h-10 w-10"
|
|
29703
29795
|
};
|
|
29704
29796
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
29705
29797
|
"button",
|
|
@@ -29820,11 +29912,13 @@ function ColorPicker({
|
|
|
29820
29912
|
const alphaPct = Math.round(rgba.a * 100);
|
|
29821
29913
|
const harmony = showHarmony ? getColorHarmony(rgba) : null;
|
|
29822
29914
|
const sizeClasses2 = {
|
|
29915
|
+
xs: formControlSizeStyles.xs.control,
|
|
29823
29916
|
sm: formControlSizeStyles.sm.control,
|
|
29824
29917
|
md: formControlSizeStyles.md.control,
|
|
29825
|
-
lg: formControlSizeStyles.lg.control
|
|
29918
|
+
lg: formControlSizeStyles.lg.control,
|
|
29919
|
+
xl: formControlSizeStyles.xl.control
|
|
29826
29920
|
};
|
|
29827
|
-
const swatchSize = size
|
|
29921
|
+
const swatchSize = size;
|
|
29828
29922
|
const trigger = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
29829
29923
|
"button",
|
|
29830
29924
|
{
|
|
@@ -30900,7 +30994,7 @@ function DataTableBodyRows({
|
|
|
30900
30994
|
idx: virtualRow.index,
|
|
30901
30995
|
virtualRow
|
|
30902
30996
|
})).filter((item) => Boolean(item.row)) : displayedData.map((row, idx) => ({ row, idx, virtualRow: void 0 }));
|
|
30903
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { colSpan: leafColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
30997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableRow, { className: "!border-border/10", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { colSpan: leafColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
30904
30998
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
30905
30999
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
30906
31000
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
@@ -30916,7 +31010,7 @@ function DataTableBodyRows({
|
|
|
30916
31010
|
t("loading"),
|
|
30917
31011
|
"\u2026"
|
|
30918
31012
|
] })
|
|
30919
|
-
] }) }) }) : displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { colSpan: leafColumns.length, className: "text-center py-6 text-muted-foreground", children: labels?.noData || t("noData") }) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
31013
|
+
] }) }) }) : displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableRow, { className: "!border-border/10", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { colSpan: leafColumns.length, className: "text-center py-6 text-muted-foreground", children: labels?.noData || t("noData") }) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
30920
31014
|
virtualPaddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableRow, { "aria-hidden": "true", className: "border-0 hover:bg-transparent hover:shadow-none", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { colSpan: leafColumns.length, className: "p-0", style: { height: virtualPaddingTop } }) }),
|
|
30921
31015
|
rowsToRender.map(({ row, idx, virtualRow }) => {
|
|
30922
31016
|
const isStripedRow = striped && idx % 2 === 0;
|
|
@@ -30925,7 +31019,11 @@ function DataTableBodyRows({
|
|
|
30925
31019
|
{
|
|
30926
31020
|
ref: virtualRow ? measureVirtualRow : void 0,
|
|
30927
31021
|
"data-index": virtualRow?.index,
|
|
30928
|
-
className: cn(
|
|
31022
|
+
className: cn(
|
|
31023
|
+
"!border-border/10",
|
|
31024
|
+
densityRowClass,
|
|
31025
|
+
isStripedRow ? "bg-surface-1" : "bg-surface-0"
|
|
31026
|
+
),
|
|
30929
31027
|
style: {
|
|
30930
31028
|
contentVisibility: "auto",
|
|
30931
31029
|
containIntrinsicSize: density === "compact" ? "0 36px" : density === "comfortable" ? "0 56px" : "0 48px"
|
|
@@ -31163,60 +31261,82 @@ function DataTableHeader({
|
|
|
31163
31261
|
const sortByText = sortByLabel ?? gi18n.sortBy ?? "Sort by";
|
|
31164
31262
|
const sortLabel = `${sortByText} ${columnLabel}`;
|
|
31165
31263
|
const useEndIcon = (col.iconPosition ?? "end") === "end";
|
|
31166
|
-
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
31167
|
-
|
|
31168
|
-
|
|
31169
|
-
|
|
31170
|
-
|
|
31171
|
-
|
|
31172
|
-
|
|
31173
|
-
|
|
31174
|
-
|
|
31264
|
+
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
31265
|
+
"div",
|
|
31266
|
+
{
|
|
31267
|
+
"data-underverse-datatable-header-content": col.key,
|
|
31268
|
+
className: cn(
|
|
31269
|
+
"items-center gap-1",
|
|
31270
|
+
useEndIcon && isCenterAlign ? "grid flex-1 grid-cols-[1fr_auto_1fr]" : "flex",
|
|
31271
|
+
useEndIcon && !isCenterAlign && "flex-1 justify-between"
|
|
31272
|
+
),
|
|
31273
|
+
children: [
|
|
31274
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31275
|
+
"span",
|
|
31175
31276
|
{
|
|
31176
|
-
type: "button",
|
|
31177
|
-
title: sortLabel,
|
|
31178
31277
|
className: cn(
|
|
31179
|
-
"
|
|
31180
|
-
|
|
31278
|
+
"font-medium whitespace-nowrap select-text",
|
|
31279
|
+
useEndIcon && isCenterAlign && "col-start-2",
|
|
31280
|
+
headerTitleClass
|
|
31181
31281
|
),
|
|
31182
|
-
|
|
31183
|
-
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
|
|
31187
|
-
|
|
31188
|
-
|
|
31189
|
-
},
|
|
31190
|
-
|
|
31191
|
-
|
|
31192
|
-
|
|
31193
|
-
"
|
|
31194
|
-
|
|
31195
|
-
|
|
31196
|
-
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
|
|
31200
|
-
|
|
31201
|
-
|
|
31202
|
-
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
|
|
31212
|
-
|
|
31213
|
-
|
|
31214
|
-
|
|
31282
|
+
children: col.title
|
|
31283
|
+
}
|
|
31284
|
+
),
|
|
31285
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31286
|
+
Tooltip,
|
|
31287
|
+
{
|
|
31288
|
+
placement: "top",
|
|
31289
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-xs font-medium", children: sortLabel }),
|
|
31290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31291
|
+
"button",
|
|
31292
|
+
{
|
|
31293
|
+
type: "button",
|
|
31294
|
+
title: sortLabel,
|
|
31295
|
+
className: cn(
|
|
31296
|
+
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
31297
|
+
useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
|
|
31298
|
+
sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
|
|
31299
|
+
),
|
|
31300
|
+
onClick: () => {
|
|
31301
|
+
setCurPage(1);
|
|
31302
|
+
setSort((current) => {
|
|
31303
|
+
if (!current || current.key !== col.key) return { key: col.key, order: "asc" };
|
|
31304
|
+
if (current.order === "asc") return { key: col.key, order: "desc" };
|
|
31305
|
+
return null;
|
|
31306
|
+
});
|
|
31307
|
+
},
|
|
31308
|
+
"aria-label": sortLabel,
|
|
31309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
|
|
31310
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31311
|
+
"path",
|
|
31312
|
+
{
|
|
31313
|
+
d: "M5 7.5l5-5 5 5",
|
|
31314
|
+
stroke: "currentColor",
|
|
31315
|
+
strokeWidth: "1.5",
|
|
31316
|
+
strokeLinecap: "round",
|
|
31317
|
+
strokeLinejoin: "round",
|
|
31318
|
+
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
31319
|
+
}
|
|
31320
|
+
),
|
|
31321
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31322
|
+
"path",
|
|
31323
|
+
{
|
|
31324
|
+
d: "M5 12.5l5 5 5-5",
|
|
31325
|
+
stroke: "currentColor",
|
|
31326
|
+
strokeWidth: "1.5",
|
|
31327
|
+
strokeLinecap: "round",
|
|
31328
|
+
strokeLinejoin: "round",
|
|
31329
|
+
opacity: sort?.key === col.key && sort.order === "desc" ? 1 : 0.4
|
|
31330
|
+
}
|
|
31331
|
+
)
|
|
31332
|
+
] })
|
|
31333
|
+
}
|
|
31334
|
+
)
|
|
31215
31335
|
}
|
|
31216
31336
|
)
|
|
31217
|
-
|
|
31218
|
-
|
|
31219
|
-
|
|
31337
|
+
]
|
|
31338
|
+
}
|
|
31339
|
+
);
|
|
31220
31340
|
const filterContent = col.filter ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31221
31341
|
Popover,
|
|
31222
31342
|
{
|
|
@@ -31297,7 +31417,7 @@ function DataTableHeader({
|
|
|
31297
31417
|
t
|
|
31298
31418
|
]
|
|
31299
31419
|
);
|
|
31300
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: headerRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableRow, { children: row.map((headerCell, cellIndex) => {
|
|
31420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: headerRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableRow, { className: "!border-border/10", children: row.map((headerCell, cellIndex) => {
|
|
31301
31421
|
const { column: col, colSpan, rowSpan, isLeaf } = headerCell;
|
|
31302
31422
|
const prevCell = cellIndex > 0 ? row[cellIndex - 1] : null;
|
|
31303
31423
|
const prevCol = prevCell?.column;
|
|
@@ -31375,7 +31495,8 @@ function DataTablePagination({
|
|
|
31375
31495
|
setCurPage,
|
|
31376
31496
|
pageSizeOptions,
|
|
31377
31497
|
setCurPageSize,
|
|
31378
|
-
size
|
|
31498
|
+
size,
|
|
31499
|
+
align
|
|
31379
31500
|
}) {
|
|
31380
31501
|
const totalPages = Math.ceil(totalItems / curPageSize);
|
|
31381
31502
|
const pages = import_react35.default.useMemo(() => {
|
|
@@ -31399,60 +31520,72 @@ function DataTablePagination({
|
|
|
31399
31520
|
const pageBtnClass = size === "sm" ? "h-6 min-w-6 px-1.5 rounded-full text-[11px] font-medium transition-colors" : size === "lg" ? "h-8 min-w-8 px-2.5 rounded-full text-sm font-medium transition-colors" : "h-7 min-w-7 px-2 rounded-full text-xs font-medium transition-colors";
|
|
31400
31521
|
const containerTextClass = size === "sm" ? "text-[11px]" : size === "lg" ? "text-sm" : "text-xs";
|
|
31401
31522
|
const pageSizeClass = size === "sm" ? "w-16" : size === "lg" ? "w-24" : "w-20";
|
|
31402
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cn("flex items-center
|
|
31403
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "
|
|
31404
|
-
(
|
|
31405
|
-
|
|
31406
|
-
|
|
31407
|
-
|
|
31408
|
-
|
|
31409
|
-
|
|
31410
|
-
|
|
31411
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31412
|
-
|
|
31523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cn("relative flex items-center gap-2 px-1 pt-3 text-muted-foreground", containerTextClass), children: [
|
|
31524
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
31525
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "tabular-nums", children: [
|
|
31526
|
+
(curPage - 1) * curPageSize + 1,
|
|
31527
|
+
"-",
|
|
31528
|
+
Math.min(curPage * curPageSize, totalItems),
|
|
31529
|
+
"/",
|
|
31530
|
+
totalItems
|
|
31531
|
+
] }),
|
|
31532
|
+
pageSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31533
|
+
Combobox,
|
|
31413
31534
|
{
|
|
31414
|
-
|
|
31415
|
-
|
|
31416
|
-
|
|
31417
|
-
|
|
31418
|
-
|
|
31419
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("svg", { className: navIconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
31420
|
-
}
|
|
31421
|
-
),
|
|
31422
|
-
pages.map(
|
|
31423
|
-
(p, i) => p === "..." ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "px-1 text-muted-foreground/60", children: "\u2026" }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31424
|
-
"button",
|
|
31425
|
-
{
|
|
31426
|
-
onClick: () => setCurPage(p),
|
|
31427
|
-
className: cn(pageBtnClass, curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"),
|
|
31428
|
-
children: p
|
|
31535
|
+
options: pageSizeOptions.map(String),
|
|
31536
|
+
value: String(curPageSize),
|
|
31537
|
+
onChange: (v) => {
|
|
31538
|
+
setCurPage(1);
|
|
31539
|
+
setCurPageSize(Number(v));
|
|
31429
31540
|
},
|
|
31430
|
-
|
|
31431
|
-
|
|
31432
|
-
),
|
|
31433
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31434
|
-
Button_default,
|
|
31435
|
-
{
|
|
31436
|
-
variant: "ghost",
|
|
31437
|
-
size: controlButtonSize,
|
|
31438
|
-
className: navBtnClass,
|
|
31439
|
-
onClick: () => setCurPage(Math.min(totalPages, curPage + 1)),
|
|
31440
|
-
disabled: curPage === totalPages,
|
|
31441
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("svg", { className: navIconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
31541
|
+
size,
|
|
31542
|
+
className: pageSizeClass
|
|
31442
31543
|
}
|
|
31443
31544
|
)
|
|
31444
31545
|
] }),
|
|
31445
|
-
|
|
31446
|
-
|
|
31546
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
31547
|
+
"div",
|
|
31447
31548
|
{
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
31453
|
-
|
|
31454
|
-
|
|
31455
|
-
|
|
31549
|
+
className: cn(
|
|
31550
|
+
"flex items-center gap-0.5",
|
|
31551
|
+
align === "center" && "absolute left-1/2 -translate-x-1/2",
|
|
31552
|
+
align === "right" && "ml-auto"
|
|
31553
|
+
),
|
|
31554
|
+
children: [
|
|
31555
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31556
|
+
Button_default,
|
|
31557
|
+
{
|
|
31558
|
+
variant: "ghost",
|
|
31559
|
+
size: controlButtonSize,
|
|
31560
|
+
className: navBtnClass,
|
|
31561
|
+
onClick: () => setCurPage(Math.max(1, curPage - 1)),
|
|
31562
|
+
disabled: curPage === 1,
|
|
31563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("svg", { className: navIconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
31564
|
+
}
|
|
31565
|
+
),
|
|
31566
|
+
pages.map(
|
|
31567
|
+
(p, i) => p === "..." ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "px-1 text-muted-foreground/60", children: "\u2026" }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31568
|
+
"button",
|
|
31569
|
+
{
|
|
31570
|
+
onClick: () => setCurPage(p),
|
|
31571
|
+
className: cn(pageBtnClass, curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"),
|
|
31572
|
+
children: p
|
|
31573
|
+
},
|
|
31574
|
+
p
|
|
31575
|
+
)
|
|
31576
|
+
),
|
|
31577
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
31578
|
+
Button_default,
|
|
31579
|
+
{
|
|
31580
|
+
variant: "ghost",
|
|
31581
|
+
size: controlButtonSize,
|
|
31582
|
+
className: navBtnClass,
|
|
31583
|
+
onClick: () => setCurPage(Math.min(totalPages, curPage + 1)),
|
|
31584
|
+
disabled: curPage === totalPages,
|
|
31585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("svg", { className: navIconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
31586
|
+
}
|
|
31587
|
+
)
|
|
31588
|
+
]
|
|
31456
31589
|
}
|
|
31457
31590
|
)
|
|
31458
31591
|
] });
|
|
@@ -32162,6 +32295,7 @@ function DataTable({
|
|
|
32162
32295
|
virtualizedRows = false,
|
|
32163
32296
|
estimatedRowHeight,
|
|
32164
32297
|
overscan = 8,
|
|
32298
|
+
paginationAlign = "right",
|
|
32165
32299
|
enableHeaderAutoFit = true,
|
|
32166
32300
|
labels,
|
|
32167
32301
|
columnColorGroups,
|
|
@@ -32412,7 +32546,8 @@ function DataTable({
|
|
|
32412
32546
|
setCurPage,
|
|
32413
32547
|
pageSizeOptions,
|
|
32414
32548
|
setCurPageSize,
|
|
32415
|
-
size
|
|
32549
|
+
size,
|
|
32550
|
+
align: paginationAlign
|
|
32416
32551
|
}
|
|
32417
32552
|
)
|
|
32418
32553
|
] });
|