@nextlyhq/ui 0.0.2-alpha.34 → 0.0.2-alpha.37
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.cjs +190 -462
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -146
- package/dist/index.d.ts +53 -146
- package/dist/index.mjs +190 -463
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +327 -179
- package/package.json +11 -8
package/dist/index.cjs
CHANGED
|
@@ -66,20 +66,26 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
66
66
|
variant: {
|
|
67
67
|
default: "bg-primary text-primary-foreground border border-transparent hover:opacity-90",
|
|
68
68
|
primary: "bg-primary text-primary-foreground border border-transparent hover:opacity-90",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
// Solid fill uses the emphasis token so white on-color text stays AA in
|
|
70
|
+
// dark mode (the base token is the readable text color, too light here).
|
|
71
|
+
// Hover darkens to a deeper shade instead of opacity-90, which would
|
|
72
|
+
// composite the fill toward the page and drop white text under 4.5:1.
|
|
73
|
+
destructive: "bg-destructive-solid text-destructive-foreground border border-transparent hover:bg-destructive-700",
|
|
74
|
+
// border-border (not a faint primary alpha) so the outline is a visible
|
|
75
|
+
// boundary at the 3:1 UI minimum.
|
|
76
|
+
outline: "border border-border text-foreground hover-unified bg-background",
|
|
77
|
+
secondary: "bg-background border border-border text-foreground hover:bg-primary/5",
|
|
72
78
|
ghost: "text-foreground border border-transparent hover-unified",
|
|
73
79
|
link: "text-primary border border-transparent underline-offset-4 hover:underline"
|
|
74
80
|
},
|
|
75
81
|
size: {
|
|
76
|
-
default: "h-[var(--control-height)] px-6 py-2",
|
|
77
|
-
sm: "h-[var(--control-height-md)] px-4 text-[13px]",
|
|
78
|
-
md: "h-[var(--control-height)] px-6 text-sm",
|
|
79
|
-
lg: "h-[var(--control-height-lg)] px-8 text-base",
|
|
80
|
-
icon: "h-[var(--control-height)] w-[var(--control-height)] p-0",
|
|
81
|
-
"icon-sm": "h-[var(--control-height-md)] w-[var(--control-height-md)] p-0",
|
|
82
|
-
"icon-lg": "h-[var(--control-height-lg)] w-[var(--control-height-lg)] p-0"
|
|
82
|
+
default: "h-[var(--nx-control-height)] px-6 py-2",
|
|
83
|
+
sm: "h-[var(--nx-control-height-md)] px-4 text-[13px]",
|
|
84
|
+
md: "h-[var(--nx-control-height)] px-6 text-sm",
|
|
85
|
+
lg: "h-[var(--nx-control-height-lg)] px-8 text-base",
|
|
86
|
+
icon: "h-[var(--nx-control-height)] w-[var(--nx-control-height)] p-0",
|
|
87
|
+
"icon-sm": "h-[var(--nx-control-height-md)] w-[var(--nx-control-height-md)] p-0",
|
|
88
|
+
"icon-lg": "h-[var(--nx-control-height-lg)] w-[var(--nx-control-height-lg)] p-0"
|
|
83
89
|
}
|
|
84
90
|
},
|
|
85
91
|
defaultVariants: {
|
|
@@ -120,9 +126,9 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
120
126
|
{
|
|
121
127
|
variants: {
|
|
122
128
|
size: {
|
|
123
|
-
sm: "h-[var(--control-height-sm)] px-2.5 py-2 text-sm",
|
|
124
|
-
default: "h-[var(--control-height)] px-3 py-2.5 text-sm",
|
|
125
|
-
lg: "h-[var(--control-height-lg)] px-4 py-3 text-base"
|
|
129
|
+
sm: "h-[var(--nx-control-height-sm)] px-2.5 py-2 text-sm",
|
|
130
|
+
default: "h-[var(--nx-control-height)] px-3 py-2.5 text-sm",
|
|
131
|
+
lg: "h-[var(--nx-control-height-lg)] px-4 py-3 text-base"
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
defaultVariants: {
|
|
@@ -151,7 +157,9 @@ var Textarea = React6.forwardRef(({ className, ...props }, ref) => {
|
|
|
151
157
|
{
|
|
152
158
|
"data-slot": "textarea",
|
|
153
159
|
className: cn(
|
|
154
|
-
|
|
160
|
+
// hover:border-primary (full strength) keeps the hover boundary more
|
|
161
|
+
// visible than the resting border-input, not a fainter alpha of it.
|
|
162
|
+
"flex min-h-[80px] w-full rounded-none border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground placeholder:opacity-50 transition-all duration-200 focus:border-primary! focus-visible:border-primary! focus:outline-none hover:border-primary disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-primary/5 resize-y",
|
|
155
163
|
"aria-invalid:border-destructive aria-invalid:focus:border-destructive!",
|
|
156
164
|
className
|
|
157
165
|
),
|
|
@@ -174,22 +182,41 @@ function Label({ className, ...props }) {
|
|
|
174
182
|
}
|
|
175
183
|
);
|
|
176
184
|
}
|
|
185
|
+
var PortalContext = React6.createContext({ container: null });
|
|
186
|
+
function PortalProvider({ container, children }) {
|
|
187
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value: { container }, children });
|
|
188
|
+
}
|
|
189
|
+
function usePortalContainer() {
|
|
190
|
+
const { container } = React6.useContext(PortalContext);
|
|
191
|
+
return container ?? void 0;
|
|
192
|
+
}
|
|
177
193
|
var TooltipProvider = reactTooltip.Provider;
|
|
178
194
|
var Tooltip = reactTooltip.Root;
|
|
179
195
|
var TooltipTrigger = reactTooltip.Trigger;
|
|
180
|
-
var TooltipContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) =>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
196
|
+
var TooltipContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
197
|
+
const portalContainer = usePortalContainer();
|
|
198
|
+
return (
|
|
199
|
+
// Portalled for the same reason as every other overlay here, plus one
|
|
200
|
+
// specific to the tooltip: the positioner measures against the nearest
|
|
201
|
+
// containing block, and it counts `container-type` as one while the
|
|
202
|
+
// browser does not. Left inline under a `@container` element, the content
|
|
203
|
+
// is offset by that element's own position. Portalling lifts it out of any
|
|
204
|
+
// such ancestor, so the two agree again.
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactTooltip.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
206
|
+
reactTooltip.Content,
|
|
207
|
+
{
|
|
208
|
+
ref,
|
|
209
|
+
sideOffset,
|
|
210
|
+
"data-slot": "tooltip-content",
|
|
211
|
+
className: cn(
|
|
212
|
+
"z-50 overflow-hidden rounded-none px-3 py-1.5 text-xs shadow-lg border border-border bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
213
|
+
className
|
|
214
|
+
),
|
|
215
|
+
...props
|
|
216
|
+
}
|
|
217
|
+
) })
|
|
218
|
+
);
|
|
219
|
+
});
|
|
193
220
|
TooltipContent.displayName = reactTooltip.Content.displayName;
|
|
194
221
|
var FormLabelWithTooltip = React6__namespace.forwardRef(
|
|
195
222
|
({
|
|
@@ -244,9 +271,9 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
244
271
|
// which was nearly invisible on dark backgrounds).
|
|
245
272
|
default: "bg-muted text-foreground",
|
|
246
273
|
primary: "bg-primary/10 text-primary dark:bg-primary/20",
|
|
247
|
-
success: "bg-
|
|
248
|
-
warning: "bg-
|
|
249
|
-
destructive: "bg-
|
|
274
|
+
success: "bg-success-100 text-success-700 dark:bg-success-900 dark:text-success-100",
|
|
275
|
+
warning: "bg-warning-100 text-warning-700 dark:bg-warning-900 dark:text-warning-100",
|
|
276
|
+
destructive: "bg-destructive-100 text-destructive-700 dark:bg-destructive-900 dark:text-destructive-100",
|
|
250
277
|
outline: "border border-border! bg-transparent text-foreground dark:text-muted-foreground dark:border-border!"
|
|
251
278
|
}
|
|
252
279
|
},
|
|
@@ -385,15 +412,71 @@ var CardFooter = React6.forwardRef(
|
|
|
385
412
|
}
|
|
386
413
|
);
|
|
387
414
|
CardFooter.displayName = "CardFooter";
|
|
415
|
+
var GAP = {
|
|
416
|
+
0: "gap-0",
|
|
417
|
+
1: "gap-1",
|
|
418
|
+
2: "gap-2",
|
|
419
|
+
3: "gap-3",
|
|
420
|
+
4: "gap-4",
|
|
421
|
+
6: "gap-6",
|
|
422
|
+
8: "gap-8"
|
|
423
|
+
};
|
|
424
|
+
var COLS = {
|
|
425
|
+
1: "grid-cols-1",
|
|
426
|
+
2: "grid-cols-2",
|
|
427
|
+
3: "grid-cols-3",
|
|
428
|
+
4: "grid-cols-4",
|
|
429
|
+
6: "grid-cols-6"
|
|
430
|
+
};
|
|
431
|
+
var Stack = React6.forwardRef(
|
|
432
|
+
({ direction = "col", gap = 4, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
ref,
|
|
436
|
+
className: cn(
|
|
437
|
+
"flex",
|
|
438
|
+
direction === "col" ? "flex-col" : "flex-row",
|
|
439
|
+
GAP[gap],
|
|
440
|
+
className
|
|
441
|
+
),
|
|
442
|
+
...props
|
|
443
|
+
}
|
|
444
|
+
)
|
|
445
|
+
);
|
|
446
|
+
Stack.displayName = "Stack";
|
|
447
|
+
var Grid = React6.forwardRef(
|
|
448
|
+
({ cols = 2, gap = 4, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
ref,
|
|
452
|
+
className: cn("grid", COLS[cols], GAP[gap], className),
|
|
453
|
+
...props
|
|
454
|
+
}
|
|
455
|
+
)
|
|
456
|
+
);
|
|
457
|
+
Grid.displayName = "Grid";
|
|
458
|
+
var Stat = React6.forwardRef(
|
|
459
|
+
({ label, value, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
460
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: label }),
|
|
461
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-2xl font-semibold text-foreground", children: value })
|
|
462
|
+
] })
|
|
463
|
+
);
|
|
464
|
+
Stat.displayName = "Stat";
|
|
388
465
|
var alertVariants = classVarianceAuthority.cva(
|
|
389
466
|
"relative flex items-start gap-3 rounded-none border border-border p-4 text-sm transition-colors duration-150",
|
|
390
467
|
{
|
|
391
468
|
variants: {
|
|
392
469
|
variant: {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
470
|
+
// text-primary is mode-correct (dark ink on light in light mode, light
|
|
471
|
+
// ink on dark in dark mode); the previous dark text override rendered
|
|
472
|
+
// dark slate on the dark tint at about 1:1.
|
|
473
|
+
info: "bg-primary/5 text-primary",
|
|
474
|
+
// dark:border-l-* re-asserts the strong base accent on the left after
|
|
475
|
+
// the dark:border-*-900 all-sides rule, so the meaningful accent stays
|
|
476
|
+
// visible in dark mode instead of collapsing to the faint -900 shade.
|
|
477
|
+
success: "border-success-200 bg-success-50 text-success-900 border-l-4 border-l-success dark:border-success-900 dark:border-l-success dark:bg-success-950 dark:text-success-100",
|
|
478
|
+
warning: "border-warning-200 bg-warning-50 text-warning-900 border-l-4 border-l-warning dark:border-warning-900 dark:border-l-warning dark:bg-warning-950 dark:text-warning-100",
|
|
479
|
+
destructive: "border-destructive-200 bg-destructive-50 text-destructive-900 border-l-4 border-l-destructive dark:border-destructive-900 dark:border-l-destructive dark:bg-destructive-950 dark:text-destructive-100"
|
|
397
480
|
}
|
|
398
481
|
},
|
|
399
482
|
defaultVariants: {
|
|
@@ -489,7 +572,7 @@ var progressVariants = classVarianceAuthority.cva("h-full rounded-none transitio
|
|
|
489
572
|
variants: {
|
|
490
573
|
variant: {
|
|
491
574
|
default: "bg-primary-500",
|
|
492
|
-
success: "bg-
|
|
575
|
+
success: "bg-success-500",
|
|
493
576
|
error: "bg-destructive"
|
|
494
577
|
}
|
|
495
578
|
},
|
|
@@ -543,11 +626,9 @@ var Checkbox = React6.forwardRef(({ className, indeterminate, ...props }, ref) =
|
|
|
543
626
|
ref,
|
|
544
627
|
"data-slot": "checkbox",
|
|
545
628
|
className: cn(
|
|
546
|
-
//
|
|
547
|
-
//
|
|
548
|
-
|
|
549
|
-
// here keeps the control self-sufficient without host overrides.
|
|
550
|
-
"peer h-4 w-4 shrink-0 rounded-none border border-primary/40 ring-offset-background focus:border-primary! focus-visible:border-primary! focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:border-destructive! aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary transition-all duration-200",
|
|
629
|
+
// Resting border uses border-input (a visible 3:1 boundary); the checked
|
|
630
|
+
// state switches to border-primary below, keeping the two states distinct.
|
|
631
|
+
"peer relative h-4 w-4 shrink-0 rounded-none border border-input ring-offset-background before:absolute before:left-1/2 before:top-1/2 before:h-6 before:w-6 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] focus:border-primary! focus-visible:border-primary! focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:border-destructive! aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary transition-all duration-200",
|
|
551
632
|
className
|
|
552
633
|
),
|
|
553
634
|
...props,
|
|
@@ -582,7 +663,9 @@ var RadioGroupItem = React6.forwardRef(({ className, ...props }, ref) => {
|
|
|
582
663
|
className: cn(
|
|
583
664
|
// Unchecked outline uses primary/40 (clearly visible) instead of primary/5
|
|
584
665
|
// (~5% opacity, effectively invisible); hover strengthens above the resting state.
|
|
585
|
-
|
|
666
|
+
// Resting border uses border-input (a visible 3:1 boundary); the checked
|
|
667
|
+
// state switches to border-primary below, keeping the two states distinct.
|
|
668
|
+
"peer h-4 w-4 shrink-0 rounded-none border border-input bg-background cursor-pointer transition-all duration-150 focus:border-primary! focus-visible:border-primary! focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:border-destructive! aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50 hover:border-primary/70 data-[state=checked]:border-primary data-[state=checked]:border-[5px]",
|
|
586
669
|
className
|
|
587
670
|
),
|
|
588
671
|
...props,
|
|
@@ -765,7 +848,7 @@ var TabsTrigger = React6.forwardRef(
|
|
|
765
848
|
ref,
|
|
766
849
|
"data-slot": "tabs-trigger",
|
|
767
850
|
className: cn(
|
|
768
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-none bg-transparent px-4 py-2 text-sm font-medium cursor-pointer transition-all duration-200 border-b-2 relative -mb-0.5 data-[state=active]:border-b-primary! data-[state=active]:text-primary data-[state=inactive]:border-transparent data-[state=inactive]:text-muted-foreground hover:text-primary hover:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
851
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-none bg-transparent px-4 py-2 text-sm font-medium cursor-pointer transition-all duration-200 border-b-2 relative -mb-0.5 data-[state=active]:border-b-primary! data-[state=active]:text-primary data-[state=inactive]:border-transparent data-[state=inactive]:text-muted-foreground hover:text-primary hover:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
769
852
|
className
|
|
770
853
|
),
|
|
771
854
|
...props
|
|
@@ -780,7 +863,7 @@ var TabsContent = React6.forwardRef(
|
|
|
780
863
|
ref,
|
|
781
864
|
"data-slot": "tabs-content",
|
|
782
865
|
className: cn(
|
|
783
|
-
"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
866
|
+
"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
784
867
|
className
|
|
785
868
|
),
|
|
786
869
|
...props
|
|
@@ -788,14 +871,6 @@ var TabsContent = React6.forwardRef(
|
|
|
788
871
|
)
|
|
789
872
|
);
|
|
790
873
|
TabsContent.displayName = reactTabs.Content.displayName;
|
|
791
|
-
var PortalContext = React6.createContext({ container: null });
|
|
792
|
-
function PortalProvider({ container, children }) {
|
|
793
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value: { container }, children });
|
|
794
|
-
}
|
|
795
|
-
function usePortalContainer() {
|
|
796
|
-
const { container } = React6.useContext(PortalContext);
|
|
797
|
-
return container ?? void 0;
|
|
798
|
-
}
|
|
799
874
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
800
875
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
801
876
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
@@ -1043,12 +1118,14 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
1043
1118
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
1044
1119
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
1045
1120
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
1121
|
+
var menuItemBase = "cursor-pointer transition-colors data-[highlighted]:bg-muted data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
1046
1122
|
var DropdownMenuSubTrigger = React6__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1047
1123
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
1048
1124
|
{
|
|
1049
1125
|
ref,
|
|
1050
1126
|
className: cn(
|
|
1051
|
-
"flex
|
|
1127
|
+
"flex select-none items-center gap-2 rounded-none px-2 py-1.5 text-sm outline-none data-[state=open]:bg-muted data-[state=open]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
1128
|
+
menuItemBase,
|
|
1052
1129
|
inset && "pl-8",
|
|
1053
1130
|
className
|
|
1054
1131
|
),
|
|
@@ -1093,7 +1170,8 @@ var DropdownMenuItem = React6__namespace.forwardRef(({ className, inset, ...prop
|
|
|
1093
1170
|
{
|
|
1094
1171
|
ref,
|
|
1095
1172
|
className: cn(
|
|
1096
|
-
"relative flex
|
|
1173
|
+
"relative flex select-none items-center gap-2 rounded-none px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
1174
|
+
menuItemBase,
|
|
1097
1175
|
inset && "pl-8",
|
|
1098
1176
|
className
|
|
1099
1177
|
),
|
|
@@ -1106,7 +1184,8 @@ var DropdownMenuCheckboxItem = React6__namespace.forwardRef(({ className, childr
|
|
|
1106
1184
|
{
|
|
1107
1185
|
ref,
|
|
1108
1186
|
className: cn(
|
|
1109
|
-
"relative flex
|
|
1187
|
+
"relative flex select-none items-center rounded-none py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
1188
|
+
menuItemBase,
|
|
1110
1189
|
className
|
|
1111
1190
|
),
|
|
1112
1191
|
checked,
|
|
@@ -1123,7 +1202,8 @@ var DropdownMenuRadioItem = React6__namespace.forwardRef(({ className, children,
|
|
|
1123
1202
|
{
|
|
1124
1203
|
ref,
|
|
1125
1204
|
className: cn(
|
|
1126
|
-
"relative flex
|
|
1205
|
+
"relative flex select-none items-center rounded-none py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
1206
|
+
menuItemBase,
|
|
1127
1207
|
className
|
|
1128
1208
|
),
|
|
1129
1209
|
...props,
|
|
@@ -1181,13 +1261,15 @@ function SelectValue({
|
|
|
1181
1261
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { "data-slot": "select-value", ...props });
|
|
1182
1262
|
}
|
|
1183
1263
|
var selectTriggerVariants = classVarianceAuthority.cva(
|
|
1184
|
-
|
|
1264
|
+
// hover:border-primary (full strength) keeps the hover boundary more visible
|
|
1265
|
+
// than the resting border-input, not a fainter alpha of it.
|
|
1266
|
+
"flex w-full items-center justify-between gap-2 rounded-none border border-input bg-background px-3 text-sm text-foreground cursor-pointer transition-all duration-150 focus:border-primary! focus-visible:border-primary! focus:outline-none hover:border-primary disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-primary/5 data-[placeholder]:text-muted-foreground aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:border-destructive! [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",
|
|
1185
1267
|
{
|
|
1186
1268
|
variants: {
|
|
1187
1269
|
size: {
|
|
1188
|
-
sm: "h-[var(--control-height-sm)] text-sm",
|
|
1189
|
-
default: "h-[var(--control-height)] text-sm",
|
|
1190
|
-
lg: "h-[var(--control-height-lg)] text-base"
|
|
1270
|
+
sm: "h-[var(--nx-control-height-sm)] text-sm",
|
|
1271
|
+
default: "h-[var(--nx-control-height)] text-sm",
|
|
1272
|
+
lg: "h-[var(--nx-control-height-lg)] text-base"
|
|
1191
1273
|
}
|
|
1192
1274
|
},
|
|
1193
1275
|
defaultVariants: {
|
|
@@ -1670,9 +1752,9 @@ function Toaster({ theme = "system", ...props }) {
|
|
|
1670
1752
|
loading: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" })
|
|
1671
1753
|
},
|
|
1672
1754
|
style: {
|
|
1673
|
-
"--normal-bg": "var(--popover)",
|
|
1674
|
-
"--normal-text": "var(--popover-foreground)",
|
|
1675
|
-
"--normal-border": "var(--border)",
|
|
1755
|
+
"--normal-bg": "var(--nx-popover)",
|
|
1756
|
+
"--normal-text": "var(--nx-popover-foreground)",
|
|
1757
|
+
"--normal-border": "var(--nx-border)",
|
|
1676
1758
|
"--border-radius": "0px"
|
|
1677
1759
|
},
|
|
1678
1760
|
...props
|
|
@@ -1792,7 +1874,7 @@ function TableSearch({
|
|
|
1792
1874
|
{
|
|
1793
1875
|
type: "button",
|
|
1794
1876
|
onClick: onClear,
|
|
1795
|
-
className: "text-muted-foreground
|
|
1877
|
+
className: "text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded-none hover:bg-primary/5",
|
|
1796
1878
|
"aria-label": "Clear search",
|
|
1797
1879
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5" })
|
|
1798
1880
|
}
|
|
@@ -1820,213 +1902,6 @@ function TableEmpty({ message = "No records found" }) {
|
|
|
1820
1902
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: message })
|
|
1821
1903
|
] });
|
|
1822
1904
|
}
|
|
1823
|
-
function renderPageNumbers(currentPage, totalPages, maxVisiblePages, onPageChange) {
|
|
1824
|
-
const getBtnClass = (active) => `flex h-8 w-8 items-center justify-center border-y border-border border-r border-border text-xs z-10 -ml-px transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${active ? "bg-primary! text-primary-foreground! border-primary! z-20" : "bg-background! border-border! hover-muted disabled:opacity-50"}`;
|
|
1825
|
-
if (totalPages <= maxVisiblePages) {
|
|
1826
|
-
return Array.from({ length: totalPages }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1827
|
-
"button",
|
|
1828
|
-
{
|
|
1829
|
-
onClick: () => onPageChange(i),
|
|
1830
|
-
"aria-label": `Go to page ${i + 1}`,
|
|
1831
|
-
"aria-current": currentPage === i ? "page" : void 0,
|
|
1832
|
-
className: getBtnClass(currentPage === i),
|
|
1833
|
-
children: i + 1
|
|
1834
|
-
},
|
|
1835
|
-
`page-${i}`
|
|
1836
|
-
));
|
|
1837
|
-
}
|
|
1838
|
-
const pages = [];
|
|
1839
|
-
const startPage = Math.max(0, currentPage - Math.floor(maxVisiblePages / 2));
|
|
1840
|
-
const endPage = Math.min(totalPages - 1, startPage + maxVisiblePages - 1);
|
|
1841
|
-
if (startPage > 0) {
|
|
1842
|
-
pages.push(
|
|
1843
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1844
|
-
"button",
|
|
1845
|
-
{
|
|
1846
|
-
onClick: () => onPageChange(0),
|
|
1847
|
-
"aria-label": "Go to page 1",
|
|
1848
|
-
className: getBtnClass(currentPage === 0),
|
|
1849
|
-
children: "1"
|
|
1850
|
-
},
|
|
1851
|
-
"page-0"
|
|
1852
|
-
)
|
|
1853
|
-
);
|
|
1854
|
-
if (startPage > 1) {
|
|
1855
|
-
pages.push(
|
|
1856
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1857
|
-
"span",
|
|
1858
|
-
{
|
|
1859
|
-
className: "flex h-8 w-8 items-center justify-center border-y border-border border-r border-border border-border! bg-background! text-muted-foreground text-xs -ml-px",
|
|
1860
|
-
"aria-hidden": "true",
|
|
1861
|
-
children: "..."
|
|
1862
|
-
},
|
|
1863
|
-
"ellipsis-start"
|
|
1864
|
-
)
|
|
1865
|
-
);
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
for (let i = startPage; i <= endPage; i++) {
|
|
1869
|
-
pages.push(
|
|
1870
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1871
|
-
"button",
|
|
1872
|
-
{
|
|
1873
|
-
onClick: () => onPageChange(i),
|
|
1874
|
-
"aria-label": `Go to page ${i + 1}`,
|
|
1875
|
-
"aria-current": currentPage === i ? "page" : void 0,
|
|
1876
|
-
className: getBtnClass(currentPage === i),
|
|
1877
|
-
children: i + 1
|
|
1878
|
-
},
|
|
1879
|
-
i
|
|
1880
|
-
)
|
|
1881
|
-
);
|
|
1882
|
-
}
|
|
1883
|
-
if (endPage < totalPages - 1) {
|
|
1884
|
-
if (endPage < totalPages - 2) {
|
|
1885
|
-
pages.push(
|
|
1886
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1887
|
-
"span",
|
|
1888
|
-
{
|
|
1889
|
-
className: "flex h-8 w-8 items-center justify-center border-y border-border border-r border-border border-border! bg-background! text-muted-foreground text-xs -ml-px",
|
|
1890
|
-
"aria-hidden": "true",
|
|
1891
|
-
children: "..."
|
|
1892
|
-
},
|
|
1893
|
-
"ellipsis-end"
|
|
1894
|
-
)
|
|
1895
|
-
);
|
|
1896
|
-
}
|
|
1897
|
-
pages.push(
|
|
1898
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
|
-
"button",
|
|
1900
|
-
{
|
|
1901
|
-
onClick: () => onPageChange(totalPages - 1),
|
|
1902
|
-
"aria-label": `Go to page ${totalPages}`,
|
|
1903
|
-
className: getBtnClass(currentPage === totalPages - 1),
|
|
1904
|
-
children: totalPages
|
|
1905
|
-
},
|
|
1906
|
-
totalPages - 1
|
|
1907
|
-
)
|
|
1908
|
-
);
|
|
1909
|
-
}
|
|
1910
|
-
return pages;
|
|
1911
|
-
}
|
|
1912
|
-
function TablePagination({
|
|
1913
|
-
meta,
|
|
1914
|
-
onPageChange,
|
|
1915
|
-
onPageSizeChange,
|
|
1916
|
-
config,
|
|
1917
|
-
isLoading = false
|
|
1918
|
-
}) {
|
|
1919
|
-
const {
|
|
1920
|
-
showPageSizeSelector = true,
|
|
1921
|
-
pageSizeOptions = [10, 20, 30, 50],
|
|
1922
|
-
maxVisiblePages = 5
|
|
1923
|
-
} = config || {};
|
|
1924
|
-
const pageIndex = meta.page - 1;
|
|
1925
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col sm:flex-row w-full items-center justify-between gap-4 text-xs sm:text-sm text-muted-foreground p-4 border-t border-border", children: [
|
|
1926
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "whitespace-nowrap order-2 sm:order-1", children: [
|
|
1927
|
-
"Showing ",
|
|
1928
|
-
(meta.page - 1) * meta.limit + 1,
|
|
1929
|
-
"-",
|
|
1930
|
-
Math.min(meta.page * meta.limit, meta.total),
|
|
1931
|
-
" of ",
|
|
1932
|
-
meta.total,
|
|
1933
|
-
" entries"
|
|
1934
|
-
] }),
|
|
1935
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-center gap-4 sm:gap-6 lg:gap-8 order-1 sm:order-2", children: [
|
|
1936
|
-
showPageSizeSelector && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1937
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap hidden sm:inline-block", children: "Rows per page" }),
|
|
1938
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1939
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1940
|
-
"select",
|
|
1941
|
-
{
|
|
1942
|
-
id: "pageSize",
|
|
1943
|
-
value: meta.limit,
|
|
1944
|
-
onChange: (e) => {
|
|
1945
|
-
const newPageSize = Number(e.target.value);
|
|
1946
|
-
onPageSizeChange(newPageSize);
|
|
1947
|
-
},
|
|
1948
|
-
className: "h-8 w-[70px] appearance-none rounded-none border border-border bg-background px-2 py-1 text-sm font-medium focus-visible:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 hover-muted cursor-pointer",
|
|
1949
|
-
disabled: isLoading,
|
|
1950
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: size, children: size }, size))
|
|
1951
|
-
}
|
|
1952
|
-
),
|
|
1953
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1954
|
-
"svg",
|
|
1955
|
-
{
|
|
1956
|
-
className: "h-3 w-3",
|
|
1957
|
-
fill: "none",
|
|
1958
|
-
viewBox: "0 0 24 24",
|
|
1959
|
-
stroke: "currentColor",
|
|
1960
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1961
|
-
"path",
|
|
1962
|
-
{
|
|
1963
|
-
strokeLinecap: "round",
|
|
1964
|
-
strokeLinejoin: "round",
|
|
1965
|
-
strokeWidth: 2,
|
|
1966
|
-
d: "M19 9l-7 7-7-7"
|
|
1967
|
-
}
|
|
1968
|
-
)
|
|
1969
|
-
}
|
|
1970
|
-
) })
|
|
1971
|
-
] })
|
|
1972
|
-
] }),
|
|
1973
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center -space-x-px", children: [
|
|
1974
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1975
|
-
"button",
|
|
1976
|
-
{
|
|
1977
|
-
onClick: () => onPageChange(0),
|
|
1978
|
-
disabled: pageIndex === 0 || isLoading,
|
|
1979
|
-
className: "hidden sm:flex h-8 w-8 items-center justify-center rounded-none border border-border bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
|
|
1980
|
-
"aria-label": "First page",
|
|
1981
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "h-4 w-4" })
|
|
1982
|
-
}
|
|
1983
|
-
),
|
|
1984
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1985
|
-
"button",
|
|
1986
|
-
{
|
|
1987
|
-
onClick: () => onPageChange(pageIndex - 1),
|
|
1988
|
-
disabled: pageIndex === 0 || isLoading,
|
|
1989
|
-
className: "flex h-8 w-8 items-center justify-center rounded-none sm:rounded-none border border-border bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
|
|
1990
|
-
"aria-label": "Previous page",
|
|
1991
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
1992
|
-
}
|
|
1993
|
-
),
|
|
1994
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex", children: renderPageNumbers(
|
|
1995
|
-
pageIndex,
|
|
1996
|
-
meta.totalPages,
|
|
1997
|
-
maxVisiblePages,
|
|
1998
|
-
onPageChange
|
|
1999
|
-
) }),
|
|
2000
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2001
|
-
"button",
|
|
2002
|
-
{
|
|
2003
|
-
onClick: () => onPageChange(pageIndex + 1),
|
|
2004
|
-
disabled: pageIndex >= meta.totalPages - 1 || isLoading,
|
|
2005
|
-
className: "flex h-8 w-8 items-center justify-center rounded-none sm:rounded-none border-y border-border border-x border-border sm:border-r border-border bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
|
|
2006
|
-
"aria-label": "Next page",
|
|
2007
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
2008
|
-
}
|
|
2009
|
-
),
|
|
2010
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2011
|
-
"button",
|
|
2012
|
-
{
|
|
2013
|
-
onClick: () => onPageChange(meta.totalPages - 1),
|
|
2014
|
-
disabled: pageIndex >= meta.totalPages - 1 || isLoading,
|
|
2015
|
-
className: "hidden sm:flex h-8 w-8 items-center justify-center rounded-none border border-border bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
|
|
2016
|
-
"aria-label": "Last page",
|
|
2017
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "h-4 w-4" })
|
|
2018
|
-
}
|
|
2019
|
-
)
|
|
2020
|
-
] }),
|
|
2021
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "whitespace-nowrap hidden sm:block", children: [
|
|
2022
|
-
"Page ",
|
|
2023
|
-
meta.page,
|
|
2024
|
-
" of ",
|
|
2025
|
-
meta.totalPages
|
|
2026
|
-
] })
|
|
2027
|
-
] })
|
|
2028
|
-
] });
|
|
2029
|
-
}
|
|
2030
1905
|
var GrayBar = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className });
|
|
2031
1906
|
var TableSkeleton = ({
|
|
2032
1907
|
columns = 5,
|
|
@@ -2069,219 +1944,71 @@ var TableSkeleton = ({
|
|
|
2069
1944
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "table-wrapper rounded-none border border-border bg-card overflow-hidden", children: content });
|
|
2070
1945
|
};
|
|
2071
1946
|
TableSkeleton.displayName = "TableSkeleton";
|
|
2072
|
-
function ResponsiveTableInner({
|
|
2073
|
-
data,
|
|
2074
|
-
columns,
|
|
2075
|
-
onRowClick,
|
|
2076
|
-
renderMobileCard,
|
|
2077
|
-
className,
|
|
2078
|
-
emptyMessage = "No results found.",
|
|
2079
|
-
ariaLabel,
|
|
2080
|
-
tableWrapperClassName,
|
|
2081
|
-
footer
|
|
2082
|
-
}, ref) {
|
|
2083
|
-
const visibleMobileColumns = React6__namespace.useMemo(
|
|
2084
|
-
() => columns.filter((col) => !col.hideOnMobile),
|
|
2085
|
-
[columns]
|
|
2086
|
-
);
|
|
2087
|
-
const primaryColumn = React6__namespace.useMemo(() => {
|
|
2088
|
-
return visibleMobileColumns.find(
|
|
2089
|
-
(col) => col.key !== "select" && col.key !== "actions"
|
|
2090
|
-
) || visibleMobileColumns[0];
|
|
2091
|
-
}, [visibleMobileColumns]);
|
|
2092
|
-
const secondaryColumns = React6__namespace.useMemo(
|
|
2093
|
-
() => visibleMobileColumns.filter((col) => col.key !== primaryColumn?.key),
|
|
2094
|
-
[visibleMobileColumns, primaryColumn]
|
|
2095
|
-
);
|
|
2096
|
-
React6__namespace.useEffect(() => {
|
|
2097
|
-
const isDev = typeof globalThis !== "undefined" && globalThis.process && globalThis.process.env?.NODE_ENV === "development";
|
|
2098
|
-
if (isDev && visibleMobileColumns.length === 0) {
|
|
2099
|
-
console.warn(
|
|
2100
|
-
"ResponsiveTable: All columns are hidden on mobile (hideOnMobile: true). Consider showing at least one column for better mobile UX. Users will see empty card borders on mobile devices."
|
|
2101
|
-
);
|
|
2102
|
-
}
|
|
2103
|
-
}, [visibleMobileColumns.length]);
|
|
2104
|
-
const handleItemClick = React6__namespace.useCallback(
|
|
2105
|
-
(item, e) => {
|
|
2106
|
-
if (!onRowClick) return;
|
|
2107
|
-
if (e) {
|
|
2108
|
-
const target = e.target;
|
|
2109
|
-
if (target.closest('[role="checkbox"]') || target.closest("button") || target.closest("a") || target.closest('[role^="menuitem"]') || target.closest("[data-actions]")) {
|
|
2110
|
-
return;
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
onRowClick(item);
|
|
2114
|
-
},
|
|
2115
|
-
[onRowClick]
|
|
2116
|
-
);
|
|
2117
|
-
const handleCardKeyDown = React6__namespace.useCallback(
|
|
2118
|
-
(item) => (e) => {
|
|
2119
|
-
if (onRowClick && (e.key === "Enter" || e.key === " ")) {
|
|
2120
|
-
e.preventDefault();
|
|
2121
|
-
handleItemClick(item, e);
|
|
2122
|
-
}
|
|
2123
|
-
},
|
|
2124
|
-
[handleItemClick, onRowClick]
|
|
2125
|
-
);
|
|
2126
|
-
if (data.length === 0) {
|
|
2127
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-8 text-center", className), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage }) });
|
|
2128
|
-
}
|
|
2129
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("w-full", className), children: [
|
|
2130
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 md:hidden", children: data.map((item) => {
|
|
2131
|
-
const primaryValue = primaryColumn ? String(item[primaryColumn.key]) : String(item.id);
|
|
2132
|
-
if (renderMobileCard) {
|
|
2133
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2134
|
-
"div",
|
|
2135
|
-
{
|
|
2136
|
-
onClick: (e) => handleItemClick(item, e),
|
|
2137
|
-
role: onRowClick ? "button" : void 0,
|
|
2138
|
-
tabIndex: onRowClick ? 0 : void 0,
|
|
2139
|
-
onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
|
|
2140
|
-
className: onRowClick ? "cursor-pointer" : void 0,
|
|
2141
|
-
"aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
|
|
2142
|
-
children: renderMobileCard(item, visibleMobileColumns)
|
|
2143
|
-
},
|
|
2144
|
-
item.id
|
|
2145
|
-
);
|
|
2146
|
-
}
|
|
2147
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2148
|
-
Card,
|
|
2149
|
-
{
|
|
2150
|
-
variant: onRowClick ? "interactive" : "default",
|
|
2151
|
-
className: cn(
|
|
2152
|
-
onRowClick && "cursor-pointer",
|
|
2153
|
-
"transition-all duration-150"
|
|
2154
|
-
),
|
|
2155
|
-
onClick: (e) => handleItemClick(item, e),
|
|
2156
|
-
role: onRowClick ? "button" : void 0,
|
|
2157
|
-
tabIndex: onRowClick ? 0 : void 0,
|
|
2158
|
-
onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
|
|
2159
|
-
"aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
|
|
2160
|
-
children: [
|
|
2161
|
-
primaryColumn ? /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "text-base", children: primaryColumn.render ? primaryColumn.render(item[primaryColumn.key], item) : String(item[primaryColumn.key]) }) }) : null,
|
|
2162
|
-
secondaryColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "pb-3", children: /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "flex flex-col gap-2", children: secondaryColumns.map((column) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2163
|
-
"div",
|
|
2164
|
-
{
|
|
2165
|
-
className: "flex items-start justify-between gap-4 text-sm",
|
|
2166
|
-
children: [
|
|
2167
|
-
!column.hideLabelOnMobile && /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "text-muted-foreground min-w-[80px] shrink-0", children: [
|
|
2168
|
-
column.label,
|
|
2169
|
-
":"
|
|
2170
|
-
] }),
|
|
2171
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2172
|
-
"dd",
|
|
2173
|
-
{
|
|
2174
|
-
className: cn(
|
|
2175
|
-
"font-medium flex-1",
|
|
2176
|
-
!column.hideLabelOnMobile ? "text-right" : "text-left"
|
|
2177
|
-
),
|
|
2178
|
-
children: column.render ? column.render(item[column.key], item) : String(item[column.key])
|
|
2179
|
-
}
|
|
2180
|
-
)
|
|
2181
|
-
]
|
|
2182
|
-
},
|
|
2183
|
-
String(column.key)
|
|
2184
|
-
)) }) })
|
|
2185
|
-
]
|
|
2186
|
-
},
|
|
2187
|
-
item.id
|
|
2188
|
-
);
|
|
2189
|
-
}) }),
|
|
2190
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2191
|
-
"div",
|
|
2192
|
-
{
|
|
2193
|
-
className: cn(
|
|
2194
|
-
"table-wrapper hidden md:block overflow-hidden rounded-none border border-border",
|
|
2195
|
-
tableWrapperClassName
|
|
2196
|
-
),
|
|
2197
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { "aria-label": ariaLabel || "Data table", children: [
|
|
2198
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "bg-[var(--table-header-bg)]", children: /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2199
|
-
TableHead,
|
|
2200
|
-
{
|
|
2201
|
-
className: column.headerClassName,
|
|
2202
|
-
children: column.label
|
|
2203
|
-
},
|
|
2204
|
-
String(column.key)
|
|
2205
|
-
)) }) }),
|
|
2206
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: data.map((item) => {
|
|
2207
|
-
const primaryValue = primaryColumn ? String(item[primaryColumn.key]) : String(item.id);
|
|
2208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2209
|
-
TableRow,
|
|
2210
|
-
{
|
|
2211
|
-
className: cn(
|
|
2212
|
-
"hover-unified-table-row",
|
|
2213
|
-
onRowClick && "cursor-pointer"
|
|
2214
|
-
),
|
|
2215
|
-
onClick: (e) => handleItemClick(item, e),
|
|
2216
|
-
role: onRowClick ? "button" : void 0,
|
|
2217
|
-
tabIndex: onRowClick ? 0 : void 0,
|
|
2218
|
-
onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
|
|
2219
|
-
"aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
|
|
2220
|
-
children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2221
|
-
TableCell,
|
|
2222
|
-
{
|
|
2223
|
-
className: column.cellClassName,
|
|
2224
|
-
children: column.render ? column.render(item[column.key], item) : String(item[column.key])
|
|
2225
|
-
},
|
|
2226
|
-
String(column.key)
|
|
2227
|
-
))
|
|
2228
|
-
},
|
|
2229
|
-
item.id
|
|
2230
|
-
);
|
|
2231
|
-
}) })
|
|
2232
|
-
] })
|
|
2233
|
-
}
|
|
2234
|
-
),
|
|
2235
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "table-footer border-t border-border bg-[var(--table-header-bg)]", children: footer })
|
|
2236
|
-
] });
|
|
2237
|
-
}
|
|
2238
|
-
var ResponsiveTable = React6__namespace.forwardRef(ResponsiveTableInner);
|
|
2239
1947
|
|
|
2240
1948
|
// src/tailwind-preset.ts
|
|
1949
|
+
var statusScale = (base) => ({
|
|
1950
|
+
50: `color-mix(in srgb, var(${base}), white 95%)`,
|
|
1951
|
+
100: `color-mix(in srgb, var(${base}), white 90%)`,
|
|
1952
|
+
200: `color-mix(in srgb, var(${base}), white 70%)`,
|
|
1953
|
+
300: `color-mix(in srgb, var(${base}), white 50%)`,
|
|
1954
|
+
400: `color-mix(in srgb, var(${base}), white 30%)`,
|
|
1955
|
+
500: `var(${base})`,
|
|
1956
|
+
600: `color-mix(in srgb, var(${base}), black 10%)`,
|
|
1957
|
+
700: `color-mix(in srgb, var(${base}), black 30%)`,
|
|
1958
|
+
800: `color-mix(in srgb, var(${base}), black 50%)`,
|
|
1959
|
+
900: `color-mix(in srgb, var(${base}), black 70%)`,
|
|
1960
|
+
950: `color-mix(in srgb, var(${base}), black 85%)`
|
|
1961
|
+
});
|
|
2241
1962
|
var uiPreset = {
|
|
2242
1963
|
theme: {
|
|
2243
1964
|
extend: {
|
|
2244
1965
|
colors: {
|
|
2245
|
-
border: "var(--border)",
|
|
2246
|
-
input: "var(--input)",
|
|
2247
|
-
ring: "var(--ring)",
|
|
2248
|
-
background: "var(--background)",
|
|
2249
|
-
foreground: "var(--foreground)",
|
|
1966
|
+
border: "var(--nx-border)",
|
|
1967
|
+
input: "var(--nx-input)",
|
|
1968
|
+
ring: "var(--nx-ring)",
|
|
1969
|
+
background: "var(--nx-background)",
|
|
1970
|
+
foreground: "var(--nx-foreground)",
|
|
2250
1971
|
primary: {
|
|
2251
|
-
DEFAULT: "var(--primary)",
|
|
2252
|
-
foreground: "var(--primary-foreground)"
|
|
1972
|
+
DEFAULT: "var(--nx-primary)",
|
|
1973
|
+
foreground: "var(--nx-primary-foreground)"
|
|
2253
1974
|
},
|
|
2254
1975
|
secondary: {
|
|
2255
|
-
DEFAULT: "var(--secondary)",
|
|
2256
|
-
foreground: "var(--secondary-foreground)"
|
|
1976
|
+
DEFAULT: "var(--nx-secondary)",
|
|
1977
|
+
foreground: "var(--nx-secondary-foreground)"
|
|
2257
1978
|
},
|
|
2258
1979
|
destructive: {
|
|
2259
|
-
DEFAULT: "var(--destructive)",
|
|
2260
|
-
|
|
1980
|
+
DEFAULT: "var(--nx-destructive)",
|
|
1981
|
+
// Saturated fill for solid buttons, distinct from the text-tuned base.
|
|
1982
|
+
solid: "var(--nx-destructive-solid)",
|
|
1983
|
+
foreground: "var(--nx-destructive-foreground)",
|
|
1984
|
+
...statusScale("--nx-destructive")
|
|
2261
1985
|
},
|
|
2262
1986
|
success: {
|
|
2263
|
-
DEFAULT: "var(--success)",
|
|
2264
|
-
|
|
1987
|
+
DEFAULT: "var(--nx-success)",
|
|
1988
|
+
solid: "var(--nx-success-solid)",
|
|
1989
|
+
foreground: "var(--nx-success-foreground)",
|
|
1990
|
+
...statusScale("--nx-success")
|
|
2265
1991
|
},
|
|
2266
1992
|
warning: {
|
|
2267
|
-
DEFAULT: "var(--warning)",
|
|
2268
|
-
foreground: "var(--warning-foreground)"
|
|
1993
|
+
DEFAULT: "var(--nx-warning)",
|
|
1994
|
+
foreground: "var(--nx-warning-foreground)",
|
|
1995
|
+
...statusScale("--nx-warning")
|
|
2269
1996
|
},
|
|
2270
1997
|
muted: {
|
|
2271
|
-
DEFAULT: "var(--muted)",
|
|
2272
|
-
foreground: "var(--muted-foreground)"
|
|
1998
|
+
DEFAULT: "var(--nx-muted)",
|
|
1999
|
+
foreground: "var(--nx-muted-foreground)"
|
|
2273
2000
|
},
|
|
2274
2001
|
accent: {
|
|
2275
|
-
DEFAULT: "var(--accent)",
|
|
2276
|
-
foreground: "var(--accent-foreground)"
|
|
2002
|
+
DEFAULT: "var(--nx-accent)",
|
|
2003
|
+
foreground: "var(--nx-accent-foreground)"
|
|
2277
2004
|
},
|
|
2278
2005
|
popover: {
|
|
2279
|
-
DEFAULT: "var(--popover)",
|
|
2280
|
-
foreground: "var(--popover-foreground)"
|
|
2006
|
+
DEFAULT: "var(--nx-popover)",
|
|
2007
|
+
foreground: "var(--nx-popover-foreground)"
|
|
2281
2008
|
},
|
|
2282
2009
|
card: {
|
|
2283
|
-
DEFAULT: "var(--card)",
|
|
2284
|
-
foreground: "var(--card-foreground)"
|
|
2010
|
+
DEFAULT: "var(--nx-card)",
|
|
2011
|
+
foreground: "var(--nx-card-foreground)"
|
|
2285
2012
|
}
|
|
2286
2013
|
},
|
|
2287
2014
|
borderRadius: {
|
|
@@ -2381,6 +2108,7 @@ exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
|
2381
2108
|
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
2382
2109
|
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
2383
2110
|
exports.FormLabelWithTooltip = FormLabelWithTooltip;
|
|
2111
|
+
exports.Grid = Grid;
|
|
2384
2112
|
exports.Input = Input;
|
|
2385
2113
|
exports.Label = Label;
|
|
2386
2114
|
exports.Popover = Popover;
|
|
@@ -2391,7 +2119,6 @@ exports.PortalProvider = PortalProvider;
|
|
|
2391
2119
|
exports.Progress = Progress;
|
|
2392
2120
|
exports.RadioGroup = RadioGroup;
|
|
2393
2121
|
exports.RadioGroupItem = RadioGroupItem;
|
|
2394
|
-
exports.ResponsiveTable = ResponsiveTable;
|
|
2395
2122
|
exports.Select = Select;
|
|
2396
2123
|
exports.SelectContent = SelectContent;
|
|
2397
2124
|
exports.SelectGroup = SelectGroup;
|
|
@@ -2415,6 +2142,8 @@ exports.SheetTitle = SheetTitle;
|
|
|
2415
2142
|
exports.SheetTrigger = SheetTrigger;
|
|
2416
2143
|
exports.Skeleton = Skeleton;
|
|
2417
2144
|
exports.Spinner = Spinner;
|
|
2145
|
+
exports.Stack = Stack;
|
|
2146
|
+
exports.Stat = Stat;
|
|
2418
2147
|
exports.Switch = Switch;
|
|
2419
2148
|
exports.Table = Table;
|
|
2420
2149
|
exports.TableBody = TableBody;
|
|
@@ -2426,7 +2155,6 @@ exports.TableFooter = TableFooter;
|
|
|
2426
2155
|
exports.TableHead = TableHead;
|
|
2427
2156
|
exports.TableHeader = TableHeader;
|
|
2428
2157
|
exports.TableLoading = TableLoading;
|
|
2429
|
-
exports.TablePagination = TablePagination;
|
|
2430
2158
|
exports.TableRow = TableRow;
|
|
2431
2159
|
exports.TableSearch = TableSearch;
|
|
2432
2160
|
exports.TableSkeleton = TableSkeleton;
|