@nswds/app 1.83.6 → 1.84.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.cjs CHANGED
@@ -16648,11 +16648,23 @@ function DataTable({
16648
16648
  function DataTableColumnHeader({
16649
16649
  column,
16650
16650
  title,
16651
- className
16651
+ className,
16652
+ sortType = "string"
16652
16653
  }) {
16653
16654
  if (!column.getCanSort()) {
16654
16655
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), children: title });
16655
16656
  }
16657
+ const getSortLabels = () => {
16658
+ switch (sortType) {
16659
+ case "date":
16660
+ return { asc: "Oldest First", desc: "Newest First" };
16661
+ case "number":
16662
+ return { asc: "Lowest First", desc: "Highest First" };
16663
+ default:
16664
+ return { asc: "Asc", desc: "Desc" };
16665
+ }
16666
+ };
16667
+ const labels = getSortLabels();
16656
16668
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center space-x-2", className), children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
16657
16669
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "ghost", size: "sm", className: "-ml-3 data-[state=open]:bg-accent", children: [
16658
16670
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
@@ -16660,12 +16672,17 @@ function DataTableColumnHeader({
16660
16672
  ] }) }),
16661
16673
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "start", children: [
16662
16674
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(false), children: [
16663
- /* @__PURE__ */ jsxRuntime.jsx(Icons.south, { className: "h-3.5 w-3.5 text-muted-foreground/70" }),
16664
- "Asc"
16675
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.north, { className: "h-3.5 w-3.5 text-muted-foreground/70" }),
16676
+ labels.asc
16665
16677
  ] }),
16666
16678
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(true), children: [
16667
- /* @__PURE__ */ jsxRuntime.jsx(Icons.north, { className: "h-3.5 w-3.5 text-muted-foreground/70" }),
16668
- "Desc"
16679
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.south, { className: "h-3.5 w-3.5 text-muted-foreground/70" }),
16680
+ labels.desc
16681
+ ] }),
16682
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
16683
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.clearSorting(), children: [
16684
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.unfold_more, { className: "h-3.5 w-3.5 text-muted-foreground/70" }),
16685
+ "Clear Sort"
16669
16686
  ] }),
16670
16687
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
16671
16688
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => column.toggleVisibility(false), children: [
@@ -17529,7 +17546,7 @@ function FormatToggle({ format, setFormat }) {
17529
17546
 
17530
17547
  // package.json
17531
17548
  var package_default = {
17532
- version: "1.83.4"};
17549
+ version: "1.83.6"};
17533
17550
  var SluggerContext = React5__namespace.default.createContext(null);
17534
17551
  function flattenText(nodes) {
17535
17552
  if (nodes == null || typeof nodes === "boolean") return "";