SPB Git

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.5 KB · 45 lines tsx
Raw Blame History
1/**2 * Trouve-KA — composant UI Badge (étiquettes mono, bordure encre)3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 */67import type { HTMLAttributes } from "react";8import { cva, type VariantProps } from "class-variance-authority";9import { cn } from "@/lib/utils";1011const badgeVariants = cva(12  // Chip éditorial signature : mono uppercase, bordure encre, micro-ombre13  // dure qui grandit au survol (translation -1px, comme les cartes KA).14  "inline-flex items-center gap-1 whitespace-nowrap rounded-[5px] border border-ink px-2 py-[3px] font-mono text-[10px] font-bold uppercase tracking-[0.09em] shadow-[2px_2px_0_rgba(20,24,20,0.16)] transition-[transform,box-shadow] duration-150 hover:-translate-y-px hover:shadow-[3px_3px_0_rgba(20,24,20,0.24)]",15  {16    variants: {17      variant: {18        default: "bg-surface text-ink-2",19        quebec: "bg-lime text-ink",20        government: "bg-green-deep text-paper",21        news: "bg-amber-soft text-ink",22        education: "bg-surface-2 text-ink",23        success: "bg-green text-paper",24        warning: "bg-amber-soft text-ink",25        danger: "bg-danger text-paper",26      },27    },28    defaultVariants: {29      variant: "default",30    },31  },32);3334export interface BadgeProps35  extends HTMLAttributes<HTMLSpanElement>,36    VariantProps<typeof badgeVariants> {}3738function Badge({ className, variant, ...props }: BadgeProps) {39  return (40    <span className={cn(badgeVariants({ variant }), className)} {...props} />41  );42}4344export { Badge, badgeVariants };45