next-data-kit 9.0.0 → 9.0.2
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/client/components/data-kit-infinity.d.ts.map +1 -1
- package/dist/client/components/data-kit-infinity.js +2 -2
- package/dist/client/components/data-kit-infinity.js.map +1 -1
- package/dist/client/components/data-kit-table.d.ts.map +1 -1
- package/dist/client/components/data-kit-table.js +3 -3
- package/dist/client/components/data-kit-table.js.map +1 -1
- package/dist/client/components/data-kit.d.ts.map +1 -1
- package/dist/client/components/data-kit.js +2 -2
- package/dist/client/components/data-kit.js.map +1 -1
- package/dist/client/components/ui/index.d.ts +0 -1
- package/dist/client/components/ui/index.d.ts.map +1 -1
- package/dist/client/components/ui/index.js +0 -1
- package/dist/client/components/ui/index.js.map +1 -1
- package/dist/client/components/ui/table.js +1 -1
- package/dist/client/components/ui/table.js.map +1 -1
- package/dist/index.cjs +58 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -100
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +7 -5
- package/dist/client/components/ui/switch.d.ts +0 -5
- package/dist/client/components/ui/switch.d.ts.map +0 -1
- package/dist/client/components/ui/switch.js +0 -9
- package/dist/client/components/ui/switch.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { Filter, Loader2, MoreHorizontal, ArrowUp, ArrowDown, ChevronLeft, Chevr
|
|
|
6
6
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
7
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
8
8
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
9
|
-
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
10
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
10
|
import { cva } from 'class-variance-authority';
|
|
12
11
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -784,7 +783,7 @@ function TableRow({ className, ...props }) {
|
|
|
784
783
|
{
|
|
785
784
|
"data-slot": "table-row",
|
|
786
785
|
className: cn(
|
|
787
|
-
"hover:bg-gray-50 dark:hover:bg-gray-900
|
|
786
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900 data-[state=selected]:bg-gray-50 dark:data-[state=selected]:bg-gray-900 border-b border-gray-100 dark:border-gray-800 transition-colors",
|
|
788
787
|
className
|
|
789
788
|
),
|
|
790
789
|
...props
|
|
@@ -936,31 +935,6 @@ function DropdownMenuSeparator({
|
|
|
936
935
|
}
|
|
937
936
|
);
|
|
938
937
|
}
|
|
939
|
-
function Switch({
|
|
940
|
-
className,
|
|
941
|
-
...props
|
|
942
|
-
}) {
|
|
943
|
-
return /* @__PURE__ */ jsx(
|
|
944
|
-
SwitchPrimitive.Root,
|
|
945
|
-
{
|
|
946
|
-
"data-slot": "switch",
|
|
947
|
-
className: cn(
|
|
948
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
949
|
-
className
|
|
950
|
-
),
|
|
951
|
-
...props,
|
|
952
|
-
children: /* @__PURE__ */ jsx(
|
|
953
|
-
SwitchPrimitive.Thumb,
|
|
954
|
-
{
|
|
955
|
-
"data-slot": "switch-thumb",
|
|
956
|
-
className: cn(
|
|
957
|
-
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
958
|
-
)
|
|
959
|
-
}
|
|
960
|
-
)
|
|
961
|
-
}
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
938
|
var buttonVariants = cva(
|
|
965
939
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-black/20 dark:focus-visible:ring-white/20 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/30 aria-invalid:border-red-500",
|
|
966
940
|
{
|
|
@@ -1407,68 +1381,52 @@ var DataKitRoot = (props) => {
|
|
|
1407
1381
|
selection.deselectAll();
|
|
1408
1382
|
}, [dataKit.items.length]);
|
|
1409
1383
|
return /* @__PURE__ */ jsxs("div", { ref: tableRef, className: `space-y-3 ${className ?? ""}`, children: [
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */ jsx(
|
|
1412
|
-
/* @__PURE__ */ jsx(
|
|
1413
|
-
|
|
1414
|
-
"Filters"
|
|
1415
|
-
] }) }),
|
|
1416
|
-
/* @__PURE__ */ jsxs(PopoverContent, { align: "start", className: "w-80", container: overlayContainer, children: [
|
|
1417
|
-
/* @__PURE__ */ jsx("div", { className: "grid gap-3", children: filters.map((f) => /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
|
|
1418
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: f.label }),
|
|
1419
|
-
f.type === "TEXT" && /* @__PURE__ */ jsx(
|
|
1420
|
-
"input",
|
|
1421
|
-
{
|
|
1422
|
-
type: "text",
|
|
1423
|
-
className: "h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none focus:ring-2 focus:ring-ring",
|
|
1424
|
-
placeholder: f.placeholder,
|
|
1425
|
-
value: dataKit.filter[f.id] ?? "",
|
|
1426
|
-
onChange: (e) => dataKit.actions.setFilter(f.id, e.target.value)
|
|
1427
|
-
}
|
|
1428
|
-
),
|
|
1429
|
-
f.type === "SELECT" && /* @__PURE__ */ jsxs(
|
|
1430
|
-
Select,
|
|
1431
|
-
{
|
|
1432
|
-
value: String(dataKit.filter[f.id] || "__all__"),
|
|
1433
|
-
onValueChange: (v) => dataKit.actions.setFilter(f.id, v === "__all__" ? "" : v),
|
|
1434
|
-
children: [
|
|
1435
|
-
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1436
|
-
/* @__PURE__ */ jsxs(SelectContent, { container: overlayContainer, children: [
|
|
1437
|
-
/* @__PURE__ */ jsx(SelectItem, { value: "__all__", children: "All" }),
|
|
1438
|
-
f.dataset?.map((d) => /* @__PURE__ */ jsx(SelectItem, { value: d.id, children: d.label }, d.id))
|
|
1439
|
-
] })
|
|
1440
|
-
]
|
|
1441
|
-
}
|
|
1442
|
-
),
|
|
1443
|
-
f.type === "BOOLEAN" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1444
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: f.placeholder ?? "Enable" }),
|
|
1445
|
-
/* @__PURE__ */ jsx(
|
|
1446
|
-
Switch,
|
|
1447
|
-
{
|
|
1448
|
-
checked: Boolean(dataKit.filter[f.id]),
|
|
1449
|
-
onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
|
|
1450
|
-
}
|
|
1451
|
-
)
|
|
1452
|
-
] })
|
|
1453
|
-
] }, f.id)) }),
|
|
1454
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-between border-t pt-3", children: [
|
|
1455
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleResetFilters, children: "Reset" }),
|
|
1456
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => setIsFilterOpen(false), children: "Done" })
|
|
1457
|
-
] })
|
|
1458
|
-
] })
|
|
1384
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between gap-2", children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: filters.length > 0 && /* @__PURE__ */ jsxs(Popover, { open: isFilterOpen, onOpenChange: setIsFilterOpen, children: [
|
|
1385
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
|
|
1386
|
+
/* @__PURE__ */ jsx(Filter, { className: "mr-1.5 size-4" }),
|
|
1387
|
+
"Filters"
|
|
1459
1388
|
] }) }),
|
|
1460
|
-
/* @__PURE__ */ jsxs(
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
|
|
1463
|
-
"
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1389
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "start", className: "w-80", container: overlayContainer, children: [
|
|
1390
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-3", children: filters.map((f) => /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
|
|
1391
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: f.label }),
|
|
1392
|
+
f.type === "TEXT" && /* @__PURE__ */ jsx(
|
|
1393
|
+
"input",
|
|
1394
|
+
{
|
|
1395
|
+
type: "text",
|
|
1396
|
+
className: "h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none focus:ring-2 focus:ring-ring",
|
|
1397
|
+
placeholder: f.placeholder,
|
|
1398
|
+
value: dataKit.filter[f.id] ?? "",
|
|
1399
|
+
onChange: (e) => dataKit.actions.setFilter(f.id, e.target.value)
|
|
1400
|
+
}
|
|
1401
|
+
),
|
|
1402
|
+
f.type === "SELECT" && /* @__PURE__ */ jsxs(
|
|
1403
|
+
Select,
|
|
1404
|
+
{
|
|
1405
|
+
value: String(dataKit.filter[f.id] || "__all__"),
|
|
1406
|
+
onValueChange: (v) => dataKit.actions.setFilter(f.id, v === "__all__" ? "" : v),
|
|
1407
|
+
children: [
|
|
1408
|
+
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1409
|
+
/* @__PURE__ */ jsxs(SelectContent, { container: overlayContainer, children: [
|
|
1410
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "__all__", children: "All" }),
|
|
1411
|
+
f.dataset?.map((d) => /* @__PURE__ */ jsx(SelectItem, { value: d.id, children: d.label }, d.id))
|
|
1412
|
+
] })
|
|
1413
|
+
]
|
|
1414
|
+
}
|
|
1415
|
+
),
|
|
1416
|
+
f.type === "BOOLEAN" && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx(
|
|
1417
|
+
Checkbox,
|
|
1418
|
+
{
|
|
1419
|
+
checked: Boolean(dataKit.filter[f.id]),
|
|
1420
|
+
onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
|
|
1421
|
+
}
|
|
1422
|
+
) })
|
|
1423
|
+
] }, f.id)) }),
|
|
1424
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-between border-t pt-3", children: [
|
|
1425
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleResetFilters, children: "Reset" }),
|
|
1426
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => setIsFilterOpen(false), children: "Done" })
|
|
1469
1427
|
] })
|
|
1470
1428
|
] })
|
|
1471
|
-
] }),
|
|
1429
|
+
] }) }) }),
|
|
1472
1430
|
/* @__PURE__ */ jsx("div", { className: `overflow-hidden border border-gray-200 dark:border-gray-800 ${bordered === "rounded" ? "rounded-lg" : bordered ? "" : "rounded-lg"}`, children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
1473
1431
|
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1474
1432
|
selectable?.enabled && /* @__PURE__ */ jsx(TableHead, { className: "w-12", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1540,8 +1498,12 @@ var DataKitRoot = (props) => {
|
|
|
1540
1498
|
}) })
|
|
1541
1499
|
] }) }),
|
|
1542
1500
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 justify-between", children: [
|
|
1543
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
1544
|
-
/* @__PURE__ */ jsxs(
|
|
1501
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1502
|
+
/* @__PURE__ */ jsxs(Select, { value: String(dataKit.limit), onValueChange: (v) => dataKit.actions.setLimit(Number(v)), disabled: dataKit.state.isLoading, children: [
|
|
1503
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-16", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1504
|
+
/* @__PURE__ */ jsx(SelectContent, { container: overlayContainer, children: limitOptions.map((v) => /* @__PURE__ */ jsx(SelectItem, { value: String(v), children: v }, v)) })
|
|
1505
|
+
] }),
|
|
1506
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: [
|
|
1545
1507
|
"Page ",
|
|
1546
1508
|
dataKit.page,
|
|
1547
1509
|
" of ",
|
|
@@ -1552,8 +1514,7 @@ var DataKitRoot = (props) => {
|
|
|
1552
1514
|
" selected"
|
|
1553
1515
|
] })
|
|
1554
1516
|
] }),
|
|
1555
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1"
|
|
1556
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end w-full", children: paginationType === "SIMPLE" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1517
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: paginationType === "SIMPLE" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1557
1518
|
/* @__PURE__ */ jsx(
|
|
1558
1519
|
Button,
|
|
1559
1520
|
{
|
|
@@ -1733,16 +1694,13 @@ var DataKitInner = (props, ref) => {
|
|
|
1733
1694
|
]
|
|
1734
1695
|
}
|
|
1735
1696
|
),
|
|
1736
|
-
f.type === "BOOLEAN" && /* @__PURE__ */
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
}
|
|
1744
|
-
)
|
|
1745
|
-
] })
|
|
1697
|
+
f.type === "BOOLEAN" && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx(
|
|
1698
|
+
Checkbox,
|
|
1699
|
+
{
|
|
1700
|
+
checked: Boolean(dataKit.filter[f.id]),
|
|
1701
|
+
onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
|
|
1702
|
+
}
|
|
1703
|
+
) })
|
|
1746
1704
|
] }, f.id)) }),
|
|
1747
1705
|
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-between border-t pt-3", children: [
|
|
1748
1706
|
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleResetFilters, children: "Reset" }),
|