@nswds/app 1.54.7 → 1.55.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/globals.css CHANGED
@@ -1093,6 +1093,9 @@
1093
1093
  .-ml-1 {
1094
1094
  margin-left: calc(var(--spacing) * -1);
1095
1095
  }
1096
+ .-ml-3 {
1097
+ margin-left: calc(var(--spacing) * -3);
1098
+ }
1096
1099
  .-ml-4 {
1097
1100
  margin-left: calc(var(--spacing) * -4);
1098
1101
  }
@@ -1267,6 +1270,9 @@
1267
1270
  .h-3 {
1268
1271
  height: calc(var(--spacing) * 3);
1269
1272
  }
1273
+ .h-3\.5 {
1274
+ height: calc(var(--spacing) * 3.5);
1275
+ }
1270
1276
  .h-4 {
1271
1277
  height: calc(var(--spacing) * 4);
1272
1278
  }
@@ -1498,12 +1504,24 @@
1498
1504
  .w-\[50vw\] {
1499
1505
  width: 50vw;
1500
1506
  }
1507
+ .w-\[80px\] {
1508
+ width: 80px;
1509
+ }
1501
1510
  .w-\[100px\] {
1502
1511
  width: 100px;
1503
1512
  }
1513
+ .w-\[160px\] {
1514
+ width: 160px;
1515
+ }
1504
1516
  .w-\[180px\] {
1505
1517
  width: 180px;
1506
1518
  }
1519
+ .w-\[184px\] {
1520
+ width: 184px;
1521
+ }
1522
+ .w-\[200px\] {
1523
+ width: 200px;
1524
+ }
1507
1525
  .w-\[260px\] {
1508
1526
  width: 260px;
1509
1527
  }
@@ -1549,6 +1567,9 @@
1549
1567
  .max-w-60 {
1550
1568
  max-width: calc(var(--spacing) * 60);
1551
1569
  }
1570
+ .max-w-\[500px\] {
1571
+ max-width: 500px;
1572
+ }
1552
1573
  .max-w-\[600px\] {
1553
1574
  max-width: 600px;
1554
1575
  }
@@ -1729,6 +1750,10 @@
1729
1750
  --tw-translate-y: -50%;
1730
1751
  translate: var(--tw-translate-x) var(--tw-translate-y);
1731
1752
  }
1753
+ .translate-y-\[2px\] {
1754
+ --tw-translate-y: 2px;
1755
+ translate: var(--tw-translate-x) var(--tw-translate-y);
1756
+ }
1732
1757
  .translate-y-\[calc\(-50\%_-_2px\)\] {
1733
1758
  --tw-translate-y: calc(-50% - 2px);
1734
1759
  translate: var(--tw-translate-x) var(--tw-translate-y);
@@ -2008,6 +2033,13 @@
2008
2033
  .gap-x-12 {
2009
2034
  column-gap: calc(var(--spacing) * 12);
2010
2035
  }
2036
+ .space-x-1 {
2037
+ :where(& > :not(:last-child)) {
2038
+ --tw-space-x-reverse: 0;
2039
+ margin-inline-start: calc(calc(var(--spacing) * 1) * var(--tw-space-x-reverse));
2040
+ margin-inline-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-x-reverse)));
2041
+ }
2042
+ }
2011
2043
  .space-x-2 {
2012
2044
  :where(& > :not(:last-child)) {
2013
2045
  --tw-space-x-reverse: 0;
@@ -2547,6 +2579,9 @@
2547
2579
  .bg-primary-500 {
2548
2580
  background-color: oklch(0.719602022988773 0.1609881523353869 242.17574150873253);
2549
2581
  }
2582
+ .bg-primary-600 {
2583
+ background-color: oklch(0.5751126532766045 0.2298336295034379 260.75633298199585);
2584
+ }
2550
2585
  .bg-primary-800 {
2551
2586
  background-color: oklch(0.2899986864508513 0.11729574451023282 259.841936589881);
2552
2587
  }
@@ -3398,6 +3433,12 @@
3398
3433
  .text-muted-foreground {
3399
3434
  color: var(--muted-foreground);
3400
3435
  }
3436
+ .text-muted-foreground\/70 {
3437
+ color: var(--muted-foreground);
3438
+ @supports (color: color-mix(in lab, red, red)) {
3439
+ color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
3440
+ }
3441
+ }
3401
3442
  .text-pink-500 {
3402
3443
  color: var(--color-pink-500);
3403
3444
  }
@@ -7295,6 +7336,16 @@
7295
7336
  color: var(--color-white);
7296
7337
  }
7297
7338
  }
7339
+ .data-\[state\=open\]\:bg-accent {
7340
+ &[data-state="open"] {
7341
+ background-color: var(--accent);
7342
+ }
7343
+ }
7344
+ .data-\[state\=open\]\:bg-muted {
7345
+ &[data-state="open"] {
7346
+ background-color: var(--muted);
7347
+ }
7348
+ }
7298
7349
  .data-\[state\=open\]\:bg-primary-800\/10 {
7299
7350
  &[data-state="open"] {
7300
7351
  background-color: color-mix(in oklab, oklch(0.2899986864508513 0.11729574451023282 259.841936589881) 10%, transparent);
@@ -8382,6 +8433,11 @@
8382
8433
  width: calc(var(--spacing) * 80);
8383
8434
  }
8384
8435
  }
8436
+ .lg\:w-\[280px\] {
8437
+ @media (width >= 64rem) {
8438
+ width: 280px;
8439
+ }
8440
+ }
8385
8441
  .lg\:max-w-none {
8386
8442
  @media (width >= 64rem) {
8387
8443
  max-width: none;
@@ -8446,6 +8502,15 @@
8446
8502
  }
8447
8503
  }
8448
8504
  }
8505
+ .lg\:space-x-8 {
8506
+ @media (width >= 64rem) {
8507
+ :where(& > :not(:last-child)) {
8508
+ --tw-space-x-reverse: 0;
8509
+ margin-inline-start: calc(calc(var(--spacing) * 8) * var(--tw-space-x-reverse));
8510
+ margin-inline-end: calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-x-reverse)));
8511
+ }
8512
+ }
8513
+ }
8449
8514
  .lg\:rounded-sm {
8450
8515
  @media (width >= 64rem) {
8451
8516
  border-radius: var(--radius-sm);
@@ -10568,6 +10633,11 @@
10568
10633
  pointer-events: none;
10569
10634
  }
10570
10635
  }
10636
+ .\[\&_svg\]\:invisible {
10637
+ & svg {
10638
+ visibility: hidden;
10639
+ }
10640
+ }
10571
10641
  .\[\&_svg\]\:shrink-0 {
10572
10642
  & svg {
10573
10643
  flex-shrink: 0;
package/dist/index.cjs CHANGED
@@ -56,6 +56,7 @@ var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
56
56
  var reactDayPicker = require('react-day-picker');
57
57
  var useEmblaCarousel = require('embla-carousel-react');
58
58
  var inputOtp = require('input-otp');
59
+ var reactTable = require('@tanstack/react-table');
59
60
  var slugify = require('@sindresorhus/slugify');
60
61
  var zustand = require('zustand');
61
62
  var middleware = require('zustand/middleware');
@@ -7871,7 +7872,7 @@ function Heading({
7871
7872
 
7872
7873
  // package.json
7873
7874
  var package_default = {
7874
- version: "1.54.4"};
7875
+ version: "1.54.7"};
7875
7876
  function Logo(props) {
7876
7877
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7877
7878
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "NSW Government" }),
@@ -24149,6 +24150,319 @@ function SidebarMenuSubButton({
24149
24150
  }
24150
24151
  );
24151
24152
  }
24153
+ function DataTablePagination({ table }) {
24154
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-2", children: [
24155
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-muted-foreground flex-1 text-sm", children: [
24156
+ table.getFilteredSelectedRowModel().rows.length,
24157
+ " of",
24158
+ " ",
24159
+ table.getFilteredRowModel().rows.length,
24160
+ " row(s) selected."
24161
+ ] }),
24162
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
24163
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
24164
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "flex-1 text-sm font-medium", children: "Rows per page" }),
24165
+ /* @__PURE__ */ jsxRuntime.jsxs(
24166
+ Select,
24167
+ {
24168
+ value: `${table.getState().pagination.pageSize}`,
24169
+ onValueChange: (value) => {
24170
+ table.setPageSize(Number(value));
24171
+ },
24172
+ children: [
24173
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
24174
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
24175
+ ]
24176
+ }
24177
+ )
24178
+ ] }),
24179
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
24180
+ "Page ",
24181
+ table.getState().pagination.pageIndex + 1,
24182
+ " of ",
24183
+ table.getPageCount()
24184
+ ] }),
24185
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
24186
+ /* @__PURE__ */ jsxRuntime.jsxs(
24187
+ Button2,
24188
+ {
24189
+ variant: "outline",
24190
+ size: "icon",
24191
+ className: "hidden p-0 lg:flex",
24192
+ onClick: () => table.setPageIndex(0),
24193
+ disabled: !table.getCanPreviousPage(),
24194
+ children: [
24195
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to first page" }),
24196
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.chevron_left, {})
24197
+ ]
24198
+ }
24199
+ ),
24200
+ /* @__PURE__ */ jsxRuntime.jsxs(
24201
+ Button2,
24202
+ {
24203
+ variant: "outline",
24204
+ size: "icon",
24205
+ className: "p-0",
24206
+ onClick: () => table.previousPage(),
24207
+ disabled: !table.getCanPreviousPage(),
24208
+ children: [
24209
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to previous page" }),
24210
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.chevron_left, {})
24211
+ ]
24212
+ }
24213
+ ),
24214
+ /* @__PURE__ */ jsxRuntime.jsxs(
24215
+ Button2,
24216
+ {
24217
+ variant: "outline",
24218
+ size: "icon",
24219
+ className: "p-0",
24220
+ onClick: () => table.nextPage(),
24221
+ disabled: !table.getCanNextPage(),
24222
+ children: [
24223
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to next page" }),
24224
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.chevron_right, {})
24225
+ ]
24226
+ }
24227
+ ),
24228
+ /* @__PURE__ */ jsxRuntime.jsxs(
24229
+ Button2,
24230
+ {
24231
+ variant: "outline",
24232
+ size: "icon",
24233
+ className: "hidden p-0 lg:flex",
24234
+ onClick: () => table.setPageIndex(table.getPageCount() - 1),
24235
+ disabled: !table.getCanNextPage(),
24236
+ children: [
24237
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Go to last page" }),
24238
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.chevron_right, {})
24239
+ ]
24240
+ }
24241
+ )
24242
+ ] })
24243
+ ] })
24244
+ ] });
24245
+ }
24246
+ function DataTableFacetedFilter({
24247
+ column,
24248
+ title,
24249
+ options
24250
+ }) {
24251
+ const facets = column?.getFacetedUniqueValues();
24252
+ const selectedValues = new Set(column?.getFilterValue());
24253
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
24254
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "outline", size: "sm", className: "border-dashed", children: [
24255
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.add, {}),
24256
+ title,
24257
+ selectedValues?.size > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
24258
+ /* @__PURE__ */ jsxRuntime.jsx(Separator4, { orientation: "vertical", className: "mx-2 h-4" }),
24259
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "soft", className: "hidden lg:block", children: selectedValues.size }),
24260
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden space-x-1 lg:flex", children: selectedValues.size > 2 ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "soft", className: "rounded-sm px-1 font-normal", children: [
24261
+ selectedValues.size,
24262
+ " selected"
24263
+ ] }) : options.filter((option) => selectedValues.has(option.value)).map((option) => /* @__PURE__ */ jsxRuntime.jsx(
24264
+ Badge,
24265
+ {
24266
+ variant: "soft",
24267
+ className: "rounded-sm px-1 font-normal",
24268
+ children: option.label
24269
+ },
24270
+ option.value
24271
+ )) })
24272
+ ] })
24273
+ ] }) }),
24274
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
24275
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: title }),
24276
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
24277
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No results found." }),
24278
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => {
24279
+ const isSelected = selectedValues.has(option.value);
24280
+ return /* @__PURE__ */ jsxRuntime.jsxs(
24281
+ CommandItem,
24282
+ {
24283
+ onSelect: () => {
24284
+ if (isSelected) {
24285
+ selectedValues.delete(option.value);
24286
+ } else {
24287
+ selectedValues.add(option.value);
24288
+ }
24289
+ const filterValues = Array.from(selectedValues);
24290
+ column?.setFilterValue(filterValues.length ? filterValues : void 0);
24291
+ },
24292
+ children: [
24293
+ /* @__PURE__ */ jsxRuntime.jsx(
24294
+ "div",
24295
+ {
24296
+ className: cn(
24297
+ "border-grey-600 mr-2 flex h-4 w-4 items-center justify-center rounded-sm border",
24298
+ isSelected ? "bg-primary-600 border-primary-600 text-primary-foreground" : "opacity-50 [&_svg]:invisible"
24299
+ ),
24300
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { className: "text-white" })
24301
+ }
24302
+ ),
24303
+ option.icon && /* @__PURE__ */ jsxRuntime.jsx(option.icon, { className: "text-muted-foreground mr-2 h-4 w-4" }),
24304
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label }),
24305
+ facets?.get(option.value) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs", children: facets.get(option.value) })
24306
+ ]
24307
+ },
24308
+ option.value
24309
+ );
24310
+ }) }),
24311
+ selectedValues.size > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
24312
+ /* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {}),
24313
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(
24314
+ CommandItem,
24315
+ {
24316
+ onSelect: () => column?.setFilterValue(void 0),
24317
+ className: "justify-center text-center",
24318
+ children: "Clear filters"
24319
+ }
24320
+ ) })
24321
+ ] })
24322
+ ] })
24323
+ ] }) })
24324
+ ] });
24325
+ }
24326
+ function DataTableViewOptions({ table }) {
24327
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
24328
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "outline", size: "sm", className: "nsw:ml-auto nsw:hidden nsw:lg:flex", children: [
24329
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.tune, {}),
24330
+ "View"
24331
+ ] }) }),
24332
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", className: "nsw:w-[150px]", children: [
24333
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: "Toggle columns" }),
24334
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
24335
+ table.getAllColumns().filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide()).map((column) => {
24336
+ return /* @__PURE__ */ jsxRuntime.jsx(
24337
+ DropdownMenuCheckboxItem,
24338
+ {
24339
+ className: "nsw:capitalize",
24340
+ checked: column.getIsVisible(),
24341
+ onCheckedChange: (value) => column.toggleVisibility(!!value),
24342
+ children: column.id
24343
+ },
24344
+ column.id
24345
+ );
24346
+ })
24347
+ ] })
24348
+ ] });
24349
+ }
24350
+ function DataTableToolbar({ search, toolbar, table }) {
24351
+ const isFiltered = table.getState().columnFilters.length > 0;
24352
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
24353
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center space-x-2", children: [
24354
+ /* @__PURE__ */ jsxRuntime.jsx(
24355
+ Input,
24356
+ {
24357
+ type: "search",
24358
+ name: "global-filter",
24359
+ placeholder: search?.placeholder ?? `Filter...`,
24360
+ value: table.getState().globalFilter ?? "",
24361
+ onChange: (event) => table.setGlobalFilter(event.target.value),
24362
+ className: "h-10 w-[184px] lg:w-[280px]"
24363
+ }
24364
+ ),
24365
+ toolbar && toolbar.map((group) => /* @__PURE__ */ jsxRuntime.jsx(
24366
+ DataTableFacetedFilter,
24367
+ {
24368
+ column: table.getColumn(group.id),
24369
+ title: group.title,
24370
+ options: group.values
24371
+ },
24372
+ group.id
24373
+ )),
24374
+ isFiltered && /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "ghost", onClick: () => table.resetColumnFilters(), children: [
24375
+ "Reset",
24376
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.close, {})
24377
+ ] })
24378
+ ] }),
24379
+ /* @__PURE__ */ jsxRuntime.jsx(DataTableViewOptions, { table })
24380
+ ] });
24381
+ }
24382
+ function DataTable({
24383
+ search,
24384
+ toolbar,
24385
+ columns,
24386
+ data
24387
+ }) {
24388
+ const [rowSelection, setRowSelection] = React18__namespace.useState({});
24389
+ const [columnVisibility, setColumnVisibility] = React18__namespace.useState({});
24390
+ const [columnFilters, setColumnFilters] = React18__namespace.useState([]);
24391
+ const [sorting, setSorting] = React18__namespace.useState([]);
24392
+ const [globalFilter, setGlobalFilter] = React18__namespace.useState("");
24393
+ const table = reactTable.useReactTable({
24394
+ data,
24395
+ columns,
24396
+ state: {
24397
+ globalFilter,
24398
+ sorting,
24399
+ columnVisibility,
24400
+ rowSelection,
24401
+ columnFilters
24402
+ },
24403
+ enableRowSelection: true,
24404
+ onRowSelectionChange: setRowSelection,
24405
+ onSortingChange: setSorting,
24406
+ onColumnFiltersChange: setColumnFilters,
24407
+ onColumnVisibilityChange: setColumnVisibility,
24408
+ onGlobalFilterChange: setGlobalFilter,
24409
+ globalFilterFn: "includesString",
24410
+ getCoreRowModel: reactTable.getCoreRowModel(),
24411
+ getFilteredRowModel: reactTable.getFilteredRowModel(),
24412
+ getPaginationRowModel: reactTable.getPaginationRowModel(),
24413
+ getSortedRowModel: reactTable.getSortedRowModel(),
24414
+ getFacetedRowModel: reactTable.getFacetedRowModel(),
24415
+ getFacetedUniqueValues: reactTable.getFacetedUniqueValues()
24416
+ });
24417
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-1", children: [
24418
+ /* @__PURE__ */ jsxRuntime.jsx(DataTableToolbar, { table, search, toolbar }),
24419
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
24420
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => {
24421
+ return /* @__PURE__ */ jsxRuntime.jsx(TableHead, { colSpan: header.colSpan, children: header.isPlaceholder ? null : reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
24422
+ }) }, headerGroup.id)) }),
24423
+ /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
24424
+ TableRow,
24425
+ {
24426
+ "data-state": row.getIsSelected() && "selected",
24427
+ className: "relative",
24428
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
24429
+ },
24430
+ row.id
24431
+ )) : /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
24432
+ ] }) }),
24433
+ /* @__PURE__ */ jsxRuntime.jsx(DataTablePagination, { table })
24434
+ ] });
24435
+ }
24436
+ function DataTableColumnHeader({
24437
+ column,
24438
+ title,
24439
+ className
24440
+ }) {
24441
+ if (!column.getCanSort()) {
24442
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), children: title });
24443
+ }
24444
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center space-x-2", className), children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
24445
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "ghost", size: "sm", className: "data-[state=open]:bg-accent -ml-3", children: [
24446
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
24447
+ column.getIsSorted() === "desc" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.south, {}) : column.getIsSorted() === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.north, {}) : /* @__PURE__ */ jsxRuntime.jsx(Icons.unfold_more, {})
24448
+ ] }) }),
24449
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "start", children: [
24450
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(false), children: [
24451
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.south, { className: "text-muted-foreground/70 h-3.5 w-3.5" }),
24452
+ "Asc"
24453
+ ] }),
24454
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(true), children: [
24455
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.north, { className: "text-muted-foreground/70 h-3.5 w-3.5" }),
24456
+ "Desc"
24457
+ ] }),
24458
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
24459
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleVisibility(false), children: [
24460
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.eye_off, { className: "text-muted-foreground/70 h-3.5 w-3.5" }),
24461
+ "Hide"
24462
+ ] })
24463
+ ] })
24464
+ ] }) });
24465
+ }
24152
24466
  var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? React18.useLayoutEffect : React18.useEffect;
24153
24467
  function useDisableToc() {
24154
24468
  const { setToc } = useToc();
@@ -24386,6 +24700,12 @@ exports.ContextMenuSub = ContextMenuSub;
24386
24700
  exports.ContextMenuSubContent = ContextMenuSubContent;
24387
24701
  exports.ContextMenuSubTrigger = ContextMenuSubTrigger;
24388
24702
  exports.ContextMenuTrigger = ContextMenuTrigger;
24703
+ exports.DataTable = DataTable;
24704
+ exports.DataTableColumnHeader = DataTableColumnHeader;
24705
+ exports.DataTableFacetedFilter = DataTableFacetedFilter;
24706
+ exports.DataTablePagination = DataTablePagination;
24707
+ exports.DataTableToolbar = DataTableToolbar;
24708
+ exports.DataTableViewOptions = DataTableViewOptions;
24389
24709
  exports.Description = Description3;
24390
24710
  exports.DescriptionDetails = DescriptionDetails;
24391
24711
  exports.DescriptionList = DescriptionList;