File
Blob: src/client/components/ui/button-classes.ts
| 1 | // Tokens live in a separate `.ts` so this module stays component-free for |
| 2 | // React Fast Refresh — mixed exports in `button.tsx` would force full reloads |
| 3 | // on token edits. Shared between `<Button>` and the small set of CTAs that |
| 4 | // render `<a href>` for top-level navigation (currently the OIDC sign-in |
| 5 | // hand-off in `pages/login.tsx`), which need native link semantics that a |
| 6 | // `<button onClick=location.assign>` would lose. |
| 7 | |
| 8 | export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost"; |
| 9 | export type ButtonSize = "sm" | "md"; |
| 10 | |
| 11 | export const BUTTON_BASE_CLASSES = |
| 12 | "inline-flex items-center justify-center gap-2 rounded-xl font-medium select-none disabled:cursor-not-allowed disabled:opacity-60 active:scale-[0.98] transition-transform"; |
| 13 | |
| 14 | export const BUTTON_VARIANT_CLASSES: Record<ButtonVariant, string> = { |
| 15 | primary: "bg-accent-600 text-white hover:bg-accent-500", |
| 16 | secondary: "border border-zinc-700/60 bg-zinc-800/60 text-zinc-200 hover:bg-zinc-700/60", |
| 17 | danger: "border border-red-500/20 bg-red-500/10 text-red-300 hover:bg-red-500/20", |
| 18 | ghost: "text-zinc-400 hover:bg-zinc-800/70 hover:text-zinc-100", |
| 19 | }; |
| 20 | |
| 21 | export const BUTTON_SIZE_CLASSES: Record<ButtonSize, string> = { |
| 22 | sm: "h-8 px-3 text-xs", |
| 23 | md: "h-10 px-4 text-sm", |
| 24 | }; |