diff --git a/packages/managed-auth-react/src/components/icons.tsx b/packages/managed-auth-react/src/components/icons.tsx index a9a368d..431bc57 100644 --- a/packages/managed-auth-react/src/components/icons.tsx +++ b/packages/managed-auth-react/src/components/icons.tsx @@ -227,6 +227,30 @@ export const GitHubMark = (p: IconProps) => ( ); +export const GitLabMark = (p: IconProps) => ( + +); + export const MicrosoftMark = (p: IconProps) => ( + ); + } + + return ( + setErroredSlug(slug)} + /> + ); +} + export function getSSOProviderInfo(provider: string): SSOProviderInfo { - const p = provider.toLowerCase(); - if (p.includes("google")) - return { label: "Google", icon: }; - if (p.includes("github")) - return { label: "GitHub", icon: }; - if (p.includes("microsoft") || p.includes("azure")) - return { - label: "Microsoft", - icon: , - }; - if (p.includes("facebook")) + const slug = slugify(provider); + + const builtinKey = Object.keys(BUILTIN_PROVIDERS).find((k) => + slug.includes(k), + ); + if (builtinKey) { + const builtin = BUILTIN_PROVIDERS[builtinKey]; return { - label: "Facebook", - icon: , + label: builtin.label, + icon: , }; - if (p.includes("apple")) - return { label: "Apple", icon: }; - if (p.includes("saml") || p.includes("sso")) - return { label: "SSO", icon: }; - if (p.includes("passkey")) - return { label: "Passkey", icon: }; - return { label: provider, icon: null }; + } + + return { + label: titleCase(provider), + icon: , + }; } diff --git a/packages/managed-auth-react/src/styles/styles.css b/packages/managed-auth-react/src/styles/styles.css index ff3a2d5..c871c5e 100644 --- a/packages/managed-auth-react/src/styles/styles.css +++ b/packages/managed-auth-react/src/styles/styles.css @@ -510,6 +510,18 @@ height: 1.25rem; } +.kma-sso-icon--letter { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 50%; + background: var(--kma-color-muted, #6b7280); + color: #fff; + font-size: 0.75rem; + font-weight: 600; + line-height: 1; +} + /* ---------- Form / Input ---------- */ .kma-form {