@nexub/react 0.0.2 → 1.0.0
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 +64 -24
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +64 -24
- package/package.json +17 -5
package/dist/index.cjs
CHANGED
|
@@ -143,6 +143,17 @@ function useMergedRefs(...refs) {
|
|
|
143
143
|
for (const ref of refsRef.current) setRef(ref, node);
|
|
144
144
|
}, []);
|
|
145
145
|
}
|
|
146
|
+
var toneClasses = {
|
|
147
|
+
neutral: "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-muted)]",
|
|
148
|
+
info: "bg-[var(--color-info-500)] text-white hover:bg-[var(--color-info-600)]",
|
|
149
|
+
success: "bg-[var(--color-success-500)] text-white hover:bg-[var(--color-success-600)]",
|
|
150
|
+
warning: "bg-[var(--color-warning-500)] text-white hover:bg-[var(--color-warning-600)]",
|
|
151
|
+
danger: "bg-[var(--color-danger-500)] text-white hover:bg-[var(--color-danger-600)]",
|
|
152
|
+
leap: "bg-[var(--color-leap-500)] text-white hover:bg-[var(--color-leap-600)]",
|
|
153
|
+
bookub: "bg-[var(--color-bookub-500)] text-white hover:bg-[var(--color-bookub-600)]",
|
|
154
|
+
payub: "bg-[var(--color-payub-500)] text-white hover:bg-[var(--color-payub-600)]",
|
|
155
|
+
founderub: "bg-[var(--color-founderub-500)] text-white hover:bg-[var(--color-founderub-600)]"
|
|
156
|
+
};
|
|
146
157
|
var buttonVariants = classVarianceAuthority.cva(
|
|
147
158
|
[
|
|
148
159
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors",
|
|
@@ -195,7 +206,11 @@ var Button = React87__namespace.forwardRef(
|
|
|
195
206
|
...props
|
|
196
207
|
}, ref) => {
|
|
197
208
|
const sharedProps = {
|
|
198
|
-
className: cn(
|
|
209
|
+
className: cn(
|
|
210
|
+
buttonVariants({ variant, size, fullWidth }),
|
|
211
|
+
tone ? toneClasses[tone] : "",
|
|
212
|
+
className
|
|
213
|
+
),
|
|
199
214
|
"data-tone": tone,
|
|
200
215
|
...props
|
|
201
216
|
};
|
|
@@ -707,12 +722,14 @@ var labelVariants = classVarianceAuthority.cva(
|
|
|
707
722
|
}
|
|
708
723
|
);
|
|
709
724
|
var Label = React87__namespace.forwardRef(
|
|
710
|
-
({ className, size, required, disabled, tone, children, ...props }, ref) => {
|
|
725
|
+
({ className, size, required, disabled, tone, style, children, ...props }, ref) => {
|
|
726
|
+
const toneStyle = tone ? { color: `var(--color-text-${tone})` } : {};
|
|
711
727
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
712
728
|
"label",
|
|
713
729
|
{
|
|
714
730
|
ref,
|
|
715
731
|
"data-tone": tone,
|
|
732
|
+
style: { ...toneStyle, ...style },
|
|
716
733
|
className: cn(
|
|
717
734
|
labelVariants({ size, disabled }),
|
|
718
735
|
"text-[var(--color-text-primary)]",
|
|
@@ -736,12 +753,14 @@ var Label = React87__namespace.forwardRef(
|
|
|
736
753
|
);
|
|
737
754
|
Label.displayName = "Label";
|
|
738
755
|
var HelperText = React87__namespace.forwardRef(
|
|
739
|
-
({ className, tone, children, ...props }, ref) => {
|
|
756
|
+
({ className, tone, style, children, ...props }, ref) => {
|
|
757
|
+
const toneStyle = tone ? { color: `var(--color-text-${tone})` } : {};
|
|
740
758
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
741
759
|
"p",
|
|
742
760
|
{
|
|
743
761
|
ref,
|
|
744
762
|
"data-tone": tone,
|
|
763
|
+
style: { ...toneStyle, ...style },
|
|
745
764
|
className: cn(
|
|
746
765
|
"text-sm text-[var(--color-text-muted)] leading-snug",
|
|
747
766
|
className
|
|
@@ -887,7 +906,7 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
887
906
|
}
|
|
888
907
|
}
|
|
889
908
|
);
|
|
890
|
-
var
|
|
909
|
+
var toneClasses2 = {
|
|
891
910
|
neutral: {
|
|
892
911
|
solid: "bg-[var(--color-neutral-500)] text-white",
|
|
893
912
|
soft: "bg-[var(--color-neutral-500)]/10 text-[var(--color-neutral-700)]",
|
|
@@ -937,7 +956,7 @@ var toneClasses = {
|
|
|
937
956
|
var Badge = React87__namespace.forwardRef(
|
|
938
957
|
({ className, size, variant = "solid", tone = "neutral", leadingIcon, children, ...props }, ref) => {
|
|
939
958
|
const resolvedVariant = variant ?? "solid";
|
|
940
|
-
const toneStyle =
|
|
959
|
+
const toneStyle = toneClasses2[tone][resolvedVariant];
|
|
941
960
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
942
961
|
"span",
|
|
943
962
|
{
|
|
@@ -1406,6 +1425,9 @@ var AvatarGroup = React87__namespace.forwardRef(
|
|
|
1406
1425
|
}
|
|
1407
1426
|
);
|
|
1408
1427
|
AvatarGroup.displayName = "AvatarGroup";
|
|
1428
|
+
|
|
1429
|
+
// src/utils/glass.ts
|
|
1430
|
+
var glassSurfaceClass = "bg-[var(--glass-bg)] border-[var(--glass-border)] backdrop-blur-[var(--glass-blur)] [box-shadow:inset_0_1px_0_0_var(--glass-highlight),var(--glass-shadow)]";
|
|
1409
1431
|
var cardVariants = classVarianceAuthority.cva(
|
|
1410
1432
|
"rounded-lg bg-[var(--color-bg-default)] border border-[var(--color-border-default)] text-[var(--color-text-primary)]",
|
|
1411
1433
|
{
|
|
@@ -1414,10 +1436,19 @@ var cardVariants = classVarianceAuthority.cva(
|
|
|
1414
1436
|
flat: "",
|
|
1415
1437
|
surface: "shadow-[var(--shadow-card,0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1))]",
|
|
1416
1438
|
interactive: "cursor-pointer shadow-[var(--shadow-card,0_1px_3px_0_rgb(0_0_0/0.1))] transition-all duration-200 hover:shadow-[var(--shadow-card-hover,0_4px_12px_0_rgb(0_0_0/0.15))] hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]"
|
|
1439
|
+
},
|
|
1440
|
+
// Material. 'glass' needs data-material="glass" on the element (set in the
|
|
1441
|
+
// component) for the --glass-* vars to resolve. Single box-shadow carries
|
|
1442
|
+
// both the inset specular highlight and the drop shadow so neither clobbers
|
|
1443
|
+
// the other. Listed after `variant` so tailwind-merge lets it win on bg/border.
|
|
1444
|
+
surface: {
|
|
1445
|
+
solid: "",
|
|
1446
|
+
glass: glassSurfaceClass
|
|
1417
1447
|
}
|
|
1418
1448
|
},
|
|
1419
1449
|
defaultVariants: {
|
|
1420
|
-
variant: "flat"
|
|
1450
|
+
variant: "flat",
|
|
1451
|
+
surface: "solid"
|
|
1421
1452
|
}
|
|
1422
1453
|
}
|
|
1423
1454
|
);
|
|
@@ -1433,15 +1464,16 @@ var toneBorderMap = {
|
|
|
1433
1464
|
founderub: "border-l-4 border-l-[var(--color-founderub-500)]"
|
|
1434
1465
|
};
|
|
1435
1466
|
var Card = React87__namespace.forwardRef(
|
|
1436
|
-
({ className, variant = "flat", tone, asChild = false, children, ...props }, ref) => {
|
|
1467
|
+
({ className, variant = "flat", surface = "solid", tone, asChild = false, children, ...props }, ref) => {
|
|
1437
1468
|
const Comp = asChild ? reactSlot.Slot : "div";
|
|
1438
1469
|
const toneStyle = tone ? toneBorderMap[tone] : "";
|
|
1439
1470
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1440
1471
|
Comp,
|
|
1441
1472
|
{
|
|
1442
1473
|
ref,
|
|
1443
|
-
className: cn(cardVariants({ variant }), toneStyle, className),
|
|
1474
|
+
className: cn(cardVariants({ variant, surface }), toneStyle, className),
|
|
1444
1475
|
"data-tone": tone,
|
|
1476
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
1445
1477
|
...props,
|
|
1446
1478
|
children
|
|
1447
1479
|
}
|
|
@@ -2660,7 +2692,7 @@ var Overlay2 = React87__namespace.forwardRef(
|
|
|
2660
2692
|
);
|
|
2661
2693
|
Overlay2.displayName = "Dialog.Overlay";
|
|
2662
2694
|
var Content2 = React87__namespace.forwardRef(
|
|
2663
|
-
function DialogContent({ className, size = "md", children, ...props }, ref) {
|
|
2695
|
+
function DialogContent({ className, size = "md", surface = "solid", children, ...props }, ref) {
|
|
2664
2696
|
const sizeMap2 = {
|
|
2665
2697
|
sm: "max-w-sm",
|
|
2666
2698
|
md: "max-w-lg",
|
|
@@ -2673,17 +2705,19 @@ var Content2 = React87__namespace.forwardRef(
|
|
|
2673
2705
|
{
|
|
2674
2706
|
ref,
|
|
2675
2707
|
className: cn(
|
|
2676
|
-
"fixed left-1/2 top-1/2 z-[var(--z-modal)] w-
|
|
2708
|
+
"fixed left-1/2 top-1/2 z-[var(--z-modal)] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
|
|
2677
2709
|
"rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-default)] shadow-xl",
|
|
2678
|
-
"p-6 focus:outline-none",
|
|
2710
|
+
"max-h-[90vh] overflow-y-auto p-6 focus:outline-none",
|
|
2679
2711
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2680
2712
|
"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2681
2713
|
"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
2682
2714
|
"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
2683
2715
|
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
2684
2716
|
sizeMap2[size],
|
|
2717
|
+
surface === "glass" && glassSurfaceClass,
|
|
2685
2718
|
className
|
|
2686
2719
|
),
|
|
2720
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
2687
2721
|
...props,
|
|
2688
2722
|
children
|
|
2689
2723
|
}
|
|
@@ -2725,7 +2759,7 @@ var Header = React87__namespace.forwardRef(
|
|
|
2725
2759
|
Header.displayName = "Dialog.Header";
|
|
2726
2760
|
var Footer = React87__namespace.forwardRef(
|
|
2727
2761
|
function DialogFooter({ className, ...props }, ref) {
|
|
2728
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mt-6 flex
|
|
2762
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
|
|
2729
2763
|
}
|
|
2730
2764
|
);
|
|
2731
2765
|
Footer.displayName = "Dialog.Footer";
|
|
@@ -2878,7 +2912,7 @@ var Trigger6 = RadixPopover__namespace.Trigger;
|
|
|
2878
2912
|
var Portal6 = RadixPopover__namespace.Portal;
|
|
2879
2913
|
var Close4 = RadixPopover__namespace.Close;
|
|
2880
2914
|
var Content6 = React87__namespace.forwardRef(
|
|
2881
|
-
function PopoverContent({ className, sideOffset = 4, ...props }, ref) {
|
|
2915
|
+
function PopoverContent({ className, sideOffset = 4, surface = "solid", ...props }, ref) {
|
|
2882
2916
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2883
2917
|
RadixPopover__namespace.Content,
|
|
2884
2918
|
{
|
|
@@ -2893,8 +2927,10 @@ var Content6 = React87__namespace.forwardRef(
|
|
|
2893
2927
|
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
2894
2928
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2895
2929
|
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2930
|
+
surface === "glass" && glassSurfaceClass,
|
|
2896
2931
|
className
|
|
2897
2932
|
),
|
|
2933
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
2898
2934
|
...props
|
|
2899
2935
|
}
|
|
2900
2936
|
);
|
|
@@ -3639,7 +3675,7 @@ var Trigger19 = vaul.Drawer.Trigger;
|
|
|
3639
3675
|
var Portal14 = vaul.Drawer.Portal;
|
|
3640
3676
|
var Close5 = vaul.Drawer.Close;
|
|
3641
3677
|
var Overlay5 = vaul.Drawer.Overlay;
|
|
3642
|
-
var Content19 = React87__namespace.forwardRef(({ className, children, side = "right", ...props }, ref) => {
|
|
3678
|
+
var Content19 = React87__namespace.forwardRef(({ className, children, side = "right", surface = "solid", ...props }, ref) => {
|
|
3643
3679
|
const sideMap = {
|
|
3644
3680
|
right: "inset-y-0 right-0 h-full w-3/4 max-w-sm border-l",
|
|
3645
3681
|
left: "inset-y-0 left-0 h-full w-3/4 max-w-sm border-r",
|
|
@@ -3653,8 +3689,10 @@ var Content19 = React87__namespace.forwardRef(({ className, children, side = "ri
|
|
|
3653
3689
|
className: cn(
|
|
3654
3690
|
"fixed z-[var(--z-modal)] flex flex-col bg-[var(--color-bg-default)] shadow-xl focus:outline-none",
|
|
3655
3691
|
sideMap[side],
|
|
3692
|
+
surface === "glass" && glassSurfaceClass,
|
|
3656
3693
|
className
|
|
3657
3694
|
),
|
|
3695
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
3658
3696
|
...props,
|
|
3659
3697
|
children: [
|
|
3660
3698
|
side === "bottom" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mt-4 h-2 w-20 rounded-full bg-[var(--color-border-default)]" }),
|
|
@@ -4169,7 +4207,7 @@ var List5 = React87__namespace.forwardRef(
|
|
|
4169
4207
|
{
|
|
4170
4208
|
ref,
|
|
4171
4209
|
className: cn(
|
|
4172
|
-
"
|
|
4210
|
+
"flex h-9 w-full items-center justify-start overflow-x-auto rounded-lg bg-[var(--color-bg-subtle)] p-1 text-[var(--color-text-muted)] gap-0.5",
|
|
4173
4211
|
className
|
|
4174
4212
|
),
|
|
4175
4213
|
...props
|
|
@@ -4428,7 +4466,7 @@ var Action4 = React87__namespace.forwardRef(
|
|
|
4428
4466
|
{
|
|
4429
4467
|
ref,
|
|
4430
4468
|
className: cn(
|
|
4431
|
-
"inline-flex h-
|
|
4469
|
+
"inline-flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md border px-3 text-xs font-medium transition-colors hover:bg-[var(--color-bg-subtle)]",
|
|
4432
4470
|
className
|
|
4433
4471
|
),
|
|
4434
4472
|
...props
|
|
@@ -4516,14 +4554,16 @@ function Toaster() {
|
|
|
4516
4554
|
] });
|
|
4517
4555
|
}
|
|
4518
4556
|
var Root47 = React87__namespace.forwardRef(
|
|
4519
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4557
|
+
({ className, children, surface = "solid", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4520
4558
|
"header",
|
|
4521
4559
|
{
|
|
4522
4560
|
ref,
|
|
4523
4561
|
className: cn(
|
|
4524
4562
|
"sticky top-0 z-[var(--z-sticky,100)] flex h-[var(--size-nav-header,64px)] items-center border-b border-[var(--color-border-default)] bg-[var(--color-bg-default)] px-4",
|
|
4563
|
+
surface === "glass" && glassSurfaceClass,
|
|
4525
4564
|
className
|
|
4526
4565
|
),
|
|
4566
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
4527
4567
|
...props,
|
|
4528
4568
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full items-center gap-4", children })
|
|
4529
4569
|
}
|
|
@@ -4787,7 +4827,7 @@ var Pagination = React87__namespace.forwardRef(
|
|
|
4787
4827
|
onClick: () => onPageChange(page - 1),
|
|
4788
4828
|
disabled: page <= 1,
|
|
4789
4829
|
"aria-label": "Go to previous page",
|
|
4790
|
-
className: "inline-flex h-
|
|
4830
|
+
className: "inline-flex h-11 w-11 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-primary)] transition-colors hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
4791
4831
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronLeft, { size: "sm", "aria-hidden": "true" })
|
|
4792
4832
|
}
|
|
4793
4833
|
),
|
|
@@ -4795,7 +4835,7 @@ var Pagination = React87__namespace.forwardRef(
|
|
|
4795
4835
|
(p, i) => p === "..." ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4796
4836
|
"span",
|
|
4797
4837
|
{
|
|
4798
|
-
className: "flex h-
|
|
4838
|
+
className: "flex h-11 w-11 items-center justify-center text-[var(--color-text-muted)]",
|
|
4799
4839
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.MoreHorizontal, { size: "sm", "aria-hidden": "true" })
|
|
4800
4840
|
},
|
|
4801
4841
|
`ellipsis-${i}`
|
|
@@ -4806,7 +4846,7 @@ var Pagination = React87__namespace.forwardRef(
|
|
|
4806
4846
|
"aria-label": `Go to page ${p}`,
|
|
4807
4847
|
"aria-current": p === page ? "page" : void 0,
|
|
4808
4848
|
className: cn(
|
|
4809
|
-
"inline-flex h-
|
|
4849
|
+
"inline-flex h-11 w-11 items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
4810
4850
|
p === page ? "bg-[var(--color-brand-primary-500)] text-white" : "border border-[var(--color-border-default)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-subtle)]"
|
|
4811
4851
|
),
|
|
4812
4852
|
children: p
|
|
@@ -4820,7 +4860,7 @@ var Pagination = React87__namespace.forwardRef(
|
|
|
4820
4860
|
onClick: () => onPageChange(page + 1),
|
|
4821
4861
|
disabled: page >= totalPages,
|
|
4822
4862
|
"aria-label": "Go to next page",
|
|
4823
|
-
className: "inline-flex h-
|
|
4863
|
+
className: "inline-flex h-11 w-11 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-primary)] transition-colors hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
4824
4864
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRight, { size: "sm", "aria-hidden": "true" })
|
|
4825
4865
|
}
|
|
4826
4866
|
)
|
|
@@ -5135,7 +5175,7 @@ function DataTable({
|
|
|
5135
5175
|
}
|
|
5136
5176
|
) }) })
|
|
5137
5177
|
] }),
|
|
5138
|
-
pagination && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm text-[var(--color-text-muted)]", children: [
|
|
5178
|
+
pagination && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-sm text-[var(--color-text-muted)]", children: [
|
|
5139
5179
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
5140
5180
|
"Page ",
|
|
5141
5181
|
table.getState().pagination.pageIndex + 1,
|
|
@@ -5148,7 +5188,7 @@ function DataTable({
|
|
|
5148
5188
|
{
|
|
5149
5189
|
onClick: () => table.previousPage(),
|
|
5150
5190
|
disabled: !table.getCanPreviousPage(),
|
|
5151
|
-
className: "rounded border border-[var(--color-border-default)] px-3 py-
|
|
5191
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
5152
5192
|
children: "Previous"
|
|
5153
5193
|
}
|
|
5154
5194
|
),
|
|
@@ -5157,7 +5197,7 @@ function DataTable({
|
|
|
5157
5197
|
{
|
|
5158
5198
|
onClick: () => table.nextPage(),
|
|
5159
5199
|
disabled: !table.getCanNextPage(),
|
|
5160
|
-
className: "rounded border border-[var(--color-border-default)] px-3 py-
|
|
5200
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
5161
5201
|
children: "Next"
|
|
5162
5202
|
}
|
|
5163
5203
|
)
|
package/dist/index.d.cts
CHANGED
|
@@ -282,9 +282,11 @@ declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & Re
|
|
|
282
282
|
|
|
283
283
|
declare const cardVariants: (props?: ({
|
|
284
284
|
variant?: "flat" | "surface" | "interactive" | null | undefined;
|
|
285
|
+
surface?: "solid" | "glass" | null | undefined;
|
|
285
286
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
286
287
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
287
288
|
tone?: ToneValue;
|
|
289
|
+
surface?: 'solid' | 'glass';
|
|
288
290
|
asChild?: boolean;
|
|
289
291
|
}
|
|
290
292
|
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -530,8 +532,11 @@ interface KeyboardShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
530
532
|
}
|
|
531
533
|
declare const KeyboardShortcut: React.ForwardRefExoticComponent<KeyboardShortcutProps & React.RefAttributes<HTMLSpanElement>>;
|
|
532
534
|
|
|
535
|
+
type SurfaceValue = 'solid' | 'glass';
|
|
536
|
+
|
|
533
537
|
interface ContentProps extends RadixDialog.DialogContentProps {
|
|
534
538
|
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
539
|
+
surface?: SurfaceValue;
|
|
535
540
|
}
|
|
536
541
|
declare const Dialog: {
|
|
537
542
|
Root: React.FC<RadixDialog.DialogProps>;
|
|
@@ -564,7 +569,9 @@ declare const Popover: {
|
|
|
564
569
|
Root: React.FC<RadixPopover.PopoverProps>;
|
|
565
570
|
Trigger: React.ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
566
571
|
Portal: React.FC<RadixPopover.PopoverPortalProps>;
|
|
567
|
-
Content: React.ForwardRefExoticComponent<RadixPopover.PopoverContentProps &
|
|
572
|
+
Content: React.ForwardRefExoticComponent<RadixPopover.PopoverContentProps & {
|
|
573
|
+
surface?: SurfaceValue;
|
|
574
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
568
575
|
Arrow: React.ForwardRefExoticComponent<RadixPopover.PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
569
576
|
Close: React.ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
570
577
|
};
|
|
@@ -639,6 +646,7 @@ declare const Drawer: {
|
|
|
639
646
|
Overlay: React.ForwardRefExoticComponent<Omit<RadixDialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
640
647
|
Content: React.ForwardRefExoticComponent<Omit<Omit<RadixDialog.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement> & {
|
|
641
648
|
side?: "left" | "right" | "top" | "bottom";
|
|
649
|
+
surface?: SurfaceValue;
|
|
642
650
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
643
651
|
Close: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
644
652
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -653,6 +661,7 @@ declare const Sheet: {
|
|
|
653
661
|
Overlay: React.ForwardRefExoticComponent<Omit<RadixDialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
654
662
|
Content: React.ForwardRefExoticComponent<Omit<Omit<RadixDialog.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement> & {
|
|
655
663
|
side?: "left" | "right" | "top" | "bottom";
|
|
664
|
+
surface?: SurfaceValue;
|
|
656
665
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
657
666
|
Close: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
658
667
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -889,7 +898,9 @@ interface TopNavItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
889
898
|
active?: boolean;
|
|
890
899
|
}
|
|
891
900
|
declare const TopNav: {
|
|
892
|
-
Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> &
|
|
901
|
+
Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
902
|
+
surface?: SurfaceValue;
|
|
903
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
893
904
|
Logo: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
894
905
|
Menu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
895
906
|
Item: React.ForwardRefExoticComponent<TopNavItemProps & React.RefAttributes<HTMLAnchorElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -282,9 +282,11 @@ declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & Re
|
|
|
282
282
|
|
|
283
283
|
declare const cardVariants: (props?: ({
|
|
284
284
|
variant?: "flat" | "surface" | "interactive" | null | undefined;
|
|
285
|
+
surface?: "solid" | "glass" | null | undefined;
|
|
285
286
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
286
287
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
287
288
|
tone?: ToneValue;
|
|
289
|
+
surface?: 'solid' | 'glass';
|
|
288
290
|
asChild?: boolean;
|
|
289
291
|
}
|
|
290
292
|
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -530,8 +532,11 @@ interface KeyboardShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
530
532
|
}
|
|
531
533
|
declare const KeyboardShortcut: React.ForwardRefExoticComponent<KeyboardShortcutProps & React.RefAttributes<HTMLSpanElement>>;
|
|
532
534
|
|
|
535
|
+
type SurfaceValue = 'solid' | 'glass';
|
|
536
|
+
|
|
533
537
|
interface ContentProps extends RadixDialog.DialogContentProps {
|
|
534
538
|
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
539
|
+
surface?: SurfaceValue;
|
|
535
540
|
}
|
|
536
541
|
declare const Dialog: {
|
|
537
542
|
Root: React.FC<RadixDialog.DialogProps>;
|
|
@@ -564,7 +569,9 @@ declare const Popover: {
|
|
|
564
569
|
Root: React.FC<RadixPopover.PopoverProps>;
|
|
565
570
|
Trigger: React.ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
566
571
|
Portal: React.FC<RadixPopover.PopoverPortalProps>;
|
|
567
|
-
Content: React.ForwardRefExoticComponent<RadixPopover.PopoverContentProps &
|
|
572
|
+
Content: React.ForwardRefExoticComponent<RadixPopover.PopoverContentProps & {
|
|
573
|
+
surface?: SurfaceValue;
|
|
574
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
568
575
|
Arrow: React.ForwardRefExoticComponent<RadixPopover.PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
569
576
|
Close: React.ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
570
577
|
};
|
|
@@ -639,6 +646,7 @@ declare const Drawer: {
|
|
|
639
646
|
Overlay: React.ForwardRefExoticComponent<Omit<RadixDialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
640
647
|
Content: React.ForwardRefExoticComponent<Omit<Omit<RadixDialog.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement> & {
|
|
641
648
|
side?: "left" | "right" | "top" | "bottom";
|
|
649
|
+
surface?: SurfaceValue;
|
|
642
650
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
643
651
|
Close: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
644
652
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -653,6 +661,7 @@ declare const Sheet: {
|
|
|
653
661
|
Overlay: React.ForwardRefExoticComponent<Omit<RadixDialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
654
662
|
Content: React.ForwardRefExoticComponent<Omit<Omit<RadixDialog.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement> & {
|
|
655
663
|
side?: "left" | "right" | "top" | "bottom";
|
|
664
|
+
surface?: SurfaceValue;
|
|
656
665
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
657
666
|
Close: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
658
667
|
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -889,7 +898,9 @@ interface TopNavItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
889
898
|
active?: boolean;
|
|
890
899
|
}
|
|
891
900
|
declare const TopNav: {
|
|
892
|
-
Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> &
|
|
901
|
+
Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
902
|
+
surface?: SurfaceValue;
|
|
903
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
893
904
|
Logo: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
894
905
|
Menu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
895
906
|
Item: React.ForwardRefExoticComponent<TopNavItemProps & React.RefAttributes<HTMLAnchorElement>>;
|
package/dist/index.js
CHANGED
|
@@ -100,6 +100,17 @@ function useMergedRefs(...refs) {
|
|
|
100
100
|
for (const ref of refsRef.current) setRef(ref, node);
|
|
101
101
|
}, []);
|
|
102
102
|
}
|
|
103
|
+
var toneClasses = {
|
|
104
|
+
neutral: "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-muted)]",
|
|
105
|
+
info: "bg-[var(--color-info-500)] text-white hover:bg-[var(--color-info-600)]",
|
|
106
|
+
success: "bg-[var(--color-success-500)] text-white hover:bg-[var(--color-success-600)]",
|
|
107
|
+
warning: "bg-[var(--color-warning-500)] text-white hover:bg-[var(--color-warning-600)]",
|
|
108
|
+
danger: "bg-[var(--color-danger-500)] text-white hover:bg-[var(--color-danger-600)]",
|
|
109
|
+
leap: "bg-[var(--color-leap-500)] text-white hover:bg-[var(--color-leap-600)]",
|
|
110
|
+
bookub: "bg-[var(--color-bookub-500)] text-white hover:bg-[var(--color-bookub-600)]",
|
|
111
|
+
payub: "bg-[var(--color-payub-500)] text-white hover:bg-[var(--color-payub-600)]",
|
|
112
|
+
founderub: "bg-[var(--color-founderub-500)] text-white hover:bg-[var(--color-founderub-600)]"
|
|
113
|
+
};
|
|
103
114
|
var buttonVariants = cva(
|
|
104
115
|
[
|
|
105
116
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors",
|
|
@@ -152,7 +163,11 @@ var Button = React87.forwardRef(
|
|
|
152
163
|
...props
|
|
153
164
|
}, ref) => {
|
|
154
165
|
const sharedProps = {
|
|
155
|
-
className: cn(
|
|
166
|
+
className: cn(
|
|
167
|
+
buttonVariants({ variant, size, fullWidth }),
|
|
168
|
+
tone ? toneClasses[tone] : "",
|
|
169
|
+
className
|
|
170
|
+
),
|
|
156
171
|
"data-tone": tone,
|
|
157
172
|
...props
|
|
158
173
|
};
|
|
@@ -664,12 +679,14 @@ var labelVariants = cva(
|
|
|
664
679
|
}
|
|
665
680
|
);
|
|
666
681
|
var Label = React87.forwardRef(
|
|
667
|
-
({ className, size, required, disabled, tone, children, ...props }, ref) => {
|
|
682
|
+
({ className, size, required, disabled, tone, style, children, ...props }, ref) => {
|
|
683
|
+
const toneStyle = tone ? { color: `var(--color-text-${tone})` } : {};
|
|
668
684
|
return /* @__PURE__ */ jsxs(
|
|
669
685
|
"label",
|
|
670
686
|
{
|
|
671
687
|
ref,
|
|
672
688
|
"data-tone": tone,
|
|
689
|
+
style: { ...toneStyle, ...style },
|
|
673
690
|
className: cn(
|
|
674
691
|
labelVariants({ size, disabled }),
|
|
675
692
|
"text-[var(--color-text-primary)]",
|
|
@@ -693,12 +710,14 @@ var Label = React87.forwardRef(
|
|
|
693
710
|
);
|
|
694
711
|
Label.displayName = "Label";
|
|
695
712
|
var HelperText = React87.forwardRef(
|
|
696
|
-
({ className, tone, children, ...props }, ref) => {
|
|
713
|
+
({ className, tone, style, children, ...props }, ref) => {
|
|
714
|
+
const toneStyle = tone ? { color: `var(--color-text-${tone})` } : {};
|
|
697
715
|
return /* @__PURE__ */ jsx(
|
|
698
716
|
"p",
|
|
699
717
|
{
|
|
700
718
|
ref,
|
|
701
719
|
"data-tone": tone,
|
|
720
|
+
style: { ...toneStyle, ...style },
|
|
702
721
|
className: cn(
|
|
703
722
|
"text-sm text-[var(--color-text-muted)] leading-snug",
|
|
704
723
|
className
|
|
@@ -844,7 +863,7 @@ var badgeVariants = cva(
|
|
|
844
863
|
}
|
|
845
864
|
}
|
|
846
865
|
);
|
|
847
|
-
var
|
|
866
|
+
var toneClasses2 = {
|
|
848
867
|
neutral: {
|
|
849
868
|
solid: "bg-[var(--color-neutral-500)] text-white",
|
|
850
869
|
soft: "bg-[var(--color-neutral-500)]/10 text-[var(--color-neutral-700)]",
|
|
@@ -894,7 +913,7 @@ var toneClasses = {
|
|
|
894
913
|
var Badge = React87.forwardRef(
|
|
895
914
|
({ className, size, variant = "solid", tone = "neutral", leadingIcon, children, ...props }, ref) => {
|
|
896
915
|
const resolvedVariant = variant ?? "solid";
|
|
897
|
-
const toneStyle =
|
|
916
|
+
const toneStyle = toneClasses2[tone][resolvedVariant];
|
|
898
917
|
return /* @__PURE__ */ jsxs(
|
|
899
918
|
"span",
|
|
900
919
|
{
|
|
@@ -1363,6 +1382,9 @@ var AvatarGroup = React87.forwardRef(
|
|
|
1363
1382
|
}
|
|
1364
1383
|
);
|
|
1365
1384
|
AvatarGroup.displayName = "AvatarGroup";
|
|
1385
|
+
|
|
1386
|
+
// src/utils/glass.ts
|
|
1387
|
+
var glassSurfaceClass = "bg-[var(--glass-bg)] border-[var(--glass-border)] backdrop-blur-[var(--glass-blur)] [box-shadow:inset_0_1px_0_0_var(--glass-highlight),var(--glass-shadow)]";
|
|
1366
1388
|
var cardVariants = cva(
|
|
1367
1389
|
"rounded-lg bg-[var(--color-bg-default)] border border-[var(--color-border-default)] text-[var(--color-text-primary)]",
|
|
1368
1390
|
{
|
|
@@ -1371,10 +1393,19 @@ var cardVariants = cva(
|
|
|
1371
1393
|
flat: "",
|
|
1372
1394
|
surface: "shadow-[var(--shadow-card,0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1))]",
|
|
1373
1395
|
interactive: "cursor-pointer shadow-[var(--shadow-card,0_1px_3px_0_rgb(0_0_0/0.1))] transition-all duration-200 hover:shadow-[var(--shadow-card-hover,0_4px_12px_0_rgb(0_0_0/0.15))] hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]"
|
|
1396
|
+
},
|
|
1397
|
+
// Material. 'glass' needs data-material="glass" on the element (set in the
|
|
1398
|
+
// component) for the --glass-* vars to resolve. Single box-shadow carries
|
|
1399
|
+
// both the inset specular highlight and the drop shadow so neither clobbers
|
|
1400
|
+
// the other. Listed after `variant` so tailwind-merge lets it win on bg/border.
|
|
1401
|
+
surface: {
|
|
1402
|
+
solid: "",
|
|
1403
|
+
glass: glassSurfaceClass
|
|
1374
1404
|
}
|
|
1375
1405
|
},
|
|
1376
1406
|
defaultVariants: {
|
|
1377
|
-
variant: "flat"
|
|
1407
|
+
variant: "flat",
|
|
1408
|
+
surface: "solid"
|
|
1378
1409
|
}
|
|
1379
1410
|
}
|
|
1380
1411
|
);
|
|
@@ -1390,15 +1421,16 @@ var toneBorderMap = {
|
|
|
1390
1421
|
founderub: "border-l-4 border-l-[var(--color-founderub-500)]"
|
|
1391
1422
|
};
|
|
1392
1423
|
var Card = React87.forwardRef(
|
|
1393
|
-
({ className, variant = "flat", tone, asChild = false, children, ...props }, ref) => {
|
|
1424
|
+
({ className, variant = "flat", surface = "solid", tone, asChild = false, children, ...props }, ref) => {
|
|
1394
1425
|
const Comp = asChild ? Slot : "div";
|
|
1395
1426
|
const toneStyle = tone ? toneBorderMap[tone] : "";
|
|
1396
1427
|
return /* @__PURE__ */ jsx(
|
|
1397
1428
|
Comp,
|
|
1398
1429
|
{
|
|
1399
1430
|
ref,
|
|
1400
|
-
className: cn(cardVariants({ variant }), toneStyle, className),
|
|
1431
|
+
className: cn(cardVariants({ variant, surface }), toneStyle, className),
|
|
1401
1432
|
"data-tone": tone,
|
|
1433
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
1402
1434
|
...props,
|
|
1403
1435
|
children
|
|
1404
1436
|
}
|
|
@@ -2617,7 +2649,7 @@ var Overlay2 = React87.forwardRef(
|
|
|
2617
2649
|
);
|
|
2618
2650
|
Overlay2.displayName = "Dialog.Overlay";
|
|
2619
2651
|
var Content2 = React87.forwardRef(
|
|
2620
|
-
function DialogContent({ className, size = "md", children, ...props }, ref) {
|
|
2652
|
+
function DialogContent({ className, size = "md", surface = "solid", children, ...props }, ref) {
|
|
2621
2653
|
const sizeMap2 = {
|
|
2622
2654
|
sm: "max-w-sm",
|
|
2623
2655
|
md: "max-w-lg",
|
|
@@ -2630,17 +2662,19 @@ var Content2 = React87.forwardRef(
|
|
|
2630
2662
|
{
|
|
2631
2663
|
ref,
|
|
2632
2664
|
className: cn(
|
|
2633
|
-
"fixed left-1/2 top-1/2 z-[var(--z-modal)] w-
|
|
2665
|
+
"fixed left-1/2 top-1/2 z-[var(--z-modal)] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
|
|
2634
2666
|
"rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-default)] shadow-xl",
|
|
2635
|
-
"p-6 focus:outline-none",
|
|
2667
|
+
"max-h-[90vh] overflow-y-auto p-6 focus:outline-none",
|
|
2636
2668
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2637
2669
|
"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2638
2670
|
"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
2639
2671
|
"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
2640
2672
|
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
2641
2673
|
sizeMap2[size],
|
|
2674
|
+
surface === "glass" && glassSurfaceClass,
|
|
2642
2675
|
className
|
|
2643
2676
|
),
|
|
2677
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
2644
2678
|
...props,
|
|
2645
2679
|
children
|
|
2646
2680
|
}
|
|
@@ -2682,7 +2716,7 @@ var Header = React87.forwardRef(
|
|
|
2682
2716
|
Header.displayName = "Dialog.Header";
|
|
2683
2717
|
var Footer = React87.forwardRef(
|
|
2684
2718
|
function DialogFooter({ className, ...props }, ref) {
|
|
2685
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn("mt-6 flex
|
|
2719
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
|
|
2686
2720
|
}
|
|
2687
2721
|
);
|
|
2688
2722
|
Footer.displayName = "Dialog.Footer";
|
|
@@ -2835,7 +2869,7 @@ var Trigger6 = RadixPopover.Trigger;
|
|
|
2835
2869
|
var Portal6 = RadixPopover.Portal;
|
|
2836
2870
|
var Close4 = RadixPopover.Close;
|
|
2837
2871
|
var Content6 = React87.forwardRef(
|
|
2838
|
-
function PopoverContent({ className, sideOffset = 4, ...props }, ref) {
|
|
2872
|
+
function PopoverContent({ className, sideOffset = 4, surface = "solid", ...props }, ref) {
|
|
2839
2873
|
return /* @__PURE__ */ jsx(
|
|
2840
2874
|
RadixPopover.Content,
|
|
2841
2875
|
{
|
|
@@ -2850,8 +2884,10 @@ var Content6 = React87.forwardRef(
|
|
|
2850
2884
|
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
2851
2885
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2852
2886
|
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2887
|
+
surface === "glass" && glassSurfaceClass,
|
|
2853
2888
|
className
|
|
2854
2889
|
),
|
|
2890
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
2855
2891
|
...props
|
|
2856
2892
|
}
|
|
2857
2893
|
);
|
|
@@ -3596,7 +3632,7 @@ var Trigger19 = Drawer$1.Trigger;
|
|
|
3596
3632
|
var Portal14 = Drawer$1.Portal;
|
|
3597
3633
|
var Close5 = Drawer$1.Close;
|
|
3598
3634
|
var Overlay5 = Drawer$1.Overlay;
|
|
3599
|
-
var Content19 = React87.forwardRef(({ className, children, side = "right", ...props }, ref) => {
|
|
3635
|
+
var Content19 = React87.forwardRef(({ className, children, side = "right", surface = "solid", ...props }, ref) => {
|
|
3600
3636
|
const sideMap = {
|
|
3601
3637
|
right: "inset-y-0 right-0 h-full w-3/4 max-w-sm border-l",
|
|
3602
3638
|
left: "inset-y-0 left-0 h-full w-3/4 max-w-sm border-r",
|
|
@@ -3610,8 +3646,10 @@ var Content19 = React87.forwardRef(({ className, children, side = "right", ...pr
|
|
|
3610
3646
|
className: cn(
|
|
3611
3647
|
"fixed z-[var(--z-modal)] flex flex-col bg-[var(--color-bg-default)] shadow-xl focus:outline-none",
|
|
3612
3648
|
sideMap[side],
|
|
3649
|
+
surface === "glass" && glassSurfaceClass,
|
|
3613
3650
|
className
|
|
3614
3651
|
),
|
|
3652
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
3615
3653
|
...props,
|
|
3616
3654
|
children: [
|
|
3617
3655
|
side === "bottom" && /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-20 rounded-full bg-[var(--color-border-default)]" }),
|
|
@@ -4126,7 +4164,7 @@ var List5 = React87.forwardRef(
|
|
|
4126
4164
|
{
|
|
4127
4165
|
ref,
|
|
4128
4166
|
className: cn(
|
|
4129
|
-
"
|
|
4167
|
+
"flex h-9 w-full items-center justify-start overflow-x-auto rounded-lg bg-[var(--color-bg-subtle)] p-1 text-[var(--color-text-muted)] gap-0.5",
|
|
4130
4168
|
className
|
|
4131
4169
|
),
|
|
4132
4170
|
...props
|
|
@@ -4385,7 +4423,7 @@ var Action4 = React87.forwardRef(
|
|
|
4385
4423
|
{
|
|
4386
4424
|
ref,
|
|
4387
4425
|
className: cn(
|
|
4388
|
-
"inline-flex h-
|
|
4426
|
+
"inline-flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md border px-3 text-xs font-medium transition-colors hover:bg-[var(--color-bg-subtle)]",
|
|
4389
4427
|
className
|
|
4390
4428
|
),
|
|
4391
4429
|
...props
|
|
@@ -4473,14 +4511,16 @@ function Toaster() {
|
|
|
4473
4511
|
] });
|
|
4474
4512
|
}
|
|
4475
4513
|
var Root47 = React87.forwardRef(
|
|
4476
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4514
|
+
({ className, children, surface = "solid", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4477
4515
|
"header",
|
|
4478
4516
|
{
|
|
4479
4517
|
ref,
|
|
4480
4518
|
className: cn(
|
|
4481
4519
|
"sticky top-0 z-[var(--z-sticky,100)] flex h-[var(--size-nav-header,64px)] items-center border-b border-[var(--color-border-default)] bg-[var(--color-bg-default)] px-4",
|
|
4520
|
+
surface === "glass" && glassSurfaceClass,
|
|
4482
4521
|
className
|
|
4483
4522
|
),
|
|
4523
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
4484
4524
|
...props,
|
|
4485
4525
|
children: /* @__PURE__ */ jsx("div", { className: "flex w-full items-center gap-4", children })
|
|
4486
4526
|
}
|
|
@@ -4744,7 +4784,7 @@ var Pagination = React87.forwardRef(
|
|
|
4744
4784
|
onClick: () => onPageChange(page - 1),
|
|
4745
4785
|
disabled: page <= 1,
|
|
4746
4786
|
"aria-label": "Go to previous page",
|
|
4747
|
-
className: "inline-flex h-
|
|
4787
|
+
className: "inline-flex h-11 w-11 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-primary)] transition-colors hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
4748
4788
|
children: /* @__PURE__ */ jsx(ChevronLeft, { size: "sm", "aria-hidden": "true" })
|
|
4749
4789
|
}
|
|
4750
4790
|
),
|
|
@@ -4752,7 +4792,7 @@ var Pagination = React87.forwardRef(
|
|
|
4752
4792
|
(p, i) => p === "..." ? /* @__PURE__ */ jsx(
|
|
4753
4793
|
"span",
|
|
4754
4794
|
{
|
|
4755
|
-
className: "flex h-
|
|
4795
|
+
className: "flex h-11 w-11 items-center justify-center text-[var(--color-text-muted)]",
|
|
4756
4796
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { size: "sm", "aria-hidden": "true" })
|
|
4757
4797
|
},
|
|
4758
4798
|
`ellipsis-${i}`
|
|
@@ -4763,7 +4803,7 @@ var Pagination = React87.forwardRef(
|
|
|
4763
4803
|
"aria-label": `Go to page ${p}`,
|
|
4764
4804
|
"aria-current": p === page ? "page" : void 0,
|
|
4765
4805
|
className: cn(
|
|
4766
|
-
"inline-flex h-
|
|
4806
|
+
"inline-flex h-11 w-11 items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
4767
4807
|
p === page ? "bg-[var(--color-brand-primary-500)] text-white" : "border border-[var(--color-border-default)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-subtle)]"
|
|
4768
4808
|
),
|
|
4769
4809
|
children: p
|
|
@@ -4777,7 +4817,7 @@ var Pagination = React87.forwardRef(
|
|
|
4777
4817
|
onClick: () => onPageChange(page + 1),
|
|
4778
4818
|
disabled: page >= totalPages,
|
|
4779
4819
|
"aria-label": "Go to next page",
|
|
4780
|
-
className: "inline-flex h-
|
|
4820
|
+
className: "inline-flex h-11 w-11 items-center justify-center rounded-md border border-[var(--color-border-default)] text-[var(--color-text-primary)] transition-colors hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
|
|
4781
4821
|
children: /* @__PURE__ */ jsx(ChevronRight, { size: "sm", "aria-hidden": "true" })
|
|
4782
4822
|
}
|
|
4783
4823
|
)
|
|
@@ -5092,7 +5132,7 @@ function DataTable({
|
|
|
5092
5132
|
}
|
|
5093
5133
|
) }) })
|
|
5094
5134
|
] }),
|
|
5095
|
-
pagination && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm text-[var(--color-text-muted)]", children: [
|
|
5135
|
+
pagination && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-sm text-[var(--color-text-muted)]", children: [
|
|
5096
5136
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
5097
5137
|
"Page ",
|
|
5098
5138
|
table.getState().pagination.pageIndex + 1,
|
|
@@ -5105,7 +5145,7 @@ function DataTable({
|
|
|
5105
5145
|
{
|
|
5106
5146
|
onClick: () => table.previousPage(),
|
|
5107
5147
|
disabled: !table.getCanPreviousPage(),
|
|
5108
|
-
className: "rounded border border-[var(--color-border-default)] px-3 py-
|
|
5148
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
5109
5149
|
children: "Previous"
|
|
5110
5150
|
}
|
|
5111
5151
|
),
|
|
@@ -5114,7 +5154,7 @@ function DataTable({
|
|
|
5114
5154
|
{
|
|
5115
5155
|
onClick: () => table.nextPage(),
|
|
5116
5156
|
disabled: !table.getCanNextPage(),
|
|
5117
|
-
className: "rounded border border-[var(--color-border-default)] px-3 py-
|
|
5157
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
5118
5158
|
children: "Next"
|
|
5119
5159
|
}
|
|
5120
5160
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "React component library for Nexub Design System — 90+ accessible, themeable UI components built on Radix UI primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"react-day-picker": "^9.14.0",
|
|
69
69
|
"tailwind-merge": "^2.5.4",
|
|
70
70
|
"vaul": "^1.1.2",
|
|
71
|
-
"@nexub/icons": "0.0
|
|
72
|
-
"@nexub/tokens": "0.0
|
|
71
|
+
"@nexub/icons": "1.0.0",
|
|
72
|
+
"@nexub/tokens": "1.0.0"
|
|
73
73
|
},
|
|
74
74
|
"module": "./dist/index.js",
|
|
75
75
|
"peerDependencies": {
|
|
@@ -77,22 +77,34 @@
|
|
|
77
77
|
"react-dom": ">=18 <20"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
+
"@storybook/addon-essentials": "8.6.14",
|
|
81
|
+
"@storybook/react": "8.6.14",
|
|
82
|
+
"@storybook/react-vite": "8.6.14",
|
|
80
83
|
"@testing-library/jest-dom": "^6.6.3",
|
|
81
84
|
"@testing-library/react": "^16.1.0",
|
|
82
85
|
"@testing-library/user-event": "^14.5.2",
|
|
83
86
|
"@types/react": "^19.0.0",
|
|
84
87
|
"@types/react-dom": "^19.0.0",
|
|
88
|
+
"autoprefixer": "^10.4.20",
|
|
85
89
|
"jsdom": "^25.0.1",
|
|
90
|
+
"postcss": "^8.4.49",
|
|
91
|
+
"react": "^19.0.0",
|
|
92
|
+
"react-dom": "^19.0.0",
|
|
93
|
+
"storybook": "8.6.14",
|
|
94
|
+
"tailwindcss": "^3.4.0",
|
|
86
95
|
"tailwindcss-animate": "^1.0.7",
|
|
87
96
|
"tsup": "^8.3.5",
|
|
88
97
|
"typescript": "^5.6.3",
|
|
89
|
-
"vitest": "^2.1.8"
|
|
98
|
+
"vitest": "^2.1.8",
|
|
99
|
+
"@nexub/themes": "1.0.0"
|
|
90
100
|
},
|
|
91
101
|
"scripts": {
|
|
92
102
|
"build": "tsup",
|
|
93
103
|
"dev": "tsup --watch",
|
|
94
104
|
"clean": "rm -rf dist",
|
|
95
105
|
"typecheck": "tsc --noEmit",
|
|
96
|
-
"test": "vitest run"
|
|
106
|
+
"test": "vitest run",
|
|
107
|
+
"storybook": "storybook dev -p 6006",
|
|
108
|
+
"build-storybook": "storybook build"
|
|
97
109
|
}
|
|
98
110
|
}
|