Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .claude/rules/sim-settings-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Settings pages never use a literal `text-[Npx]` class — always the named Tailw
scale token from the `@theme` block in `apps/sim/app/_styles/globals.css` (`text-micro`
10px, `text-xs` 11px, `text-caption` 12px, `text-small` 13px, `text-sm` 14px
[Tailwind default, unmodified], `text-base` 15px, `text-md` 16px, `text-lg` 18px
[Tailwind default]). A literal size is either a straight rename to the equivalent
[the exact Tailwind default adopted in globals.css]). A literal size is either a straight rename to the equivalent
token (if the pixel value matches one exactly) or a sign the page never migrated —
grep `text-\[1[0-8]px\]` under `apps/sim/app/workspace/*/settings/**` and
`apps/sim/ee/**` to find stragglers.
Expand Down
8 changes: 6 additions & 2 deletions .claude/rules/sim-styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ setWidth: (width) => {

## Text Scale

Custom font sizes (the `@theme` block in `apps/sim/app/_styles/globals.css`): `text-micro`=10px, `text-xs`=11px, `text-caption`=12px, `text-small`=13px, `text-base`=15px. `text-sm` is Tailwind default 14px. Field titles use `text-small` (13px); hints/errors use `text-caption` (12px).
Use the named scale in `apps/sim/app/_styles/globals.css`: `text-micro`=10px, `text-xs`=11px, `text-caption`=12px, `text-small`=13px, `text-base`=15px, `text-md`=16px, `text-title`=28px, `text-title-lg`=32px, and `text-display`=40px. The explicitly adopted stock entries retain their rem units and default leading: `text-sm`=0.875rem, `text-lg`=1.125rem, `text-xl`=1.25rem, and `text-2xl`=1.5rem (14/18/20/24px at the default root size). Field titles use `text-small`; hints/errors use `text-caption`; workflow titles use `text-md`.

Preserve explicit line heights when replacing arbitrary sizes. Where the old size inherited its line height, use `leading-[inherit]` if the named utility would otherwise add a different default. Keep document-relative heading/code recipes and the thinking loader's proportional label sizing distinct from ordinary UI text.

Use `font-inter` within the existing scoped Inter loading boundary; the utility does not load the font globally. Keep monospace for code, JSON, and credentials.

Icons default `size-[14px]`. Equal h/w → `size-*` (`size-[14px]`, `size-4`), never `h-N w-N`.

Expand All @@ -67,7 +71,7 @@ A scroll region that can hide rows past an edge uses `useScrollEdges` with `scro

## Font Weight

Three steps, Tailwind's stock scale, nothing else: **`font-normal` (400)**, **`font-medium` (500)**, **`font-semibold` (600)**. 400 is the document default, so body text, chip labels, sidebar items, and headings carry **no weight class at all** — they inherit. Reach for a class only to step *up* from body.
Three steps, explicitly adopted from Tailwind's stock scale in globals.css, nothing else: **`font-normal` (400)**, **`font-medium` (500)**, **`font-semibold` (600)**. 400 is the document default, so body text, chip labels, sidebar items, and headings carry **no weight class at all** — they inherit. Reach for a class to step *up* from body or to reset meaningful inherited weight. Raw CSS references the same `--font-weight-normal`, `--font-weight-medium`, and `--font-weight-semibold` definitions; their values remain 400/500/600.

Never write an arbitrary weight (`font-[380]`, `font-[430]`, `font-[450]`, …), and never set `fontWeight` in an inline `style`. There was previously a CSS-variable weight scale (`--font-weight-base/medium/semibold`, remapping `font-medium` to 440/480) plus seven ad-hoc values clustered between 380 and 500; it was deleted because nothing read as hierarchical. Off-scale values are only acceptable where the design system genuinely cannot reach — react-email templates and the static `apps/sim/emails/broadcasts/*.html`, which email clients render without CSS variables.

Expand Down
2 changes: 1 addition & 1 deletion .cursor/rules/sim-settings-pages.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Settings pages never use a literal `text-[Npx]` class — always the named Tailw
scale token from the `@theme` block in `apps/sim/app/_styles/globals.css` (`text-micro`
10px, `text-xs` 11px, `text-caption` 12px, `text-small` 13px, `text-sm` 14px
[Tailwind default, unmodified], `text-base` 15px, `text-md` 16px, `text-lg` 18px
[Tailwind default]). A literal size is either a straight rename to the equivalent
[the exact Tailwind default adopted in globals.css]). A literal size is either a straight rename to the equivalent
token (if the pixel value matches one exactly) or a sign the page never migrated —
grep `text-\[1[0-8]px\]` under `apps/sim/app/workspace/*/settings/**` and
`apps/sim/ee/**` to find stragglers.
Expand Down
8 changes: 6 additions & 2 deletions .cursor/rules/sim-styling.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ setWidth: (width) => {

## Text Scale

Custom font sizes (the `@theme` block in `apps/sim/app/_styles/globals.css`): `text-micro`=10px, `text-xs`=11px, `text-caption`=12px, `text-small`=13px, `text-base`=15px. `text-sm` is Tailwind default 14px. Field titles use `text-small` (13px); hints/errors use `text-caption` (12px).
Use the named scale in `apps/sim/app/_styles/globals.css`: `text-micro`=10px, `text-xs`=11px, `text-caption`=12px, `text-small`=13px, `text-base`=15px, `text-md`=16px, `text-title`=28px, `text-title-lg`=32px, and `text-display`=40px. The explicitly adopted stock entries retain their rem units and default leading: `text-sm`=0.875rem, `text-lg`=1.125rem, `text-xl`=1.25rem, and `text-2xl`=1.5rem (14/18/20/24px at the default root size). Field titles use `text-small`; hints/errors use `text-caption`; workflow titles use `text-md`.

Preserve explicit line heights when replacing arbitrary sizes. Where the old size inherited its line height, use `leading-[inherit]` if the named utility would otherwise add a different default. Keep document-relative heading/code recipes and the thinking loader's proportional label sizing distinct from ordinary UI text.

Use `font-inter` within the existing scoped Inter loading boundary; the utility does not load the font globally. Keep monospace for code, JSON, and credentials.

Icons default `size-[14px]`. Equal h/w → `size-*` (`size-[14px]`, `size-4`), never `h-N w-N`.

Expand All @@ -67,7 +71,7 @@ A scroll region that can hide rows past an edge uses `useScrollEdges` with `scro

## Font Weight

Three steps, Tailwind's stock scale, nothing else: **`font-normal` (400)**, **`font-medium` (500)**, **`font-semibold` (600)**. 400 is the document default, so body text, chip labels, sidebar items, and headings carry **no weight class at all** — they inherit. Reach for a class only to step *up* from body.
Three steps, explicitly adopted from Tailwind's stock scale in globals.css, nothing else: **`font-normal` (400)**, **`font-medium` (500)**, **`font-semibold` (600)**. 400 is the document default, so body text, chip labels, sidebar items, and headings carry **no weight class at all** — they inherit. Reach for a class to step *up* from body or to reset meaningful inherited weight. Raw CSS references the same `--font-weight-normal`, `--font-weight-medium`, and `--font-weight-semibold` definitions; their values remain 400/500/600.

Never write an arbitrary weight (`font-[380]`, `font-[430]`, `font-[450]`, …), and never set `fontWeight` in an inline `style`. There was previously a CSS-variable weight scale (`--font-weight-base/medium/semibold`, remapping `font-medium` to 440/480) plus seven ad-hoc values clustered between 380 and 500; it was deleted because nothing read as hierarchical. Off-scale values are only acceptable where the design system genuinely cannot reach — react-email templates and the static `apps/sim/emails/broadcasts/*.html`, which email clients render without CSS variables.

Expand Down
4 changes: 3 additions & 1 deletion apps/sim/app/(auth)/components/auth-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ interface AuthHeaderProps {
export function AuthHeader({ title, description }: AuthHeaderProps) {
return (
<div className='space-y-1 text-center'>
<h1 className='text-balance text-[32px] text-[var(--text-primary)] leading-[1.2]'>{title}</h1>
<h1 className='text-balance text-[var(--text-primary)] text-title-lg leading-[1.2]'>
{title}
</h1>
{description != null && (
<p className='text-[var(--text-muted)] text-base leading-[1.5]'>{description}</p>
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/components/auth-nav-prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function AuthNavPrompt({ prompt, href, linkLabel, onNavigate }: AuthNavPr
return (
<div className='flex items-center justify-center gap-1 text-sm'>
{prompt && <span className='text-[var(--text-muted)]'>{prompt}</span>}
<ChipLink href={href} onClick={onNavigate} className='border border-[var(--border-1)]'>
<ChipLink href={href} onClick={onNavigate} variant='outline'>
{linkLabel}
</ChipLink>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/(auth)/components/auth-submit-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ReactNode } from 'react'
import { Chip, Loader } from '@sim/emcn'
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'

interface AuthSubmitButtonProps {
children: ReactNode
Expand Down Expand Up @@ -32,7 +31,8 @@ export function AuthSubmitButton({
onClick={onClick}
disabled={disabled || loading}
fullWidth
className={AUTH_BUTTON_CLASS}
size='lg'
align='center'
>
{loading ? (
<span className='flex items-center gap-2'>
Expand Down
17 changes: 0 additions & 17 deletions apps/sim/app/(auth)/components/constants.ts

This file was deleted.

8 changes: 4 additions & 4 deletions apps/sim/app/(auth)/components/password-input.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client'

import { useState } from 'react'
import { ChipInput, type ChipInputProps, cn } from '@sim/emcn'
import { ChipInput, type ChipInputProps } from '@sim/emcn'
import { Eye, EyeOff } from '@sim/emcn/icons'
import { AUTH_CONTROL_HEIGHT } from '@/app/(auth)/components/constants'

type PasswordInputProps = Omit<ChipInputProps, 'type' | 'icon' | 'endAdornment'>
type PasswordInputProps = Omit<ChipInputProps, 'type' | 'icon' | 'endAdornment' | 'size'>

/**
* A {@link ChipInput} that owns the password reveal toggle — the eye button is
Expand All @@ -19,7 +18,8 @@ export function PasswordInput({ error, className, ...props }: PasswordInputProps
return (
<ChipInput
{...props}
className={cn(AUTH_CONTROL_HEIGHT, className)}
size='lg'
className={className}
type={visible ? 'text' : 'password'}
error={error}
endAdornment={
Expand Down
15 changes: 10 additions & 5 deletions apps/sim/app/(auth)/components/social-login-buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use client'

import { type ReactNode, useState } from 'react'
import { Chip, cn } from '@sim/emcn'
import { Chip } from '@sim/emcn'
import { createLogger } from '@sim/logger'
import { getErrorMessage } from '@sim/utils/errors'
import { GithubIcon, GoogleIcon, MicrosoftIcon } from '@/components/icons'
import { client } from '@/lib/auth/auth-client'
import { DEFAULT_POST_AUTH_ROUTE } from '@/app/(auth)/auth-redirect'
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'

const logger = createLogger('SocialLoginButtons')

Expand Down Expand Up @@ -73,7 +72,9 @@ export function SocialLoginButtons({
<Chip
fullWidth
leftIcon={GithubIcon}
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
variant='outline'
size='lg'
align='center'
disabled={!githubAvailable || isGithubLoading}
onClick={signInWithGithub}
>
Expand All @@ -85,7 +86,9 @@ export function SocialLoginButtons({
<Chip
fullWidth
leftIcon={GoogleIcon}
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
variant='outline'
size='lg'
align='center'
disabled={!googleAvailable || isGoogleLoading}
onClick={signInWithGoogle}
>
Expand All @@ -97,7 +100,9 @@ export function SocialLoginButtons({
<Chip
fullWidth
leftIcon={MicrosoftIcon}
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
variant='outline'
size='lg'
align='center'
disabled={!microsoftAvailable || isMicrosoftLoading}
onClick={signInWithMicrosoft}
>
Expand Down
13 changes: 5 additions & 8 deletions apps/sim/app/(auth)/components/sso-login-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client'
import { Chip, cn } from '@sim/emcn'
import { Chip } from '@sim/emcn'
import { useRouter } from 'next/navigation'
import { isSsoEnabled } from '@/lib/core/config/env-flags'
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'

interface SSOLoginButtonProps {
callbackURL?: string
Expand All @@ -28,14 +27,12 @@ export function SSOLoginButton({

return (
<Chip
variant={variant === 'primary' ? 'primary' : undefined}
variant={variant}
fullWidth
onClick={handleSSOClick}
className={cn(
AUTH_BUTTON_CLASS,
variant === 'outline' && 'border border-[var(--border-1)]',
className
)}
size='lg'
align='center'
className={className}
>
Sign in with SSO
</Chip>
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/(auth)/oauth/consent/consent-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
AuthSubmitButton,
AuthTextLink,
} from '@/app/(auth)/components'
import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
import { OAuthConsentLoading } from '@/app/(auth)/oauth/consent/loading'
import {
useOAuthConsent,
Expand Down Expand Up @@ -166,7 +165,8 @@ export function OAuthConsentView({
variant='border'
fullWidth
disabled={isPending}
className={AUTH_BUTTON_CLASS}
size='lg'
align='center'
onClick={() => decide(false)}
>
{consent.isPending && consent.variables === false ? 'Declining…' : 'Deny'}
Expand Down
Loading
Loading