next-data-kit 9.0.0 → 9.0.1

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.js CHANGED
@@ -784,7 +784,7 @@ function TableRow({ className, ...props }) {
784
784
  {
785
785
  "data-slot": "table-row",
786
786
  className: cn(
787
- "hover:bg-gray-50 dark:hover:bg-gray-900/50 hover:border-gray-200 dark:hover:border-gray-800 data-[state=selected]:bg-gray-50 dark:data-[state=selected]:bg-gray-900/50 border-b border-gray-100 dark:border-gray-900 transition-colors",
787
+ "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
788
  className
789
789
  ),
790
790
  ...props
@@ -945,7 +945,7 @@ function Switch({
945
945
  {
946
946
  "data-slot": "switch",
947
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",
948
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-zinc-200 focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-zinc-700 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
949
  className
950
950
  ),
951
951
  ...props,
@@ -1407,68 +1407,55 @@ var DataKitRoot = (props) => {
1407
1407
  selection.deselectAll();
1408
1408
  }, [dataKit.items.length]);
1409
1409
  return /* @__PURE__ */ jsxs("div", { ref: tableRef, className: `space-y-3 ${className ?? ""}`, children: [
1410
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
1411
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: filters.length > 0 && /* @__PURE__ */ jsxs(Popover, { open: isFilterOpen, onOpenChange: setIsFilterOpen, children: [
1412
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
1413
- /* @__PURE__ */ jsx(Filter, { className: "mr-1.5 size-4" }),
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",
1410
+ /* @__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: [
1411
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", children: [
1412
+ /* @__PURE__ */ jsx(Filter, { className: "mr-1.5 size-4" }),
1413
+ "Filters"
1414
+ ] }) }),
1415
+ /* @__PURE__ */ jsxs(PopoverContent, { align: "start", className: "w-80", container: overlayContainer, children: [
1416
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3", children: filters.map((f) => /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
1417
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: f.label }),
1418
+ f.type === "TEXT" && /* @__PURE__ */ jsx(
1419
+ "input",
1420
+ {
1421
+ type: "text",
1422
+ className: "h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none focus:ring-2 focus:ring-ring",
1423
+ placeholder: f.placeholder,
1424
+ value: dataKit.filter[f.id] ?? "",
1425
+ onChange: (e) => dataKit.actions.setFilter(f.id, e.target.value)
1426
+ }
1427
+ ),
1428
+ f.type === "SELECT" && /* @__PURE__ */ jsxs(
1429
+ Select,
1430
+ {
1431
+ value: String(dataKit.filter[f.id] || "__all__"),
1432
+ onValueChange: (v) => dataKit.actions.setFilter(f.id, v === "__all__" ? "" : v),
1433
+ children: [
1434
+ /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
1435
+ /* @__PURE__ */ jsxs(SelectContent, { container: overlayContainer, children: [
1436
+ /* @__PURE__ */ jsx(SelectItem, { value: "__all__", children: "All" }),
1437
+ f.dataset?.map((d) => /* @__PURE__ */ jsx(SelectItem, { value: d.id, children: d.label }, d.id))
1438
+ ] })
1439
+ ]
1440
+ }
1441
+ ),
1442
+ f.type === "BOOLEAN" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1443
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: f.placeholder ?? "Enable" }),
1444
+ /* @__PURE__ */ jsx(
1445
+ Switch,
1421
1446
  {
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)
1447
+ checked: Boolean(dataKit.filter[f.id]),
1448
+ onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
1427
1449
  }
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" })
1450
+ )
1457
1451
  ] })
1458
- ] })
1459
- ] }) }),
1460
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1461
- /* @__PURE__ */ jsxs("span", { className: "mr-2 text-sm text-muted-foreground", children: [
1462
- dataKit.items.length,
1463
- " of ",
1464
- dataKit.total
1465
- ] }),
1466
- /* @__PURE__ */ jsxs(Select, { value: String(dataKit.limit), onValueChange: (v) => dataKit.actions.setLimit(Number(v)), disabled: dataKit.state.isLoading, children: [
1467
- /* @__PURE__ */ jsx(SelectTrigger, { className: "w-16", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
1468
- /* @__PURE__ */ jsx(SelectContent, { container: overlayContainer, children: limitOptions.map((v) => /* @__PURE__ */ jsx(SelectItem, { value: String(v), children: v }, v)) })
1452
+ ] }, f.id)) }),
1453
+ /* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-between border-t pt-3", children: [
1454
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleResetFilters, children: "Reset" }),
1455
+ /* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => setIsFilterOpen(false), children: "Done" })
1469
1456
  ] })
1470
1457
  ] })
1471
- ] }),
1458
+ ] }) }) }),
1472
1459
  /* @__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
1460
  /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
1474
1461
  selectable?.enabled && /* @__PURE__ */ jsx(TableHead, { className: "w-12", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -1540,8 +1527,12 @@ var DataKitRoot = (props) => {
1540
1527
  }) })
1541
1528
  ] }) }),
1542
1529
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 justify-between", children: [
1543
- /* @__PURE__ */ jsxs("div", { className: "min-w-[140px]", children: [
1544
- /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
1530
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1531
+ /* @__PURE__ */ jsxs(Select, { value: String(dataKit.limit), onValueChange: (v) => dataKit.actions.setLimit(Number(v)), disabled: dataKit.state.isLoading, children: [
1532
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "w-16", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
1533
+ /* @__PURE__ */ jsx(SelectContent, { container: overlayContainer, children: limitOptions.map((v) => /* @__PURE__ */ jsx(SelectItem, { value: String(v), children: v }, v)) })
1534
+ ] }),
1535
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: [
1545
1536
  "Page ",
1546
1537
  dataKit.page,
1547
1538
  " of ",
@@ -1552,8 +1543,7 @@ var DataKitRoot = (props) => {
1552
1543
  " selected"
1553
1544
  ] })
1554
1545
  ] }),
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: [
1546
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: paginationType === "SIMPLE" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1557
1547
  /* @__PURE__ */ jsx(
1558
1548
  Button,
1559
1549
  {
@@ -1733,16 +1723,13 @@ var DataKitInner = (props, ref) => {
1733
1723
  ]
1734
1724
  }
1735
1725
  ),
1736
- f.type === "BOOLEAN" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1737
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: f.placeholder ?? "Enable" }),
1738
- /* @__PURE__ */ jsx(
1739
- Switch,
1740
- {
1741
- checked: Boolean(dataKit.filter[f.id]),
1742
- onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
1743
- }
1744
- )
1745
- ] })
1726
+ f.type === "BOOLEAN" && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx(
1727
+ Switch,
1728
+ {
1729
+ checked: Boolean(dataKit.filter[f.id]),
1730
+ onCheckedChange: (c) => dataKit.actions.setFilter(f.id, c)
1731
+ }
1732
+ ) })
1746
1733
  ] }, f.id)) }),
1747
1734
  /* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-between border-t pt-3", children: [
1748
1735
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleResetFilters, children: "Reset" }),