veza/apps/web/src/features/auth/components/AuthButton.tsx
senke 39b2b642d2 feat(web): UI premium Discord/Spotify-like — tokens, shadows, focus, layout
Plan UI premium 6–8 semaines (design system, shell, Storybook, a11y):

- Design system: DESIGN_TOKENS.md, APP_SHELL.md, FULL_LAYOUT_PAGE.md. Single source
  for layout/shell (index.css), shadows (design-system.css), durations/easing.
- Tokens: shadow-cover-depth, shadow-gold-glow, shadow-fab-glow; layout max-height
  (max-h-layout-drawer, max-h-layout-panel, max-h-layout-list). All duration-200/300/500
  replaced by --duration-fast/normal/slow. Arbitrary shadows replaced by token classes.
- Shell & player: Sidebar, Header, GlobalPlayer, MiniPlayer, PlayerQueue, PlayerControls,
  AudioPlayer use tokens; focus-visible on Sidebar, PlayerQueue, DropdownMenuTrigger/Item,
  TabsTrigger. Typography: text-[10px]/[9px] → text-xs where applicable.
- ESLint: no-restricted-syntax (warn) for w-/h-/rounded-/shadow-/text-/spacing arbitrary.
- Scripts: report-arbitrary-values.mjs, capture/compare/generate visual; visual-complete.spec.ts.
- Stories full layout: Dashboard, Playlists, Library, Settings, Profile in DashboardLayout.stories.
- .cursorrules + README: DESIGN_TOKENS, APP_SHELL, visual commands, no arbitrary without justification.
- apps/web/.gitignore: e2e test artifacts (test-results-visual, playwright-report-visual).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:15:58 +01:00

43 lines
1.2 KiB
TypeScript

import React from 'react';
import { cn } from '@/lib/utils';
interface AuthButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
loading?: boolean;
variant?: 'primary' | 'secondary';
}
export function AuthButton({
loading,
variant = 'primary',
className,
children,
disabled,
...props
}: AuthButtonProps) {
return (
<button
className={cn(
'w-full px-4 py-2.5 rounded-xl font-medium transition-all duration-[var(--duration-immersive)] ease-in-out focus:outline-none focus:ring-2 focus:ring-primary/20 focus:ring-offset-2 focus:ring-offset-background',
variant === 'primary'
? 'bg-primary text-primary-foreground hover:opacity-90 shadow-button-primary-glow'
: 'bg-muted text-foreground hover:bg-muted/80 border border-border',
(disabled || loading) && 'opacity-50 cursor-not-allowed',
className,
)}
disabled={disabled || loading}
aria-busy={loading}
aria-disabled={disabled || loading ? 'true' : 'false'}
{...props}
>
{loading ? (
<>
<span className="sr-only">Chargement en cours</span>
<span aria-hidden="true">Chargement...</span>
</>
) : (
children
)}
</button>
);
}