shadcn-ui-react 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8182,17 +8182,223 @@ function Breadcrumbs({ items, className, classNameList }) {
8182
8182
  }
8183
8183
 
8184
8184
  // src/shared/data-table.tsx
8185
- import { useMemo as useMemo3 } from "react";
8185
+ import React67, { useMemo as useMemo3 } from "react";
8186
8186
  import { AnimatePresence, motion as motion2 } from "framer-motion";
8187
- import { DoubleArrowLeftIcon, DoubleArrowRightIcon } from "@radix-ui/react-icons";
8187
+ import {
8188
+ DoubleArrowLeftIcon,
8189
+ DoubleArrowRightIcon
8190
+ } from "@radix-ui/react-icons";
8188
8191
  import {
8189
8192
  flexRender,
8190
8193
  getCoreRowModel,
8191
8194
  getFilteredRowModel,
8192
8195
  useReactTable
8193
8196
  } from "@tanstack/react-table";
8194
- import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
8197
+ import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
8195
8198
  import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
8199
+ var TablePlain = React67.forwardRef((_a, ref) => {
8200
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
8201
+ return /* @__PURE__ */ jsx48(
8202
+ "table",
8203
+ __spreadValues({
8204
+ ref,
8205
+ className: cn("w-full caption-bottom text-sm", className)
8206
+ }, props)
8207
+ );
8208
+ });
8209
+ TablePlain.displayName = "TablePlain";
8210
+ var ACCENT_COLOR = {
8211
+ primary: "var(--primary)",
8212
+ emerald: "#10b981",
8213
+ indigo: "#6366f1",
8214
+ rose: "#f43f5e",
8215
+ amber: "#f59e0b",
8216
+ zinc: "#71717a"
8217
+ };
8218
+ function resolveAccent(accent, accentColor) {
8219
+ var _a;
8220
+ const custom = accentColor == null ? void 0 : accentColor.trim();
8221
+ if (custom) return custom;
8222
+ if (!accent) return void 0;
8223
+ return (_a = ACCENT_COLOR[accent]) != null ? _a : ACCENT_COLOR.primary;
8224
+ }
8225
+ var DATA_TABLE_TEMPLATES = {
8226
+ neo: {
8227
+ root: cn(
8228
+ "relative w-full overflow-hidden rounded-2xl border shadow-sm",
8229
+ "bg-background/70 supports-[backdrop-filter]:bg-background/45 backdrop-blur",
8230
+ "flex flex-col",
8231
+ "before:absolute before:inset-x-0 before:top-0 before:h-[2px] before:bg-transparent",
8232
+ "data-[accent=on]:before:bg-[color:var(--dt-accent)]"
8233
+ ),
8234
+ table: cn("w-full text-sm"),
8235
+ thead: "border-b",
8236
+ theadSticky: "sticky top-0 z-10 bg-background/85 supports-[backdrop-filter]:bg-background/60 backdrop-blur",
8237
+ trHead: "hover:bg-transparent",
8238
+ th: cn(
8239
+ "h-11 px-4 text-left align-middle whitespace-nowrap",
8240
+ "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground"
8241
+ ),
8242
+ tbody: cn(
8243
+ "[&_tr:last-child]:border-0",
8244
+ "[&>tr:nth-child(even)]:bg-muted/20"
8245
+ ),
8246
+ tr: cn(
8247
+ "border-b transition-colors",
8248
+ "data-[state=selected]:bg-muted/35",
8249
+ "data-[accent=on]:data-[state=selected]:bg-[color:var(--dt-accent)]/10"
8250
+ ),
8251
+ trClickable: cn(
8252
+ "cursor-pointer",
8253
+ "hover:bg-muted/35 active:bg-muted/45",
8254
+ "data-[accent=on]:hover:bg-[color:var(--dt-accent)]/8",
8255
+ "data-[accent=on]:active:bg-[color:var(--dt-accent)]/12"
8256
+ ),
8257
+ td: "px-4 py-3 align-middle",
8258
+ footer: cn(
8259
+ "border-t",
8260
+ "bg-background/80 supports-[backdrop-filter]:bg-background/55 backdrop-blur"
8261
+ ),
8262
+ footerInner: "px-4 py-3",
8263
+ metaWrap: "flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",
8264
+ controlsWrap: "flex flex-wrap items-center justify-between gap-3 sm:justify-end",
8265
+ pageSizeLabel: "text-sm font-medium whitespace-nowrap",
8266
+ pageSizeTrigger: cn(
8267
+ "h-8 w-[5rem]",
8268
+ "border-muted-foreground/20",
8269
+ "focus-visible:ring-2 focus-visible:ring-ring",
8270
+ "data-[accent=on]:focus-visible:ring-[color:var(--dt-accent)]/35"
8271
+ ),
8272
+ pageLabel: "hidden sm:flex min-w-[9.25rem] items-center justify-center text-sm font-medium",
8273
+ navButton: cn(
8274
+ "h-8 w-8 p-0 rounded-md",
8275
+ "border-muted-foreground/20",
8276
+ "hover:bg-muted/35 hover:border-muted-foreground/40",
8277
+ "focus-visible:ring-2 focus-visible:ring-ring",
8278
+ "data-[accent=on]:hover:border-[color:var(--dt-accent)]/45",
8279
+ "data-[accent=on]:hover:bg-[color:var(--dt-accent)]/10",
8280
+ "data-[accent=on]:focus-visible:ring-[color:var(--dt-accent)]/35"
8281
+ )
8282
+ },
8283
+ glass: {
8284
+ root: cn(
8285
+ "relative w-full overflow-hidden rounded-2xl border shadow-md",
8286
+ "bg-background/55 supports-[backdrop-filter]:bg-background/25 backdrop-blur-xl",
8287
+ "flex flex-col",
8288
+ "before:absolute before:inset-x-0 before:top-0 before:h-[2px] before:bg-transparent",
8289
+ "data-[accent=on]:before:bg-[color:var(--dt-accent)]"
8290
+ ),
8291
+ theadSticky: "sticky top-0 z-10 bg-background/70 supports-[backdrop-filter]:bg-background/35 backdrop-blur-xl",
8292
+ tbody: cn("[&_tr:last-child]:border-0", "[&>tr:nth-child(even)]:bg-background/20")
8293
+ },
8294
+ compact: {
8295
+ th: "h-10 px-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground whitespace-nowrap",
8296
+ td: "px-3 py-2 text-xs align-middle",
8297
+ pageSizeTrigger: "h-8 w-[4.5rem]"
8298
+ },
8299
+ minimal: {
8300
+ root: cn("relative w-full overflow-hidden rounded-xl border-0 shadow-none bg-transparent flex flex-col"),
8301
+ theadSticky: "sticky top-0 z-10 bg-background",
8302
+ footer: "border-t bg-transparent",
8303
+ tbody: "[&_tr:last-child]:border-0"
8304
+ },
8305
+ clean: {
8306
+ root: cn(
8307
+ "relative w-full overflow-hidden rounded-2xl border shadow-none",
8308
+ "bg-background flex flex-col",
8309
+ "before:absolute before:inset-x-0 before:top-0 before:h-[2px] before:bg-transparent",
8310
+ "data-[accent=on]:before:bg-[color:var(--dt-accent)]"
8311
+ ),
8312
+ theadSticky: "sticky top-0 z-10 bg-background",
8313
+ tbody: cn("[&_tr:last-child]:border-0", "[&>tr:nth-child(even)]:bg-transparent"),
8314
+ tr: cn(
8315
+ "border-b",
8316
+ "data-[state=selected]:bg-muted/35",
8317
+ "data-[accent=on]:data-[state=selected]:bg-[color:var(--dt-accent)]/10"
8318
+ ),
8319
+ trClickable: cn(
8320
+ "cursor-pointer",
8321
+ "hover:bg-muted/30 active:bg-muted/40",
8322
+ "data-[accent=on]:hover:bg-[color:var(--dt-accent)]/8",
8323
+ "data-[accent=on]:active:bg-[color:var(--dt-accent)]/12"
8324
+ )
8325
+ },
8326
+ elevated: {
8327
+ root: cn(
8328
+ "relative w-full overflow-hidden rounded-3xl border shadow-lg",
8329
+ "bg-card flex flex-col",
8330
+ "before:absolute before:inset-x-0 before:top-0 before:h-[2px] before:bg-transparent",
8331
+ "data-[accent=on]:before:bg-[color:var(--dt-accent)]"
8332
+ ),
8333
+ theadSticky: "sticky top-0 z-10 bg-card/95 supports-[backdrop-filter]:bg-card/75 backdrop-blur",
8334
+ tbody: cn("[&_tr:last-child]:border-0", "[&>tr:nth-child(even)]:bg-muted/10"),
8335
+ th: cn(
8336
+ "h-12 px-5 text-left align-middle whitespace-nowrap",
8337
+ "text-[11px] font-semibold uppercase tracking-wider text-muted-foreground"
8338
+ ),
8339
+ td: "px-5 py-3 align-middle"
8340
+ },
8341
+ grid: {
8342
+ root: cn("relative w-full overflow-hidden rounded-2xl border shadow-sm bg-background flex flex-col"),
8343
+ table: cn(
8344
+ "w-full text-sm border-separate border-spacing-0",
8345
+ "[&_th]:border-b [&_td]:border-b",
8346
+ "[&_th:not(:last-child)]:border-r [&_td:not(:last-child)]:border-r",
8347
+ "[&_th]:border-muted-foreground/15 [&_td]:border-muted-foreground/10"
8348
+ ),
8349
+ thead: "border-b-0",
8350
+ tbody: "[&_tr:last-child_td]:border-b-0",
8351
+ tr: cn(
8352
+ "transition-colors",
8353
+ "data-[state=selected]:bg-muted/35",
8354
+ "data-[accent=on]:data-[state=selected]:bg-[color:var(--dt-accent)]/10"
8355
+ ),
8356
+ trClickable: cn(
8357
+ "cursor-pointer",
8358
+ "hover:bg-muted/25 active:bg-muted/35",
8359
+ "data-[accent=on]:hover:bg-[color:var(--dt-accent)]/7",
8360
+ "data-[accent=on]:active:bg-[color:var(--dt-accent)]/10"
8361
+ )
8362
+ },
8363
+ cards: {
8364
+ root: cn("relative w-full overflow-hidden rounded-2xl border bg-transparent shadow-none flex flex-col"),
8365
+ table: cn(
8366
+ "w-full text-sm border-separate border-spacing-y-2",
8367
+ "[&_tbody_tr_td]:bg-background",
8368
+ "[&_tbody_tr_td:first-child]:rounded-l-xl",
8369
+ "[&_tbody_tr_td:last-child]:rounded-r-xl",
8370
+ "[&_tbody_tr_td]:shadow-sm",
8371
+ "[&_thead_tr]:border-b"
8372
+ ),
8373
+ theadSticky: "sticky top-0 z-10 bg-background",
8374
+ tr: cn(
8375
+ "border-0",
8376
+ "data-[state=selected]:opacity-100",
8377
+ "data-[state=selected]:[&_td]:ring-1 data-[state=selected]:[&_td]:ring-muted-foreground/15",
8378
+ "data-[accent=on]:data-[state=selected]:[&_td]:ring-[color:var(--dt-accent)]/25"
8379
+ ),
8380
+ trClickable: cn(
8381
+ "cursor-pointer",
8382
+ "[&_td]:transition-colors",
8383
+ "hover:[&_td]:bg-muted/25 active:[&_td]:bg-muted/35",
8384
+ "data-[accent=on]:hover:[&_td]:bg-[color:var(--dt-accent)]/7",
8385
+ "data-[accent=on]:active:[&_td]:bg-[color:var(--dt-accent)]/10"
8386
+ ),
8387
+ tbody: "[&_tr:last-child]:border-0"
8388
+ }
8389
+ };
8390
+ function mergeSlots(...parts) {
8391
+ const out = {};
8392
+ for (const p of parts) {
8393
+ if (!p) continue;
8394
+ for (const k of Object.keys(p)) {
8395
+ const v = p[k];
8396
+ if (!v) continue;
8397
+ out[k] = out[k] ? cn(out[k], v) : v;
8398
+ }
8399
+ }
8400
+ return out;
8401
+ }
8196
8402
  function DataTable({
8197
8403
  columns,
8198
8404
  data,
@@ -8206,18 +8412,17 @@ function DataTable({
8206
8412
  isRowsSelected = true,
8207
8413
  totalRows,
8208
8414
  rowsSelectedLabel = "row(s) selected",
8209
- className,
8415
+ template = "neo",
8416
+ classNames,
8417
+ accent = null,
8418
+ accentColor = null,
8210
8419
  emptyData,
8211
- bodyClassName,
8212
- cellClassName,
8213
- headerClassName,
8214
- rowClassName,
8215
- tableClassName,
8216
8420
  onPageChange,
8217
8421
  onClick,
8218
8422
  onPageSizeChange,
8219
8423
  animate = true,
8220
8424
  stickyHeader = true,
8425
+ headerScroll = false,
8221
8426
  heightClassName = "h-[clamp(22rem,80vh,44rem)] supports-[height:100dvh]:h-[clamp(22rem,80dvh,44rem)]"
8222
8427
  }) {
8223
8428
  const safePageCount = Math.max(pageCount != null ? pageCount : 1, 1);
@@ -8255,114 +8460,90 @@ function DataTable({
8255
8460
  onPageSizeChange == null ? void 0 : onPageSizeChange(size);
8256
8461
  onPageChange == null ? void 0 : onPageChange(1);
8257
8462
  };
8463
+ const ui = useMemo3(() => {
8464
+ var _a;
8465
+ const builtIn = (_a = DATA_TABLE_TEMPLATES[template]) != null ? _a : DATA_TABLE_TEMPLATES.neo;
8466
+ return mergeSlots(DATA_TABLE_TEMPLATES.neo, builtIn, classNames);
8467
+ }, [template, classNames]);
8468
+ const dtAccent = resolveAccent(accent, accentColor);
8469
+ const accentOn = !!dtAccent;
8470
+ const dataAccent = accentOn ? "on" : "off";
8471
+ const headerIsSticky = stickyHeader && !headerScroll;
8258
8472
  return /* @__PURE__ */ jsxs23(
8259
8473
  "div",
8260
8474
  {
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
- ),
8475
+ "data-accent": dataAccent,
8476
+ className: cn(ui.root, heightClassName),
8477
+ style: accentOn ? { "--dt-accent": dtAccent } : void 0,
8267
8478
  children: [
8268
- /* @__PURE__ */ jsx48("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-full", children: [
8269
- /* @__PURE__ */ jsxs23(
8270
- Table,
8271
- {
8272
- containerClassName: "overflow-visible",
8273
- className: cn("w-full", tableClassName),
8274
- children: [
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
- }
8479
+ /* @__PURE__ */ jsx48("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxs23(ScrollArea, { className: "h-full", children: [
8480
+ /* @__PURE__ */ jsx48("div", { className: "relative min-w-full w-max", children: /* @__PURE__ */ jsxs23(TablePlain, { className: cn(ui.table), children: [
8481
+ /* @__PURE__ */ jsx48(TableHeader, { className: cn(ui.thead), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx48(TableRow, { className: cn(ui.trHead), children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx48(
8482
+ TableHead,
8483
+ {
8484
+ className: cn(
8485
+ ui.th,
8486
+ headerIsSticky ? cn(ui.theadSticky, "z-20") : void 0
8301
8487
  ),
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(
8488
+ children: header.isPlaceholder ? null : flexRender(
8489
+ header.column.columnDef.header,
8490
+ header.getContext()
8491
+ )
8492
+ },
8493
+ header.id
8494
+ )) }, headerGroup.id)) }),
8495
+ animate ? /* @__PURE__ */ jsx48(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx48(
8496
+ motion2.tbody,
8497
+ {
8498
+ className: cn(ui.tbody),
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__ */ jsx48(
8336
8504
  TableRow,
8337
8505
  {
8506
+ "data-accent": dataAccent,
8338
8507
  "data-state": row.getIsSelected() ? "selected" : void 0,
8339
8508
  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))
8509
+ className: cn(ui.tr, clickable ? ui.trClickable : void 0),
8510
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cn(ui.td), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8348
8511
  },
8349
8512
  row.id
8350
- )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { children: /* @__PURE__ */ jsx48(
8513
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { "data-accent": dataAccent, children: /* @__PURE__ */ jsx48(
8351
8514
  TableCell,
8352
8515
  {
8353
8516
  colSpan: columns.length,
8354
- className: "h-28 text-center text-muted-foreground",
8517
+ className: cn(ui.td, "text-muted-foreground h-28 text-center"),
8355
8518
  children: "No results."
8356
8519
  }
8357
- ) }) })
8358
- ]
8359
- }
8360
- ),
8520
+ ) })
8521
+ },
8522
+ pageKey
8523
+ ) }) : /* @__PURE__ */ jsx48(TableBody, { className: cn(ui.tbody), children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx48(
8524
+ TableRow,
8525
+ {
8526
+ "data-accent": dataAccent,
8527
+ "data-state": row.getIsSelected() ? "selected" : void 0,
8528
+ onClick: () => onClick == null ? void 0 : onClick(row.original),
8529
+ className: cn(ui.tr, clickable ? ui.trClickable : void 0),
8530
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx48(TableCell, { className: cn(ui.td), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
8531
+ },
8532
+ row.id
8533
+ )) : emptyData || /* @__PURE__ */ jsx48(TableRow, { "data-accent": dataAccent, children: /* @__PURE__ */ jsx48(
8534
+ TableCell,
8535
+ {
8536
+ colSpan: columns.length,
8537
+ className: cn(ui.td, "text-muted-foreground h-28 text-center"),
8538
+ children: "No results."
8539
+ }
8540
+ ) }) })
8541
+ ] }) }),
8361
8542
  /* @__PURE__ */ jsx48(ScrollBar, { orientation: "horizontal" })
8362
8543
  ] }) }),
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: [
8544
+ /* @__PURE__ */ jsx48("div", { className: cn(ui.footer), children: /* @__PURE__ */ jsx48("div", { className: cn(ui.footerInner), children: /* @__PURE__ */ jsxs23("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-center", children: [
8545
+ /* @__PURE__ */ jsxs23("div", { className: cn(ui.metaWrap), children: [
8546
+ isRowsSelected && /* @__PURE__ */ jsxs23("div", { children: [
8366
8547
  table.getFilteredSelectedRowModel().rows.length,
8367
8548
  " ",
8368
8549
  ofLabel,
@@ -8371,29 +8552,22 @@ function DataTable({
8371
8552
  " ",
8372
8553
  rowsSelectedLabel
8373
8554
  ] }),
8374
- typeof totalRows === "number" && /* @__PURE__ */ jsxs23("div", { className: "text-sm text-muted-foreground", children: [
8555
+ typeof totalRows === "number" && /* @__PURE__ */ jsxs23("div", { children: [
8375
8556
  "Total: ",
8376
8557
  totalRows,
8377
8558
  " registros"
8378
8559
  ] })
8379
8560
  ] }),
8380
- /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:justify-end", children: [
8561
+ /* @__PURE__ */ jsxs23("div", { className: cn(ui.controlsWrap), children: [
8381
8562
  /* @__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
- )
8563
+ /* @__PURE__ */ jsx48("p", { className: cn(ui.pageSizeLabel), children: rowPerPageLabel }),
8564
+ /* @__PURE__ */ jsxs23(Select2, { value: `${pageSize}`, onValueChange: (v) => changePageSize(Number(v)), children: [
8565
+ /* @__PURE__ */ jsx48(SelectTrigger, { "data-accent": dataAccent, className: cn(ui.pageSizeTrigger), children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: `${pageSize}` }) }),
8566
+ /* @__PURE__ */ jsx48(SelectContent, { side: "top", children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx48(SelectItem, { value: `${size}`, children: size }, size)) })
8567
+ ] })
8394
8568
  ] }),
8395
8569
  /* @__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: [
8570
+ /* @__PURE__ */ jsxs23("div", { className: cn(ui.pageLabel), children: [
8397
8571
  pageLabel,
8398
8572
  " ",
8399
8573
  pageIndex + 1,
@@ -8405,9 +8579,10 @@ function DataTable({
8405
8579
  /* @__PURE__ */ jsx48(
8406
8580
  Button,
8407
8581
  {
8582
+ "data-accent": dataAccent,
8408
8583
  "aria-label": "Go to first page",
8409
8584
  variant: "outline",
8410
- className: "hidden h-8 w-8 p-0 lg:flex",
8585
+ className: cn("hidden lg:flex", ui.navButton),
8411
8586
  onClick: () => goToPage(0),
8412
8587
  disabled: pageIndex === 0,
8413
8588
  children: /* @__PURE__ */ jsx48(DoubleArrowLeftIcon, { className: "h-4 w-4" })
@@ -8416,38 +8591,41 @@ function DataTable({
8416
8591
  /* @__PURE__ */ jsx48(
8417
8592
  Button,
8418
8593
  {
8594
+ "data-accent": dataAccent,
8419
8595
  "aria-label": "Go to previous page",
8420
8596
  variant: "outline",
8421
- className: "h-8 w-8 p-0",
8597
+ className: cn(ui.navButton),
8422
8598
  onClick: () => goToPage(pageIndex - 1),
8423
8599
  disabled: pageIndex === 0,
8424
- children: /* @__PURE__ */ jsx48(ChevronLeftIcon2, { className: "h-4 w-4" })
8600
+ children: /* @__PURE__ */ jsx48(ChevronLeft3, { className: "h-4 w-4" })
8425
8601
  }
8426
8602
  ),
8427
8603
  /* @__PURE__ */ jsx48(
8428
8604
  Button,
8429
8605
  {
8606
+ "data-accent": dataAccent,
8430
8607
  "aria-label": "Go to next page",
8431
8608
  variant: "outline",
8432
- className: "h-8 w-8 p-0",
8609
+ className: cn(ui.navButton),
8433
8610
  onClick: () => goToPage(pageIndex + 1),
8434
8611
  disabled: pageIndex + 1 >= safePageCount,
8435
- children: /* @__PURE__ */ jsx48(ChevronRightIcon6, { className: "h-4 w-4" })
8612
+ children: /* @__PURE__ */ jsx48(ChevronRight3, { className: "h-4 w-4" })
8436
8613
  }
8437
8614
  ),
8438
8615
  /* @__PURE__ */ jsx48(
8439
8616
  Button,
8440
8617
  {
8618
+ "data-accent": dataAccent,
8441
8619
  "aria-label": "Go to last page",
8442
8620
  variant: "outline",
8443
- className: "hidden h-8 w-8 p-0 lg:flex",
8621
+ className: cn("hidden lg:flex", ui.navButton),
8444
8622
  onClick: () => goToPage(safePageCount - 1),
8445
8623
  disabled: pageIndex + 1 >= safePageCount,
8446
8624
  children: /* @__PURE__ */ jsx48(DoubleArrowRightIcon, { className: "h-4 w-4" })
8447
8625
  }
8448
8626
  )
8449
8627
  ] }),
8450
- /* @__PURE__ */ jsxs23("div", { className: "sm:hidden w-full text-center text-xs text-muted-foreground", children: [
8628
+ /* @__PURE__ */ jsxs23("div", { className: "text-muted-foreground w-full text-center text-xs sm:hidden", children: [
8451
8629
  pageLabel,
8452
8630
  " ",
8453
8631
  pageIndex + 1,
@@ -8940,6 +9118,7 @@ export {
8940
9118
  ContextMenuSubContent,
8941
9119
  ContextMenuSubTrigger,
8942
9120
  ContextMenuTrigger,
9121
+ DATA_TABLE_TEMPLATES,
8943
9122
  DataTable,
8944
9123
  DataTableSkeleton,
8945
9124
  Dialog,