@nexub/react 1.7.0 → 1.8.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-C6JRJ6JW.js → chunk-22BGPRJZ.js} +1 -1
- package/dist/{chunk-NGQKBDHA.js → chunk-322WR6EU.js} +1 -1
- package/dist/{chunk-24ZFAXB2.js → chunk-3MSIO7KM.js} +29 -1
- package/dist/chunk-4B4XWDAH.js +1 -0
- package/dist/{chunk-AGYGWU6C.js → chunk-4MEV2WHD.js} +27 -6
- package/dist/{chunk-FLZD7HQY.js → chunk-5FWJXSXT.js} +1 -1
- package/dist/{chunk-NYWD5SI4.js → chunk-5GN2GFW3.js} +1 -1
- package/dist/{chunk-LESI7J7B.js → chunk-5NKIGEDZ.js} +1 -0
- package/dist/{chunk-7SXR4PGO.js → chunk-5W3AOOYS.js} +1 -1
- package/dist/{chunk-NZR4UGUZ.js → chunk-6U5WQERX.js} +4 -4
- package/dist/{chunk-NZT4TTNV.js → chunk-7BAIEYUW.js} +79 -58
- package/dist/{chunk-NQPGELMP.js → chunk-A4QLUIFN.js} +1 -1
- package/dist/{chunk-PGDXFBKT.js → chunk-BEOHZKPQ.js} +1 -1
- package/dist/{chunk-4UBVU53C.js → chunk-BIAYWCDE.js} +1 -1
- package/dist/{chunk-YNU6VRD5.js → chunk-BSKEBC2Q.js} +1 -1
- package/dist/chunk-BU5QD2FS.js +148 -0
- package/dist/{chunk-GRKCUQG4.js → chunk-DFCHCYNT.js} +4 -3
- package/dist/{chunk-4HQFOIZW.js → chunk-ENB7X3W4.js} +3 -3
- package/dist/{chunk-643EYCLL.js → chunk-ESMIBOF5.js} +1 -1
- package/dist/{chunk-ZMJ54TG6.js → chunk-ETWFHIAE.js} +1 -1
- package/dist/{chunk-JHVYI5GK.js → chunk-F7ZA2VA2.js} +1 -1
- package/dist/{chunk-KRCLK5O4.js → chunk-FT2S7N64.js} +1 -1
- package/dist/{chunk-RATKKN3F.js → chunk-G4RLUGE3.js} +4 -4
- package/dist/{chunk-X4BQHXLB.js → chunk-GG5HDX7J.js} +1 -1
- package/dist/{chunk-RM7MTOT5.js → chunk-GSA7NBEG.js} +1 -1
- package/dist/{chunk-MYP5ZTC3.js → chunk-HSM7RXUF.js} +3 -3
- package/dist/{chunk-U2ZYPPRG.js → chunk-IDIS7Z6H.js} +2 -2
- package/dist/{chunk-JSBNYRO4.js → chunk-JVOSMXD5.js} +2 -2
- package/dist/{chunk-BSL62LBX.js → chunk-KRHD7VI6.js} +1 -1
- package/dist/{chunk-4NFUBFYK.js → chunk-L4BSKMLK.js} +1 -1
- package/dist/{chunk-7VJABRKB.js → chunk-NORCPKRD.js} +1 -1
- package/dist/{chunk-CQWYZPPJ.js → chunk-NYORXEPS.js} +1 -1
- package/dist/{chunk-MLT7SA3T.js → chunk-O6J6HXVT.js} +3 -3
- package/dist/{chunk-NAJKIBU2.js → chunk-OS4NOWEI.js} +1 -1
- package/dist/{chunk-J65MK3N4.js → chunk-OTZBGMYH.js} +2 -2
- package/dist/{chunk-W3KO3JNZ.js → chunk-PC7YGDNL.js} +2 -2
- package/dist/{chunk-PREMZMLU.js → chunk-PGD246WD.js} +1 -1
- package/dist/{chunk-VMT7Y3AT.js → chunk-R6VLSYXK.js} +2 -2
- package/dist/{chunk-UTLKZPKJ.js → chunk-RSBJBQPG.js} +1 -1
- package/dist/{chunk-B254JXS7.js → chunk-RVWQROFK.js} +1 -1
- package/dist/{chunk-2I7FIU6R.js → chunk-SKIJVVBU.js} +1 -1
- package/dist/{chunk-SYZADSLI.js → chunk-SZNSQR2B.js} +1 -1
- package/dist/{chunk-ZTLALVWA.js → chunk-TSN6HYVY.js} +2 -2
- package/dist/{chunk-TAVVXXGO.js → chunk-UAQRQNOB.js} +2 -2
- package/dist/chunk-UCNA2ICU.js +28 -0
- package/dist/{chunk-NERAWEIQ.js → chunk-UV5O2BMW.js} +2 -2
- package/dist/{chunk-XDU27NRX.js → chunk-UVWQPDOV.js} +1 -1
- package/dist/{chunk-GWDEKW7P.js → chunk-V6CMWCJH.js} +2 -2
- package/dist/{chunk-VD4RFTNV.js → chunk-VF6RWEKX.js} +1 -1
- package/dist/{chunk-CV5ZKED7.js → chunk-W2P2WOAN.js} +1 -1
- package/dist/{chunk-GG54WBLA.js → chunk-WECNLNIA.js} +2 -2
- package/dist/{chunk-KE4YVG5Q.js → chunk-X3B2MTX6.js} +1 -1
- package/dist/{chunk-37L5ERUJ.js → chunk-XHLSYHAV.js} +2 -2
- package/dist/{chunk-RUR57JZQ.js → chunk-ZGZQZG6S.js} +1 -1
- package/dist/{chunk-WVBGQCYC.js → chunk-ZLW7IBXK.js} +1 -1
- package/dist/{chunk-TZ6KJIR4.js → chunk-ZRBLASQE.js} +1 -1
- package/dist/{chunk-QUNH4BFR.js → chunk-ZTI4MK3L.js} +1 -1
- package/dist/{chunk-7XWJCFWI.js → chunk-ZUGZRXME.js} +1 -1
- package/dist/components/Alert/index.js +2 -2
- package/dist/components/AlertDialog/index.js +4 -4
- package/dist/components/Amount/index.js +3 -3
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/AvatarGroup/index.js +2 -2
- package/dist/components/Banner/index.js +2 -2
- package/dist/components/Breadcrumb/index.js +2 -2
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Chip/index.js +2 -2
- package/dist/components/Citation/index.js +4 -4
- package/dist/components/CommandPalette/index.js +3 -3
- package/dist/components/ContextMenu/index.js +2 -2
- package/dist/components/DataTable/index.js +4 -2
- package/dist/components/DatePicker/index.js +4 -4
- package/dist/components/DateRangePicker/index.js +5 -5
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/DropdownMenu/index.js +2 -2
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/EyebrowChip/index.js +3 -3
- package/dist/components/FileUpload/index.js +2 -2
- package/dist/components/FilterChip/index.js +3 -3
- package/dist/components/FormField/index.js +5 -5
- package/dist/components/Heading/index.js +3 -3
- package/dist/components/HelperText/index.js +3 -3
- package/dist/components/HoverCard/index.js +2 -2
- package/dist/components/IconButton/index.js +2 -2
- package/dist/components/Input/index.js +2 -2
- package/dist/components/Kbd/index.js +1 -1
- package/dist/components/KeyboardShortcut/index.js +2 -2
- package/dist/components/Label/index.js +3 -3
- package/dist/components/Menubar/index.js +2 -2
- package/dist/components/MessageBubble/index.js +4 -4
- package/dist/components/MoneyInput/index.js +4 -4
- package/dist/components/NavigationMenu/index.js +2 -2
- package/dist/components/NavigationRail/index.js +2 -2
- package/dist/components/NexubProvider/index.js +1 -1
- package/dist/components/NumberInput/index.js +4 -4
- package/dist/components/NumberTicker/index.js +2 -2
- package/dist/components/PageHeader/index.js +1 -1
- package/dist/components/Pagination/index.js +3 -3
- package/dist/components/PasswordInput/index.js +4 -4
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/PromptInput/index.js +4 -4
- package/dist/components/Rating/index.js +2 -2
- package/dist/components/SearchInput/index.js +4 -4
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Sidebar/index.js +2 -2
- package/dist/components/Spinner/index.js +2 -2
- package/dist/components/SplitButton/index.js +5 -5
- package/dist/components/Table/index.js +2 -1
- package/dist/components/Textarea/index.js +2 -2
- package/dist/components/ThinkingIndicator/index.js +2 -2
- package/dist/components/Toast/index.js +2 -2
- package/dist/components/TopNav/index.js +2 -2
- package/dist/index.d.ts +54 -5
- package/dist/index.js +91 -90
- package/package.json +6 -6
- package/dist/chunk-MTK3GHDQ.js +0 -25
- package/dist/chunk-OYCK6BRG.js +0 -89
|
@@ -60,7 +60,35 @@ var defaultMessages = {
|
|
|
60
60
|
sources: "Sources",
|
|
61
61
|
source: (n) => `Source ${n}`,
|
|
62
62
|
jumpToLatest: "Jump to latest",
|
|
63
|
-
conversation: "Conversation"
|
|
63
|
+
conversation: "Conversation",
|
|
64
|
+
pageOf: (page, total) => `Page ${page} of ${total}`,
|
|
65
|
+
previous: "Previous",
|
|
66
|
+
next: "Next",
|
|
67
|
+
search: "Search",
|
|
68
|
+
searchProduct: (productName) => `Search ${productName}`,
|
|
69
|
+
keyboardShortcut: (shortcut) => `Keyboard shortcut: ${shortcut}`,
|
|
70
|
+
commandKey: "Command",
|
|
71
|
+
controlKey: "Control",
|
|
72
|
+
searching: "Searching\u2026",
|
|
73
|
+
searchFailed: "Search failed. Try again.",
|
|
74
|
+
noResultsFor: (query) => `No results for \u201C${query}\u201D`,
|
|
75
|
+
typeToSearch: "Type to search",
|
|
76
|
+
switchOrganization: (name) => `${name}, switch organization`,
|
|
77
|
+
organizations: "Organizations",
|
|
78
|
+
switchToLightTheme: "Switch to light theme",
|
|
79
|
+
switchToDarkTheme: "Switch to dark theme",
|
|
80
|
+
glass: "Glass",
|
|
81
|
+
glassClear: "Clear",
|
|
82
|
+
glassBalanced: "Balanced",
|
|
83
|
+
glassTinted: "Tinted",
|
|
84
|
+
glassSolid: "Solid",
|
|
85
|
+
accountMenu: (name) => `Account: ${name}`,
|
|
86
|
+
manageAccount: "Manage your Nexub Account",
|
|
87
|
+
privacyPolicy: "Privacy policy",
|
|
88
|
+
termsOfService: "Terms of service",
|
|
89
|
+
signOut: "Sign out",
|
|
90
|
+
signingOut: "Signing out\u2026",
|
|
91
|
+
accountAndApps: "Account and apps"
|
|
64
92
|
};
|
|
65
93
|
var NexubContext = React.createContext({
|
|
66
94
|
locale: void 0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
useIntlLocale
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3MSIO7KM.js";
|
|
5
5
|
import {
|
|
6
6
|
cn
|
|
7
7
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -22,6 +22,26 @@ var SHIFT = [
|
|
|
22
22
|
"-translate-y-[90%]"
|
|
23
23
|
];
|
|
24
24
|
var DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
25
|
+
var isDigit = (c) => c !== void 0 && /^[0-9]$/.test(c);
|
|
26
|
+
var RTL = /[\u0590-\u08FF\u200F\u061C\uFB1D-\uFDFF\uFE70-\uFEFF]/;
|
|
27
|
+
function digitRuns(items) {
|
|
28
|
+
const out = [];
|
|
29
|
+
let run = [];
|
|
30
|
+
const flush = () => {
|
|
31
|
+
if (run.length) out.push(/* @__PURE__ */ jsx("span", { dir: "ltr", children: run.map((r) => r.node) }, `run${run[run.length - 1].key}`));
|
|
32
|
+
run = [];
|
|
33
|
+
};
|
|
34
|
+
items.forEach((it, i) => {
|
|
35
|
+
const inRun = isDigit(it.char) || run.length > 0 && isDigit(items[i + 1]?.char) && /^[.,\u00A0\u202F' ]$/.test(it.char);
|
|
36
|
+
if (inRun) run.push(it);
|
|
37
|
+
else {
|
|
38
|
+
flush();
|
|
39
|
+
out.push(it.node);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
flush();
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
25
45
|
function Char({ char, className, enter }) {
|
|
26
46
|
const [entering] = React.useState(enter);
|
|
27
47
|
const motion = entering ? { "data-motion": "from-fade" } : {};
|
|
@@ -61,6 +81,11 @@ var NumberTicker = React.forwardRef(
|
|
|
61
81
|
React.useEffect(() => {
|
|
62
82
|
mounted.current = true;
|
|
63
83
|
}, []);
|
|
84
|
+
const rendered = chars.map(({ char, className: cls }, i) => {
|
|
85
|
+
const key = `${chars.length - 1 - i}${isDigit(char) ? "d" : `s${char}`}`;
|
|
86
|
+
return { char, key, node: /* @__PURE__ */ jsx(Char, { char, className: cls, enter: mounted.current }, key) };
|
|
87
|
+
});
|
|
88
|
+
const rtlText = RTL.test(text);
|
|
64
89
|
return /* @__PURE__ */ jsxs(
|
|
65
90
|
"span",
|
|
66
91
|
{
|
|
@@ -71,11 +96,7 @@ var NumberTicker = React.forwardRef(
|
|
|
71
96
|
...props,
|
|
72
97
|
children: [
|
|
73
98
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
|
|
74
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true",
|
|
75
|
-
const fromEnd = chars.length - 1 - i;
|
|
76
|
-
const kind = /^[0-9]$/.test(char) ? "d" : `s${char}`;
|
|
77
|
-
return /* @__PURE__ */ jsx(Char, { char, className: cls, enter: mounted.current }, `${fromEnd}${kind}`);
|
|
78
|
-
}) })
|
|
99
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", dir: rtlText ? "rtl" : "ltr", children: rtlText ? digitRuns(rendered) : rendered.map((r) => r.node) })
|
|
79
100
|
]
|
|
80
101
|
}
|
|
81
102
|
);
|
|
@@ -12,7 +12,7 @@ var menuItem = [
|
|
|
12
12
|
].join(" ");
|
|
13
13
|
var menuSeparator = "-mx-1.5 my-1.5 h-px bg-[var(--color-outline-variant)]";
|
|
14
14
|
var menuLabel = "px-2.5 py-1.5 text-label-sm text-[var(--color-on-surface-muted)]";
|
|
15
|
-
var scrim = "bg-[color-mix(in_srgb,var(--color-scrim
|
|
15
|
+
var scrim = "bg-[color-mix(in_srgb,var(--color-scrim)_40%,transparent)]";
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
18
|
overlaySurface,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/utils/control.ts
|
|
4
4
|
var field = [
|
|
5
|
-
"rounded-shape-field border border-[var(--color-
|
|
5
|
+
"rounded-shape-field border border-[var(--color-outline)]",
|
|
6
6
|
"bg-[var(--color-surface-container-lowest)] text-[var(--color-on-surface)]",
|
|
7
7
|
"transition-[border-color,box-shadow] duration-effects-fast ease-effects-fast",
|
|
8
8
|
"hover:border-[var(--color-on-surface-variant)]"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
useCalendarLocale
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HSM7RXUF.js";
|
|
5
5
|
import {
|
|
6
6
|
floatingSurface
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5FWJXSXT.js";
|
|
8
8
|
import {
|
|
9
9
|
field,
|
|
10
10
|
fieldFocusVisible
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5W3AOOYS.js";
|
|
12
12
|
import {
|
|
13
13
|
useNexubMessages
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3MSIO7KM.js";
|
|
15
15
|
import {
|
|
16
16
|
cn
|
|
17
17
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Table
|
|
4
|
+
} from "./chunk-BU5QD2FS.js";
|
|
2
5
|
import {
|
|
3
6
|
disabledContainer,
|
|
4
7
|
pressable
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5W3AOOYS.js";
|
|
9
|
+
import {
|
|
10
|
+
useNexubMessages
|
|
11
|
+
} from "./chunk-3MSIO7KM.js";
|
|
6
12
|
import {
|
|
7
13
|
cn
|
|
8
14
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -19,20 +25,22 @@ import {
|
|
|
19
25
|
} from "@tanstack/react-table";
|
|
20
26
|
import { ArrowUp, ArrowDown, ChevronsUpDown } from "@nexub/icons";
|
|
21
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var alignText = {
|
|
29
|
+
start: "text-start",
|
|
30
|
+
end: "text-end",
|
|
31
|
+
center: "text-center"
|
|
32
|
+
};
|
|
33
|
+
var alignJustify = {
|
|
34
|
+
start: "justify-start",
|
|
35
|
+
end: "justify-end",
|
|
36
|
+
center: "justify-center"
|
|
37
|
+
};
|
|
22
38
|
var pagerButton = cn(
|
|
23
39
|
pressable,
|
|
24
40
|
"border border-[var(--color-outline-variant)] bg-transparent px-4 py-2 min-h-[44px] text-label-lg text-[var(--color-on-surface)]",
|
|
25
41
|
disabledContainer
|
|
26
42
|
);
|
|
27
|
-
var TableRoot =
|
|
28
|
-
"table",
|
|
29
|
-
{
|
|
30
|
-
ref,
|
|
31
|
-
className: cn("w-full caption-bottom text-sm", className),
|
|
32
|
-
...props
|
|
33
|
-
}
|
|
34
|
-
) }));
|
|
35
|
-
TableRoot.displayName = "DataTable.TableRoot";
|
|
43
|
+
var TableRoot = Table.Root;
|
|
36
44
|
var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
37
45
|
"thead",
|
|
38
46
|
{
|
|
@@ -42,26 +50,21 @@ var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
42
50
|
}
|
|
43
51
|
));
|
|
44
52
|
TableHeader.displayName = "DataTable.TableHeader";
|
|
45
|
-
var TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
46
|
-
"tbody",
|
|
47
|
-
{
|
|
48
|
-
ref,
|
|
49
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
50
|
-
...props
|
|
51
|
-
}
|
|
52
|
-
));
|
|
53
|
+
var TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
53
54
|
TableBody.displayName = "DataTable.TableBody";
|
|
54
|
-
var TableRow = React.forwardRef(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
var TableRow = React.forwardRef(
|
|
56
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
57
|
+
"tr",
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
className: cn(
|
|
61
|
+
"border-b border-[var(--color-outline-variant)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-on-surface)_8%,transparent)] data-[state=selected]:bg-[var(--color-surface-container-low)]",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
65
68
|
TableRow.displayName = "DataTable.TableRow";
|
|
66
69
|
var TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
67
70
|
"th",
|
|
@@ -93,9 +96,14 @@ function DataTable({
|
|
|
93
96
|
enableSorting = false,
|
|
94
97
|
enableRowSelection = false,
|
|
95
98
|
pagination,
|
|
99
|
+
caption,
|
|
100
|
+
captionHidden = false,
|
|
96
101
|
className,
|
|
102
|
+
"aria-label": ariaLabel,
|
|
103
|
+
"aria-labelledby": ariaLabelledBy,
|
|
97
104
|
...props
|
|
98
105
|
}) {
|
|
106
|
+
const messages = useNexubMessages();
|
|
99
107
|
const [sorting, setSorting] = React.useState([]);
|
|
100
108
|
const [rowSelection, setRowSelection] = React.useState({});
|
|
101
109
|
const [paginationState, setPaginationState] = React.useState({
|
|
@@ -125,30 +133,46 @@ function DataTable({
|
|
|
125
133
|
manualPagination: false
|
|
126
134
|
});
|
|
127
135
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), ...props, children: [
|
|
128
|
-
/* @__PURE__ */ jsxs(TableRoot, { children: [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
/* @__PURE__ */ jsxs(TableRoot, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children: [
|
|
137
|
+
caption != null && /* @__PURE__ */ jsx(Table.Caption, { className: cn(captionHidden && "sr-only"), children: caption }),
|
|
138
|
+
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => {
|
|
139
|
+
const align = header.column.columnDef.meta?.align ?? "start";
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
TableHead,
|
|
142
|
+
{
|
|
143
|
+
className: alignText[align],
|
|
144
|
+
"aria-sort": enableSorting && header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
|
|
145
|
+
children: header.isPlaceholder ? null : enableSorting && header.column.getCanSort() ? /* @__PURE__ */ jsxs(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
150
|
+
className: cn(
|
|
151
|
+
"flex w-full items-center gap-1 hover:text-[var(--color-on-surface)]",
|
|
152
|
+
alignJustify[align]
|
|
153
|
+
),
|
|
154
|
+
children: [
|
|
155
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
156
|
+
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" })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
) : flexRender(header.column.columnDef.header, header.getContext())
|
|
160
|
+
},
|
|
161
|
+
header.id
|
|
162
|
+
);
|
|
163
|
+
}) }, headerGroup.id)) }),
|
|
147
164
|
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
148
165
|
TableRow,
|
|
149
166
|
{
|
|
150
167
|
"data-state": enableRowSelection && row.getIsSelected() ? "selected" : void 0,
|
|
151
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(
|
|
168
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(
|
|
169
|
+
TableCell,
|
|
170
|
+
{
|
|
171
|
+
className: alignText[cell.column.columnDef.meta?.align ?? "start"],
|
|
172
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
173
|
+
},
|
|
174
|
+
cell.id
|
|
175
|
+
))
|
|
152
176
|
},
|
|
153
177
|
row.id
|
|
154
178
|
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
@@ -156,34 +180,31 @@ function DataTable({
|
|
|
156
180
|
{
|
|
157
181
|
colSpan: columns.length,
|
|
158
182
|
className: "h-24 text-center text-[var(--color-on-surface-muted)]",
|
|
159
|
-
children:
|
|
183
|
+
children: messages.noResults
|
|
160
184
|
}
|
|
161
185
|
) }) })
|
|
162
186
|
] }),
|
|
163
187
|
pagination && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-sm text-[var(--color-on-surface-muted)]", children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
"Page ",
|
|
166
|
-
table.getState().pagination.pageIndex + 1,
|
|
167
|
-
" of ",
|
|
168
|
-
table.getPageCount()
|
|
169
|
-
] }),
|
|
188
|
+
/* @__PURE__ */ jsx("span", { children: messages.pageOf(table.getState().pagination.pageIndex + 1, table.getPageCount()) }),
|
|
170
189
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
171
190
|
/* @__PURE__ */ jsx(
|
|
172
191
|
"button",
|
|
173
192
|
{
|
|
193
|
+
type: "button",
|
|
174
194
|
onClick: () => table.previousPage(),
|
|
175
195
|
disabled: !table.getCanPreviousPage(),
|
|
176
196
|
className: pagerButton,
|
|
177
|
-
children:
|
|
197
|
+
children: messages.previous
|
|
178
198
|
}
|
|
179
199
|
),
|
|
180
200
|
/* @__PURE__ */ jsx(
|
|
181
201
|
"button",
|
|
182
202
|
{
|
|
203
|
+
type: "button",
|
|
183
204
|
onClick: () => table.nextPage(),
|
|
184
205
|
disabled: !table.getCanNextPage(),
|
|
185
206
|
className: pagerButton,
|
|
186
|
-
children:
|
|
207
|
+
children: messages.next
|
|
187
208
|
}
|
|
188
209
|
)
|
|
189
210
|
] })
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-Q7G5WGYV.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Table/Table.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var CaptionIdContext = React.createContext(void 0);
|
|
10
|
+
var Root = React.forwardRef(
|
|
11
|
+
({ className, scrollLabel, ...props }, ref) => {
|
|
12
|
+
const wrapperRef = React.useRef(null);
|
|
13
|
+
const tableRef = React.useRef(null);
|
|
14
|
+
const captionId = React.useId();
|
|
15
|
+
const [overflow, setOverflow] = React.useState(null);
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
const wrapper = wrapperRef.current;
|
|
18
|
+
if (!wrapper) return;
|
|
19
|
+
const measure = () => {
|
|
20
|
+
if (wrapper.scrollWidth > wrapper.clientWidth) {
|
|
21
|
+
const id = tableRef.current?.caption?.id || null;
|
|
22
|
+
setOverflow((prev) => prev && prev.captionId === id ? prev : { captionId: id });
|
|
23
|
+
} else {
|
|
24
|
+
setOverflow(null);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
measure();
|
|
28
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
29
|
+
const ro = new ResizeObserver(measure);
|
|
30
|
+
ro.observe(wrapper);
|
|
31
|
+
if (tableRef.current) ro.observe(tableRef.current);
|
|
32
|
+
return () => ro.disconnect();
|
|
33
|
+
}, []);
|
|
34
|
+
const setRefs = (el) => {
|
|
35
|
+
tableRef.current = el;
|
|
36
|
+
if (typeof ref === "function") ref(el);
|
|
37
|
+
else if (ref) ref.current = el;
|
|
38
|
+
};
|
|
39
|
+
const label = scrollLabel ?? props["aria-label"];
|
|
40
|
+
const labelledBy = label ? void 0 : props["aria-labelledby"] ?? overflow?.captionId ?? void 0;
|
|
41
|
+
const named = Boolean(label || labelledBy);
|
|
42
|
+
return /* @__PURE__ */ jsx(CaptionIdContext.Provider, { value: captionId, children: /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
ref: wrapperRef,
|
|
46
|
+
className: "relative w-full overflow-auto",
|
|
47
|
+
...overflow ? {
|
|
48
|
+
tabIndex: 0,
|
|
49
|
+
...named ? { role: "region", "aria-label": label, "aria-labelledby": labelledBy } : {}
|
|
50
|
+
} : {},
|
|
51
|
+
children: /* @__PURE__ */ jsx(
|
|
52
|
+
"table",
|
|
53
|
+
{
|
|
54
|
+
ref: setRefs,
|
|
55
|
+
className: cn("w-full caption-bottom text-sm tabular-nums", className),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
Root.displayName = "Table.Root";
|
|
64
|
+
var Header = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
65
|
+
Header.displayName = "Table.Header";
|
|
66
|
+
var Body = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
67
|
+
Body.displayName = "Table.Body";
|
|
68
|
+
var TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
69
|
+
"tfoot",
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
className: cn(
|
|
73
|
+
"border-t bg-[var(--color-surface-container-low)] font-medium [&>tr]:last:border-b-0",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
TableFooter.displayName = "Table.Footer";
|
|
80
|
+
var Row = React.forwardRef(
|
|
81
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
82
|
+
"tr",
|
|
83
|
+
{
|
|
84
|
+
ref,
|
|
85
|
+
className: cn(
|
|
86
|
+
"border-b border-[var(--color-outline-variant)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-surface-container-low)_50%,transparent)] data-[state=selected]:bg-[var(--color-surface-container-low)]",
|
|
87
|
+
className
|
|
88
|
+
),
|
|
89
|
+
...props
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
Row.displayName = "Table.Row";
|
|
94
|
+
var Head = React.forwardRef(
|
|
95
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
96
|
+
"th",
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
className: cn(
|
|
100
|
+
"h-10 px-4 text-start align-middle font-medium text-[var(--color-on-surface-muted)] [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
Head.displayName = "Table.Head";
|
|
108
|
+
var Cell = React.forwardRef(
|
|
109
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
110
|
+
"td",
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
className: cn(
|
|
114
|
+
"p-4 align-middle [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
115
|
+
className
|
|
116
|
+
),
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
Cell.displayName = "Table.Cell";
|
|
122
|
+
var Caption = React.forwardRef(({ className, id, ...props }, ref) => {
|
|
123
|
+
const contextId = React.useContext(CaptionIdContext);
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
"caption",
|
|
126
|
+
{
|
|
127
|
+
ref,
|
|
128
|
+
id: id ?? contextId,
|
|
129
|
+
className: cn("mt-4 text-sm text-[var(--color-on-surface-muted)]", className),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
Caption.displayName = "Table.Caption";
|
|
135
|
+
var Table = {
|
|
136
|
+
Root,
|
|
137
|
+
Header,
|
|
138
|
+
Body,
|
|
139
|
+
Footer: TableFooter,
|
|
140
|
+
Row,
|
|
141
|
+
Head,
|
|
142
|
+
Cell,
|
|
143
|
+
Caption
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Table
|
|
148
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
DropdownMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A4QLUIFN.js";
|
|
5
5
|
import {
|
|
6
6
|
ButtonGroup
|
|
7
7
|
} from "./chunk-WHTLXQB6.js";
|
|
8
8
|
import {
|
|
9
9
|
Button
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-22BGPRJZ.js";
|
|
11
11
|
import {
|
|
12
12
|
cn
|
|
13
13
|
} from "./chunk-Q7G5WGYV.js";
|
|
@@ -19,6 +19,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
var SplitButton = React.forwardRef(
|
|
20
20
|
({ menuLabel, menu, align = "end", variant, size, tone, disabled, loading, className, ...props }, ref) => {
|
|
21
21
|
const shared = { variant, size, tone };
|
|
22
|
+
const busy = loading || props.status === "loading";
|
|
22
23
|
return /* @__PURE__ */ jsxs(ButtonGroup, { attached: true, className, children: [
|
|
23
24
|
/* @__PURE__ */ jsx(Button, { ref, ...shared, disabled, ...loading ? { loading: true } : {}, ...props }),
|
|
24
25
|
/* @__PURE__ */ jsxs(DropdownMenu.Root, { modal: false, children: [
|
|
@@ -26,7 +27,7 @@ var SplitButton = React.forwardRef(
|
|
|
26
27
|
Button,
|
|
27
28
|
{
|
|
28
29
|
...shared,
|
|
29
|
-
disabled: disabled ||
|
|
30
|
+
disabled: disabled || busy,
|
|
30
31
|
"aria-label": menuLabel,
|
|
31
32
|
className: cn(
|
|
32
33
|
"px-3",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
inputWrapperVariants
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F7ZA2VA2.js";
|
|
5
5
|
import {
|
|
6
6
|
disabledText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5W3AOOYS.js";
|
|
8
8
|
import {
|
|
9
9
|
useNexubMessages
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3MSIO7KM.js";
|
|
11
11
|
import {
|
|
12
12
|
cn
|
|
13
13
|
} from "./chunk-Q7G5WGYV.js";
|