@nexub/react 1.0.0 → 1.2.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/chunk-24CZFBTG.js +83 -0
- package/dist/chunk-2RLSIOGB.js +173 -0
- package/dist/chunk-2VDP2ML4.js +105 -0
- package/dist/chunk-3CSKW56L.js +44 -0
- package/dist/chunk-3U54QLYB.js +87 -0
- package/dist/chunk-46CFSBEO.js +48 -0
- package/dist/chunk-4NGB7XIM.js +88 -0
- package/dist/chunk-4OCXGNP3.js +85 -0
- package/dist/chunk-52KTX5A7.js +119 -0
- package/dist/chunk-6AZP6VBM.js +62 -0
- package/dist/chunk-6Y734SXN.js +51 -0
- package/dist/chunk-7B4FS7VQ.js +150 -0
- package/dist/chunk-7W2YDJ5W.js +128 -0
- package/dist/chunk-A7L75YXY.js +61 -0
- package/dist/chunk-ADO2DB6Q.js +1 -0
- package/dist/chunk-AT6RPKU3.js +12 -0
- package/dist/chunk-BBVOB4EC.js +36 -0
- package/dist/chunk-BGY23Y5O.js +104 -0
- package/dist/chunk-BJKW3G2L.js +99 -0
- package/dist/chunk-BMVAZIAJ.js +187 -0
- package/dist/chunk-BTZW34TX.js +76 -0
- package/dist/chunk-BUBYXAJK.js +20 -0
- package/dist/chunk-BV3U3ATL.js +1 -0
- package/dist/chunk-BYCTJHXY.js +75 -0
- package/dist/chunk-BYF223HT.js +92 -0
- package/dist/chunk-CPV367VS.js +106 -0
- package/dist/chunk-CVBAWKNG.js +124 -0
- package/dist/chunk-CZUNTABW.js +25 -0
- package/dist/chunk-DAXDAFNG.js +92 -0
- package/dist/chunk-DD6XCW6R.js +53 -0
- package/dist/chunk-DEH2Z27F.js +50 -0
- package/dist/chunk-DGJE5MX5.js +102 -0
- package/dist/chunk-DOHXBNOP.js +119 -0
- package/dist/chunk-DR2Y3PIT.js +91 -0
- package/dist/chunk-ELC2NBGH.js +89 -0
- package/dist/chunk-EV43I5J6.js +1 -0
- package/dist/chunk-EVCTOIRS.js +66 -0
- package/dist/chunk-FS4XKWFA.js +308 -0
- package/dist/chunk-FUJOSPNQ.js +38 -0
- package/dist/chunk-GTQIA62H.js +60 -0
- package/dist/chunk-H4MXRAXP.js +37 -0
- package/dist/chunk-HW3I7I3R.js +29 -0
- package/dist/chunk-HY3JWSG4.js +1 -0
- package/dist/chunk-I5Z3A7N3.js +40 -0
- package/dist/chunk-IBCYG6HR.js +55 -0
- package/dist/chunk-IHW2L532.js +175 -0
- package/dist/chunk-IU76LV3W.js +101 -0
- package/dist/chunk-IZ6ZPEZ2.js +1 -0
- package/dist/chunk-JCUVWDUC.js +57 -0
- package/dist/chunk-JKTZMWWC.js +63 -0
- package/dist/chunk-JQDLCN5D.js +66 -0
- package/dist/chunk-K7CUCLLI.js +43 -0
- package/dist/chunk-KBB7M6WO.js +65 -0
- package/dist/chunk-KLTQJZOX.js +1 -0
- package/dist/chunk-KWWV3CM3.js +62 -0
- package/dist/chunk-KZW37FQZ.js +40 -0
- package/dist/chunk-LAWZQ6R6.js +76 -0
- package/dist/chunk-LOP63AVE.js +49 -0
- package/dist/chunk-MY6XUJ5P.js +216 -0
- package/dist/chunk-N2GIMMTF.js +98 -0
- package/dist/chunk-NAIZ7R2L.js +59 -0
- package/dist/chunk-NHUQLIHL.js +9 -0
- package/dist/chunk-NZ7UK3G6.js +1 -0
- package/dist/chunk-OUBBOOZE.js +34 -0
- package/dist/chunk-OZPPL76D.js +82 -0
- package/dist/chunk-P6BZNFVU.js +38 -0
- package/dist/chunk-PANDAMD2.js +54 -0
- package/dist/chunk-PBLEGOLM.js +71 -0
- package/dist/chunk-PER3O4FD.js +33 -0
- package/dist/chunk-PICMOOAZ.js +1 -0
- package/dist/chunk-POBSY7EZ.js +155 -0
- package/dist/chunk-POFKKYHY.js +37 -0
- package/dist/chunk-QF7GUDOE.js +67 -0
- package/dist/chunk-QHJ43Q2T.js +70 -0
- package/dist/chunk-QRZV2FLW.js +106 -0
- package/dist/chunk-QURKXXNS.js +46 -0
- package/dist/chunk-RIDDJUPA.js +122 -0
- package/dist/chunk-ROZVVWPV.js +8 -0
- package/dist/chunk-SZKUSLHI.js +176 -0
- package/dist/chunk-T4IVMVMQ.js +32 -0
- package/dist/chunk-TCTFQYLH.js +115 -0
- package/dist/chunk-U3AEA4BZ.js +56 -0
- package/dist/chunk-U3EGB3JL.js +43 -0
- package/dist/chunk-UALYS4XI.js +67 -0
- package/dist/chunk-UTBUIBEP.js +153 -0
- package/dist/chunk-UWWL5FPC.js +80 -0
- package/dist/chunk-V3FZHIEB.js +52 -0
- package/dist/chunk-VPZCQFVY.js +33 -0
- package/dist/chunk-VT7RKY46.js +49 -0
- package/dist/chunk-W4IEXUD4.js +127 -0
- package/dist/chunk-WCJNZ5ME.js +1593 -0
- package/dist/chunk-WPPNDU2E.js +36 -0
- package/dist/chunk-XNDCVVNE.js +45 -0
- package/dist/chunk-Y45JAJKW.js +44 -0
- package/dist/chunk-YAGVMERC.js +81 -0
- package/dist/chunk-YGOR3KT7.js +46 -0
- package/dist/chunk-YJD66LTV.js +54 -0
- package/dist/chunk-YJU4ZRQZ.js +1 -0
- package/dist/chunk-YUFCNHZF.js +27 -0
- package/dist/chunk-YUNWZAAD.js +57 -0
- package/dist/chunk-ZFVBFCYV.js +84 -0
- package/dist/chunk-ZLSUVZM2.js +145 -0
- package/dist/chunk-ZXLACKEB.js +8 -0
- package/dist/components/Accordion/index.js +8 -0
- package/dist/components/Alert/index.js +10 -0
- package/dist/components/AlertDialog/index.js +8 -0
- package/dist/components/AppShell/index.js +8 -0
- package/dist/components/AspectRatio/index.js +8 -0
- package/dist/components/Autocomplete/index.js +9 -0
- package/dist/components/Avatar/index.js +11 -0
- package/dist/components/AvatarGroup/index.js +11 -0
- package/dist/components/Badge/index.js +10 -0
- package/dist/components/Banner/index.js +10 -0
- package/dist/components/Box/index.js +8 -0
- package/dist/components/Breadcrumb/index.js +8 -0
- package/dist/components/Button/index.js +10 -0
- package/dist/components/ButtonGroup/index.js +8 -0
- package/dist/components/Callout/index.js +10 -0
- package/dist/components/Card/index.js +11 -0
- package/dist/components/CheckList/index.js +10 -0
- package/dist/components/Checkbox/index.js +8 -0
- package/dist/components/Chip/index.js +10 -0
- package/dist/components/Code/index.js +8 -0
- package/dist/components/Collapsible/index.js +8 -0
- package/dist/components/Combobox/index.js +9 -0
- package/dist/components/CommandPalette/index.js +8 -0
- package/dist/components/Container/index.js +10 -0
- package/dist/components/ContextMenu/index.js +8 -0
- package/dist/components/CountryBadge/index.js +9 -0
- package/dist/components/DataTable/index.js +8 -0
- package/dist/components/DatePicker/index.js +8 -0
- package/dist/components/DateRangePicker/index.js +8 -0
- package/dist/components/Dialog/index.js +9 -0
- package/dist/components/Drawer/index.js +11 -0
- package/dist/components/DropdownMenu/index.js +8 -0
- package/dist/components/EmptyState/index.js +8 -0
- package/dist/components/ErrorState/index.js +8 -0
- package/dist/components/EyebrowChip/index.js +8 -0
- package/dist/components/FileUpload/index.js +8 -0
- package/dist/components/FilterChip/index.js +8 -0
- package/dist/components/Flag/index.js +9 -0
- package/dist/components/Flex/index.js +8 -0
- package/dist/components/FormError/index.js +9 -0
- package/dist/components/FormField/index.js +11 -0
- package/dist/components/GradientDivider/index.js +8 -0
- package/dist/components/Grid/index.js +8 -0
- package/dist/components/Heading/index.js +10 -0
- package/dist/components/HelperText/index.js +9 -0
- package/dist/components/HoverCard/index.js +8 -0
- package/dist/components/IconButton/index.js +10 -0
- package/dist/components/Input/index.js +15 -0
- package/dist/components/Kbd/index.js +9 -0
- package/dist/components/KeyboardShortcut/index.js +9 -0
- package/dist/components/Label/index.js +11 -0
- package/dist/components/Link/index.js +10 -0
- package/dist/components/Logo/index.js +10 -0
- package/dist/components/Menubar/index.js +8 -0
- package/dist/components/Motion/index.js +13 -0
- package/dist/components/NavigationMenu/index.js +8 -0
- package/dist/components/NumberInput/index.js +9 -0
- package/dist/components/PageHeader/index.js +8 -0
- package/dist/components/Pagination/index.js +8 -0
- package/dist/components/PasswordInput/index.js +9 -0
- package/dist/components/Popover/index.js +9 -0
- package/dist/components/Progress/index.js +12 -0
- package/dist/components/RadioGroup/index.js +8 -0
- package/dist/components/Rating/index.js +11 -0
- package/dist/components/ScrollArea/index.js +8 -0
- package/dist/components/SearchInput/index.js +9 -0
- package/dist/components/Section/index.js +10 -0
- package/dist/components/SegmentedControl/index.js +8 -0
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Separator/index.js +10 -0
- package/dist/components/Sidebar/index.js +8 -0
- package/dist/components/Skeleton/index.js +10 -0
- package/dist/components/Slider/index.js +8 -0
- package/dist/components/Spinner/index.js +10 -0
- package/dist/components/Stack/index.js +8 -0
- package/dist/components/StatusPill/index.js +10 -0
- package/dist/components/Switch/index.js +8 -0
- package/dist/components/Table/index.js +8 -0
- package/dist/components/Tabs/index.js +8 -0
- package/dist/components/Tag/index.js +10 -0
- package/dist/components/Text/index.js +10 -0
- package/dist/components/TextGradient/index.js +8 -0
- package/dist/components/Textarea/index.js +10 -0
- package/dist/components/ThemeProvider/index.js +10 -0
- package/dist/components/Toast/index.js +14 -0
- package/dist/components/Toggle/index.js +11 -0
- package/dist/components/ToggleGroup/index.js +9 -0
- package/dist/components/Toolbar/index.js +8 -0
- package/dist/components/Tooltip/index.js +16 -0
- package/dist/components/TopNav/index.js +9 -0
- package/dist/components/VisuallyHidden/index.js +7 -0
- package/dist/index.d.ts +36 -14
- package/dist/index.js +479 -5896
- package/package.json +13 -13
- package/dist/index.cjs +0 -6112
- package/dist/index.d.cts +0 -1245
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var ScrollArea = React.forwardRef(
|
|
11
|
+
({ className, children, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxs(RadixScrollArea.Root, { ref, className: cn("relative overflow-hidden", className), ...props, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(RadixScrollArea.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
13
|
+
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsx(
|
|
14
|
+
RadixScrollArea.Scrollbar,
|
|
15
|
+
{
|
|
16
|
+
className: "flex touch-none select-none transition-colors h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
17
|
+
orientation: "vertical",
|
|
18
|
+
children: /* @__PURE__ */ jsx(RadixScrollArea.Thumb, { className: "relative flex-1 rounded-full bg-[var(--color-border-default)]" })
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ jsx(
|
|
22
|
+
RadixScrollArea.Scrollbar,
|
|
23
|
+
{
|
|
24
|
+
className: "flex touch-none select-none transition-colors flex-col h-2.5 border-t border-t-transparent p-[1px]",
|
|
25
|
+
orientation: "horizontal",
|
|
26
|
+
children: /* @__PURE__ */ jsx(RadixScrollArea.Thumb, { className: "relative flex-1 rounded-full bg-[var(--color-border-default)]" })
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(RadixScrollArea.Corner, {})
|
|
30
|
+
] })
|
|
31
|
+
);
|
|
32
|
+
ScrollArea.displayName = "ScrollArea";
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
ScrollArea
|
|
36
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Badge/Badge.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var badgeVariants = cva(
|
|
11
|
+
[
|
|
12
|
+
"inline-flex items-center gap-1 font-medium rounded-full whitespace-nowrap",
|
|
13
|
+
"transition-colors select-none"
|
|
14
|
+
],
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: "px-2 py-0.5 text-xs",
|
|
19
|
+
md: "px-2.5 py-0.5 text-sm",
|
|
20
|
+
lg: "px-3 py-1 text-sm"
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
solid: "",
|
|
24
|
+
soft: "",
|
|
25
|
+
outline: "bg-transparent border"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: "md",
|
|
30
|
+
variant: "solid"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
var toneClasses = {
|
|
35
|
+
neutral: {
|
|
36
|
+
solid: "bg-[var(--color-neutral-500)] text-white",
|
|
37
|
+
soft: "bg-[var(--color-neutral-500)]/10 text-[var(--color-neutral-700)]",
|
|
38
|
+
outline: "border-[var(--color-neutral-500)] text-[var(--color-neutral-700)]"
|
|
39
|
+
},
|
|
40
|
+
info: {
|
|
41
|
+
solid: "bg-[var(--color-fill-info)] text-white",
|
|
42
|
+
soft: "bg-[var(--color-semantic-info-default)]/10 text-[var(--color-text-info)]",
|
|
43
|
+
outline: "border-[var(--color-semantic-info-default)] text-[var(--color-text-info)]"
|
|
44
|
+
},
|
|
45
|
+
success: {
|
|
46
|
+
solid: "bg-[var(--color-fill-success)] text-white",
|
|
47
|
+
soft: "bg-[var(--color-semantic-success-default)]/10 text-[var(--color-text-success)]",
|
|
48
|
+
outline: "border-[var(--color-semantic-success-default)] text-[var(--color-text-success)]"
|
|
49
|
+
},
|
|
50
|
+
warning: {
|
|
51
|
+
solid: "bg-[var(--color-fill-warning)] text-white",
|
|
52
|
+
soft: "bg-[var(--color-semantic-warning-default)]/10 text-[var(--color-text-warning)]",
|
|
53
|
+
outline: "border-[var(--color-semantic-warning-default)] text-[var(--color-text-warning)]"
|
|
54
|
+
},
|
|
55
|
+
danger: {
|
|
56
|
+
solid: "bg-[var(--color-fill-danger)] text-white",
|
|
57
|
+
soft: "bg-[var(--color-semantic-error-default)]/10 text-[var(--color-text-danger)]",
|
|
58
|
+
outline: "border-[var(--color-semantic-error-default)] text-[var(--color-text-danger)]"
|
|
59
|
+
},
|
|
60
|
+
leap: {
|
|
61
|
+
solid: "bg-[var(--color-fill-leap)] text-white",
|
|
62
|
+
soft: "bg-[var(--color-leap-500)]/10 text-[var(--color-leap-700)]",
|
|
63
|
+
outline: "border-[var(--color-leap-500)] text-[var(--color-leap-700)]"
|
|
64
|
+
},
|
|
65
|
+
bookub: {
|
|
66
|
+
solid: "bg-[var(--color-fill-bookub)] text-white",
|
|
67
|
+
soft: "bg-[var(--color-bookub-500)]/10 text-[var(--color-bookub-700)]",
|
|
68
|
+
outline: "border-[var(--color-bookub-500)] text-[var(--color-bookub-700)]"
|
|
69
|
+
},
|
|
70
|
+
payub: {
|
|
71
|
+
solid: "bg-[var(--color-fill-payub)] text-white",
|
|
72
|
+
soft: "bg-[var(--color-payub-500)]/10 text-[var(--color-payub-700)]",
|
|
73
|
+
outline: "border-[var(--color-payub-500)] text-[var(--color-payub-700)]"
|
|
74
|
+
},
|
|
75
|
+
founderub: {
|
|
76
|
+
solid: "bg-[var(--color-fill-founderub)] text-white",
|
|
77
|
+
soft: "bg-[var(--color-founderub-500)]/10 text-[var(--color-founderub-700)]",
|
|
78
|
+
outline: "border-[var(--color-founderub-500)] text-[var(--color-founderub-700)]"
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var Badge = React.forwardRef(
|
|
82
|
+
({ className, size, variant = "solid", tone = "neutral", leadingIcon, children, ...props }, ref) => {
|
|
83
|
+
const resolvedVariant = variant ?? "solid";
|
|
84
|
+
const toneStyle = toneClasses[tone][resolvedVariant];
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: cn(badgeVariants({ size, variant: resolvedVariant }), toneStyle, className),
|
|
90
|
+
...props,
|
|
91
|
+
children: [
|
|
92
|
+
leadingIcon && /* @__PURE__ */ jsx("span", { className: "shrink-0 inline-flex items-center", children: leadingIcon }),
|
|
93
|
+
children
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
Badge.displayName = "Badge";
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
badgeVariants,
|
|
103
|
+
Badge
|
|
104
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Pagination/Pagination.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "@nexub/icons";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function generatePages(current, total, siblings) {
|
|
11
|
+
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
12
|
+
const leftSibling = Math.max(current - siblings, 1);
|
|
13
|
+
const rightSibling = Math.min(current + siblings, total);
|
|
14
|
+
const showLeft = leftSibling > 2;
|
|
15
|
+
const showRight = rightSibling < total - 1;
|
|
16
|
+
const pages = [1];
|
|
17
|
+
if (showLeft) pages.push("...");
|
|
18
|
+
for (let i = leftSibling; i <= rightSibling; i++) {
|
|
19
|
+
if (i !== 1 && i !== total) pages.push(i);
|
|
20
|
+
}
|
|
21
|
+
if (showRight) pages.push("...");
|
|
22
|
+
pages.push(total);
|
|
23
|
+
return pages;
|
|
24
|
+
}
|
|
25
|
+
var Pagination = React.forwardRef(
|
|
26
|
+
({
|
|
27
|
+
className,
|
|
28
|
+
page,
|
|
29
|
+
totalItems,
|
|
30
|
+
pageSize = 20,
|
|
31
|
+
siblingCount = 1,
|
|
32
|
+
onPageChange,
|
|
33
|
+
...props
|
|
34
|
+
}, ref) => {
|
|
35
|
+
const totalPages = Math.ceil(totalItems / pageSize);
|
|
36
|
+
if (totalPages <= 1) return null;
|
|
37
|
+
const pages = generatePages(page, totalPages, siblingCount);
|
|
38
|
+
return /* @__PURE__ */ jsxs(
|
|
39
|
+
"nav",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
role: "navigation",
|
|
43
|
+
"aria-label": "Pagination",
|
|
44
|
+
className: cn("flex items-center gap-1", className),
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
onClick: () => onPageChange(page - 1),
|
|
51
|
+
disabled: page <= 1,
|
|
52
|
+
"aria-label": "Go to previous page",
|
|
53
|
+
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",
|
|
54
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { size: "sm", "aria-hidden": "true" })
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
pages.map(
|
|
58
|
+
(p, i) => p === "..." ? /* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: "flex h-11 w-11 items-center justify-center text-[var(--color-text-muted)]",
|
|
62
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { size: "sm", "aria-hidden": "true" })
|
|
63
|
+
},
|
|
64
|
+
`ellipsis-${i}`
|
|
65
|
+
) : /* @__PURE__ */ jsx(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
onClick: () => onPageChange(p),
|
|
69
|
+
"aria-label": `Go to page ${p}`,
|
|
70
|
+
"aria-current": p === page ? "page" : void 0,
|
|
71
|
+
className: cn(
|
|
72
|
+
"inline-flex h-11 w-11 items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
73
|
+
p === page ? "bg-[var(--color-fill-primary)] text-white" : "border border-[var(--color-border-default)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-subtle)]"
|
|
74
|
+
),
|
|
75
|
+
children: p
|
|
76
|
+
},
|
|
77
|
+
p
|
|
78
|
+
)
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
onClick: () => onPageChange(page + 1),
|
|
84
|
+
disabled: page >= totalPages,
|
|
85
|
+
"aria-label": "Go to next page",
|
|
86
|
+
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",
|
|
87
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { size: "sm", "aria-hidden": "true" })
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
Pagination.displayName = "Pagination";
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
Pagination
|
|
99
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/DataTable/DataTable.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import {
|
|
9
|
+
useReactTable,
|
|
10
|
+
getCoreRowModel,
|
|
11
|
+
getSortedRowModel,
|
|
12
|
+
getFilteredRowModel,
|
|
13
|
+
getPaginationRowModel,
|
|
14
|
+
flexRender
|
|
15
|
+
} from "@tanstack/react-table";
|
|
16
|
+
import { ArrowUp, ArrowDown, ChevronsUpDown } from "@nexub/icons";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var TableRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
19
|
+
"table",
|
|
20
|
+
{
|
|
21
|
+
ref,
|
|
22
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
) }));
|
|
26
|
+
TableRoot.displayName = "DataTable.TableRoot";
|
|
27
|
+
var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
28
|
+
"thead",
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: cn("[&_tr]:border-b border-[var(--color-border-default)]", className),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
TableHeader.displayName = "DataTable.TableHeader";
|
|
36
|
+
var TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
37
|
+
"tbody",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
));
|
|
44
|
+
TableBody.displayName = "DataTable.TableBody";
|
|
45
|
+
var TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
46
|
+
"tr",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
className: cn(
|
|
50
|
+
"border-b border-[var(--color-border-default)] transition-colors hover:bg-[var(--color-bg-subtle)] data-[state=selected]:bg-[var(--color-bg-subtle)]",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
));
|
|
56
|
+
TableRow.displayName = "DataTable.TableRow";
|
|
57
|
+
var TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
58
|
+
"th",
|
|
59
|
+
{
|
|
60
|
+
ref,
|
|
61
|
+
className: cn(
|
|
62
|
+
"h-10 px-4 text-left align-middle text-xs font-medium text-[var(--color-text-muted)] [&:has([role=checkbox])]:pr-0",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
...props
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
|
+
TableHead.displayName = "DataTable.TableHead";
|
|
69
|
+
var TableCell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
70
|
+
"td",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: cn(
|
|
74
|
+
"px-4 py-3 align-middle text-[var(--color-text-primary)] [&:has([role=checkbox])]:pr-0",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
TableCell.displayName = "DataTable.TableCell";
|
|
81
|
+
function DataTable({
|
|
82
|
+
columns,
|
|
83
|
+
data,
|
|
84
|
+
enableSorting = false,
|
|
85
|
+
enableRowSelection = false,
|
|
86
|
+
pagination,
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
const [sorting, setSorting] = React.useState([]);
|
|
91
|
+
const [rowSelection, setRowSelection] = React.useState({});
|
|
92
|
+
const [paginationState, setPaginationState] = React.useState({
|
|
93
|
+
pageIndex: 0,
|
|
94
|
+
pageSize: pagination?.pageSize ?? 20
|
|
95
|
+
});
|
|
96
|
+
const tableState = React.useMemo(
|
|
97
|
+
() => ({
|
|
98
|
+
sorting: enableSorting ? sorting : void 0,
|
|
99
|
+
rowSelection: enableRowSelection ? rowSelection : void 0,
|
|
100
|
+
pagination: pagination ? paginationState : void 0
|
|
101
|
+
}),
|
|
102
|
+
[enableSorting, sorting, enableRowSelection, rowSelection, pagination, paginationState]
|
|
103
|
+
);
|
|
104
|
+
const table = useReactTable({
|
|
105
|
+
data,
|
|
106
|
+
columns,
|
|
107
|
+
state: tableState,
|
|
108
|
+
onSortingChange: enableSorting ? setSorting : void 0,
|
|
109
|
+
onRowSelectionChange: enableRowSelection ? setRowSelection : void 0,
|
|
110
|
+
onPaginationChange: pagination ? setPaginationState : void 0,
|
|
111
|
+
getCoreRowModel: getCoreRowModel(),
|
|
112
|
+
getSortedRowModel: enableSorting ? getSortedRowModel() : void 0,
|
|
113
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
114
|
+
getPaginationRowModel: pagination ? getPaginationRowModel() : void 0,
|
|
115
|
+
enableRowSelection,
|
|
116
|
+
manualPagination: false
|
|
117
|
+
});
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), ...props, children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(TableRoot, { children: [
|
|
120
|
+
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
121
|
+
TableHead,
|
|
122
|
+
{
|
|
123
|
+
"aria-sort": enableSorting && header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
|
|
124
|
+
children: header.isPlaceholder ? null : enableSorting && header.column.getCanSort() ? /* @__PURE__ */ jsxs(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
128
|
+
className: "inline-flex items-center gap-1 hover:text-[var(--color-text-primary)]",
|
|
129
|
+
children: [
|
|
130
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
131
|
+
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { size: "xs", "aria-hidden": "true" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { size: "xs", className: "opacity-40", "aria-hidden": "true" })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
) : flexRender(header.column.columnDef.header, header.getContext())
|
|
135
|
+
},
|
|
136
|
+
header.id
|
|
137
|
+
)) }, headerGroup.id)) }),
|
|
138
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
139
|
+
TableRow,
|
|
140
|
+
{
|
|
141
|
+
"data-state": enableRowSelection && row.getIsSelected() ? "selected" : void 0,
|
|
142
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
143
|
+
},
|
|
144
|
+
row.id
|
|
145
|
+
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
146
|
+
TableCell,
|
|
147
|
+
{
|
|
148
|
+
colSpan: columns.length,
|
|
149
|
+
className: "h-24 text-center text-[var(--color-text-muted)]",
|
|
150
|
+
children: "No results."
|
|
151
|
+
}
|
|
152
|
+
) }) })
|
|
153
|
+
] }),
|
|
154
|
+
pagination && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-sm text-[var(--color-text-muted)]", children: [
|
|
155
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
156
|
+
"Page ",
|
|
157
|
+
table.getState().pagination.pageIndex + 1,
|
|
158
|
+
" of ",
|
|
159
|
+
table.getPageCount()
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
onClick: () => table.previousPage(),
|
|
166
|
+
disabled: !table.getCanPreviousPage(),
|
|
167
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
168
|
+
children: "Previous"
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
/* @__PURE__ */ jsx(
|
|
172
|
+
"button",
|
|
173
|
+
{
|
|
174
|
+
onClick: () => table.nextPage(),
|
|
175
|
+
disabled: !table.getCanNextPage(),
|
|
176
|
+
className: "rounded border border-[var(--color-border-default)] px-3 py-2 min-h-[44px] disabled:opacity-50",
|
|
177
|
+
children: "Next"
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
] })
|
|
181
|
+
] })
|
|
182
|
+
] });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
DataTable
|
|
187
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
glassSurfaceClass
|
|
4
|
+
} from "./chunk-ROZVVWPV.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-AT6RPKU3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/TopNav/TopNav.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Root = React.forwardRef(
|
|
14
|
+
({ className, children, surface = "solid", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
15
|
+
"header",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
className: cn(
|
|
19
|
+
"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",
|
|
20
|
+
surface === "glass" && glassSurfaceClass,
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
"data-material": surface === "glass" ? "glass" : void 0,
|
|
24
|
+
...props,
|
|
25
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex w-full items-center gap-4", children })
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
Root.displayName = "TopNav.Root";
|
|
30
|
+
var Logo = React.forwardRef(
|
|
31
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("shrink-0 flex items-center", className), ...props })
|
|
32
|
+
);
|
|
33
|
+
Logo.displayName = "TopNav.Logo";
|
|
34
|
+
var Menu = React.forwardRef(
|
|
35
|
+
({ className, ...props }, ref) => (
|
|
36
|
+
// Scrolls horizontally on narrow screens rather than hiding the links.
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"nav",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
"aria-label": "Main",
|
|
42
|
+
className: cn("flex min-w-0 items-center gap-1 overflow-x-auto", className),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
Menu.displayName = "TopNav.Menu";
|
|
49
|
+
var Item = React.forwardRef(
|
|
50
|
+
({ className, active, asChild, ...props }, ref) => {
|
|
51
|
+
const Comp = asChild ? Slot : "a";
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Comp,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
"aria-current": active ? "page" : void 0,
|
|
57
|
+
className: cn(
|
|
58
|
+
"inline-flex h-9 shrink-0 items-center rounded-md px-4 text-sm font-medium transition-colors",
|
|
59
|
+
active ? "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)]" : "text-[var(--color-text-muted)] hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
Item.displayName = "TopNav.Item";
|
|
68
|
+
var Actions = React.forwardRef(
|
|
69
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("ml-auto flex items-center gap-2", className), ...props })
|
|
70
|
+
);
|
|
71
|
+
Actions.displayName = "TopNav.Actions";
|
|
72
|
+
var TopNav = { Root, Logo, Menu, Item, Actions };
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
TopNav
|
|
76
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Box/Box.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var Box = React.forwardRef(
|
|
11
|
+
({ asChild = false, className, children, ...rest }, ref) => {
|
|
12
|
+
const Comp = asChild ? Slot : "div";
|
|
13
|
+
return /* @__PURE__ */ jsx(Comp, { ref, className: cn(className), ...rest, children });
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
Box.displayName = "Box";
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
Box
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
avatarVariants
|
|
4
|
+
} from "./chunk-CPV367VS.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-AT6RPKU3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/AvatarGroup/AvatarGroup.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var avatarGroupVariants = cva("flex items-center", {
|
|
14
|
+
variants: {
|
|
15
|
+
spacing: {
|
|
16
|
+
sm: "[&>*:not(:first-child)]:-ml-3",
|
|
17
|
+
md: "[&>*:not(:first-child)]:-ml-2",
|
|
18
|
+
lg: "[&>*:not(:first-child)]:-ml-1"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
spacing: "md"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var AvatarGroup = React.forwardRef(
|
|
26
|
+
({ className, max, size = "md", spacing, children, ...props }, ref) => {
|
|
27
|
+
const items = React.Children.toArray(children);
|
|
28
|
+
const visibleItems = max !== void 0 ? items.slice(0, max) : items;
|
|
29
|
+
const overflowCount = max !== void 0 && items.length > max ? items.length - max : 0;
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
className: cn(avatarGroupVariants({ spacing }), className),
|
|
35
|
+
role: "group",
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
visibleItems.map((child, index) => {
|
|
39
|
+
if (!React.isValidElement(child)) return child;
|
|
40
|
+
const childWithSize = React.cloneElement(
|
|
41
|
+
child,
|
|
42
|
+
{ size }
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
className: "ring-2 ring-[var(--color-bg-default)] rounded-full inline-flex",
|
|
48
|
+
children: childWithSize
|
|
49
|
+
},
|
|
50
|
+
child.key ?? index
|
|
51
|
+
);
|
|
52
|
+
}),
|
|
53
|
+
overflowCount > 0 && /* @__PURE__ */ jsx("span", { className: "ring-2 ring-[var(--color-bg-default)] rounded-full inline-flex", children: /* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: cn(avatarVariants({ size }), "font-medium"),
|
|
57
|
+
role: "img",
|
|
58
|
+
"aria-label": `${overflowCount} more`,
|
|
59
|
+
children: /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", children: [
|
|
60
|
+
"+",
|
|
61
|
+
overflowCount
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
avatarGroupVariants,
|
|
74
|
+
AvatarGroup
|
|
75
|
+
};
|