SPB Git

spb/vquant Public MIT

VibeQuant — AI-powered institutional-grade financial intelligence platform.

TypeScript 84.3% Python 11.7% JavaScript 1.6% CSS 1.5% HTML 0.7%
9.0 KB · 273 lines tsx
Raw Blame History
1/*2 * =============================================================================3 *  VibeQuant (vquant) — AI-Powered Financial Intelligence Platform4 * -----------------------------------------------------------------------------5 *  File:      client/src/components/ui/menubar.tsx6 *7 *  Author:    Simon-Pierre Boucher8 *  Contact:   contact@spboucher.ai9 *  Website:   https://www.spboucher.ai10 *  Demo:      https://www.vquant.ai11 *  License:   MIT (see LICENSE)12 *13 *  Copyright © 2026 Simon-Pierre Boucher. All rights reserved.14 * =============================================================================15 */1617"use client"1819import * as React from "react"20import * as MenubarPrimitive from "@radix-ui/react-menubar"21import { Check, ChevronRight, Circle } from "lucide-react"2223import { cn } from "@/lib/utils"2425function MenubarMenu({26  ...props27}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {28  return <MenubarPrimitive.Menu {...props} />29}3031function MenubarGroup({32  ...props33}: React.ComponentProps<typeof MenubarPrimitive.Group>) {34  return <MenubarPrimitive.Group {...props} />35}3637function MenubarPortal({38  ...props39}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {40  return <MenubarPrimitive.Portal {...props} />41}4243function MenubarRadioGroup({44  ...props45}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {46  return <MenubarPrimitive.RadioGroup {...props} />47}4849function MenubarSub({50  ...props51}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {52  return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />53}5455const Menubar = React.forwardRef<56  React.ElementRef<typeof MenubarPrimitive.Root>,57  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>58>(({ className, ...props }, ref) => (59  <MenubarPrimitive.Root60    ref={ref}61    className={cn(62      "flex h-10 items-center space-x-1 rounded-md border bg-background p-1",63      className64    )}65    {...props}66  />67))68Menubar.displayName = MenubarPrimitive.Root.displayName6970const MenubarTrigger = React.forwardRef<71  React.ElementRef<typeof MenubarPrimitive.Trigger>,72  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>73>(({ className, ...props }, ref) => (74  <MenubarPrimitive.Trigger75    ref={ref}76    className={cn(77      "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",78      className79    )}80    {...props}81  />82))83MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName8485const MenubarSubTrigger = React.forwardRef<86  React.ElementRef<typeof MenubarPrimitive.SubTrigger>,87  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {88    inset?: boolean89  }90>(({ className, inset, children, ...props }, ref) => (91  <MenubarPrimitive.SubTrigger92    ref={ref}93    className={cn(94      "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",95      inset && "pl-8",96      className97    )}98    {...props}99  >100    {children}101    <ChevronRight className="ml-auto h-4 w-4" />102  </MenubarPrimitive.SubTrigger>103))104MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName105106const MenubarSubContent = React.forwardRef<107  React.ElementRef<typeof MenubarPrimitive.SubContent>,108  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>109>(({ className, ...props }, ref) => (110  <MenubarPrimitive.SubContent111    ref={ref}112    className={cn(113      "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",114      className115    )}116    {...props}117  />118))119MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName120121const MenubarContent = React.forwardRef<122  React.ElementRef<typeof MenubarPrimitive.Content>,123  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>124>(125  (126    { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },127    ref128  ) => (129    <MenubarPrimitive.Portal>130      <MenubarPrimitive.Content131        ref={ref}132        align={align}133        alignOffset={alignOffset}134        sideOffset={sideOffset}135        className={cn(136          "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",137          className138        )}139        {...props}140      />141    </MenubarPrimitive.Portal>142  )143)144MenubarContent.displayName = MenubarPrimitive.Content.displayName145146const MenubarItem = React.forwardRef<147  React.ElementRef<typeof MenubarPrimitive.Item>,148  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {149    inset?: boolean150  }151>(({ className, inset, ...props }, ref) => (152  <MenubarPrimitive.Item153    ref={ref}154    className={cn(155      "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",156      inset && "pl-8",157      className158    )}159    {...props}160  />161))162MenubarItem.displayName = MenubarPrimitive.Item.displayName163164const MenubarCheckboxItem = React.forwardRef<165  React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,166  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>167>(({ className, children, checked, ...props }, ref) => (168  <MenubarPrimitive.CheckboxItem169    ref={ref}170    className={cn(171      "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",172      className173    )}174    checked={checked}175    {...props}176  >177    <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">178      <MenubarPrimitive.ItemIndicator>179        <Check className="h-4 w-4" />180      </MenubarPrimitive.ItemIndicator>181    </span>182    {children}183  </MenubarPrimitive.CheckboxItem>184))185MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName186187const MenubarRadioItem = React.forwardRef<188  React.ElementRef<typeof MenubarPrimitive.RadioItem>,189  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>190>(({ className, children, ...props }, ref) => (191  <MenubarPrimitive.RadioItem192    ref={ref}193    className={cn(194      "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",195      className196    )}197    {...props}198  >199    <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">200      <MenubarPrimitive.ItemIndicator>201        <Circle className="h-2 w-2 fill-current" />202      </MenubarPrimitive.ItemIndicator>203    </span>204    {children}205  </MenubarPrimitive.RadioItem>206))207MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName208209const MenubarLabel = React.forwardRef<210  React.ElementRef<typeof MenubarPrimitive.Label>,211  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {212    inset?: boolean213  }214>(({ className, inset, ...props }, ref) => (215  <MenubarPrimitive.Label216    ref={ref}217    className={cn(218      "px-2 py-1.5 text-sm font-semibold",219      inset && "pl-8",220      className221    )}222    {...props}223  />224))225MenubarLabel.displayName = MenubarPrimitive.Label.displayName226227const MenubarSeparator = React.forwardRef<228  React.ElementRef<typeof MenubarPrimitive.Separator>,229  React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>230>(({ className, ...props }, ref) => (231  <MenubarPrimitive.Separator232    ref={ref}233    className={cn("-mx-1 my-1 h-px bg-muted", className)}234    {...props}235  />236))237MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName238239const MenubarShortcut = ({240  className,241  ...props242}: React.HTMLAttributes<HTMLSpanElement>) => {243  return (244    <span245      className={cn(246        "ml-auto text-xs tracking-widest text-muted-foreground",247        className248      )}249      {...props}250    />251  )252}253MenubarShortcut.displayname = "MenubarShortcut"254255export {256  Menubar,257  MenubarMenu,258  MenubarTrigger,259  MenubarContent,260  MenubarItem,261  MenubarSeparator,262  MenubarLabel,263  MenubarCheckboxItem,264  MenubarRadioGroup,265  MenubarRadioItem,266  MenubarPortal,267  MenubarSubContent,268  MenubarSubTrigger,269  MenubarGroup,270  MenubarSub,271  MenubarShortcut,272}273