feat(foundry): add map camera spiral controls
This commit is contained in:
@@ -4,14 +4,19 @@ import { cn } from "./cn.js";
|
||||
export interface CheckerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
||||
checked: boolean;
|
||||
label: string;
|
||||
description?: string;
|
||||
/** Helper copy belongs outside the control, immediately before it. */
|
||||
description?: never;
|
||||
onChange: (checked: boolean) => void;
|
||||
}
|
||||
|
||||
type IsNever<Value> = [Value] extends [never] ? true : false;
|
||||
type Assert<Value extends true> = Value;
|
||||
type _CheckerDescriptionMustStayForbidden = Assert<IsNever<Exclude<CheckerProps["description"], undefined>>>;
|
||||
|
||||
export function Checker({
|
||||
checked,
|
||||
label,
|
||||
description,
|
||||
description: _unsupportedDescription,
|
||||
onChange,
|
||||
disabled,
|
||||
className,
|
||||
@@ -32,10 +37,8 @@ export function Checker({
|
||||
>
|
||||
<span className="nodedc-checker__copy">
|
||||
<span className="nodedc-checker__label">{label}</span>
|
||||
{description ? <span className="nodedc-checker__description">{description}</span> : null}
|
||||
</span>
|
||||
<span className="nodedc-checker__indicator" aria-hidden="true" />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ export function RangeControl({
|
||||
max={safeMax}
|
||||
step={step}
|
||||
aria-label={label}
|
||||
aria-valuetext={formatValue(value)}
|
||||
onChange={(event) => onChange(Number(event.target.value))}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user