import { Feather } from "@phosphor-icons/react";
import { commandIds } from "@commands/ids";
import type { AppStore } from "@editor/store";
import type { FeatherSettings } from "@editor/tools";
import { BottomControlDivider } from "./Divider";
import { BottomControlSlider } from "./Slider";
import { bottomControlFieldClass, bottomControlIconSlotClass, bottomControlLabelClass, bottomControlMenuClass } from "./styles";
export function FeatherControls({ settings, editingMask, dispatch }: { settings: FeatherSettings; editingMask: boolean; dispatch: AppStore["dispatch"] }) {
return (
{editingMask ? "Feather mask" : "Feather layer mask"}
dispatch(commandIds.toolSetFeatherSettings, { size })} />
dispatch(commandIds.toolSetFeatherSettings, { radius })} />
dispatch(commandIds.toolSetFeatherSettings, { strength })} />
dispatch(commandIds.toolSetFeatherSettings, { smoothing })} />
{editingMask ? (
<>
>
) : null}
);
}
function FeatherSlider({ label, min, max, value, suffix = "", onValueChange }: { label: string; min: number; max: number; value: number; suffix?: string; onValueChange: (value: number) => void }) {
return (
);
}
function toggleClass(active: boolean) {
return `rounded-md px-3 py-1.5 text-xs font-medium transition ${active ? "bg-sky-300 text-slate-950" : "bg-white/[0.06] text-white/70 hover:bg-white/10"}`;
}