"use client";
import { useRef } from "react";
import { cn } from "@/lib/cn";
import { gsap, motionDuration, motionEase, prefersReducedMotion, useGSAP } from "@/lib/motion";
type BrandMarkProps = {
className?: string;
/**
* Renders the mark for placement on a filled `primary` panel: the block reads
* in the panel's foreground colour instead of the brand green.
*/
inverted?: boolean;
};
/**
* An isometric block on a 24-unit grid — three faces, no interior detail.
*
* The mark ships as small as 32px, so it is drawn with only the silhouette and
* the three face tones that separate it. Colour comes from `currentColor` plus
* two `color-mix` shades of it, so the block follows `text-primary` /
* `text-primary-foreground` and works on the sidebar, the light dashboard, and
* the filled primary panel from a single asset.
*/
function BrandGlyph({ className }: { className?: string }) {
return (
);
}
export function BrandMark({ className, inverted }: BrandMarkProps) {
const ref = useRef(null);
useGSAP(
() => {
const el = ref.current;
if (!el || prefersReducedMotion()) return;
const enter = () =>
gsap.to(el, { y: -2, duration: motionDuration.fast, ease: motionEase.out });
const leave = () =>
gsap.to(el, { y: 0, duration: motionDuration.fast, ease: motionEase.out });
el.addEventListener("pointerenter", enter);
el.addEventListener("pointerleave", leave);
return () => {
el.removeEventListener("pointerenter", enter);
el.removeEventListener("pointerleave", leave);
};
},
{ scope: ref }
);
return (