UNPKG

@flanksource/clicky-ui

Version:

Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.

34 lines (33 loc) 939 B
import { jsxs, jsx } from "react/jsx-runtime"; import { cn } from "../lib/utils.js"; function SortableHeader({ active, dir, onClick, align = "left", className, children }) { const alignCls = align === "right" ? "justify-end" : align === "center" ? "justify-center" : "justify-start"; return /* @__PURE__ */ jsxs( "button", { type: "button", onClick, className: cn( "inline-flex items-center gap-1 cursor-pointer select-none hover:text-foreground", active ? "text-primary" : "text-muted-foreground", alignCls, className ), children: [ children, active ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: dir === "asc" ? "↑" : "↓" }) : /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "opacity-40", children: "↕" }) ] } ); } export { SortableHeader }; //# sourceMappingURL=SortableHeader.js.map