shadcn-ui-react 0.5.1 → 0.5.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/index.cjs CHANGED
@@ -7860,16 +7860,18 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
7860
7860
  // src/components/table.tsx
7861
7861
  var React59 = __toESM(require("react"), 1);
7862
7862
  var import_jsx_runtime39 = require("react/jsx-runtime");
7863
- var Table = React59.forwardRef((_a, ref) => {
7864
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
7865
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
7866
- "table",
7867
- __spreadValues({
7868
- ref,
7869
- className: cn("w-full caption-bottom text-sm", className)
7870
- }, props)
7871
- ) });
7872
- });
7863
+ var Table = React59.forwardRef(
7864
+ (_a, ref) => {
7865
+ var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
7866
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("relative w-full overflow-auto", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
7867
+ "table",
7868
+ __spreadValues({
7869
+ ref,
7870
+ className: cn("w-full caption-bottom text-sm", className)
7871
+ }, props)
7872
+ ) });
7873
+ }
7874
+ );
7873
7875
  Table.displayName = "Table";
7874
7876
  var TableHeader = React59.forwardRef((_a, ref) => {
7875
7877
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
@@ -7922,7 +7924,7 @@ var TableHead = React59.forwardRef((_a, ref) => {
7922
7924
  __spreadValues({
7923
7925
  ref,
7924
7926
  className: cn(
7925
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
7927
+ "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
7926
7928
  className
7927
7929
  )
7928
7930
  }, props)
@@ -7936,7 +7938,7 @@ var TableCell = React59.forwardRef((_a, ref) => {
7936
7938
  __spreadValues({
7937
7939
  ref,
7938
7940
  className: cn(
7939
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
7941
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
7940
7942
  className
7941
7943
  )
7942
7944
  }, props)
@@ -8390,6 +8392,7 @@ function Breadcrumbs({ items, className, classNameList }) {
8390
8392
 
8391
8393
  // src/shared/data-table.tsx
8392
8394
  var import_react36 = __toESM(require("react"), 1);
8395
+ var import_framer_motion2 = require("framer-motion");
8393
8396
  var import_react_icons18 = require("@radix-ui/react-icons");
8394
8397
  var import_react_table = require("@tanstack/react-table");
8395
8398
  var import_lucide_react6 = require("lucide-react");
@@ -8416,16 +8419,36 @@ function DataTable({
8416
8419
  tableClassName,
8417
8420
  onPageChange,
8418
8421
  onClick,
8419
- onPageSizeChange
8422
+ onPageSizeChange,
8423
+ animate = true,
8424
+ stickyHeader = true,
8425
+ heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
8420
8426
  }) {
8427
+ const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
8421
8428
  const [pagination, setPagination] = import_react36.default.useState({
8422
8429
  pageIndex: Math.max(page - 1, 0),
8423
8430
  pageSize: perPage
8424
8431
  });
8432
+ (0, import_react36.useEffect)(() => {
8433
+ setPagination((prev) => {
8434
+ const nextIndex = Math.max(page - 1, 0);
8435
+ const nextSize = perPage;
8436
+ if (prev.pageIndex === nextIndex && prev.pageSize === nextSize) return prev;
8437
+ return { pageIndex: nextIndex, pageSize: nextSize };
8438
+ });
8439
+ }, [page, perPage]);
8440
+ (0, import_react36.useEffect)(() => {
8441
+ setPagination((prev) => {
8442
+ const maxIndex = Math.max(safePageCount - 1, 0);
8443
+ const clamped = Math.min(prev.pageIndex, maxIndex);
8444
+ if (clamped === prev.pageIndex) return prev;
8445
+ return __spreadProps(__spreadValues({}, prev), { pageIndex: clamped });
8446
+ });
8447
+ }, [safePageCount]);
8425
8448
  const table = (0, import_react_table.useReactTable)({
8426
8449
  data,
8427
8450
  columns,
8428
- pageCount,
8451
+ pageCount: safePageCount,
8429
8452
  getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
8430
8453
  getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
8431
8454
  state: { pagination },
@@ -8434,147 +8457,190 @@ function DataTable({
8434
8457
  manualPagination: true,
8435
8458
  manualFiltering: true
8436
8459
  });
8437
- const onClickItem = (row) => {
8438
- if (onClick) {
8439
- onClick(row);
8440
- }
8441
- };
8460
+ const clickable = !!onClick;
8442
8461
  (0, import_react36.useEffect)(() => {
8443
- if (onPageChange) {
8444
- onPageChange(pagination.pageIndex + 1);
8445
- }
8446
- }, [pagination, onPageChange]);
8447
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("rounded-md border bg-background flex flex-col", className), children: [
8448
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(ScrollArea, { className: "h-[calc(80vh-220px)] md:h-[calc(80dvh-80px)]", children: [
8449
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Table, { className: cn("relative", tableClassName), children: [
8450
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHeader, { className: headerClassName, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { className: rowClassName, children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHead, { className: headerClassName, children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
8451
- header.column.columnDef.header,
8452
- header.getContext()
8453
- ) }, header.id)) }, headerGroup.id)) }),
8454
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8455
- TableRow,
8456
- {
8457
- "data-state": row.getIsSelected() ? "selected" : void 0,
8458
- onClick: () => onClickItem(row.original),
8459
- className: rowClassName,
8460
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cellClassName, children: (0, import_react_table.flexRender)(
8461
- cell.column.columnDef.cell,
8462
- cell.getContext()
8463
- ) }, cell.id))
8464
- },
8465
- row.id
8466
- )) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8467
- TableCell,
8468
- {
8469
- colSpan: columns.length,
8470
- className: "h-24 text-center",
8471
- children: "No results."
8472
- }
8473
- ) }) })
8474
- ] }),
8475
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollBar, { orientation: "horizontal" })
8476
- ] }),
8477
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "border-t px-4 py-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
8478
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
8479
- isRowsSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-muted-foreground text-sm", children: [
8480
- table.getFilteredSelectedRowModel().rows.length,
8481
- " ",
8482
- ofLabel,
8483
- " ",
8484
- table.getFilteredRowModel().rows.length,
8485
- " ",
8486
- rowsSelectedLabel
8487
- ] }),
8488
- totalRows ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
8489
- "Total: ",
8490
- totalRows,
8491
- " registros"
8492
- ] }) : null
8493
- ] }),
8494
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-end", children: [
8495
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
8496
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
8462
+ onPageChange == null ? void 0 : onPageChange(pagination.pageIndex + 1);
8463
+ }, [pagination.pageIndex, onPageChange]);
8464
+ const pageKey = (0, import_react36.useMemo)(
8465
+ () => `${pagination.pageIndex}-${pagination.pageSize}-${data.length}`,
8466
+ [pagination.pageIndex, pagination.pageSize, data.length]
8467
+ );
8468
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
8469
+ "div",
8470
+ {
8471
+ className: cn(
8472
+ "relative w-full overflow-hidden rounded-xl border bg-background/60 backdrop-blur supports-backdrop-filter:bg-background/40 shadow-sm",
8473
+ "flex flex-col",
8474
+ heightClassName,
8475
+ className
8476
+ ),
8477
+ children: [
8478
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(ScrollArea, { className: "h-full", children: [
8497
8479
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
8498
- Select2,
8480
+ Table,
8499
8481
  {
8500
- value: `${pagination.pageSize}`,
8501
- onValueChange: (value) => {
8502
- const newSize = Number(value);
8503
- setPagination(__spreadProps(__spreadValues({}, pagination), {
8504
- pageSize: newSize,
8505
- pageIndex: 0
8506
- }));
8507
- if (onPageSizeChange) onPageSizeChange(newSize);
8508
- },
8482
+ containerClassName: "overflow-visible",
8483
+ className: cn("w-full", tableClassName),
8509
8484
  children: [
8510
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectValue, { placeholder: pagination.pageSize }) }),
8511
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectItem, { value: `${size}`, children: size }, size)) })
8485
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8486
+ TableHeader,
8487
+ {
8488
+ className: cn(
8489
+ headerClassName,
8490
+ stickyHeader ? "sticky top-0 z-10 bg-background/80 backdrop-blur border-b" : ""
8491
+ ),
8492
+ children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { className: cn("hover:bg-transparent", rowClassName), children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableHead, { className: cn("whitespace-nowrap", headerClassName), children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id))
8493
+ }
8494
+ ),
8495
+ animate ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_framer_motion2.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8496
+ import_framer_motion2.motion.tbody,
8497
+ {
8498
+ className: cn("[&_tr:last-child]:border-0", bodyClassName),
8499
+ initial: { opacity: 0, y: 6 },
8500
+ animate: { opacity: 1, y: 0 },
8501
+ exit: { opacity: 0, y: -6 },
8502
+ transition: { duration: 0.18 },
8503
+ children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8504
+ TableRow,
8505
+ {
8506
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8507
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8508
+ className: cn(
8509
+ rowClassName,
8510
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8511
+ ),
8512
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cellClassName, children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8513
+ },
8514
+ row.id
8515
+ )) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) })
8516
+ },
8517
+ pageKey
8518
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8519
+ TableRow,
8520
+ {
8521
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8522
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8523
+ className: cn(
8524
+ rowClassName,
8525
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8526
+ ),
8527
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { className: cn(cellClassName), children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8528
+ },
8529
+ row.id
8530
+ )) : emptyData || /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) }) })
8512
8531
  ]
8513
8532
  }
8514
- )
8515
- ] }),
8516
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
8517
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex w-[110px] items-center justify-center text-sm font-medium", children: [
8518
- pageLabel,
8519
- " ",
8520
- pagination.pageIndex + 1,
8521
- " ",
8522
- ofLabel,
8523
- " ",
8524
- pageCount
8525
- ] }),
8526
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8527
- Button,
8528
- {
8529
- "aria-label": "Go to first page",
8530
- variant: "outline",
8531
- className: "hidden h-8 w-8 p-0 lg:flex",
8532
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: 0 })),
8533
- disabled: pagination.pageIndex === 0,
8534
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowLeftIcon, { className: "h-4 w-4" })
8535
- }
8536
- ),
8537
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8538
- Button,
8539
- {
8540
- "aria-label": "Go to previous page",
8541
- variant: "outline",
8542
- className: "h-8 w-8 p-0",
8543
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
8544
- pageIndex: pagination.pageIndex - 1
8545
- })),
8546
- disabled: pagination.pageIndex === 0,
8547
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronLeftIcon, { className: "h-4 w-4" })
8548
- }
8549
8533
  ),
8550
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8551
- Button,
8552
- {
8553
- "aria-label": "Go to next page",
8554
- variant: "outline",
8555
- className: "h-8 w-8 p-0",
8556
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
8557
- pageIndex: pagination.pageIndex + 1
8558
- })),
8559
- disabled: pagination.pageIndex + 1 >= pageCount,
8560
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronRightIcon, { className: "h-4 w-4" })
8561
- }
8562
- ),
8563
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8564
- Button,
8565
- {
8566
- "aria-label": "Go to last page",
8567
- variant: "outline",
8568
- className: "hidden h-8 w-8 p-0 lg:flex",
8569
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: pageCount - 1 })),
8570
- disabled: pagination.pageIndex + 1 >= pageCount,
8571
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowRightIcon, { className: "h-4 w-4" })
8572
- }
8573
- )
8574
- ] })
8575
- ] })
8576
- ] })
8577
- ] });
8534
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollBar, { orientation: "horizontal" })
8535
+ ] }) }),
8536
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "border-t bg-background/70 backdrop-blur supports-backdrop-filter:bg-background/50", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-center", children: [
8537
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
8538
+ isRowsSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-muted-foreground text-sm", children: [
8539
+ table.getFilteredSelectedRowModel().rows.length,
8540
+ " ",
8541
+ ofLabel,
8542
+ " ",
8543
+ table.getFilteredRowModel().rows.length,
8544
+ " ",
8545
+ rowsSelectedLabel
8546
+ ] }),
8547
+ typeof totalRows === "number" && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
8548
+ "Total: ",
8549
+ totalRows,
8550
+ " registros"
8551
+ ] })
8552
+ ] }),
8553
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
8554
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
8555
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
8556
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
8557
+ Select2,
8558
+ {
8559
+ value: `${pagination.pageSize}`,
8560
+ onValueChange: (value) => {
8561
+ const newSize = Number(value);
8562
+ setPagination((p) => __spreadProps(__spreadValues({}, p), { pageSize: newSize, pageIndex: 0 }));
8563
+ onPageSizeChange == null ? void 0 : onPageSizeChange(newSize);
8564
+ onPageChange == null ? void 0 : onPageChange(1);
8565
+ },
8566
+ children: [
8567
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectTrigger, { className: "h-8 w-21", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectValue, { placeholder: pagination.pageSize }) }),
8568
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectItem, { value: `${size}`, children: size }, size)) })
8569
+ ]
8570
+ }
8571
+ )
8572
+ ] }),
8573
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
8574
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "hidden sm:flex min-w-35 items-center justify-center text-sm font-medium", children: [
8575
+ pageLabel,
8576
+ " ",
8577
+ pagination.pageIndex + 1,
8578
+ " ",
8579
+ ofLabel,
8580
+ " ",
8581
+ safePageCount
8582
+ ] }),
8583
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8584
+ Button,
8585
+ {
8586
+ "aria-label": "Go to first page",
8587
+ variant: "outline",
8588
+ className: "hidden h-8 w-8 p-0 lg:flex",
8589
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: 0 })),
8590
+ disabled: pagination.pageIndex === 0,
8591
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowLeftIcon, { className: "h-4 w-4" })
8592
+ }
8593
+ ),
8594
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8595
+ Button,
8596
+ {
8597
+ "aria-label": "Go to previous page",
8598
+ variant: "outline",
8599
+ className: "h-8 w-8 p-0",
8600
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: Math.max(p.pageIndex - 1, 0) })),
8601
+ disabled: pagination.pageIndex === 0,
8602
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronLeftIcon, { className: "h-4 w-4" })
8603
+ }
8604
+ ),
8605
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8606
+ Button,
8607
+ {
8608
+ "aria-label": "Go to next page",
8609
+ variant: "outline",
8610
+ className: "h-8 w-8 p-0",
8611
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), {
8612
+ pageIndex: Math.min(p.pageIndex + 1, safePageCount - 1)
8613
+ })),
8614
+ disabled: pagination.pageIndex + 1 >= safePageCount,
8615
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react6.ChevronRightIcon, { className: "h-4 w-4" })
8616
+ }
8617
+ ),
8618
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8619
+ Button,
8620
+ {
8621
+ "aria-label": "Go to last page",
8622
+ variant: "outline",
8623
+ className: "hidden h-8 w-8 p-0 lg:flex",
8624
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: safePageCount - 1 })),
8625
+ disabled: pagination.pageIndex + 1 >= safePageCount,
8626
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_icons18.DoubleArrowRightIcon, { className: "h-4 w-4" })
8627
+ }
8628
+ )
8629
+ ] }),
8630
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
8631
+ pageLabel,
8632
+ " ",
8633
+ pagination.pageIndex + 1,
8634
+ " ",
8635
+ ofLabel,
8636
+ " ",
8637
+ safePageCount
8638
+ ] })
8639
+ ] })
8640
+ ] }) }) })
8641
+ ]
8642
+ }
8643
+ );
8578
8644
  }
8579
8645
 
8580
8646
  // src/shared/data-table-skeleton.tsx
@@ -8589,10 +8655,10 @@ function DataTableSkeleton({
8589
8655
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-full space-y-3 overflow-auto", children: [
8590
8656
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full items-center justify-between space-x-2 overflow-auto p-1", children: [
8591
8657
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-1 items-center space-x-2 space-y-4", children: [
8592
- searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-[150px] lg:w-[250px]" }, i)) : null,
8593
- filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-[70px] border-dashed" }, i)) : null
8658
+ searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-37.5 lg:w-62.5" }, i)) : null,
8659
+ filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-10 w-17.5 border-dashed" }, i)) : null
8594
8660
  ] }),
8595
- showViewOptions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "ml-auto hidden h-7 w-[70px] lg:flex" }) : null
8661
+ showViewOptions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "ml-auto hidden h-7 w-17.5 lg:flex" }) : null
8596
8662
  ] }),
8597
8663
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "rounded-md border", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
8598
8664
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHeader, { children: Array.from({ length: 1 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnCount }).map((_2, i2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-6 w-full" }) }, i2)) }, i)) }),
@@ -8603,9 +8669,9 @@ function DataTableSkeleton({
8603
8669
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8", children: [
8604
8670
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center space-x-2", children: [
8605
8671
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-24" }),
8606
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-[70px]" })
8672
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-17.5" })
8607
8673
  ] }),
8608
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-20" }) }),
8674
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex w-25 items-center justify-center text-sm font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "h-8 w-20" }) }),
8609
8675
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center space-x-2", children: [
8610
8676
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "hidden size-8 lg:block" }),
8611
8677
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Skeleton, { className: "size-8" }),
package/dist/index.d.cts CHANGED
@@ -645,7 +645,9 @@ declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Ele
645
645
 
646
646
  declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
647
647
 
648
- declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
648
+ declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & {
649
+ containerClassName?: string;
650
+ } & React$1.RefAttributes<HTMLTableElement>>;
649
651
  declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
650
652
  declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
651
653
  declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
@@ -790,8 +792,11 @@ interface DataTableProps<TData, TValue> {
790
792
  pageLabel?: string;
791
793
  ofLabel?: string;
792
794
  emptyData?: React__default.ReactNode;
795
+ animate?: boolean;
796
+ stickyHeader?: boolean;
797
+ heightClassName?: string;
793
798
  }
794
- declare function DataTable<TData, TValue>({ columns, data, pageCount, page, perPage, pageSizeOptions, rowPerPageLabel, ofLabel, pageLabel, isRowsSelected, totalRows, rowsSelectedLabel, className, emptyData, bodyClassName, cellClassName, headerClassName, rowClassName, tableClassName, onPageChange, onClick, onPageSizeChange, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
799
+ declare function DataTable<TData, TValue>({ columns, data, pageCount, page, perPage, pageSizeOptions, rowPerPageLabel, ofLabel, pageLabel, isRowsSelected, totalRows, rowsSelectedLabel, className, emptyData, bodyClassName, cellClassName, headerClassName, rowClassName, tableClassName, onPageChange, onClick, onPageSizeChange, animate, stickyHeader, heightClassName, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
795
800
 
796
801
  type DataTableSkeletonProps = {
797
802
  columnCount: number;
package/dist/index.d.ts CHANGED
@@ -645,7 +645,9 @@ declare const Toaster: ({ ...props }: ToasterProps) => react_jsx_runtime.JSX.Ele
645
645
 
646
646
  declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
647
647
 
648
- declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
648
+ declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & {
649
+ containerClassName?: string;
650
+ } & React$1.RefAttributes<HTMLTableElement>>;
649
651
  declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
650
652
  declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
651
653
  declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
@@ -790,8 +792,11 @@ interface DataTableProps<TData, TValue> {
790
792
  pageLabel?: string;
791
793
  ofLabel?: string;
792
794
  emptyData?: React__default.ReactNode;
795
+ animate?: boolean;
796
+ stickyHeader?: boolean;
797
+ heightClassName?: string;
793
798
  }
794
- declare function DataTable<TData, TValue>({ columns, data, pageCount, page, perPage, pageSizeOptions, rowPerPageLabel, ofLabel, pageLabel, isRowsSelected, totalRows, rowsSelectedLabel, className, emptyData, bodyClassName, cellClassName, headerClassName, rowClassName, tableClassName, onPageChange, onClick, onPageSizeChange, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
799
+ declare function DataTable<TData, TValue>({ columns, data, pageCount, page, perPage, pageSizeOptions, rowPerPageLabel, ofLabel, pageLabel, isRowsSelected, totalRows, rowsSelectedLabel, className, emptyData, bodyClassName, cellClassName, headerClassName, rowClassName, tableClassName, onPageChange, onClick, onPageSizeChange, animate, stickyHeader, heightClassName, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
795
800
 
796
801
  type DataTableSkeletonProps = {
797
802
  columnCount: number;
package/dist/index.js CHANGED
@@ -7651,16 +7651,18 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
7651
7651
  // src/components/table.tsx
7652
7652
  import * as React59 from "react";
7653
7653
  import { jsx as jsx39 } from "react/jsx-runtime";
7654
- var Table = React59.forwardRef((_a, ref) => {
7655
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
7656
- return /* @__PURE__ */ jsx39("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx39(
7657
- "table",
7658
- __spreadValues({
7659
- ref,
7660
- className: cn("w-full caption-bottom text-sm", className)
7661
- }, props)
7662
- ) });
7663
- });
7654
+ var Table = React59.forwardRef(
7655
+ (_a, ref) => {
7656
+ var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
7657
+ return /* @__PURE__ */ jsx39("div", { className: cn("relative w-full overflow-auto", containerClassName), children: /* @__PURE__ */ jsx39(
7658
+ "table",
7659
+ __spreadValues({
7660
+ ref,
7661
+ className: cn("w-full caption-bottom text-sm", className)
7662
+ }, props)
7663
+ ) });
7664
+ }
7665
+ );
7664
7666
  Table.displayName = "Table";
7665
7667
  var TableHeader = React59.forwardRef((_a, ref) => {
7666
7668
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
@@ -7713,7 +7715,7 @@ var TableHead = React59.forwardRef((_a, ref) => {
7713
7715
  __spreadValues({
7714
7716
  ref,
7715
7717
  className: cn(
7716
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
7718
+ "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
7717
7719
  className
7718
7720
  )
7719
7721
  }, props)
@@ -7727,7 +7729,7 @@ var TableCell = React59.forwardRef((_a, ref) => {
7727
7729
  __spreadValues({
7728
7730
  ref,
7729
7731
  className: cn(
7730
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
7732
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5",
7731
7733
  className
7732
7734
  )
7733
7735
  }, props)
@@ -8180,11 +8182,9 @@ function Breadcrumbs({ items, className, classNameList }) {
8180
8182
  }
8181
8183
 
8182
8184
  // src/shared/data-table.tsx
8183
- import React67, { useEffect as useEffect4 } from "react";
8184
- import {
8185
- DoubleArrowLeftIcon,
8186
- DoubleArrowRightIcon
8187
- } from "@radix-ui/react-icons";
8185
+ import React67, { useEffect as useEffect4, useMemo as useMemo3 } from "react";
8186
+ import { AnimatePresence, motion as motion2 } from "framer-motion";
8187
+ import { DoubleArrowLeftIcon, DoubleArrowRightIcon } from "@radix-ui/react-icons";
8188
8188
  import {
8189
8189
  flexRender,
8190
8190
  getCoreRowModel,
@@ -8216,16 +8216,36 @@ function DataTable({
8216
8216
  tableClassName,
8217
8217
  onPageChange,
8218
8218
  onClick,
8219
- onPageSizeChange
8219
+ onPageSizeChange,
8220
+ animate = true,
8221
+ stickyHeader = true,
8222
+ heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
8220
8223
  }) {
8224
+ const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
8221
8225
  const [pagination, setPagination] = React67.useState({
8222
8226
  pageIndex: Math.max(page - 1, 0),
8223
8227
  pageSize: perPage
8224
8228
  });
8229
+ useEffect4(() => {
8230
+ setPagination((prev) => {
8231
+ const nextIndex = Math.max(page - 1, 0);
8232
+ const nextSize = perPage;
8233
+ if (prev.pageIndex === nextIndex && prev.pageSize === nextSize) return prev;
8234
+ return { pageIndex: nextIndex, pageSize: nextSize };
8235
+ });
8236
+ }, [page, perPage]);
8237
+ useEffect4(() => {
8238
+ setPagination((prev) => {
8239
+ const maxIndex = Math.max(safePageCount - 1, 0);
8240
+ const clamped = Math.min(prev.pageIndex, maxIndex);
8241
+ if (clamped === prev.pageIndex) return prev;
8242
+ return __spreadProps(__spreadValues({}, prev), { pageIndex: clamped });
8243
+ });
8244
+ }, [safePageCount]);
8225
8245
  const table = useReactTable({
8226
8246
  data,
8227
8247
  columns,
8228
- pageCount,
8248
+ pageCount: safePageCount,
8229
8249
  getCoreRowModel: getCoreRowModel(),
8230
8250
  getFilteredRowModel: getFilteredRowModel(),
8231
8251
  state: { pagination },
@@ -8234,147 +8254,190 @@ function DataTable({
8234
8254
  manualPagination: true,
8235
8255
  manualFiltering: true
8236
8256
  });
8237
- const onClickItem = (row) => {
8238
- if (onClick) {
8239
- onClick(row);
8240
- }
8241
- };
8257
+ const clickable = !!onClick;
8242
8258
  useEffect4(() => {
8243
- if (onPageChange) {
8244
- onPageChange(pagination.pageIndex + 1);
8245
- }
8246
- }, [pagination, onPageChange]);
8247
- return /* @__PURE__ */ jsxs23("div", { className: cn("rounded-md border bg-background flex flex-col", className), children: [
8248
- /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-[calc(80vh-220px)] md:h-[calc(80dvh-80px)]", children: [
8249
- /* @__PURE__ */ jsxs23(Table, { className: cn("relative", tableClassName), children: [
8250
- /* @__PURE__ */ jsx48(TableHeader, { className: headerClassName, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx48(TableRow, { className: rowClassName, children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx48(TableHead, { className: headerClassName, children: header.isPlaceholder ? null : flexRender(
8251
- header.column.columnDef.header,
8252
- header.getContext()
8253
- ) }, header.id)) }, headerGroup.id)) }),
8254
- /* @__PURE__ */ jsx48(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8255
- TableRow,
8256
- {
8257
- "data-state": row.getIsSelected() ? "selected" : void 0,
8258
- onClick: () => onClickItem(row.original),
8259
- className: rowClassName,
8260
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cellClassName, children: flexRender(
8261
- cell.column.columnDef.cell,
8262
- cell.getContext()
8263
- ) }, cell.id))
8264
- },
8265
- row.id
8266
- )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(
8267
- TableCell,
8268
- {
8269
- colSpan: columns.length,
8270
- className: "h-24 text-center",
8271
- children: "No results."
8272
- }
8273
- ) }) })
8274
- ] }),
8275
- /* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
8276
- ] }),
8277
- /* @__PURE__ */ jsxs23("div", { className: "border-t px-4 py-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
8278
- /* @__PURE__ */ jsxs23("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
8279
- isRowsSelected && /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground text-sm", children: [
8280
- table.getFilteredSelectedRowModel().rows.length,
8281
- " ",
8282
- ofLabel,
8283
- " ",
8284
- table.getFilteredRowModel().rows.length,
8285
- " ",
8286
- rowsSelectedLabel
8287
- ] }),
8288
- totalRows ? /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
8289
- "Total: ",
8290
- totalRows,
8291
- " registros"
8292
- ] }) : null
8293
- ] }),
8294
- /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-end", children: [
8295
- /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8296
- /* @__PURE__ */ jsx48("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
8259
+ onPageChange == null ? void 0 : onPageChange(pagination.pageIndex + 1);
8260
+ }, [pagination.pageIndex, onPageChange]);
8261
+ const pageKey = useMemo3(
8262
+ () => `${pagination.pageIndex}-${pagination.pageSize}-${data.length}`,
8263
+ [pagination.pageIndex, pagination.pageSize, data.length]
8264
+ );
8265
+ return /* @__PURE__ */ jsxs23(
8266
+ "div",
8267
+ {
8268
+ className: cn(
8269
+ "relative w-full overflow-hidden rounded-xl border bg-background/60 backdrop-blur supports-backdrop-filter:bg-background/40 shadow-sm",
8270
+ "flex flex-col",
8271
+ heightClassName,
8272
+ className
8273
+ ),
8274
+ children: [
8275
+ /* @__PURE__ */ jsx48("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-full", children: [
8297
8276
  /* @__PURE__ */ jsxs23(
8298
- Select2,
8277
+ Table,
8299
8278
  {
8300
- value: `${pagination.pageSize}`,
8301
- onValueChange: (value) => {
8302
- const newSize = Number(value);
8303
- setPagination(__spreadProps(__spreadValues({}, pagination), {
8304
- pageSize: newSize,
8305
- pageIndex: 0
8306
- }));
8307
- if (onPageSizeChange) onPageSizeChange(newSize);
8308
- },
8279
+ containerClassName: "overflow-visible",
8280
+ className: cn("w-full", tableClassName),
8309
8281
  children: [
8310
- /* @__PURE__ */ jsx48(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: pagination.pageSize }) }),
8311
- /* @__PURE__ */ jsx48(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx48(SelectItem, { value: `${size}`, children: size }, size)) })
8282
+ /* @__PURE__ */ jsx48(
8283
+ TableHeader,
8284
+ {
8285
+ className: cn(
8286
+ headerClassName,
8287
+ stickyHeader ? "sticky top-0 z-10 bg-background/80 backdrop-blur border-b" : ""
8288
+ ),
8289
+ children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx48(TableRow, { className: cn("hover:bg-transparent", rowClassName), children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx48(TableHead, { className: cn("whitespace-nowrap", headerClassName), children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id))
8290
+ }
8291
+ ),
8292
+ animate ? /* @__PURE__ */ jsx48(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx48(
8293
+ motion2.tbody,
8294
+ {
8295
+ className: cn("[&_tr:last-child]:border-0", bodyClassName),
8296
+ initial: { opacity: 0, y: 6 },
8297
+ animate: { opacity: 1, y: 0 },
8298
+ exit: { opacity: 0, y: -6 },
8299
+ transition: { duration: 0.18 },
8300
+ children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8301
+ TableRow,
8302
+ {
8303
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8304
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8305
+ className: cn(
8306
+ rowClassName,
8307
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8308
+ ),
8309
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cellClassName, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8310
+ },
8311
+ row.id
8312
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) })
8313
+ },
8314
+ pageKey
8315
+ ) }) : /* @__PURE__ */ jsx48(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8316
+ TableRow,
8317
+ {
8318
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8319
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8320
+ className: cn(
8321
+ rowClassName,
8322
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8323
+ ),
8324
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cn(cellClassName), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8325
+ },
8326
+ row.id
8327
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(TableCell, { colSpan: columns.length, className: "h-28 text-center text-muted-foreground", children: "No results." }) }) })
8312
8328
  ]
8313
8329
  }
8314
- )
8315
- ] }),
8316
- /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8317
- /* @__PURE__ */ jsxs23("div", { className: "flex w-[110px] items-center justify-center text-sm font-medium", children: [
8318
- pageLabel,
8319
- " ",
8320
- pagination.pageIndex + 1,
8321
- " ",
8322
- ofLabel,
8323
- " ",
8324
- pageCount
8325
- ] }),
8326
- /* @__PURE__ */ jsx48(
8327
- Button,
8328
- {
8329
- "aria-label": "Go to first page",
8330
- variant: "outline",
8331
- className: "hidden h-8 w-8 p-0 lg:flex",
8332
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: 0 })),
8333
- disabled: pagination.pageIndex === 0,
8334
- children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
8335
- }
8336
8330
  ),
8337
- /* @__PURE__ */ jsx48(
8338
- Button,
8339
- {
8340
- "aria-label": "Go to previous page",
8341
- variant: "outline",
8342
- className: "h-8 w-8 p-0",
8343
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
8344
- pageIndex: pagination.pageIndex - 1
8345
- })),
8346
- disabled: pagination.pageIndex === 0,
8347
- children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
8348
- }
8349
- ),
8350
- /* @__PURE__ */ jsx48(
8351
- Button,
8352
- {
8353
- "aria-label": "Go to next page",
8354
- variant: "outline",
8355
- className: "h-8 w-8 p-0",
8356
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), {
8357
- pageIndex: pagination.pageIndex + 1
8358
- })),
8359
- disabled: pagination.pageIndex + 1 >= pageCount,
8360
- children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
8361
- }
8362
- ),
8363
- /* @__PURE__ */ jsx48(
8364
- Button,
8365
- {
8366
- "aria-label": "Go to last page",
8367
- variant: "outline",
8368
- className: "hidden h-8 w-8 p-0 lg:flex",
8369
- onClick: () => setPagination(__spreadProps(__spreadValues({}, pagination), { pageIndex: pageCount - 1 })),
8370
- disabled: pagination.pageIndex + 1 >= pageCount,
8371
- children: /* @__PURE__ */ jsx48(DoubleArrowRightIcon, { className: "h-4 w-4" })
8372
- }
8373
- )
8374
- ] })
8375
- ] })
8376
- ] })
8377
- ] });
8331
+ /* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
8332
+ ] }) }),
8333
+ /* @__PURE__ */ jsx48("div", { className: "border-t bg-background/70 backdrop-blur supports-backdrop-filter:bg-background/50", children: /* @__PURE__ */ jsx48("div", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs23("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-center", children: [
8334
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
8335
+ isRowsSelected && /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground text-sm", children: [
8336
+ table.getFilteredSelectedRowModel().rows.length,
8337
+ " ",
8338
+ ofLabel,
8339
+ " ",
8340
+ table.getFilteredRowModel().rows.length,
8341
+ " ",
8342
+ rowsSelectedLabel
8343
+ ] }),
8344
+ typeof totalRows === "number" && /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
8345
+ "Total: ",
8346
+ totalRows,
8347
+ " registros"
8348
+ ] })
8349
+ ] }),
8350
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
8351
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8352
+ /* @__PURE__ */ jsx48("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
8353
+ /* @__PURE__ */ jsxs23(
8354
+ Select2,
8355
+ {
8356
+ value: `${pagination.pageSize}`,
8357
+ onValueChange: (value) => {
8358
+ const newSize = Number(value);
8359
+ setPagination((p) => __spreadProps(__spreadValues({}, p), { pageSize: newSize, pageIndex: 0 }));
8360
+ onPageSizeChange == null ? void 0 : onPageSizeChange(newSize);
8361
+ onPageChange == null ? void 0 : onPageChange(1);
8362
+ },
8363
+ children: [
8364
+ /* @__PURE__ */ jsx48(SelectTrigger, { className: "h-8 w-21", children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: pagination.pageSize }) }),
8365
+ /* @__PURE__ */ jsx48(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx48(SelectItem, { value: `${size}`, children: size }, size)) })
8366
+ ]
8367
+ }
8368
+ )
8369
+ ] }),
8370
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8371
+ /* @__PURE__ */ jsxs23("div", { className: "hidden sm:flex min-w-35 items-center justify-center text-sm font-medium", children: [
8372
+ pageLabel,
8373
+ " ",
8374
+ pagination.pageIndex + 1,
8375
+ " ",
8376
+ ofLabel,
8377
+ " ",
8378
+ safePageCount
8379
+ ] }),
8380
+ /* @__PURE__ */ jsx48(
8381
+ Button,
8382
+ {
8383
+ "aria-label": "Go to first page",
8384
+ variant: "outline",
8385
+ className: "hidden h-8 w-8 p-0 lg:flex",
8386
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: 0 })),
8387
+ disabled: pagination.pageIndex === 0,
8388
+ children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
8389
+ }
8390
+ ),
8391
+ /* @__PURE__ */ jsx48(
8392
+ Button,
8393
+ {
8394
+ "aria-label": "Go to previous page",
8395
+ variant: "outline",
8396
+ className: "h-8 w-8 p-0",
8397
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: Math.max(p.pageIndex - 1, 0) })),
8398
+ disabled: pagination.pageIndex === 0,
8399
+ children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
8400
+ }
8401
+ ),
8402
+ /* @__PURE__ */ jsx48(
8403
+ Button,
8404
+ {
8405
+ "aria-label": "Go to next page",
8406
+ variant: "outline",
8407
+ className: "h-8 w-8 p-0",
8408
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), {
8409
+ pageIndex: Math.min(p.pageIndex + 1, safePageCount - 1)
8410
+ })),
8411
+ disabled: pagination.pageIndex + 1 >= safePageCount,
8412
+ children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
8413
+ }
8414
+ ),
8415
+ /* @__PURE__ */ jsx48(
8416
+ Button,
8417
+ {
8418
+ "aria-label": "Go to last page",
8419
+ variant: "outline",
8420
+ className: "hidden h-8 w-8 p-0 lg:flex",
8421
+ onClick: () => setPagination((p) => __spreadProps(__spreadValues({}, p), { pageIndex: safePageCount - 1 })),
8422
+ disabled: pagination.pageIndex + 1 >= safePageCount,
8423
+ children: /* @__PURE__ */ jsx48(DoubleArrowRightIcon, { className: "h-4 w-4" })
8424
+ }
8425
+ )
8426
+ ] }),
8427
+ /* @__PURE__ */ jsxs23("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
8428
+ pageLabel,
8429
+ " ",
8430
+ pagination.pageIndex + 1,
8431
+ " ",
8432
+ ofLabel,
8433
+ " ",
8434
+ safePageCount
8435
+ ] })
8436
+ ] })
8437
+ ] }) }) })
8438
+ ]
8439
+ }
8440
+ );
8378
8441
  }
8379
8442
 
8380
8443
  // src/shared/data-table-skeleton.tsx
@@ -8389,10 +8452,10 @@ function DataTableSkeleton({
8389
8452
  return /* @__PURE__ */ jsxs24("div", { className: "w-full space-y-3 overflow-auto", children: [
8390
8453
  /* @__PURE__ */ jsxs24("div", { className: "flex w-full items-center justify-between space-x-2 overflow-auto p-1", children: [
8391
8454
  /* @__PURE__ */ jsxs24("div", { className: "flex flex-1 items-center space-x-2 space-y-4", children: [
8392
- searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-[150px] lg:w-[250px]" }, i)) : null,
8393
- filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-[70px] border-dashed" }, i)) : null
8455
+ searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-37.5 lg:w-62.5" }, i)) : null,
8456
+ filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-17.5 border-dashed" }, i)) : null
8394
8457
  ] }),
8395
- showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-[70px] lg:flex" }) : null
8458
+ showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-17.5 lg:flex" }) : null
8396
8459
  ] }),
8397
8460
  /* @__PURE__ */ jsx49("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs24(Table, { children: [
8398
8461
  /* @__PURE__ */ jsx49(TableHeader, { children: Array.from({ length: 1 }).map((_, i) => /* @__PURE__ */ jsx49(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnCount }).map((_2, i2) => /* @__PURE__ */ jsx49(TableHead, { children: /* @__PURE__ */ jsx49(Skeleton, { className: "h-6 w-full" }) }, i2)) }, i)) }),
@@ -8403,9 +8466,9 @@ function DataTableSkeleton({
8403
8466
  /* @__PURE__ */ jsxs24("div", { className: "flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8", children: [
8404
8467
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
8405
8468
  /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-24" }),
8406
- /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-[70px]" })
8469
+ /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-17.5" })
8407
8470
  ] }),
8408
- /* @__PURE__ */ jsx49("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-20" }) }),
8471
+ /* @__PURE__ */ jsx49("div", { className: "flex w-25 items-center justify-center text-sm font-medium", children: /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-20" }) }),
8409
8472
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
8410
8473
  /* @__PURE__ */ jsx49(Skeleton, { className: "hidden size-8 lg:block" }),
8411
8474
  /* @__PURE__ */ jsx49(Skeleton, { className: "size-8" }),
package/dist/style.css CHANGED
@@ -545,8 +545,8 @@
545
545
  .h-12 {
546
546
  height: calc(var(--spacing) * 12);
547
547
  }
548
- .h-24 {
549
- height: calc(var(--spacing) * 24);
548
+ .h-28 {
549
+ height: calc(var(--spacing) * 28);
550
550
  }
551
551
  .h-36 {
552
552
  height: calc(var(--spacing) * 36);
@@ -554,8 +554,8 @@
554
554
  .h-\[1px\] {
555
555
  height: 1px;
556
556
  }
557
- .h-\[calc\(80vh-220px\)\] {
558
- height: calc(80vh - 220px);
557
+ .h-\[clamp\(22rem\,80vh\,44rem\)\] {
558
+ height: clamp(22rem, 80vh, 44rem);
559
559
  }
560
560
  .h-\[var\(--radix-navigation-menu-viewport-height\)\] {
561
561
  height: var(--radix-navigation-menu-viewport-height);
@@ -578,6 +578,9 @@
578
578
  .max-h-screen {
579
579
  max-height: 100vh;
580
580
  }
581
+ .min-h-0 {
582
+ min-height: calc(var(--spacing) * 0);
583
+ }
581
584
  .min-h-\[60px\] {
582
585
  min-height: 60px;
583
586
  }
@@ -611,15 +614,27 @@
611
614
  .w-10 {
612
615
  width: calc(var(--spacing) * 10);
613
616
  }
617
+ .w-17\.5 {
618
+ width: calc(var(--spacing) * 17.5);
619
+ }
614
620
  .w-20 {
615
621
  width: calc(var(--spacing) * 20);
616
622
  }
623
+ .w-21 {
624
+ width: calc(var(--spacing) * 21);
625
+ }
617
626
  .w-24 {
618
627
  width: calc(var(--spacing) * 24);
619
628
  }
629
+ .w-25 {
630
+ width: calc(var(--spacing) * 25);
631
+ }
620
632
  .w-36 {
621
633
  width: calc(var(--spacing) * 36);
622
634
  }
635
+ .w-37\.5 {
636
+ width: calc(var(--spacing) * 37.5);
637
+ }
623
638
  .w-40 {
624
639
  width: calc(var(--spacing) * 40);
625
640
  }
@@ -632,18 +647,9 @@
632
647
  .w-\[1px\] {
633
648
  width: 1px;
634
649
  }
635
- .w-\[70px\] {
636
- width: 70px;
637
- }
638
650
  .w-\[100px\] {
639
651
  width: 100px;
640
652
  }
641
- .w-\[110px\] {
642
- width: 110px;
643
- }
644
- .w-\[150px\] {
645
- width: 150px;
646
- }
647
653
  .w-full {
648
654
  width: 100%;
649
655
  }
@@ -670,6 +676,9 @@
670
676
  .min-w-32 {
671
677
  min-width: calc(var(--spacing) * 32);
672
678
  }
679
+ .min-w-35 {
680
+ min-width: calc(var(--spacing) * 35);
681
+ }
673
682
  .min-w-\[8rem\] {
674
683
  min-width: 8rem;
675
684
  }
@@ -740,6 +749,9 @@
740
749
  .list-none {
741
750
  list-style-type: none;
742
751
  }
752
+ .grid-cols-1 {
753
+ grid-template-columns: repeat(1, minmax(0, 1fr));
754
+ }
743
755
  .flex-col {
744
756
  flex-direction: column;
745
757
  }
@@ -820,6 +832,10 @@
820
832
  margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
821
833
  }
822
834
  }
835
+ .gap-x-3 {
836
+ -moz-column-gap: calc(var(--spacing) * 3);
837
+ column-gap: calc(var(--spacing) * 3);
838
+ }
823
839
  .space-x-1 {
824
840
  :where(& > :not(:last-child)) {
825
841
  --tw-space-x-reverse: 0;
@@ -834,6 +850,9 @@
834
850
  margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
835
851
  }
836
852
  }
853
+ .gap-y-1 {
854
+ row-gap: calc(var(--spacing) * 1);
855
+ }
837
856
  .self-center {
838
857
  align-self: center;
839
858
  }
@@ -843,6 +862,9 @@
843
862
  .overflow-hidden {
844
863
  overflow: hidden;
845
864
  }
865
+ .overflow-visible {
866
+ overflow: visible;
867
+ }
846
868
  .overflow-x-hidden {
847
869
  overflow-x: hidden;
848
870
  }
@@ -958,6 +980,24 @@
958
980
  .bg-background {
959
981
  background-color: var(--background);
960
982
  }
983
+ .bg-background\/60 {
984
+ background-color: var(--background);
985
+ @supports (color: color-mix(in lab, red, red)) {
986
+ background-color: color-mix(in oklab, var(--background) 60%, transparent);
987
+ }
988
+ }
989
+ .bg-background\/70 {
990
+ background-color: var(--background);
991
+ @supports (color: color-mix(in lab, red, red)) {
992
+ background-color: color-mix(in oklab, var(--background) 70%, transparent);
993
+ }
994
+ }
995
+ .bg-background\/80 {
996
+ background-color: var(--background);
997
+ @supports (color: color-mix(in lab, red, red)) {
998
+ background-color: color-mix(in oklab, var(--background) 80%, transparent);
999
+ }
1000
+ }
961
1001
  .bg-black\/80 {
962
1002
  background-color: color-mix(in srgb, #000 80%, transparent);
963
1003
  @supports (color: color-mix(in lab, red, red)) {
@@ -1747,6 +1787,16 @@
1747
1787
  }
1748
1788
  }
1749
1789
  }
1790
+ .hover\:bg-muted\/60 {
1791
+ &:hover {
1792
+ @media (hover: hover) {
1793
+ background-color: var(--muted);
1794
+ @supports (color: color-mix(in lab, red, red)) {
1795
+ background-color: color-mix(in oklab, var(--muted) 60%, transparent);
1796
+ }
1797
+ }
1798
+ }
1799
+ }
1750
1800
  .hover\:bg-primary {
1751
1801
  &:hover {
1752
1802
  @media (hover: hover) {
@@ -2094,6 +2144,14 @@
2094
2144
  scale: var(--tw-scale-x) var(--tw-scale-y);
2095
2145
  }
2096
2146
  }
2147
+ .active\:bg-muted\/80 {
2148
+ &:active {
2149
+ background-color: var(--muted);
2150
+ @supports (color: color-mix(in lab, red, red)) {
2151
+ background-color: color-mix(in oklab, var(--muted) 80%, transparent);
2152
+ }
2153
+ }
2154
+ }
2097
2155
  .disabled\:pointer-events-none {
2098
2156
  &:disabled {
2099
2157
  pointer-events: none;
@@ -2629,6 +2687,22 @@
2629
2687
  transition-property: none;
2630
2688
  }
2631
2689
  }
2690
+ .supports-backdrop-filter\:bg-background\/40 {
2691
+ @supports (backdrop-filter: var(--tw)) {
2692
+ background-color: var(--background);
2693
+ @supports (color: color-mix(in lab, red, red)) {
2694
+ background-color: color-mix(in oklab, var(--background) 40%, transparent);
2695
+ }
2696
+ }
2697
+ }
2698
+ .supports-backdrop-filter\:bg-background\/50 {
2699
+ @supports (backdrop-filter: var(--tw)) {
2700
+ background-color: var(--background);
2701
+ @supports (color: color-mix(in lab, red, red)) {
2702
+ background-color: color-mix(in oklab, var(--background) 50%, transparent);
2703
+ }
2704
+ }
2705
+ }
2632
2706
  .supports-\[backdrop-filter\]\:bg-popover\/60 {
2633
2707
  @supports (backdrop-filter: var(--tw)) {
2634
2708
  background-color: var(--popover);
@@ -2637,6 +2711,11 @@
2637
2711
  }
2638
2712
  }
2639
2713
  }
2714
+ .supports-\[height\:100dvh\]\:h-\[clamp\(22rem\,80dvh\,44rem\)\] {
2715
+ @supports (height:100dvh) {
2716
+ height: clamp(22rem, 80dvh, 44rem);
2717
+ }
2718
+ }
2640
2719
  .sm\:top-auto {
2641
2720
  @media (width >= 40rem) {
2642
2721
  top: auto;
@@ -2657,11 +2736,26 @@
2657
2736
  margin-top: calc(var(--spacing) * 0);
2658
2737
  }
2659
2738
  }
2739
+ .sm\:flex {
2740
+ @media (width >= 40rem) {
2741
+ display: flex;
2742
+ }
2743
+ }
2744
+ .sm\:hidden {
2745
+ @media (width >= 40rem) {
2746
+ display: none;
2747
+ }
2748
+ }
2660
2749
  .sm\:max-w-sm {
2661
2750
  @media (width >= 40rem) {
2662
2751
  max-width: var(--container-sm);
2663
2752
  }
2664
2753
  }
2754
+ .sm\:grid-cols-\[1fr_auto\] {
2755
+ @media (width >= 40rem) {
2756
+ grid-template-columns: 1fr auto;
2757
+ }
2758
+ }
2665
2759
  .sm\:flex-col {
2666
2760
  @media (width >= 40rem) {
2667
2761
  flex-direction: column;
@@ -2677,11 +2771,6 @@
2677
2771
  align-items: center;
2678
2772
  }
2679
2773
  }
2680
- .sm\:justify-between {
2681
- @media (width >= 40rem) {
2682
- justify-content: space-between;
2683
- }
2684
- }
2685
2774
  .sm\:justify-end {
2686
2775
  @media (width >= 40rem) {
2687
2776
  justify-content: flex-end;
@@ -2757,11 +2846,6 @@
2757
2846
  position: absolute;
2758
2847
  }
2759
2848
  }
2760
- .md\:h-\[calc\(80dvh-80px\)\] {
2761
- @media (width >= 48rem) {
2762
- height: calc(80dvh - 80px);
2763
- }
2764
- }
2765
2849
  .md\:w-\[var\(--radix-navigation-menu-viewport-width\)\] {
2766
2850
  @media (width >= 48rem) {
2767
2851
  width: var(--radix-navigation-menu-viewport-width);
@@ -2792,9 +2876,9 @@
2792
2876
  display: flex;
2793
2877
  }
2794
2878
  }
2795
- .lg\:w-\[250px\] {
2879
+ .lg\:w-62\.5 {
2796
2880
  @media (width >= 64rem) {
2797
- width: 250px;
2881
+ width: calc(var(--spacing) * 62.5);
2798
2882
  }
2799
2883
  }
2800
2884
  .lg\:gap-8 {
@@ -2960,10 +3044,12 @@
2960
3044
  padding-right: calc(var(--spacing) * 0);
2961
3045
  }
2962
3046
  }
2963
- .\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\] {
2964
- & > [role=checkbox] {
2965
- --tw-translate-y: 2px;
2966
- translate: var(--tw-translate-x) var(--tw-translate-y);
3047
+ .\*\:\[\[role\=checkbox\]\]\:translate-y-0\.5 {
3048
+ :is(& > *) {
3049
+ &:is([role=checkbox]) {
3050
+ --tw-translate-y: calc(var(--spacing) * 0.5);
3051
+ translate: var(--tw-translate-x) var(--tw-translate-y);
3052
+ }
2967
3053
  }
2968
3054
  }
2969
3055
  .\[\&\>span\]\:line-clamp-1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadcn-ui-react",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "author": "Bleker Cordova <bleker@gliyen.com>",
6
6
  "description": "A collection of components for building beautiful and accessible user interfaces with React and Tailwind CSS.",
@@ -46,8 +46,8 @@
46
46
  "test:watch": "jest --watch"
47
47
  },
48
48
  "devDependencies": {
49
- "@babel/core": "^7.28.5",
50
- "@babel/preset-env": "^7.28.5",
49
+ "@babel/core": "^7.28.6",
50
+ "@babel/preset-env": "^7.28.6",
51
51
  "@babel/preset-react": "^7.28.5",
52
52
  "@babel/preset-typescript": "^7.28.5",
53
53
  "@eslint/config-array": "^0.23.0",
@@ -57,14 +57,14 @@
57
57
  "@tailwindcss/vite": "^4.1.18",
58
58
  "@testing-library/dom": "^10.4.1",
59
59
  "@testing-library/jest-dom": "^6.9.1",
60
- "@testing-library/react": "^16.3.1",
60
+ "@testing-library/react": "^16.3.2",
61
61
  "@testing-library/user-event": "^14.6.1",
62
62
  "@types/jest": "^30.0.0",
63
- "@types/node": "^25.0.6",
64
- "@types/react": "^19.2.8",
63
+ "@types/node": "^25.0.9",
64
+ "@types/react": "^19.2.9",
65
65
  "@types/react-dom": "^19.2.3",
66
- "@typescript-eslint/eslint-plugin": "^8.52.0",
67
- "@typescript-eslint/parser": "^8.52.0",
66
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
67
+ "@typescript-eslint/parser": "^8.53.1",
68
68
  "autoprefixer": "^10.4.23",
69
69
  "babel-jest": "^30.2.0",
70
70
  "cross-env": "^10.1.0",
@@ -132,14 +132,14 @@
132
132
  "clsx": "^2.1.1",
133
133
  "cmdk": "^1.1.1",
134
134
  "embla-carousel-react": "^8.6.0",
135
- "framer-motion": "^12.25.0",
135
+ "framer-motion": "^12.27.5",
136
136
  "input-otp": "^1.4.2",
137
137
  "lucide-react": "^0.562.0",
138
138
  "next-themes": "^0.4.6",
139
139
  "react-dropzone": "^14.3.8",
140
140
  "react-helmet-next": "^0.0.2",
141
- "react-hook-form": "^7.70.0",
142
- "react-resizable-panels": "^4.3.3",
141
+ "react-hook-form": "^7.71.1",
142
+ "react-resizable-panels": "^4.4.1",
143
143
  "sonner": "^2.0.7",
144
144
  "tailwind-merge": "^3.4.0",
145
145
  "tailwind-variants": "^3.2.2",