Skip to content

Commit 7737344

Browse files
BillLeoutsakosvl346Bill Leoutsakoswaleedlatif1
authored
improvement(ui): share public headings and product typography (#8069)
* improvement(emcn): share larger chip and field geometry * improvement(ui): share public authentication headings * improvement(ui): share workflow panel tab buttons (#8072) * improvement(ui): share workflow panel tab buttons * improvement(ui): reuse chips for panel selection actions (#8166) Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> * refactor(ui): share account headings and auth control sizing (#8074) * improvement(ui): share account status headings * improvement(ui): use shared sizing for auth controls * refactor(emcn): share invalid OTP slot treatment (#8246) * Add shared invalid state to EMCN OTP slots * fix(ui): distinguish OTP verification from resend errors * test(ui): type OTP input queries as inputs * test(ui): import OTP test button prop type * test(ui): use shared logger mock in OTP regression --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> Co-authored-by: Waleed <walif6@gmail.com> * improvement(ui): share missing resource states (#8078) Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> * improvement(ui): reuse avatars for owners and members (#8079) Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> * fix(ui): adopt exact shared 18px typography token * fix(ui): preserve panel and auth control semantics --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> Co-authored-by: Waleed <walif6@gmail.com>
1 parent e30731f commit 7737344

88 files changed

Lines changed: 806 additions & 474 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/rules/sim-settings-pages.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Settings pages never use a literal `text-[Npx]` class — always the named Tailw
117117
scale token from the `@theme` block in `apps/sim/app/_styles/globals.css` (`text-micro`
118118
10px, `text-xs` 11px, `text-caption` 12px, `text-small` 13px, `text-sm` 14px
119119
[Tailwind default, unmodified], `text-base` 15px, `text-md` 16px, `text-lg` 18px
120-
[Tailwind default]). A literal size is either a straight rename to the equivalent
120+
[the exact Tailwind default adopted in globals.css]). A literal size is either a straight rename to the equivalent
121121
token (if the pixel value matches one exactly) or a sign the page never migrated —
122122
grep `text-\[1[0-8]px\]` under `apps/sim/app/workspace/*/settings/**` and
123123
`apps/sim/ee/**` to find stragglers.

‎.claude/rules/sim-styling.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ setWidth: (width) => {
4747

4848
## Text Scale
4949

50-
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).
50+
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`.
51+
52+
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.
53+
54+
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.
5155

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

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

6872
## Font Weight
6973

70-
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.
74+
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.
7175

7276
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.
7377

‎.cursor/rules/sim-settings-pages.mdc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Settings pages never use a literal `text-[Npx]` class — always the named Tailw
114114
scale token from the `@theme` block in `apps/sim/app/_styles/globals.css` (`text-micro`
115115
10px, `text-xs` 11px, `text-caption` 12px, `text-small` 13px, `text-sm` 14px
116116
[Tailwind default, unmodified], `text-base` 15px, `text-md` 16px, `text-lg` 18px
117-
[Tailwind default]). A literal size is either a straight rename to the equivalent
117+
[the exact Tailwind default adopted in globals.css]). A literal size is either a straight rename to the equivalent
118118
token (if the pixel value matches one exactly) or a sign the page never migrated —
119119
grep `text-\[1[0-8]px\]` under `apps/sim/app/workspace/*/settings/**` and
120120
`apps/sim/ee/**` to find stragglers.

‎.cursor/rules/sim-styling.mdc‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ setWidth: (width) => {
4747

4848
## Text Scale
4949

50-
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).
50+
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`.
51+
52+
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.
53+
54+
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.
5155

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

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

6872
## Font Weight
6973

70-
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.
74+
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.
7175

7276
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.
7377

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ interface AuthHeaderProps {
1414
export function AuthHeader({ title, description }: AuthHeaderProps) {
1515
return (
1616
<div className='space-y-1 text-center'>
17-
<h1 className='text-balance text-[32px] text-[var(--text-primary)] leading-[1.2]'>{title}</h1>
17+
<h1 className='text-balance text-[var(--text-primary)] text-title-lg leading-[1.2]'>
18+
{title}
19+
</h1>
1820
{description != null && (
1921
<p className='text-[var(--text-muted)] text-base leading-[1.5]'>{description}</p>
2022
)}

‎apps/sim/app/(auth)/components/auth-nav-prompt.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function AuthNavPrompt({ prompt, href, linkLabel, onNavigate }: AuthNavPr
1919
return (
2020
<div className='flex items-center justify-center gap-1 text-sm'>
2121
{prompt && <span className='text-[var(--text-muted)]'>{prompt}</span>}
22-
<ChipLink href={href} onClick={onNavigate} className='border border-[var(--border-1)]'>
22+
<ChipLink href={href} onClick={onNavigate} variant='outline'>
2323
{linkLabel}
2424
</ChipLink>
2525
</div>

‎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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
'use client'
22

33
import { type ReactNode, useState } from 'react'
4-
import { Chip, cn } from '@sim/emcn'
4+
import { Chip } from '@sim/emcn'
55
import { createLogger } from '@sim/logger'
66
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

@@ -73,7 +72,9 @@ export function SocialLoginButtons({
7372
<Chip
7473
fullWidth
7574
leftIcon={GithubIcon}
76-
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
75+
variant='outline'
76+
size='lg'
77+
align='center'
7778
disabled={!githubAvailable || isGithubLoading}
7879
onClick={signInWithGithub}
7980
>
@@ -85,7 +86,9 @@ export function SocialLoginButtons({
8586
<Chip
8687
fullWidth
8788
leftIcon={GoogleIcon}
88-
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
89+
variant='outline'
90+
size='lg'
91+
align='center'
8992
disabled={!googleAvailable || isGoogleLoading}
9093
onClick={signInWithGoogle}
9194
>
@@ -97,7 +100,9 @@ export function SocialLoginButtons({
97100
<Chip
98101
fullWidth
99102
leftIcon={MicrosoftIcon}
100-
className={cn(AUTH_BUTTON_CLASS, 'border border-[var(--border-1)]')}
103+
variant='outline'
104+
size='lg'
105+
align='center'
101106
disabled={!microsoftAvailable || isMicrosoftLoading}
102107
onClick={signInWithMicrosoft}
103108
>

0 commit comments

Comments
 (0)