Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
71 lines
2.2 KiB
TypeScript
71 lines
2.2 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { WATERMARK_POSITIONS, type WatermarkPosition } from "@/lib/types";
|
|
import { cn } from "@/lib/utils";
|
|
import {
|
|
POSITION_CLASSES,
|
|
POSITION_LABELS,
|
|
} from "@/components/brand/brand-utils";
|
|
|
|
interface PositionPickerProps {
|
|
value: WatermarkPosition;
|
|
onChange: (position: WatermarkPosition) => void;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
/**
|
|
* A 2x2 grid of corner buttons; each renders a mini 9:16 frame with a dot in the
|
|
* corresponding corner so the choice reads at a glance. The selected corner is
|
|
* highlighted. Fully keyboard-operable via native `<button>`s.
|
|
*/
|
|
export function PositionPicker({
|
|
value,
|
|
onChange,
|
|
disabled = false,
|
|
}: PositionPickerProps) {
|
|
return (
|
|
<div
|
|
role="radiogroup"
|
|
aria-label="Logo position"
|
|
className="grid grid-cols-2 gap-3"
|
|
>
|
|
{WATERMARK_POSITIONS.map((position) => {
|
|
const selected = position === value;
|
|
return (
|
|
<button
|
|
key={position}
|
|
type="button"
|
|
role="radio"
|
|
aria-checked={selected}
|
|
aria-label={POSITION_LABELS[position]}
|
|
disabled={disabled}
|
|
onClick={() => onChange(position)}
|
|
className={cn(
|
|
"flex items-center gap-3 rounded-lg border p-3 text-left transition-colors",
|
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
selected
|
|
? "border-primary bg-primary/10"
|
|
: "border-border bg-secondary/20 hover:bg-secondary/40",
|
|
)}
|
|
>
|
|
<span className="relative block h-12 w-7 shrink-0 rounded-sm border border-border bg-background">
|
|
<span
|
|
className={cn(
|
|
"absolute size-2 rounded-[1px]",
|
|
POSITION_CLASSES[position],
|
|
selected ? "bg-primary" : "bg-muted-foreground",
|
|
)}
|
|
/>
|
|
</span>
|
|
<span className="text-sm font-medium">
|
|
{POSITION_LABELS[position]}
|
|
</span>
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|