UNPKG

@flanksource/clicky-ui

Version:

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

33 lines (32 loc) 962 B
import { jsx } from "react/jsx-runtime"; import { forwardRef } from "react"; import { IconMenuPicker } from "./icon-menu-picker.js"; import { useDensity } from "../hooks/use-density.js"; const DENSITY_OPTIONS = [ { value: "compact", icon: "ph:rows", label: "compact" }, { value: "comfortable", icon: "ph:list", label: "comfortable" }, { value: "spacious", icon: "ph:list-dashes", label: "spacious" } ]; const DensitySwitcher = forwardRef( ({ className, triggerClassName, menuClassName }, ref) => { const { density, setDensity } = useDensity(); return /* @__PURE__ */ jsx( IconMenuPicker, { ref, value: density, onChange: setDensity, options: DENSITY_OPTIONS, ariaLabel: "Density", className, triggerClassName, menuClassName } ); } ); DensitySwitcher.displayName = "DensitySwitcher"; export { DensitySwitcher }; //# sourceMappingURL=density-switcher.js.map