Skip to content

Commit 4c26fc6

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
improvement(ui): use shared sizing for auth controls
1 parent d2f04f1 commit 4c26fc6

17 files changed

Lines changed: 48 additions & 59 deletions

File tree

‎apps/sim/app/(auth)/components/auth-submit-button.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ReactNode } from 'react'
22
import { Chip, Loader } from '@sim/emcn'
3-
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
43

54
interface AuthSubmitButtonProps {
65
children: ReactNode
@@ -32,7 +31,8 @@ export function AuthSubmitButton({
3231
onClick={onClick}
3332
disabled={disabled || loading}
3433
fullWidth
35-
className={AUTH_BUTTON_CLASS}
34+
size='lg'
35+
align='center'
3636
>
3737
{loading ? (
3838
<span className='flex items-center gap-2'>

‎apps/sim/app/(auth)/components/constants.ts‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎apps/sim/app/(auth)/components/password-input.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
'use client'
22

33
import { useState } from 'react'
4-
import { ChipInput, type ChipInputProps, cn } from '@sim/emcn'
4+
import { ChipInput, type ChipInputProps } from '@sim/emcn'
55
import { Eye, EyeOff } from '@sim/emcn/icons'
6-
import { AUTH_CONTROL_HEIGHT } from '@/app/(auth)/components/constants'
76

8-
type PasswordInputProps = Omit<ChipInputProps, 'type' | 'icon' | 'endAdornment'>
7+
type PasswordInputProps = Omit<ChipInputProps, 'type' | 'icon' | 'endAdornment' | 'size'>
98

109
/**
1110
* A {@link ChipInput} that owns the password reveal toggle — the eye button is
@@ -19,7 +18,8 @@ export function PasswordInput({ error, className, ...props }: PasswordInputProps
1918
return (
2019
<ChipInput
2120
{...props}
22-
className={cn(AUTH_CONTROL_HEIGHT, className)}
21+
size='lg'
22+
className={className}
2323
type={visible ? 'text' : 'password'}
2424
error={error}
2525
endAdornment={

‎apps/sim/app/(auth)/components/social-login-buttons.tsx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { getErrorMessage } from '@sim/utils/errors'
77
import { GithubIcon, GoogleIcon, MicrosoftIcon } from '@/components/icons'
88
import { client } from '@/lib/auth/auth-client'
99
import { DEFAULT_POST_AUTH_ROUTE } from '@/app/(auth)/auth-redirect'
10-
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
1110

1211
const logger = createLogger('SocialLoginButtons')
1312

@@ -74,7 +73,8 @@ export function SocialLoginButtons({
7473
fullWidth
7574
leftIcon={GithubIcon}
7675
variant='outline'
77-
className={AUTH_BUTTON_CLASS}
76+
size='lg'
77+
align='center'
7878
disabled={!githubAvailable || isGithubLoading}
7979
onClick={signInWithGithub}
8080
>
@@ -87,7 +87,8 @@ export function SocialLoginButtons({
8787
fullWidth
8888
leftIcon={GoogleIcon}
8989
variant='outline'
90-
className={AUTH_BUTTON_CLASS}
90+
size='lg'
91+
align='center'
9192
disabled={!googleAvailable || isGoogleLoading}
9293
onClick={signInWithGoogle}
9394
>
@@ -100,7 +101,8 @@ export function SocialLoginButtons({
100101
fullWidth
101102
leftIcon={MicrosoftIcon}
102103
variant='outline'
103-
className={AUTH_BUTTON_CLASS}
104+
size='lg'
105+
align='center'
104106
disabled={!microsoftAvailable || isMicrosoftLoading}
105107
onClick={signInWithMicrosoft}
106108
>

‎apps/sim/app/(auth)/components/sso-login-button.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use client'
2-
import { Chip, cn } from '@sim/emcn'
2+
import { Chip } from '@sim/emcn'
33
import { useRouter } from 'next/navigation'
44
import { isSsoEnabled } from '@/lib/core/config/env-flags'
5-
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
65

76
interface SSOLoginButtonProps {
87
callbackURL?: string
@@ -31,7 +30,9 @@ export function SSOLoginButton({
3130
variant={variant}
3231
fullWidth
3332
onClick={handleSSOClick}
34-
className={cn(AUTH_BUTTON_CLASS, className)}
33+
size='lg'
34+
align='center'
35+
className={className}
3536
>
3637
Sign in with SSO
3738
</Chip>

‎apps/sim/app/(auth)/oauth/consent/consent-view.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
AuthSubmitButton,
1515
AuthTextLink,
1616
} from '@/app/(auth)/components'
17-
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
1817
import { OAuthConsentLoading } from '@/app/(auth)/oauth/consent/loading'
1918
import {
2019
useOAuthConsent,
@@ -166,7 +165,8 @@ export function OAuthConsentView({
166165
variant='border'
167166
fullWidth
168167
disabled={isPending}
169-
className={AUTH_BUTTON_CLASS}
168+
size='lg'
169+
align='center'
170170
onClick={() => decide(false)}
171171
>
172172
{consent.isPending && consent.variables === false ? 'Declining…' : 'Deny'}

‎apps/sim/app/(interfaces)/chat/components/auth/email/email-auth.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default function EmailAuth({ identifier }: EmailAuthProps) {
143143
autoCorrect='off'
144144
value={email}
145145
onChange={handleEmailChange}
146-
className='h-[34px]'
146+
size='lg'
147147
error={Boolean(hasEmailError)}
148148
/>
149149
{hasEmailError && (

‎apps/sim/app/(interfaces)/chat/components/auth/password/password-auth.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export default function PasswordAuth({ identifier }: PasswordAuthProps) {
7272
placeholder='Enter password'
7373
value={password}
7474
onChange={handlePasswordChange}
75-
className='h-[34px]'
7675
error={hasPasswordError}
7776
/>
7877
<div

‎apps/sim/app/f/[token]/public-file-auth.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export function PublicFileAuth({ token }: PublicFileAuthProps) {
6060
setPassword(e.target.value)
6161
setError(null)
6262
}}
63-
className='h-[34px]'
6463
error={Boolean(error)}
6564
/>
6665
{error ? <p className='text-[var(--text-error)] text-xs'>{error}</p> : null}

‎apps/sim/app/f/[token]/public-file-email-auth.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function PublicFileEmailAuth({ token }: PublicFileEmailAuthProps) {
104104
setEmail(e.target.value)
105105
setError(null)
106106
}}
107-
className='h-[34px]'
107+
size='lg'
108108
error={Boolean(error)}
109109
/>
110110
{error ? <p className='text-[var(--text-error)] text-xs'>{error}</p> : null}

0 commit comments

Comments
 (0)