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%
2.9 KB · 79 lines tsx
Raw Blame History
1/*2 * =============================================================================3 *  VibeQuant (vquant) — AI-Powered Financial Intelligence Platform4 * -----------------------------------------------------------------------------5 *  File:      client/src/components/ui/button.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 */1617import * as React from "react"18import { Slot } from "@radix-ui/react-slot"19import { cva, type VariantProps } from "class-variance-authority"2021import { cn } from "@/lib/utils"2223const buttonVariants = cva(24  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0" +25  " hover-elevate active-elevate-2",26  {27    variants: {28      variant: {29        default:30          "bg-primary text-primary-foreground border border-primary-border",31        destructive:32          "bg-destructive text-destructive-foreground border border-destructive-border",33        outline:34          // Shows the background color of whatever card / sidebar / accent background it is inside of.35          // Inherits the current text color.36          " border [border-color:var(--button-outline)]  shadow-xs active:shadow-none ",37        secondary: "border bg-secondary text-secondary-foreground border border-secondary-border ",38        // Add a transparent border so that when someone toggles a border on later, it doesn't shift layout/size.39        ghost: "border border-transparent",40      },41      // Heights are set as "min" heights, because sometimes Ai will place large amount of content42      // inside buttons. With a min-height they will look appropriate with small amounts of content,43      // but will expand to fit large amounts of content.44      size: {45        default: "min-h-9 px-4 py-2",46        sm: "min-h-8 rounded-md px-3 text-xs",47        lg: "min-h-10 rounded-md px-8",48        icon: "h-9 w-9",49      },50    },51    defaultVariants: {52      variant: "default",53      size: "default",54    },55  },56)5758export interface ButtonProps59  extends React.ButtonHTMLAttributes<HTMLButtonElement>,60    VariantProps<typeof buttonVariants> {61  asChild?: boolean62}6364const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(65  ({ className, variant, size, asChild = false, ...props }, ref) => {66    const Comp = asChild ? Slot : "button"67    return (68      <Comp69        className={cn(buttonVariants({ variant, size, className }))}70        ref={ref}71        {...props}72      />73    )74  },75)76Button.displayName = "Button"7778export { Button, buttonVariants }79