shadcn-ui-react 0.5.1 → 0.5.3

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
@@ -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,16 +8182,13 @@ 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 { 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,
8191
8191
  getFilteredRowModel,
8192
- getPaginationRowModel,
8193
8192
  useReactTable
8194
8193
  } from "@tanstack/react-table";
8195
8194
  import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
@@ -8216,165 +8215,252 @@ function DataTable({
8216
8215
  tableClassName,
8217
8216
  onPageChange,
8218
8217
  onClick,
8219
- onPageSizeChange
8218
+ onPageSizeChange,
8219
+ animate = true,
8220
+ stickyHeader = true,
8221
+ heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
8220
8222
  }) {
8221
- const [pagination, setPagination] = React67.useState({
8222
- pageIndex: Math.max(page - 1, 0),
8223
- pageSize: perPage
8224
- });
8223
+ const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
8224
+ const pageIndex = Math.min(Math.max(page - 1, 0), safePageCount - 1);
8225
+ const pageSize = Math.max(perPage, 1);
8226
+ const paginationState = useMemo3(
8227
+ () => ({ pageIndex, pageSize }),
8228
+ [pageIndex, pageSize]
8229
+ );
8225
8230
  const table = useReactTable({
8226
8231
  data,
8227
8232
  columns,
8228
- pageCount,
8233
+ pageCount: safePageCount,
8234
+ state: { pagination: paginationState },
8229
8235
  getCoreRowModel: getCoreRowModel(),
8230
8236
  getFilteredRowModel: getFilteredRowModel(),
8231
- state: { pagination },
8232
- onPaginationChange: setPagination,
8233
- getPaginationRowModel: getPaginationRowModel(),
8234
8237
  manualPagination: true,
8235
- manualFiltering: true
8238
+ manualFiltering: true,
8239
+ autoResetAll: false,
8240
+ autoResetPageIndex: false
8236
8241
  });
8237
- const onClickItem = (row) => {
8238
- if (onClick) {
8239
- onClick(row);
8240
- }
8242
+ const clickable = !!onClick;
8243
+ const pageKey = useMemo3(
8244
+ () => `${pageIndex}-${pageSize}-${data.length}`,
8245
+ [pageIndex, pageSize, data.length]
8246
+ );
8247
+ const goToPage = (nextPageIndex) => {
8248
+ const clamped = Math.min(Math.max(nextPageIndex, 0), safePageCount - 1);
8249
+ if (clamped === pageIndex) return;
8250
+ onPageChange == null ? void 0 : onPageChange(clamped + 1);
8241
8251
  };
8242
- 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 }),
8252
+ const changePageSize = (newSize) => {
8253
+ const size = Math.max(Number(newSize) || 1, 1);
8254
+ if (size === pageSize) return;
8255
+ onPageSizeChange == null ? void 0 : onPageSizeChange(size);
8256
+ onPageChange == null ? void 0 : onPageChange(1);
8257
+ };
8258
+ return /* @__PURE__ */ jsxs23(
8259
+ "div",
8260
+ {
8261
+ className: cn(
8262
+ "relative w-full overflow-hidden rounded-xl border bg-background/60 backdrop-blur supports-backdrop-filter:bg-background/40 shadow-sm",
8263
+ "flex flex-col",
8264
+ heightClassName,
8265
+ className
8266
+ ),
8267
+ children: [
8268
+ /* @__PURE__ */ jsx48("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-full", children: [
8297
8269
  /* @__PURE__ */ jsxs23(
8298
- Select2,
8270
+ Table,
8299
8271
  {
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
- },
8272
+ containerClassName: "overflow-visible",
8273
+ className: cn("w-full", tableClassName),
8309
8274
  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)) })
8275
+ /* @__PURE__ */ jsx48(
8276
+ TableHeader,
8277
+ {
8278
+ className: cn(
8279
+ stickyHeader ? "sticky top-0 z-10 bg-background/80 backdrop-blur border-b" : "",
8280
+ headerClassName
8281
+ ),
8282
+ children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx48(
8283
+ TableRow,
8284
+ {
8285
+ className: cn("hover:bg-transparent", rowClassName),
8286
+ children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx48(
8287
+ TableHead,
8288
+ {
8289
+ className: cn("whitespace-nowrap", headerClassName),
8290
+ children: header.isPlaceholder ? null : flexRender(
8291
+ header.column.columnDef.header,
8292
+ header.getContext()
8293
+ )
8294
+ },
8295
+ header.id
8296
+ ))
8297
+ },
8298
+ headerGroup.id
8299
+ ))
8300
+ }
8301
+ ),
8302
+ animate ? /* @__PURE__ */ jsx48(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx48(
8303
+ motion2.tbody,
8304
+ {
8305
+ className: cn("[&_tr:last-child]:border-0", bodyClassName),
8306
+ initial: { opacity: 0, y: 6 },
8307
+ animate: { opacity: 1, y: 0 },
8308
+ exit: { opacity: 0, y: -6 },
8309
+ transition: { duration: 0.18 },
8310
+ children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8311
+ TableRow,
8312
+ {
8313
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8314
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8315
+ className: cn(
8316
+ rowClassName,
8317
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8318
+ ),
8319
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cellClassName, children: flexRender(
8320
+ cell.column.columnDef.cell,
8321
+ cell.getContext()
8322
+ ) }, cell.id))
8323
+ },
8324
+ row.id
8325
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(
8326
+ TableCell,
8327
+ {
8328
+ colSpan: columns.length,
8329
+ className: "h-28 text-center text-muted-foreground",
8330
+ children: "No results."
8331
+ }
8332
+ ) })
8333
+ },
8334
+ pageKey
8335
+ ) }) : /* @__PURE__ */ jsx48(TableBody, { className: bodyClassName, children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8336
+ TableRow,
8337
+ {
8338
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8339
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8340
+ className: cn(
8341
+ rowClassName,
8342
+ clickable ? "cursor-pointer hover:bg-muted/60 active:bg-muted/80" : ""
8343
+ ),
8344
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cn(cellClassName), children: flexRender(
8345
+ cell.column.columnDef.cell,
8346
+ cell.getContext()
8347
+ ) }, cell.id))
8348
+ },
8349
+ row.id
8350
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(
8351
+ TableCell,
8352
+ {
8353
+ colSpan: columns.length,
8354
+ className: "h-28 text-center text-muted-foreground",
8355
+ children: "No results."
8356
+ }
8357
+ ) }) })
8312
8358
  ]
8313
8359
  }
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
- ),
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
8360
  ),
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
- ] });
8361
+ /* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
8362
+ ] }) }),
8363
+ /* @__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: [
8364
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
8365
+ isRowsSelected && /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground text-sm", children: [
8366
+ table.getFilteredSelectedRowModel().rows.length,
8367
+ " ",
8368
+ ofLabel,
8369
+ " ",
8370
+ table.getFilteredRowModel().rows.length,
8371
+ " ",
8372
+ rowsSelectedLabel
8373
+ ] }),
8374
+ typeof totalRows === "number" && /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
8375
+ "Total: ",
8376
+ totalRows,
8377
+ " registros"
8378
+ ] })
8379
+ ] }),
8380
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
8381
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8382
+ /* @__PURE__ */ jsx48("p", { className: "text-sm font-medium whitespace-nowrap", children: rowPerPageLabel }),
8383
+ /* @__PURE__ */ jsxs23(
8384
+ Select2,
8385
+ {
8386
+ value: `${pageSize}`,
8387
+ onValueChange: (value) => changePageSize(Number(value)),
8388
+ children: [
8389
+ /* @__PURE__ */ jsx48(SelectTrigger, { className: "h-8 w-21", children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: pageSize }) }),
8390
+ /* @__PURE__ */ jsx48(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx48(SelectItem, { value: `${size}`, children: size }, size)) })
8391
+ ]
8392
+ }
8393
+ )
8394
+ ] }),
8395
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
8396
+ /* @__PURE__ */ jsxs23("div", { className: "hidden sm:flex min-w-35 items-center justify-center text-sm font-medium", children: [
8397
+ pageLabel,
8398
+ " ",
8399
+ pageIndex + 1,
8400
+ " ",
8401
+ ofLabel,
8402
+ " ",
8403
+ safePageCount
8404
+ ] }),
8405
+ /* @__PURE__ */ jsx48(
8406
+ Button,
8407
+ {
8408
+ "aria-label": "Go to first page",
8409
+ variant: "outline",
8410
+ className: "hidden h-8 w-8 p-0 lg:flex",
8411
+ onClick: () => goToPage(0),
8412
+ disabled: pageIndex === 0,
8413
+ children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
8414
+ }
8415
+ ),
8416
+ /* @__PURE__ */ jsx48(
8417
+ Button,
8418
+ {
8419
+ "aria-label": "Go to previous page",
8420
+ variant: "outline",
8421
+ className: "h-8 w-8 p-0",
8422
+ onClick: () => goToPage(pageIndex - 1),
8423
+ disabled: pageIndex === 0,
8424
+ children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
8425
+ }
8426
+ ),
8427
+ /* @__PURE__ */ jsx48(
8428
+ Button,
8429
+ {
8430
+ "aria-label": "Go to next page",
8431
+ variant: "outline",
8432
+ className: "h-8 w-8 p-0",
8433
+ onClick: () => goToPage(pageIndex + 1),
8434
+ disabled: pageIndex + 1 >= safePageCount,
8435
+ children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
8436
+ }
8437
+ ),
8438
+ /* @__PURE__ */ jsx48(
8439
+ Button,
8440
+ {
8441
+ "aria-label": "Go to last page",
8442
+ variant: "outline",
8443
+ className: "hidden h-8 w-8 p-0 lg:flex",
8444
+ onClick: () => goToPage(safePageCount - 1),
8445
+ disabled: pageIndex + 1 >= safePageCount,
8446
+ children: /* @__PURE__ */ jsx48(DoubleArrowRightIcon, { className: "h-4 w-4" })
8447
+ }
8448
+ )
8449
+ ] }),
8450
+ /* @__PURE__ */ jsxs23("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
8451
+ pageLabel,
8452
+ " ",
8453
+ pageIndex + 1,
8454
+ " ",
8455
+ ofLabel,
8456
+ " ",
8457
+ safePageCount
8458
+ ] })
8459
+ ] })
8460
+ ] }) }) })
8461
+ ]
8462
+ }
8463
+ );
8378
8464
  }
8379
8465
 
8380
8466
  // src/shared/data-table-skeleton.tsx
@@ -8389,10 +8475,10 @@ function DataTableSkeleton({
8389
8475
  return /* @__PURE__ */ jsxs24("div", { className: "w-full space-y-3 overflow-auto", children: [
8390
8476
  /* @__PURE__ */ jsxs24("div", { className: "flex w-full items-center justify-between space-x-2 overflow-auto p-1", children: [
8391
8477
  /* @__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
8478
+ searchableColumnCount > 0 ? Array.from({ length: searchableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-37.5 lg:w-62.5" }, i)) : null,
8479
+ filterableColumnCount > 0 ? Array.from({ length: filterableColumnCount }).map((_, i) => /* @__PURE__ */ jsx49(Skeleton, { className: "h-10 w-17.5 border-dashed" }, i)) : null
8394
8480
  ] }),
8395
- showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-[70px] lg:flex" }) : null
8481
+ showViewOptions ? /* @__PURE__ */ jsx49(Skeleton, { className: "ml-auto hidden h-7 w-17.5 lg:flex" }) : null
8396
8482
  ] }),
8397
8483
  /* @__PURE__ */ jsx49("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs24(Table, { children: [
8398
8484
  /* @__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 +8489,9 @@ function DataTableSkeleton({
8403
8489
  /* @__PURE__ */ jsxs24("div", { className: "flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8", children: [
8404
8490
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
8405
8491
  /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-24" }),
8406
- /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-[70px]" })
8492
+ /* @__PURE__ */ jsx49(Skeleton, { className: "h-8 w-17.5" })
8407
8493
  ] }),
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" }) }),
8494
+ /* @__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
8495
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center space-x-2", children: [
8410
8496
  /* @__PURE__ */ jsx49(Skeleton, { className: "hidden size-8 lg:block" }),
8411
8497
  /* @__PURE__ */ jsx49(Skeleton, { className: "size-8" }),
@@ -8420,7 +8506,7 @@ function DataTableSkeleton({
8420
8506
  // src/shared/fileupload.tsx
8421
8507
  import { AvatarIcon } from "@radix-ui/react-icons";
8422
8508
  import { CameraIcon } from "lucide-react";
8423
- import { useEffect as useEffect5, useState as useState5 } from "react";
8509
+ import { useEffect as useEffect4, useState as useState5 } from "react";
8424
8510
  import { useDropzone } from "react-dropzone";
8425
8511
  import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
8426
8512
  function FileUpload({
@@ -8459,7 +8545,7 @@ function FileUpload({
8459
8545
  }
8460
8546
  function ImagePreview({ file }) {
8461
8547
  const [objectUrl, setObjectUrl] = useState5(null);
8462
- useEffect5(() => {
8548
+ useEffect4(() => {
8463
8549
  const url = URL.createObjectURL(file);
8464
8550
  setObjectUrl(url);
8465
8551
  return () => {