spb/trouve-ka Public
Trouve-KA — moteur de recherche web indépendant, Québec-first. Crawler distribué, index OpenSearch, ranking bilingue, galerie d'images. En prod : www.trouve-ka.com
Python 76.8%
TypeScript 15.7%
SQL 3.9%
Shell 1.4%
CSS 1.3%
Dockerfile 0.7%
1/**2 * Trouve-KA — composant UI Button (éditorial sharp : bordure encre, ombre dure)3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 */67import { forwardRef, type ButtonHTMLAttributes } from "react";8import { cva, type VariantProps } from "class-variance-authority";9import { cn } from "@/lib/utils";1011const buttonVariants = cva(12 "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-ctl border-[1.5px] font-display text-sm font-bold transition-colors active:translate-x-[2px] active:translate-y-[2px] active:shadow-none disabled:pointer-events-none disabled:opacity-50",13 {14 variants: {15 variant: {16 default:17 "border-ink bg-ink text-lime shadow-off-btn hover:bg-green-deep",18 secondary:19 "border-ink bg-lime text-ink shadow-[4px_4px_0_rgba(217,242,107,0.25)] hover:bg-lime-soft",20 outline: "border-ink bg-surface text-ink shadow-off-field hover:bg-lime",21 ghost: "border-transparent text-ink-2 hover:border-ink hover:text-ink",22 danger:23 "border-ink bg-danger text-paper shadow-off-btn hover:bg-[#9c352e]",24 },25 size: {26 sm: "h-9 px-3.5 text-xs",27 md: "h-11 px-5",28 lg: "h-12 px-7 text-base",29 },30 },31 defaultVariants: {32 variant: "default",33 size: "md",34 },35 },36);3738export interface ButtonProps39 extends ButtonHTMLAttributes<HTMLButtonElement>,40 VariantProps<typeof buttonVariants> {}4142const Button = forwardRef<HTMLButtonElement, ButtonProps>(43 ({ className, variant, size, type = "button", ...props }, ref) => (44 <button45 ref={ref}46 type={type}47 className={cn(buttonVariants({ variant, size }), className)}48 {...props}49 />50 ),51);52Button.displayName = "Button";5354export { Button, buttonVariants };55