import { CaretUpRegularIcon } from "alouette-icons/phosphor-icons/CaretUp"; import type { ReactNode } from "react"; import type { Accent } from "../../core/AlouetteConfig"; import { tv } from "../../core/tv"; import { Menu } from "../actions/Menu"; import { PressableBox } from "../actions/PressableBox"; import { Avatar } from "../data/Avatar"; import { Icon, type SVGIconElement } from "../primitives/Icon"; import { Text } from "../primitives/Text"; import { View } from "../primitives/View"; const appSidebarAccountVariants = tv({ slots: { frame: "flex-row items-center gap-sm rounded-full px-xs py-xxs min-h-control-md", identity: "flex-1", name: "text-base text-sharp", description: "text-sm text-muted", caret: "text-muted", }, }); export interface AppSidebarAccountProps { /** Account name: drives the initials and labels the trigger. */ name: string; /** Second line under the name — the email, the role. */ description?: string; /** Replaces the initials in the disc. */ icon?: SVGIconElement; /** Accent of the disc. Defaults to the inherited accent, or `brand` outside * an accent scope. */ accent?: Accent; /** * Rendered above the items — typically the `ColorModePicker`, the identity * being on the row already. A press there leaves the menu open. */ header?: ReactNode; /** `MenuItem`s, and `Separator`s between groups. */ children: ReactNode; } /** * Footer of an `AppSidebar`: the signed-in account, as a row opening a menu * of session actions. The row is pinned at the bottom of the viewport, so the * menu opens above it, as wide as the row. */ export function AppSidebarAccount({ name, description, icon, accent, header, children, }: AppSidebarAccountProps): ReactNode { const styles = appSidebarAccountVariants(); return (
); }