"use client"
/**
* Design reference previews for the Ask Leo button family.
*
* Previews pass a no-op `onClick` so browsing the catalog does not open the
* real Ask Leo sidebar. `AskLeoToggle` keeps its live behavior because the
* shell trigger has no override hook.
*/
import * as React from "react"
import { AskLeoButton } from "@/components/ask-leo-button"
import { AskLeoToggle } from "@/components/ask-leo-sidebar"
import { Button } from "@/components/ui/button"
import { LeoIcon, type LeoIconMotionState } from "@/components/ui/leo-icon"
import { utilityBarActionButtonClass } from "@/components/utility-bar-chrome"
const noop = () => {}
function PreviewRow({
label,
children,
}: {
label: string
children: React.ReactNode
}) {
return (
{label}
{children}
)
}
export function AskLeoButtonSizePreview() {
return (
)
}
export function AskLeoButtonStarPreview() {
return (
)
}
export function AskLeoButtonIconOnlyPreview() {
return (
)
}
export function AskLeoButtonStatePreview() {
return (
)
}
export function AskLeoButtonRouteActionPreview() {
return (
)
}
const MOTION_STATES: { state: LeoIconMotionState; hint: string }[] = [
{ state: "rest", hint: "Still — chrome does not loop" },
{ state: "invited", hint: "Hover or focus, one-shot" },
{ state: "working", hint: "Loops while Leo answers" },
{ state: "answered", hint: "Resolution beat, one-shot" },
]
export function LeoMotionStatePreview() {
const [state, setState] = React.useState("rest")
// Bumped on every press so re-selecting the current state replays it —
// `invited` and `answered` are one-shots and hold their final frame.
const [replay, setReplay] = React.useState(0)
const active = MOTION_STATES.find(s => s.state === state)!
// Remounting is what replays the gesture: a fresh mount starts from
// `initial="rest"` and animates into `state`.
const runKey = `${state}-${replay}`
return (
{MOTION_STATES.map(({ state: value }) => (
))}
{active.hint}
)
}
export function AskLeoTogglePreview() {
return (