Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/ui/src/oauth/oauth-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ const OAuthButton = React.forwardRef(function OAuthButton(
) {
const { text, icon, compact = false, className = "", ...rest } = props;

// Compact mode hides the label, which leaves the button with nothing but an icon:
// no accessible name for assistive technology, and no way to tell providers apart
// for anyone who does not recognise the mark. Supplying the label as `aria-label`
// restores the name, and `title` gives sighted users a tooltip. Only applied when
// compact -- with the label visible, `aria-label` would needlessly shadow it.
const compactLabelProps = compact ? { title: text, "aria-label": text } : {};

return (
<button
ref={ref}
{...compactLabelProps}
className={cn(
"bg-onboarding-background-200 hover:bg-onboarding-background-300 flex h-9 w-full items-center justify-center gap-2 rounded-md border border-strong px-4 py-2.5 text-13 font-medium text-primary duration-300",
className
Expand Down
Loading